Files
tk-mini-program/unpackage/dist/build/mp-weixin/pages/Mine/Mine.js
pengxiaolong 8ec7365e7c 优化页面
2025-06-16 22:09:12 +08:00

2 lines
3.9 KiB
JavaScript

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