优化页面
This commit is contained in:
199
unpackage/dist/dev/mp-weixin/pages/pkDetail/pkDetail.js
vendored
Normal file
199
unpackage/dist/dev/mp-weixin/pages/pkDetail/pkDetail.js
vendored
Normal file
@@ -0,0 +1,199 @@
|
||||
"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 NewAddedPk = () => "../NewAddedPk/NewAddedPk2.js";
|
||||
const _sfc_main = {
|
||||
data() {
|
||||
return {
|
||||
item: {},
|
||||
id: 0,
|
||||
InvitingPartyEventID: null,
|
||||
list: [],
|
||||
selectedId: null,
|
||||
InvitingPartyEventindex: null,
|
||||
chatInfo: {},
|
||||
currentConversation: null,
|
||||
// parentMessage: null,
|
||||
style: {
|
||||
backgroundColor: "#ffffff"
|
||||
}
|
||||
};
|
||||
},
|
||||
onLoad(options) {
|
||||
const eventChannel = this.getOpenerEventChannel();
|
||||
eventChannel.on("itemDetail", (data) => {
|
||||
this.item = data.item;
|
||||
common_vendor.index.__f__("log", "at pages/pkDetail/pkDetail.vue:170", "接收到的数据:", this.item);
|
||||
});
|
||||
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: {
|
||||
//修改信息
|
||||
// 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
|
||||
});
|
||||
},
|
||||
open() {
|
||||
this.$refs.popup.open("center");
|
||||
this.userlist();
|
||||
},
|
||||
invite() {
|
||||
if (this.item.pkTime !== this.list[this.InvitingPartyEventindex].pkTime) {
|
||||
common_vendor.index.showToast({
|
||||
icon: "none",
|
||||
title: "请保持时间一致"
|
||||
});
|
||||
return;
|
||||
}
|
||||
const conversationID = `C2C${this.item.senderId}`;
|
||||
const myitem = JSON.stringify(this.list[this.InvitingPartyEventindex]);
|
||||
const youritem = JSON.stringify(this.item);
|
||||
common_vendor.index.redirectTo({
|
||||
url: `/TUIKit/components/TUIChat/index?conversationID=${conversationID}&myitem=${myitem}&youritem=${youritem}`
|
||||
});
|
||||
},
|
||||
close() {
|
||||
this.$refs.popup.close();
|
||||
},
|
||||
openChat() {
|
||||
const conversationID = `C2C${this.item.senderId}`;
|
||||
common_vendor.index.redirectTo({
|
||||
url: `/TUIKit/components/TUIChat/index?conversationID=${conversationID}`
|
||||
});
|
||||
},
|
||||
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();
|
||||
common_vendor.index.__f__("log", "at pages/pkDetail/pkDetail.vue:258", "res.data", res.data);
|
||||
this.list = res.data;
|
||||
} else {
|
||||
common_vendor.index.hideLoading();
|
||||
this.openPopupQuantity();
|
||||
}
|
||||
} 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_easyinput2 = common_vendor.resolveComponent("uni-easyinput");
|
||||
const _component_viewm = common_vendor.resolveComponent("viewm");
|
||||
const _easycom_uni_popup2 = common_vendor.resolveComponent("uni-popup");
|
||||
const _component_NewAddedPk = common_vendor.resolveComponent("NewAddedPk");
|
||||
(_easycom_uni_easyinput2 + _component_viewm + _easycom_uni_popup2 + _component_NewAddedPk)();
|
||||
}
|
||||
const _easycom_uni_easyinput = () => "../../uni_modules/uni-easyinput/components/uni-easyinput/uni-easyinput.js";
|
||||
const _easycom_uni_popup = () => "../../uni_modules/uni-popup/components/uni-popup/uni-popup.js";
|
||||
if (!Math) {
|
||||
(_easycom_uni_easyinput + _easycom_uni_popup)();
|
||||
}
|
||||
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
||||
return common_vendor.e({
|
||||
a: common_vendor.o$1((...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.sex === "1" ? "男" : "女")
|
||||
} : {
|
||||
f: common_vendor.t($data.item.sex === "2" ? "男" : "女")
|
||||
}, {
|
||||
g: common_vendor.t($data.item.country),
|
||||
h: common_vendor.t($options.formatDate($data.item.pkTime)),
|
||||
i: common_vendor.t($data.item.coin),
|
||||
j: common_vendor.t($data.item.pkNumber),
|
||||
k: common_vendor.s($data.style),
|
||||
l: common_vendor.o$1(($event) => $data.item.remark = $event),
|
||||
m: common_vendor.p({
|
||||
type: "textarea",
|
||||
placeholder: "备注",
|
||||
maxlength: "-1",
|
||||
disabled: "true",
|
||||
modelValue: $data.item.remark
|
||||
}),
|
||||
n: $data.item.senderId !== $data.id
|
||||
}, $data.item.senderId !== $data.id ? {
|
||||
o: common_vendor.o$1(($event) => $options.openChat()),
|
||||
p: common_vendor.o$1(($event) => $options.open())
|
||||
} : {}, {
|
||||
q: 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)),
|
||||
d: common_vendor.t(item.coin),
|
||||
e: "9639f721-2-" + i0 + ",9639f721-1",
|
||||
f: common_vendor.o$1(($event) => $options.Select(item.id, index), index),
|
||||
g: $data.selectedId === item.id ? "#f6f6f6" : "#ffffff",
|
||||
h: index
|
||||
};
|
||||
}),
|
||||
r: common_vendor.o$1(($event) => $options.invite()),
|
||||
s: common_vendor.o$1(($event) => $options.close()),
|
||||
t: common_vendor.sr("popup", "9639f721-1"),
|
||||
v: common_vendor.p({
|
||||
type: "center",
|
||||
["border-radius"]: "10px 10px 0 0"
|
||||
}),
|
||||
w: common_vendor.sr("createModule", "9639f721-3")
|
||||
});
|
||||
}
|
||||
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-9639f721"]]);
|
||||
wx.createPage(MiniProgramPage);
|
||||
//# sourceMappingURL=../../../.sourcemap/mp-weixin/pages/pkDetail/pkDetail.js.map
|
||||
Reference in New Issue
Block a user