2 lines
3.7 KiB
JavaScript
2 lines
3.7 KiB
JavaScript
"use strict";const t=require("../../common/vendor.js"),e=require("../../components/request.js"),o=require("../../components/formatDate.js"),n=require("../../components/TimeFormatting.js"),a={data:()=>({userinfo:{},pkInformationdata:[],myPkRecorddata:[],SignStatus:null,AnchorList:[]}),onShow(){t.index.getStorage({key:"userinfo",success:t=>{this.userinfo=t.data,console.log(this.userinfo),this.getpkInformation(),this.getmyPkRecord(),this.getSignStatus(),this.getAnchorList()}})},methods:{getAnchorList(){e.request({url:"anchor/list",method:"POST",data:{userId:this.userinfo.id},userInfo:!0}).then((t=>{200==t.code?this.AnchorList=t.data.slice(0,4):console.log(t.msg)}))},getSignStatus(){e.request({url:"user/checkSignStatus",method:"GET",data:{userId:this.userinfo.id},userInfo:!0}).then((t=>{200==t.code?this.SignStatus=t.data:console.log(t.msg)}))},sign(){e.request({url:"user/signIn",method:"POST",data:{userId:this.userinfo.id},userInfo:!0}).then((e=>{200==e.code?(t.index.showToast({title:"签到成功",icon:"none",duration:2e3}),this.getSignStatus()):console.log(e.msg)}))},formatDate:o.formatDate,TimeFormatting:n.TimeFormatting,getpkInformation(){e.request({url:"user/queryMyAllPkData",method:"POST",data:{userId:this.userinfo.id,page:0,size:4},userInfo:!0}).then((t=>{200==t.code?(this.pkInformationdata=t.data,console.log(this.pkInformationdata)):console.log(t.msg)}))},getmyPkRecord(){e.request({url:"user/handlePkInfo",method:"POST",data:{type:1,userId:this.userinfo.id,page:0,size:4},userInfo:!1}).then((t=>{200==t.code?(this.myPkRecorddata=t.data,console.log(this.myPkRecorddata)):console.log(t.msg)}))},anchorLibrary(){t.index.navigateTo({url:"/pages/Mine/minecomponents/anchorLibrary"})},pkInformation(){t.index.navigateTo({url:"/pages/Mine/minecomponents/pkInformation"})},pkRecord(){t.index.navigateTo({url:"/pages/Mine/minecomponents/pkRecord"})},contact(){t.index.navigateTo({url:"/pages/Mine/minecomponents/contact"})},goSetting(){t.index.navigateTo({url:"/pages/Setting/Setting"})},serviceProtocol(){t.index.navigateTo({url:"/pages/Mine/minecomponents/serviceProtocol"})},logout(){t.index.clearStorage(),t.A.logout(),t.index.reLaunch({url:"/pages/login/login"})}},components:{tabBar:()=>"../../components/tabBar/tabBar.js"}};if(!Array){t.resolveComponent("tabBar")()}Math;const r=t._export_sfc(a,[["render",function(e,o,n,a,r,i){return t.e({a:r.userinfo.headerIcon,b:t.t(r.userinfo.nickName),c:!0===r.SignStatus},!0===r.SignStatus?{d:t.o$1(((...t)=>i.sign&&i.sign(...t)))}:{},{e:!1===r.SignStatus},(r.SignStatus,{}),{f:t.o$1(((...t)=>i.goSetting&&i.goSetting(...t))),g:t.o$1(((...t)=>i.anchorLibrary&&i.anchorLibrary(...t))),h:0!==r.AnchorList.length},0!==r.AnchorList.length?{i:t.f(r.AnchorList,((e,o,n)=>({a:e.headerIcon,b:t.t(e.anchorId),c:t.t(e.country),d:o})))}:{},{j:0===r.AnchorList.length},(r.AnchorList.length,{}),{k:t.o$1(((...t)=>i.pkInformation&&i.pkInformation(...t))),l:0!==r.pkInformationdata.length},0!==r.pkInformationdata.length?{m:t.f(r.pkInformationdata,((e,o,n)=>({a:e.anchorIcon,b:t.t(i.formatDate(e.pkTime)),c:t.t(e.coin),d:o})))}:{},{n:0===r.pkInformationdata.length},(r.pkInformationdata.length,{}),{o:t.o$1(((...t)=>i.pkRecord&&i.pkRecord(...t))),p:0!==r.myPkRecorddata.length},0!==r.myPkRecorddata.length?{q:t.f(r.myPkRecorddata,((e,o,n)=>t.e({a:e.anchorIconA,b:e.winnerAnchorId!==e.anchorIdA},(e.winnerAnchorId!==e.anchorIdA||(e.winnerAnchorId,e.anchorIdA),{}),{c:e.winnerAnchorId===e.anchorIdA,d:t.t(e.pkNumber),e:t.t(i.TimeFormatting(e.pkTime)),f:o})))}:{},{r:0===r.myPkRecorddata.length},(r.myPkRecorddata.length,{}),{s:t.o$1(((...t)=>i.contact&&i.contact(...t))),t:t.o$1(((...t)=>i.serviceProtocol&&i.serviceProtocol(...t))),v:t.o$1(((...t)=>i.logout&&i.logout(...t))),w:t.p({tabIndex:4})})}],["__scopeId","data-v-a35a4a7f"]]);wx.createPage(r);
|