import{d,x as r,g as u,j as t,v as h,B as l,z as i,C as m,aR as f,F as p,Z as g}from"./index.3bfa6a0e.js";import{C as _}from"./index.85c8c2f7.js";import{C as c}from"./index.79997a38.js";import{I as n}from"./index.0fd5538f.js";import{L as w}from"./index.0a290e73.js";import{C}from"./index.8a2292dc.js";import{U as y}from"./index.a68b9b7d.js";import{C as b}from"./index.645e7ddc.js";import"./use-tab-status.c0d730a9.js";import"./index.0916b076.js";import"./index.bb2d59fe.js";import"./index.68aa5658.js";import"./index.fb1da5d0.js";import"./index.983bfd1a.js";import"./use-id.7c44c16f.js";import"./icon_checkbox_default.2fe5d57e.js";import"./icon_checkbox-tenant.ecfa11df.js";import"./index.8903238b.js";import"./index.9551d420.js";const v="_cellGroup_1m609_1",A="_image_1m609_7",B="_title_1m609_13",F="_label_1m609_19",S="_cellTitle_1m609_23",E="_button_1m609_28",D="_popup_1m609_32",G="_popupContainer_1m609_38",R="_cert_1m609_41",L="_award_1m609_46",k="_btnGroup_1m609_63",x="_lastBtn_1m609_67",I="_btnMore_1m609_76";var s={cellGroup:v,image:A,title:B,label:F,cellTitle:S,button:E,popup:D,popupContainer:G,cert:R,award:L,btnGroup:k,lastBtn:x,btnMore:I},T="./assets/award.2f8938c1.png",U="./assets/cert.7f558e5e.png";function M(a){return typeof a=="function"||Object.prototype.toString.call(a)==="[object Object]"&&!g(a)}var at=d({name:"award-activity",data(){return{status:!1,type:"auth",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 a=await r.get(u.platformApi+"/sysUserContractRecord/checkContractSign",{params:{contractType:"REGISTER"}});this.exists=a.data}catch{}},async onGetAward(){try{await r.post(`${u.platformApi}/activity/receiveReward/${this.receiveRewardId}`),this.status=!0,this.type="success",this.receiveRewardId=null}catch{}},async onAuthSuccess(){this.popupShow=!1,this.status=!1,await this.getUserRegisterProtocol(),this.onGetAward()},async getList(){try{const a=this.params,e=await r.post(`${u.platformApi}/activity/receiveRewardList`,{data:{...a}});this.loading=!1;const o=e.data||{};if(this.list.length>0&&o.pageNo===1)return;this.list=this.list.concat(o.rows||[]),this.finished=o.pageNo>=o.totalPage,this.params.page=o.pageNo+1,this.dataShow=this.list.length>0}catch{this.dataShow=!1,this.finished=!0}}},render(){let a;return t("div",{class:s.award},[t(b,null,null),this.dataShow?t(w,{class:s.videoList,loading:this.loading,"onUpdate:loading":e=>this.loading=e,finished:this.finished,finishedText:" ",immediateCheck:!1,onLoad:this.getList},M(a=this.list.map(e=>t(_,{inset:!0,class:s.cellGroup},{default:()=>[t(c,null,{icon:()=>t(n,{src:e.imgUrl,class:s.image},null),title:()=>t("div",{class:s.title},[e.rewardName]),label:()=>t("div",{class:s.label},[e.rewardDescribe])}),t(c,{center:!0,title:`\u83B7\u5956\u65F6\u95F4\uFF1A${h(e.winningTime).format("YYYY-MM-DD")}`,titleClass:s.cellTitle},{value:()=>t(l,{color:"linear-gradient(180deg, #FF8636 0%, #FF4E19 100%)",size:"small",class:s.button,onClick:()=>{this.receiveRewardId=e.receiveRewardId,this.onGetAward()}},{default:()=>[i("\u7ACB\u5373\u9886\u53D6")]})})]})))?a:{default:()=>[a]}):t(m,{btnStatus:!1,classImgSize:"SMALL",tips:"\u6682\u65E0\u6570\u636E"},null),t(f,{show:this.status,"onUpdate:show":e=>this.status=e,class:s.popup},{default:()=>[t("div",{class:s.popupContainer},[this.type==="auth"&&t(p,null,[t(n,{src:U,class:s.cert},null),t("h3",null,[i("\u60A8\u8FD8\u6CA1\u6709\u5B9E\u540D\u8BA4\u8BC1")]),t("p",null,[i("\u5B8C\u6210\u5B9E\u540D\u8BA4\u8BC1\u540E\u5373\u53EF\u9886\u53D6\u5956\u54C1")]),t("div",{class:[s.btnGroup,s.btnMore]},[t(l,{type:"primary",block:!0,class:s.lastBtn,onClick:()=>{this.status=!1}},{default:()=>[i("\u4EE5\u540E\u518D\u8BF4")]}),t(l,{type:"primary",block:!0,color:"linear-gradient(180deg, #59E5D5 0%, #2DC7AA 100%)",onClick:()=>{this.popupShow=!0}},{default:()=>[i("\u7ACB\u5373\u8BA4\u8BC1")]})])]),this.type==="success"&&t(p,null,[t(n,{src:T,class:s.award},null),t("h3",null,[i("\u5956\u54C1\u9886\u53D6\u6210\u529F\uFF01")]),t("p",null,[i("\u8BF7\u8010\u5FC3\u7B49\u5F85\uFF0C\u6D3B\u52A8\u5956\u54C1\u5C06\u4F1A\u5230\u8FBE\uFF5E")]),t("div",{class:[s.btnGroup]},[t(l,{type:"primary",block:!0,color:"linear-gradient(180deg, #59E5D5 0%, #2DC7AA 100%)",onClick:()=>{this.status=!1,this.list=[],this.params.page=1,this.getList()}},{default:()=>[i("\u6211\u77E5\u9053\u4E86")]})])])])]}),t(C,{modelValue:this.popupShow,"onUpdate:modelValue":e=>this.popupShow=e},{default:()=>[t(y,{exists:this.exists,onSuccess:this.onAuthSuccess},null)]})])}});export{at as default};
