"use strict"; const common_vendor = require("../../common/vendor.js"); const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({ __name: "person", setup(__props) { var _a; const $api = (_a = common_vendor.getCurrentInstance()) == null ? void 0 : _a.appContext.config.globalProperties.$api; const user = common_vendor.ref({}); const searchInfo = common_vendor.ref({}); const list = common_vendor.ref([{ id: 1, name: "成都容城" }, { id: 1, name: "YYDS|脏三疯" }]); const pageNum = common_vendor.ref(1); const pageSize = common_vendor.ref(10); const total = common_vendor.ref(0); const config = common_vendor.ref({}); const scrollTop = common_vendor.ref(0); const is_bottom = common_vendor.ref(false); common_vendor.onShow(async () => { await searchConfig(); await searchUser(); await search(); }); const searchConfig = async () => { config.value = common_vendor.index.getStorageSync("config"); }; const searchUser = async () => { user.value = common_vendor.index.getStorageSync("user"); }; const search = async () => { const info = { pageNum: pageNum.value, pageSize: pageSize.value, userId: user.value.id }; const res = await $api("team/list", "GET", { ...info }); if (res.code === 200) { list.value = res.rows; total.value = res.total; } else { common_vendor.index.showToast({ title: res.msg || "", icon: "error" }); } }; const searchTeam = async () => { const info = { pageNum: pageNum.value, pageSize: pageSize.value }; const res = await $api("team/list", "GET", { ...info, ...searchInfo }); if (res.code === 200) { list.value = res.rows; total.value = res.total; } else { common_vendor.index.showToast({ title: res.msg || "", icon: "error" }); } }; const toInput = (e) => { if (searchInfo.value.name) searchInfo.value.name = e.detail.value; searchInfo.value = {}; clearPage(); searchTeam(); }; const toSelect = (item) => { common_vendor.index.$emit("opponentInfo", item); common_vendor.index.navigateBack({ delta: 1 }); }; const toPage = () => { if (total.value > list.value.length) { common_vendor.index.showLoading({ title: "加载中", mask: true }); pageNum.value = pageNum.value + 1; pageSize.value = pageNum.value * 10; search(); common_vendor.index.hideLoading(); } else is_bottom.value = true; }; const toScroll = (e) => { let up = scrollTop.value; scrollTop.value = e.detail.scrollTop; let num = Math.sign(up - e.detail.scrollTop); if (num == 1) is_bottom.value = false; }; const clearPage = () => { list.value = []; pageNum.value = 1; pageSize.value = 10; }; return (_ctx, _cache) => { return common_vendor.e({ a: common_vendor.o([($event) => searchInfo.value.name = $event.detail.value, toInput]), b: searchInfo.value.name, c: common_vendor.f(list.value, (item, index, i0) => { return { a: item.logo || config.value.logoUrl, b: common_vendor.t(item.name || "暂无名称"), c: common_vendor.t(item.city || "未入驻"), d: common_vendor.t(item.win || 0), e: common_vendor.t(item.flat || 0), f: common_vendor.t(item.burden || 0), g: index, h: common_vendor.o(($event) => toSelect(item), index) }; }), d: is_bottom.value }, is_bottom.value ? { e: common_vendor.t(config.value.bottomTitle || "到底了!") } : {}, { f: common_vendor.o(toPage), g: common_vendor.o(toScroll) }); }; } }); const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-3a2dd265"], ["__file", "D:/project/足球比赛/match_applet/pagesHome/create/person.vue"]]); wx.createPage(MiniProgramPage);