"use strict"; const common_vendor = require("../../common/vendor.js"); if (!Array) { const _easycom_uni_segmented_control2 = common_vendor.resolveComponent("uni-segmented-control"); _easycom_uni_segmented_control2(); } const _easycom_uni_segmented_control = () => "../../uni_modules/uni-segmented-control/components/uni-segmented-control/uni-segmented-control.js"; if (!Math) { _easycom_uni_segmented_control(); } const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({ __name: "info", setup(__props) { var _a; const $api = (_a = common_vendor.getCurrentInstance()) == null ? void 0 : _a.appContext.config.globalProperties.$api; const config = common_vendor.ref({ logoUrl: "" }); const info = common_vendor.ref({}); const list = common_vendor.ref(["出勤报名", "数据统计"]); const current = common_vendor.ref(0); const id = common_vendor.ref(""); common_vendor.onLoad(async (options) => { id.value = options && options.id; common_vendor.index.setNavigationBarTitle({ title: options && options.name || "活动详情" }); await searchConfig(); await search(); }); const searchConfig = async () => { config.value = common_vendor.index.getStorageSync("config"); }; const search = async () => { if (id.value) { const res = await $api(`game/${id.value}`, "GET", {}); if (res.code === 200) { if (res.data) { const date1 = common_vendor.hooks(res.data.startTime).format("YYYY-MM-DD"); const date2 = common_vendor.hooks(res.data.endTime).format("YYYY-MM-DD"); if (common_vendor.hooks(date1).isSame(date2)) res.data.time = common_vendor.hooks(res.data.startTime).format("MM-DD") + " " + common_vendor.hooks(res.data.startTime).format("HH:mm") + "-" + common_vendor.hooks(res.data.endTime).format("HH:mm"); else res.data.time = common_vendor.hooks(res.data.startTime).format("MM-DD") + "/" + common_vendor.hooks(res.data.endTime).format("MM-DD"); info.value = res.data; } } else { common_vendor.index.showToast({ title: res.msg || "", icon: "error" }); } } }; const onClickItem = (e) => { if (current.value !== e.currentIndex) current.value = e.currentIndex; }; const getDayOfWeek = (dateString) => { if (dateString) { const date = new Date(dateString); const dayOfWeek = date.getDay(); const weekdays = ["星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六"]; return weekdays[dayOfWeek]; } else return "暂无日期"; }; return (_ctx, _cache) => { var _a2, _b, _c, _d, _e, _f, _g, _h, _i, _j; return { a: common_vendor.t(info.value.number || 0), b: common_vendor.t(info.value.wheel || 0), c: ((_b = (_a2 = info.value) == null ? void 0 : _a2.redInfo) == null ? void 0 : _b.logo) || config.value.logoUrl, d: common_vendor.t(((_d = (_c = info.value) == null ? void 0 : _c.redInfo) == null ? void 0 : _d.name) || "暂无红方名称"), e: common_vendor.t(info.value.redScore || 0), f: common_vendor.t(info.value.blueScore || 0), g: ((_f = (_e = info.value) == null ? void 0 : _e.blueInfo) == null ? void 0 : _f.logo) || config.value.logoUrl, h: common_vendor.t(((_h = (_g = info.value) == null ? void 0 : _g.blueInfo) == null ? void 0 : _h.name) || "暂无蓝方名称"), i: common_vendor.t(getDayOfWeek(info.value.startTime)), j: common_vendor.t(info.value.time || "暂无时间"), k: common_vendor.t(((_j = (_i = info.value) == null ? void 0 : _i.matchInfo) == null ? void 0 : _j.address) || "暂无地点"), l: common_vendor.o(onClickItem), m: common_vendor.p({ current: current.value, values: list.value, styleType: "text", activeColor: "#dd524d" }), n: current.value === 0, o: current.value === 1 }; }; } }); const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-24c37ea1"], ["__file", "D:/project/足球比赛/match_applet/pagesHome/activity/info.vue"]]); wx.createPage(MiniProgramPage);