import{d,y as l,g as r,j as t,w as h,E as n,B as o,C as f,aT as p,a0 as g}from"./ResizeObserver.es.62ab429c.js";import{C as m}from"./index.e24f8570.js";import{C as u}from"./index.d7a13e47.js";import{I as c}from"./index.021584f9.js";import{L as _}from"./index.00698f4b.js";import{C as w}from"./index.3ed577ca.js";import{U as C}from"./index.3b85c1f2.js";import{C as B}from"./index.786e83cc.js";import"./use-tab-status.a98984d2.js";import"./index.3b8bb459.js";import"./index.5a30932c.js";import"./index.ac0c4528.js";import"./index.2745b15c.js";import"./index.9a52dc9a.js";import"./index.82be4917.js";import"./use-id.1bbe472d.js";import"./icon_checkbox.808b953c.js";import"./icon_checkbox_default.256c0849.js";import"./icon_checkbox-tenant.ecfa11df.js";import"./index.2bf63958.js";import"./index.2b14f9f1.js";const b="_cellGroup_i1axj_1",y="_image_i1axj_7",G="_title_i1axj_13",x="_label_i1axj_19",v="_cellTitle_i1axj_23",j="_button_i1axj_28",A="_popup_i1axj_32",S="_popupContainer_i1axj_38",R="_cert_i1axj_41",E="_award_i1axj_46",L="_btnGroup_i1axj_63",D="_lastBtn_i1axj_67",T="_btnMore_i1axj_76",U="_popupGift_i1axj_82",I="_popupContainerGift_i1axj_85",k="_giftBg_i1axj_88",F="_giftBtn_i1axj_92";var s={cellGroup:b,image:y,title:G,label:x,cellTitle:v,button:j,popup:A,popupContainer:S,cert:R,award:E,btnGroup:L,lastBtn:D,btnMore:T,popupGift:U,popupContainerGift:I,giftBg:k,giftBtn:F},M="./assets/gift-bg.84edad83.png",N="./assets/gift-btn.267d29d9.png",$="./assets/cert.7f558e5e.png";function P(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Object]"&&!g(e)}var pt=d({name:"award-activity",data(){return{status:!1,statusGift:!1,list:[],dataShow:!0,loading:!1,finished:!1,params:{page:1,rows:20},exists:!1,popupShow:!1,receiveRewardId:null}},async mounted(){this.getList()},methods:{async getUserRegisterProtocol(){try{const e=await l.get(r.platformApi+"/sysUserContractRecord/checkContractSign",{params:{contractType:"REGISTER"}});this.exists=e.data}catch{}},async onGetAward(){try{await l.post(`${r.platformApi}/activity/receiveReward/${this.receiveRewardId}`),this.statusGift=!0,this.receiveRewardId=null}catch{}},async onAuthSuccess(){this.popupShow=!1,this.status=!1,await this.getUserRegisterProtocol(),this.onGetAward()},async getList(){try{const e=this.params,a=await l.post(`${r.platformApi}/activity/receiveRewardList`,{data:{...e}});this.loading=!1;const i=a.data||{};if(this.list.length>0&&i.pageNo===1)return;this.list=this.list.concat(i.rows||[]),this.finished=i.pageNo>=i.totalPage,this.params.page=i.pageNo+1,this.dataShow=this.list.length>0}catch{this.dataShow=!1,this.finished=!0}}},render(){let e;return t("div",{class:s.award},[t(B,null,null),this.dataShow?t(_,{class:s.videoList,loading:this.loading,"onUpdate:loading":a=>this.loading=a,finished:this.finished,finishedText:" ",immediateCheck:!1,onLoad:this.getList},P(e=this.list.map(a=>t(m,{inset:!0,class:s.cellGroup},{default:()=>[t(u,null,{icon:()=>t(c,{src:a.imgUrl,class:s.image},null),title:()=>t("div",{class:s.title},[a.rewardName]),label:()=>t("div",{class:s.label},[a.rewardDescribe])}),t(u,{center:!0,title:`\u83B7\u5956\u65F6\u95F4\uFF1A${h(a.winningTime).format("YYYY-MM-DD")}`,titleClass:s.cellTitle},{value:()=>t(n,{color:"linear-gradient(180deg, #FF8636 0%, #FF4E19 100%)",size:"small",class:s.button,onClick:()=>{this.receiveRewardId=a.receiveRewardId,this.onGetAward()}},{default:()=>[o("\u7ACB\u5373\u9886\u53D6")]})})]})))?e:{default:()=>[e]}):t(f,{btnStatus:!1,classImgSize:"SMALL",tips:"\u6682\u65E0\u6570\u636E"},null),t(p,{show:this.status,"onUpdate:show":a=>this.status=a,class:s.popup},{default:()=>[t("div",{class:s.popupContainer},[t(c,{src:$,class:s.cert},null),t("h3",null,[o("\u60A8\u8FD8\u6CA1\u6709\u5B9E\u540D\u8BA4\u8BC1")]),t("p",null,[o("\u5B8C\u6210\u5B9E\u540D\u8BA4\u8BC1\u540E\u5373\u53EF\u9886\u53D6\u5956\u54C1")]),t("div",{class:[s.btnGroup,s.btnMore]},[t(n,{type:"primary",block:!0,class:s.lastBtn,onClick:()=>{this.status=!1}},{default:()=>[o("\u4EE5\u540E\u518D\u8BF4")]}),t(n,{type:"primary",block:!0,color:"linear-gradient(180deg, #59E5D5 0%, #2DC7AA 100%)",onClick:()=>{this.popupShow=!0}},{default:()=>[o("\u7ACB\u5373\u8BA4\u8BC1")]})])])]}),t(p,{show:this.statusGift,"onUpdate:show":a=>this.statusGift=a,class:s.popupGift},{default:()=>[t("div",{class:s.popupContainerGift},[t("img",{src:M,class:s.giftBg,style:"opacity: 0",onLoad:a=>{a.target.style.opacity=1}},null),t("img",{src:N,class:s.giftBtn,onClick:()=>{this.statusGift=!1,this.list=[],this.params.page=1,this.getList()}},null)])]}),t(w,{modelValue:this.popupShow,"onUpdate:modelValue":a=>this.popupShow=a},{default:()=>[t(C,{exists:this.exists,onSuccess:this.onAuthSuccess},null)]})])}});export{pt as default};
