Files
tk-mini-program/unpackage/dist/dev/mp-weixin/pages/Home/Home.js

211 lines
6.7 KiB
JavaScript
Raw Normal View History

2025-05-12 21:23:37 +08:00
"use strict";
const common_vendor = require("../../common/vendor.js");
2025-05-27 21:05:01 +08:00
const components_TUILogin = require("../../components/TUILogin.js");
2025-06-05 23:50:08 +08:00
const components_request = require("../../components/request.js");
const components_formatDate = require("../../components/formatDate.js");
2025-05-30 22:04:45 +08:00
const stores_counter = require("../../stores/counter.js");
2025-05-12 21:23:37 +08:00
const common_assets = require("../../common/assets.js");
const topNavigation = () => "../../components/topNavigation/topNavigation.js";
const Advertisement = () => "../../components/Advertisement/Advertisement.js";
2025-05-12 22:19:21 +08:00
const tabBar = () => "../../components/tabBar/tabBar.js";
2025-05-30 22:04:45 +08:00
const counter = stores_counter.useCounterStore();
2025-05-12 21:23:37 +08:00
const _sfc_main = {
2025-05-19 18:34:04 +08:00
inject: ["$global"],
2025-05-12 21:23:37 +08:00
data() {
2025-05-27 21:05:01 +08:00
return {
info: {},
myuserSig: "",
2025-06-05 23:50:08 +08:00
chatInfo: {},
page: 0,
//页码
size: 10,
//每页条数
list: [],
// 列表数据
detailsdata: {},
//详情数据
2025-06-06 22:36:41 +08:00
triggered: false,
2025-06-05 23:50:08 +08:00
//下拉刷新标识
2025-06-06 22:36:41 +08:00
RealTimePklist: [],
// PK大厅列表数据
MakeAppointmentPKlist: [],
// 今日PK列表数据
listtype: 1
// 列表类型 1 当天 2 大于当天
2025-05-27 21:05:01 +08:00
};
2025-05-12 21:23:37 +08:00
},
2025-06-05 23:50:08 +08:00
mounted() {
2025-06-06 22:36:41 +08:00
this.pkList({ type: 2 });
this.pkList({ type: 1 });
2025-06-05 23:50:08 +08:00
},
2025-05-12 21:23:37 +08:00
onLoad() {
2025-05-27 21:05:01 +08:00
common_vendor.index.getStorage({
key: "userinfo",
success: (res) => {
this.info = res.data;
2025-05-30 22:04:45 +08:00
counter.$patch({ myitem: this.info });
2025-05-27 21:05:01 +08:00
common_vendor.index.getStorage({
key: "myuserSig",
success: (res2) => {
this.myuserSig = res2.data;
common_vendor.index.getStorage({
key: "chatInfo",
success: (res3) => {
this.chatInfo = res3.data;
components_TUILogin.TUIlogin(this.chatInfo.appId, this.info.id, this.myuserSig.userSig);
}
});
}
});
}
});
2025-05-12 21:23:37 +08:00
},
methods: {
2025-06-05 23:50:08 +08:00
goMakeAppointmentPK() {
2025-06-06 22:36:41 +08:00
this.listtype = 1;
this.list = this.MakeAppointmentPKlist;
},
goRealTimePk() {
this.listtype = 2;
this.list = this.RealTimePklist;
2025-06-05 23:50:08 +08:00
},
2025-05-15 22:24:39 +08:00
goAdvertisement() {
2025-05-22 22:05:55 +08:00
common_vendor.index.navigateTo({ url: "/pages/pkDetail/pkDetail" });
2025-06-05 23:50:08 +08:00
},
onRefresherRefresh() {
this.page = 0;
this.list = [];
2025-06-06 22:36:41 +08:00
if (this.listtype === 1) {
this.MakeAppointmentPKlist = [];
} else {
this.RealTimePklist = [];
}
2025-06-05 23:50:08 +08:00
this.triggered = true;
2025-06-06 22:36:41 +08:00
this.pkList({ type: this.listtype });
2025-06-05 23:50:08 +08:00
},
async goDetail(item) {
common_vendor.index.showLoading({
title: "加载中...",
mask: true
});
2025-06-06 22:36:41 +08:00
common_vendor.index.__f__("log", "at pages/Home/Home.vue:147", "id", item.id);
2025-06-05 23:50:08 +08:00
const res = await components_request.request({
url: "pk/pkInfoDetail",
method: "POST",
data: {
id: item.id
},
userInfo: true
});
2025-06-06 22:36:41 +08:00
common_vendor.index.__f__("log", "at pages/Home/Home.vue:156", "res", res);
2025-06-05 23:50:08 +08:00
this.detailsdata = res.data;
if (res.code === 200) {
if (res.data.length !== 0) {
common_vendor.index.hideLoading();
2025-06-06 22:36:41 +08:00
common_vendor.index.__f__("log", "at pages/Home/Home.vue:161", "res.data", res.data);
2025-06-05 23:50:08 +08:00
common_vendor.index.navigateTo({
url: "/pages/pkDetail/pkDetail",
success: (res2) => {
res2.eventChannel.emit("itemDetail", {
item: this.detailsdata
});
}
});
} else {
common_vendor.index.hideLoading();
this.openPopupQuantity();
}
} else {
common_vendor.index.hideLoading();
common_vendor.index.showToast({
title: "加载失败",
icon: "none",
duration: 2e3
});
}
},
formatDate: components_formatDate.formatDate,
2025-06-06 22:36:41 +08:00
async pkList(condition) {
2025-06-05 23:50:08 +08:00
const res = await components_request.request({
url: "pk/pkList",
method: "POST",
data: {
status: 0,
page: this.page,
2025-06-06 22:36:41 +08:00
size: this.size,
condition
2025-06-05 23:50:08 +08:00
},
userInfo: false
});
2025-06-06 22:36:41 +08:00
common_vendor.index.__f__("log", "at pages/Home/Home.vue:197", res);
2025-06-05 23:50:08 +08:00
if (res.code === 200) {
this.triggered = false;
2025-06-06 22:36:41 +08:00
if (condition.type === 1) {
this.MakeAppointmentPKlist.push(...res.data);
2025-06-09 19:18:38 +08:00
if (condition.type == this.listtype) {
this.list = this.MakeAppointmentPKlist;
}
2025-06-06 22:36:41 +08:00
} else {
this.RealTimePklist.push(...res.data);
2025-06-09 19:18:38 +08:00
if (condition.type == this.listtype) {
this.list = this.RealTimePklist;
}
2025-06-06 22:36:41 +08:00
}
2025-06-05 23:50:08 +08:00
}
2025-05-15 22:24:39 +08:00
}
2025-05-12 21:23:37 +08:00
},
2025-06-06 22:36:41 +08:00
onScrollToLower() {
this.page++;
this.pkList({ type: this.listtype });
},
2025-05-12 21:23:37 +08:00
components: {
topNavigation,
2025-05-12 22:19:21 +08:00
Advertisement,
tabBar
2025-05-12 21:23:37 +08:00
}
};
if (!Array) {
const _component_top_navigation = common_vendor.resolveComponent("top-navigation");
const _component_advertisement = common_vendor.resolveComponent("advertisement");
2025-06-05 23:50:08 +08:00
const _component_uni_card = common_vendor.resolveComponent("uni-card");
2025-05-12 22:19:21 +08:00
const _easycom_tabBar2 = common_vendor.resolveComponent("tabBar");
2025-06-05 23:50:08 +08:00
(_component_top_navigation + _component_advertisement + _component_uni_card + _easycom_tabBar2)();
2025-05-12 21:23:37 +08:00
}
2025-05-12 22:19:21 +08:00
const _easycom_tabBar = () => "../../components/tabBar/tabBar.js";
2025-05-12 21:23:37 +08:00
if (!Math) {
2025-06-05 23:50:08 +08:00
_easycom_tabBar();
2025-05-12 21:23:37 +08:00
}
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
return {
2025-05-15 22:24:39 +08:00
a: common_assets._imports_0$1,
2025-06-05 23:50:08 +08:00
b: common_vendor.o$1($options.goRealTimePk),
c: common_vendor.o$1($options.goMakeAppointmentPK),
d: common_vendor.o$1((...args) => $options.goAdvertisement && $options.goAdvertisement(...args)),
e: common_vendor.f($data.list, (item, index, i0) => {
return common_vendor.e({
a: item.anchorIcon,
b: common_vendor.t(item.anchorId),
c: item.sex === "2"
}, item.sex === "2" ? {
d: common_assets._imports_3
} : {
e: common_assets._imports_2
}, {
f: common_vendor.t(item.sex === "1" ? "男" : "女"),
g: item.sex === "1" ? 1 : "",
h: item.sex === "2" ? 1 : "",
i: common_vendor.t($options.formatDate(item.pkTime)),
j: common_vendor.t(item.coin + "K"),
k: common_vendor.o$1(($event) => $options.goDetail(item)),
l: "7ffebbf4-2-" + i0
});
}),
f: common_vendor.o$1((...args) => $options.onRefresherRefresh && $options.onRefresherRefresh(...args)),
2025-06-06 22:36:41 +08:00
g: common_vendor.o$1((...args) => _ctx.onScrollToLower && _ctx.onScrollToLower(...args)),
2025-06-05 23:50:08 +08:00
h: $data.triggered
2025-05-12 21:23:37 +08:00
};
}
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-7ffebbf4"]]);
wx.createPage(MiniProgramPage);
//# sourceMappingURL=../../../.sourcemap/mp-weixin/pages/Home/Home.js.map