"use strict"; const common_vendor = require("../../common/vendor.js"); const components_formatDate = require("../../components/formatDate.js"); const components_TimeFormatting = require("../../components/TimeFormatting.js"); const components_request = require("../../components/request.js"); const components_VerifyLogin = require("../../components/VerifyLogin.js"); const NewAddedPk = () => "../NewAddedPk/NewAddedPk2.js"; const _sfc_main = { data() { return { item: {}, id: 0, InvitingPartyEventID: null, list: [], selectedId: null, InvitingPartyEventindex: null, chatInfo: {}, currentConversation: null, inid: null, chatPartnerinfo: {} }; }, onShareAppMessage(res) { if (res.from === "menu") { return { title: "分享", path: `${getCurrentPages()[getCurrentPages().length - 1].route}?inid=${this.item.id}` }; } }, onLoad(options) { this.inid = options.inid; common_vendor.index.__f__("log", "at pages/pkDetail/pkDetail.vue:194", this.inid); if (this.inid) { this.GetonShareAppMessagedata(); } const eventChannel = this.getOpenerEventChannel(); eventChannel.on("itemDetail", (data) => { this.item = data.item; components_request.request({ url: "user/getUserInfo", method: "POST", data: { id: data.item.senderId }, userInfo: false }).then((res) => { if (res.code === 200) { this.chatPartnerinfo = res.data; } }); }); common_vendor.index.getStorage({ key: "userinfo", success: (res) => { this.id = res.data.id; } }); common_vendor.index.getStorage({ key: "chatInfo", success: (res) => { this.chatInfo = res.data; } }); }, methods: { //分享直接获取数据 GetonShareAppMessagedata() { components_request.request({ url: "pk/pkInfoDetail", method: "POST", data: { id: this.inid, userId: this.id, from: 1 }, userInfo: true }).then((res) => { if (res.code === 200) { this.item = res.data; } else { common_vendor.index.showToast({ title: res.msg, icon: "none", duration: 2e3 }); } }); }, //修改信息 // onRecompose(item) { // this.parentMessage = item; // this.createModule.open(); // }, formatDate: components_formatDate.formatDate, TimeFormatting: components_TimeFormatting.TimeFormatting, Select(id, index) { if (this.selectedId === id) { this.selectedId = null; this.InvitingPartyEventID = null; this.InvitingPartyEventindex = null; } else { this.selectedId = this.selectedId === id ? null : id; this.InvitingPartyEventID = id; this.InvitingPartyEventindex = index; } }, Returnfunc() { common_vendor.index.navigateBack({ delta: 1, fail: () => { common_vendor.index.reLaunch({ url: "/pages/Home/Home" }); } }); }, open() { components_VerifyLogin.VerifyLogin(this.item.id).then((res) => { this.$refs.popup.open("center"); this.userlist(); }); }, invite() { if (this.InvitingPartyEventindex === null) { common_vendor.index.showToast({ title: "请选择您要参与的PK信息", icon: "none", duration: 2e3 }); return; } this.$refs.popups.open("center"); }, closeHint() { this.$refs.popups.close(); }, inviteHint() { this.$refs.popups.close(); const myitem = JSON.stringify(this.list[this.InvitingPartyEventindex]); const youritem = JSON.stringify(this.item); common_vendor.index.redirectTo({ url: `/pages/index/chat/chat?userId=${this.chatPartnerinfo.id}&nickname=${this.chatPartnerinfo.nickName}&avatar=${this.chatPartnerinfo.headerIcon}&myitem=${myitem}&youritem=${youritem}&type=pk` }); }, // 打开邀请弹窗 close() { this.$refs.popup.close(); }, openChat() { components_VerifyLogin.VerifyLogin(this.item.id).then((res) => { common_vendor.wx$1.navigateTo({ url: `/pages/index/chat/chat?userId=${this.chatPartnerinfo.id}&nickname=${this.chatPartnerinfo.nickName}&avatar=${this.chatPartnerinfo.headerIcon}` }); }); }, async userlist() { common_vendor.index.showLoading({ title: "加载中...", mask: true }); const res = await components_request.request({ url: "pk/queryMyCanUsePkData", method: "POST", data: { userId: this.id }, userInfo: true }); if (res.code === 200) { if (res.data.length !== 0) { common_vendor.index.hideLoading(); this.list = res.data; } else { common_vendor.index.hideLoading(); setTimeout(() => { this.openPopupQuantity(); this.$refs.popup.close(); }, 2e3); } } else { common_vendor.index.hideLoading(); common_vendor.index.showToast({ title: "加载失败", icon: "none", duration: 2e3 }); } }, openPopupQuantity() { this.$refs.createModule.open(); } }, components: { NewAddedPk } }; if (!Array) { const _easycom_uni_popup2 = common_vendor.resolveComponent("uni-popup"); const _component_NewAddedPk = common_vendor.resolveComponent("NewAddedPk"); (_easycom_uni_popup2 + _component_NewAddedPk)(); } const _easycom_uni_popup = () => "../../uni_modules/uni-popup/components/uni-popup/uni-popup.js"; if (!Math) { _easycom_uni_popup(); } function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) { return common_vendor.e({ a: common_vendor.o((...args) => $options.Returnfunc && $options.Returnfunc(...args)), b: $data.item.anchorIcon, c: common_vendor.t($data.item.disPlayId), d: $data.item.sex === "1" }, $data.item.sex === "1" ? {} : {}, { e: common_vendor.t($data.item.country), f: common_vendor.t($options.formatDate($data.item.pkTime)), g: common_vendor.t($data.item.coin), h: common_vendor.t($data.item.pkNumber), i: common_vendor.t($data.item.remark), j: $data.item.senderId !== $data.id }, $data.item.senderId !== $data.id ? { k: common_vendor.o(($event) => $options.openChat()), l: common_vendor.o(($event) => $options.open()) } : {}, { m: $data.list.length !== 0 }, $data.list.length !== 0 ? { n: common_vendor.f($data.list, (item, index, i0) => { return { a: item.anchorIcon, b: common_vendor.t(item.anchorId), c: common_vendor.t($options.TimeFormatting(item.pkTime * 1e3)), d: common_vendor.t(item.coin), e: common_vendor.o(($event) => $options.Select(item.id, index), index), f: $data.selectedId === item.id ? "#b8ff8c74" : "#ffffff", g: index }; }) } : {}, { o: $data.list.length === 0 }, $data.list.length === 0 ? {} : {}, { p: common_vendor.o(($event) => $options.invite()), q: common_vendor.o(($event) => $options.close()), r: common_vendor.sr("popup", "9639f721-0"), s: common_vendor.p({ type: "center", ["border-radius"]: "10px 10px 0 0" }), t: common_vendor.sr("createModule", "9639f721-1"), v: common_vendor.o(($event) => $options.inviteHint()), w: common_vendor.o(($event) => $options.closeHint()), x: common_vendor.sr("popups", "9639f721-2"), y: common_vendor.p({ type: "center", ["border-radius"]: "10px 10px 0 0" }) }); } const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-9639f721"]]); _sfc_main.__runtimeHooks = 2; wx.createPage(MiniProgramPage); //# sourceMappingURL=../../../.sourcemap/mp-weixin/pages/pkDetail/pkDetail.js.map