"use strict";const e=require("../../../../common/vendor.js"),t=require("../../../../components/request.js"),n=require("../../../../components/formatDate.js"),i={data:()=>({title:"Hello",item:{},coinNumlist:[],triggered:!1,iconNumber:123457}),onLoad(e){this.getOpenerEventChannel().on("itemDetail",(e=>{this.item=e.item,this.getCoinNum(this.item)}))},methods:{formatCoinNum(e){if(null==e)return"";if(e<1e3)return String(e);if(e>=1e6)return"1M+";const t=e/1e3,n=t.toFixed(2).match(/^\d+\.\d{0,2}/);if(null===n)return t.toFixed(2)+"k";return`${n[0]}k`},onRefresherRefresh(){this.triggered=!0,this.coinNumlist=[],this.getCoinNum(this.item)},getCoinNum(e){t.request({url:"pk/fetchDetailPkDataWithId",method:"POST",data:{id:e.id},userInfo:!0}).then((e=>{200==e.code?(this.coinNumlist=e.data,this.triggered=!1):console.log("获取金币数量失败")}))},formatDate:n.formatDate,onBack(){e.index.navigateBack({delta:1})}}};if(!Array){e.resolveComponent("uni-card")()}const r=e._export_sfc(i,[["render",function(t,n,i,r,o,m){return e.e({a:e.o(((...e)=>m.onBack&&m.onBack(...e))),b:o.item.anchorIconA,c:o.item.winnerAnchorId==o.item.anchorIdA},(o.item.winnerAnchorId,o.item.anchorIdA,{}),{d:e.t(o.item.anchorIdA),e:e.t(m.formatDate(o.item.pkTime)),f:e.t(m.formatCoinNum(o.iconNumber)),g:o.item.anchorIconB,h:o.item.winnerAnchorId==o.item.anchorIdB},(o.item.winnerAnchorId,o.item.anchorIdB,{}),{i:e.t(o.item.anchorIdB),j:e.t(m.formatDate(o.item.pkTime)),k:null!==o.item.userBCoins},null!==o.item.userBCoins?{l:e.t(m.formatCoinNum(o.item.userBCoins))}:{},{m:e.f(o.coinNumlist,((t,n,i)=>({a:e.t(m.formatCoinNum(t.anchorCoinA)),b:t.anchorIdA==t.winnerAnchorId?"#00fbff21":"#ff000011",c:e.t(m.formatCoinNum(t.anchorCoinB)),d:t.anchorIdB==t.winnerAnchorId?"#00fbff21":"#ff000011",e:n,f:"50b361e7-0-"+i}))),n:e.o(((...e)=>m.onRefresherRefresh&&m.onRefresherRefresh(...e))),o:o.triggered})}],["__scopeId","data-v-50b361e7"]]);wx.createPage(r);
