index.3a3e556a.js 4.6 KB

1
  1. import{d,y as r,g as u,j as t,w as h,B as l,A as i,C as m,aS as f,F as p,$ as g}from"./ResizeObserver.es.39b48a47.js";import{C as _}from"./index.9f5e14d1.js";import{C as c}from"./index.db115763.js";import{I as n}from"./index.fcbcb027.js";import{L as w}from"./index.6c529ad4.js";import{C}from"./index.a0f53d9f.js";import{U as y}from"./index.0404e33a.js";import{C as b}from"./index.970ad07b.js";import"./use-tab-status.bcc0c503.js";import"./index.f6c41ddf.js";import"./index.16ffd6ad.js";import"./index.867583ad.js";import"./index.0a093430.js";import"./index.3c44a6d7.js";import"./index.428ab1a8.js";import"./use-id.b004ff17.js";import"./icon_checkbox.808b953c.js";import"./icon_checkbox_default.256c0849.js";import"./icon_checkbox-tenant.ecfa11df.js";import"./index.418cbe7f.js";import"./index.45e4ca3e.js";const A="_cellGroup_1m609_1",v="_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",I="_lastBtn_1m609_67",T="_btnMore_1m609_76";var s={cellGroup:A,image:v,title:B,label:F,cellTitle:S,button:E,popup:D,popupContainer:G,cert:R,award:L,btnGroup:k,lastBtn:I,btnMore:T},U="./assets/award.2f8938c1.png",x="./assets/cert.7f558e5e.png";function M(a){return typeof a=="function"||Object.prototype.toString.call(a)==="[object Object]"&&!g(a)}var ot=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:x,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:U,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{ot as default};