"use strict";const e=require("../../common/vendor.js"),t=require("../../components/formatDate.js"),i=require("../../components/TimeFormatting.js"),n=require("../../components/request.js"),s={data:()=>({item:{},id:0,InvitingPartyEventID:null,list:[],selectedId:null,InvitingPartyEventindex:null,chatInfo:{},currentConversation:null,inid:null,style:{backgroundColor:"#ffffff"}}),onShareAppMessage(e){if("menu"===e.from)return{title:"分享",path:`${getCurrentPages()[getCurrentPages().length-1].route}?inid=${this.item.id}`}},onLoad(t){this.inid=t.inid,this.inid&&this.GetonShareAppMessagedata();this.getOpenerEventChannel().on("itemDetail",(e=>{this.item=e.item,console.log(" itemDetail",e.item)})),e.index.getStorage({key:"userinfo",success:e=>{this.id=e.data.id}}),e.index.getStorage({key:"chatInfo",success:e=>{this.chatInfo=e.data}})},methods:{GetonShareAppMessagedata(){n.request({url:"pk/pkInfoDetail",method:"POST",data:{id:this.inid,userId:this.id},userInfo:!0}).then((t=>{200===t.code?this.item=t.data:e.index.showToast({title:t.msg,icon:"none",duration:2e3})}))},formatDate:t.formatDate,TimeFormatting:i.TimeFormatting,Select(e,t){this.selectedId===e?(this.selectedId=null,this.InvitingPartyEventID=null,this.InvitingPartyEventindex=null):(this.selectedId=this.selectedId===e?null:e,this.InvitingPartyEventID=e,this.InvitingPartyEventindex=t)},Returnfunc(){e.index.navigateBack({delta:1,fail:()=>{e.index.reLaunch({url:"/pages/Home/Home"})}})},open(){this.$refs.popup.open("center"),this.userlist()},invite(){null!==this.InvitingPartyEventindex?this.$refs.popups.open("center"):e.index.showToast({title:"请选择您要参与的PK信息",icon:"none",duration:2e3})},closeHint(){this.$refs.popups.close()},inviteHint(){this.$refs.popups.close();const t=`C2C${this.item.senderId}`,i=JSON.stringify(this.list[this.InvitingPartyEventindex]),n=JSON.stringify(this.item);e.index.redirectTo({url:`/TUIKit/components/TUIChat/index?conversationID=${t}&myitem=${i}&youritem=${n}`})},close(){this.$refs.popup.close()},openChat(){const t=`C2C${this.item.senderId}`;e.index.navigateTo({url:`/TUIKit/components/TUIChat/index?conversationID=${t}`})},async userlist(){e.index.showLoading({title:"加载中...",mask:!0});const t=await n.request({url:"pk/queryMyCanUsePkData",method:"POST",data:{userId:this.id},userInfo:!0});200===t.code?0!==t.data.length?(e.index.hideLoading(),this.list=t.data):(e.index.hideLoading(),setTimeout((()=>{this.openPopupQuantity(),this.$refs.popup.close()}),2e3)):(e.index.hideLoading(),e.index.showToast({title:"加载失败",icon:"none",duration:2e3}))},openPopupQuantity(){this.$refs.createModule.open()}},components:{NewAddedPk:()=>"../NewAddedPk/NewAddedPk2.js"}};if(!Array){(e.resolveComponent("uni-easyinput")+e.resolveComponent("uni-popup")+e.resolveComponent("NewAddedPk"))()}Math||((()=>"../../uni_modules/uni-easyinput/components/uni-easyinput/uni-easyinput.js")+(()=>"../../uni_modules/uni-popup/components/uni-popup/uni-popup.js"))();const o=e._export_sfc(s,[["render",function(t,i,n,s,o,r){return e.e({a:e.o$1(((...e)=>r.Returnfunc&&r.Returnfunc(...e))),b:o.item.anchorIcon,c:e.t(o.item.disPlayId),d:"1"===o.item.sex},(o.item.sex,{}),{e:e.t(o.item.country),f:e.t(r.formatDate(o.item.pkTime)),g:e.t(o.item.coin),h:e.t(o.item.pkNumber),i:e.s(o.style),j:e.o$1((e=>o.item.remark=e)),k:e.p({type:"textarea",placeholder:"备注",maxlength:"-1",disabled:"true",modelValue:o.item.remark}),l:o.item.senderId!==o.id},o.item.senderId!==o.id?{m:e.o$1((e=>r.openChat())),n:e.o$1((e=>r.open()))}:{},{o:0!==o.list.length},0!==o.list.length?{p:e.f(o.list,((t,i,n)=>({a:t.anchorIcon,b:e.t(t.anchorId),c:e.t(r.TimeFormatting(t.pkTime)),d:e.t(t.coin),e:e.o$1((e=>r.Select(t.id,i)),i),f:o.selectedId===t.id?"#b8ff8c74":"#ffffff",g:i})))}:{},{q:0===o.list.length},(o.list.length,{}),{r:e.o$1((e=>r.invite())),s:e.o$1((e=>r.close())),t:e.sr("popup","4b7d5532-1"),v:e.p({type:"center","border-radius":"10px 10px 0 0"}),w:e.sr("createModule","4b7d5532-2"),x:e.o$1((e=>r.inviteHint())),y:e.o$1((e=>r.closeHint())),z:e.sr("popups","4b7d5532-3"),A:e.p({type:"center","border-radius":"10px 10px 0 0"})})}],["__scopeId","data-v-4b7d5532"]]);s.__runtimeHooks=2,wx.createPage(o);
