"use strict";const t=require("../../common/vendor.js"),e=require("../../components/request.js"),a=require("../../components/formatDate.js"),o={data:()=>({customData:{},SenderData:{},ReceiverData:{},PkIDInfodata:{},id:""}),onLoad(e){t.index.getStorage({key:"userinfo",success:t=>{this.id=t.data.id}}),this.customData=JSON.parse(e.customData),this.getPkyourInfo(),this.getPkmineInfo(),this.getPkIDInfo()},methods:{async getPkIDInfo(){await e.request({url:"pk/singleRecord",method:"POST",data:{id:this.customData.id},userInfo:!0}).then((t=>{this.PkIDInfodata=t.data}))},async getPkyourInfo(){await e.request({url:"pk/pkInfoDetail",method:"POST",data:{id:this.customData.pkIdA},userInfo:!0}).then((t=>{this.SenderData=t.data}))},async getPkmineInfo(){await e.request({url:"pk/pkInfoDetail",method:"POST",data:{id:this.customData.pkIdB},userInfo:!0}).then((t=>{this.ReceiverData=t.data}))},goBack(){t.wx$1.navigateBack({delta:1})},formatDate:a.formatDate,async operation(a){await e.request({url:"pk/updatePkStatus",method:"POST",data:{id:this.customData.id,pkStatus:a},userInfo:!0}).then((e=>{const o=1===a?"接受邀请成功":"拒绝邀请成功";200===e.code?(this.getPkIDInfo(),t.wx$1.showToast({title:o,icon:"success",duration:2e3}),t.wx$1.navigateBack({delta:1})):t.wx$1.showToast({title:"操作失败",icon:"none",duration:2e3})}))}}};const n=t._export_sfc(o,[["render",function(e,a,o,n,r,s){return t.e({a:t.o$1(((...t)=>s.goBack&&s.goBack(...t))),b:r.SenderData.anchorIcon,c:t.t(r.SenderData.anchorId),d:"1"===r.SenderData.sex},"1"===r.SenderData.sex?{e:t.t(1==r.SenderData.sex?"男":"女")}:{f:t.t(1==r.SenderData.sex?"男":"女")},{g:t.t(r.SenderData.country),h:t.t(s.formatDate(r.SenderData.pkTime)),i:t.t(r.SenderData.coin),j:t.t(r.SenderData.pkNumber),k:r.ReceiverData.anchorIcon,l:t.t(r.ReceiverData.anchorId),m:"1"===r.ReceiverData.sex},"1"===r.ReceiverData.sex?{n:t.t(1==r.ReceiverData.sex?"男":"女")}:{o:t.t(1==r.ReceiverData.sex?"男":"女")},{p:t.t(r.ReceiverData.country),q:t.t(s.formatDate(r.ReceiverData.pkTime)),r:t.t(r.ReceiverData.coin),s:t.t(r.ReceiverData.pkNumber),t:0===r.PkIDInfodata.pkStatus&&r.ReceiverData.senderId!==r.id},0===r.PkIDInfodata.pkStatus&&r.ReceiverData.senderId!==r.id?{v:t.o$1((t=>s.operation(1))),w:t.o$1((t=>s.operation(2)))}:{},{x:r.ReceiverData.senderId===r.id&&0===r.PkIDInfodata.pkStatus},(r.ReceiverData.senderId===r.id&&r.PkIDInfodata.pkStatus,{}),{y:1===r.PkIDInfodata.pkStatus},(r.PkIDInfodata.pkStatus,{}),{z:2===r.PkIDInfodata.pkStatus},(r.PkIDInfodata.pkStatus,{}))}],["__scopeId","data-v-e6394bdd"]]);wx.createPage(n);
