"use strict";const e=require("../../common/vendor.js"),t=require("../../components/request.js"),a=require("../../components/formatDate.js"),o={data:()=>({customData:{},SenderData:{},ReceiverData:{},PkIDInfodata:{},id:""}),onLoad(t){e.index.getStorage({key:"userinfo",success:e=>{this.id=e.data.id}}),this.customData=JSON.parse(t.customData),setTimeout((()=>{this.getPkIDInfo(),this.getPkyourInfo(),this.getPkmineInfo()}),1e3)},onShareAppMessage(e){if("menu"===e.from)return{title:"分享",path:`${getCurrentPages()[getCurrentPages().length-1].route}?customData=${JSON.stringify(this.customData)}`}},methods:{async getPkIDInfo(){await t.request({url:"pk/singleRecord",method:"POST",data:{id:this.customData.id},userInfo:!0}).then((e=>{console.log(e.data),this.PkIDInfodata=e.data}))},async getPkyourInfo(){await t.request({url:"pk/pkInfoDetail",method:"POST",data:{id:this.customData.pkIdA,userId:this.id,from:2},userInfo:!1}).then((t=>{console.log(t),200===t.code?(console.log(t.data),this.SenderData=t.data):e.wx$1.showToast({title:"获取发布者信息失败",icon:"none",duration:2e3})}))},async getPkmineInfo(){await t.request({url:"pk/pkInfoDetail",method:"POST",data:{id:this.customData.pkIdB,userId:this.id,from:2},userInfo:!1}).then((t=>{200===t.code?(console.log(t.data),this.ReceiverData=t.data):e.wx$1.showToast({title:"获取被邀请者信息失败",icon:"none",duration:2e3})}))},goBack(){e.wx$1.navigateBack({delta:1})},formatDate:a.formatDate,AcceptHint(){this.$refs.popups.open("center")},closeHint(){this.$refs.popups.close()},RefuseHint(){this.$refs.Refusepopup.open("center")},RefuseHintcloseHint(){this.$refs.Refusepopup.close()},async operation(a){await t.request({url:"pk/updatePkStatus",method:"POST",data:{id:this.customData.id,pkStatus:a},userInfo:!0}).then((t=>{const o=1===a?"接受邀请成功":"拒绝邀请成功";200===t.code?(this.getPkIDInfo(),this.$refs.popups.close(),this.$refs.Refusepopup.close(),e.wx$1.showToast({title:o,icon:"success",duration:2e3}),e.wx$1.navigateBack({delta:1})):e.wx$1.showToast({title:"操作失败",icon:"none",duration:2e3})}))}}};if(!Array){e.resolveComponent("uni-popup")()}Math;const s=e._export_sfc(o,[["render",function(t,a,o,s,n,r){return e.e({a:e.o(((...e)=>r.goBack&&r.goBack(...e))),b:n.SenderData.anchorIcon,c:e.t(n.SenderData.anchorId),d:"1"===n.SenderData.sex},"1"===n.SenderData.sex?{e:e.t(1==n.SenderData.sex?"男":"女")}:{f:e.t(1==n.SenderData.sex?"男":"女")},{g:e.t(n.SenderData.country),h:e.t(r.formatDate(n.SenderData.pkTime)),i:e.t(n.SenderData.coin),j:e.t(n.SenderData.pkNumber),k:n.ReceiverData.anchorIcon,l:e.t(n.ReceiverData.anchorId),m:"1"===n.ReceiverData.sex},"1"===n.ReceiverData.sex?{n:e.t(1==n.ReceiverData.sex?"男":"女")}:{o:e.t(1==n.ReceiverData.sex?"男":"女")},{p:e.t(n.ReceiverData.country),q:e.t(r.formatDate(n.ReceiverData.pkTime)),r:e.t(n.ReceiverData.coin),s:e.t(n.ReceiverData.pkNumber),t:0===n.PkIDInfodata.pkStatus&&n.ReceiverData.senderId!==n.id},0===n.PkIDInfodata.pkStatus&&n.ReceiverData.senderId!==n.id?{v:e.o((e=>r.AcceptHint())),w:e.o((e=>r.RefuseHint()))}:{},{x:n.ReceiverData.senderId===n.id&&0===n.PkIDInfodata.pkStatus},(n.ReceiverData.senderId===n.id&&n.PkIDInfodata.pkStatus,{}),{y:1===n.PkIDInfodata.pkStatus},(n.PkIDInfodata.pkStatus,{}),{z:2===n.PkIDInfodata.pkStatus},(n.PkIDInfodata.pkStatus,{}),{A:e.o((e=>r.operation(1))),B:e.o((e=>r.closeHint())),C:e.sr("popups","a49ecc79-0"),D:e.p({type:"center","border-radius":"10px 10px 0 0"}),E:e.o((e=>r.operation(2))),F:e.o((e=>r.RefuseHintcloseHint())),G:e.sr("Refusepopup","a49ecc79-1"),H:e.p({type:"center","border-radius":"10px 10px 0 0"})})}],["__scopeId","data-v-a49ecc79"]]);o.__runtimeHooks=2,wx.createPage(s);
