123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213 |
- "use strict";
- const common_vendor = require("../../common/vendor.js");
- if (!Array) {
- const _easycom_uni_icons2 = common_vendor.resolveComponent("uni-icons");
- _easycom_uni_icons2();
- }
- const _easycom_uni_icons = () => "../../uni_modules/uni-icons/components/uni-icons/uni-icons.js";
- if (!Math) {
- (_easycom_uni_icons + circle)();
- }
- const circle = () => "./components/circle.js";
- 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 list = common_vendor.ref([{ id: 1, name: "测试球队" }, { id: 1, name: "肝帝集团队" }]);
- const pageNum = common_vendor.ref(1);
- const pageSize = common_vendor.ref(10);
- const total = common_vendor.ref(0);
- const info = common_vendor.ref({});
- const id = common_vendor.ref("");
- const config = common_vendor.ref({ logoUrl: "" });
- const user = common_vendor.ref({});
- const statusList = common_vendor.ref([]);
- common_vendor.onLoad(async (options) => {
- id.value = options && options.id;
- await searchConfig();
- await searchOther();
- await search();
- await searchGame();
- });
- const searchConfig = async () => {
- config.value = common_vendor.index.getStorageSync("config");
- user.value = common_vendor.index.getStorageSync("user");
- };
- const searchOther = async () => {
- let res;
- res = await $api(`dict/data/list`, "GET", { dictType: "sys_game_status", status: "0" });
- if (res.code === 200 && res.total > 0)
- statusList.value = res.rows;
- };
- const search = async () => {
- if (id.value) {
- const res = await $api(`team/${id.value}`, "GET", {});
- if (res.code === 200) {
- if (res.data)
- info.value = res.data;
- } else {
- common_vendor.index.showToast({
- title: res.msg || "",
- icon: "error"
- });
- }
- }
- };
- const searchGame = async () => {
- if (id.value) {
- const res = await $api("game/list", "GET", {
- pageNum: pageNum.value,
- pageSize: pageSize.value,
- userId: user.value.id
- });
- if (res.code === 200) {
- list.value = res.rows;
- total.value = res.total;
- } else {
- common_vendor.index.showToast({
- title: res.msg || "",
- icon: "error"
- });
- }
- }
- };
- const menuList = common_vendor.ref([
- { name: "队员", icon: "icon-a-14-chengyuanguanli", color: "#333333", route: "/pagesHome/team/person" },
- { name: "相册", icon: "icon-xiangce", color: "#333333", route: "/pagesHome/team/album" },
- { name: "账本", icon: "icon-zhangben", color: "#333333", route: "/pagesHome/team/book" },
- { name: "战术板", icon: "icon-cricket-pitch", color: "#333333", route: "/pagesHome/team/board" }
- ]);
- const toEdit = (item) => {
- common_vendor.index.navigateTo({
- url: `/pagesHome/team/index?id=${item._id || item.id}`
- });
- };
- const toInfo = (item) => {
- common_vendor.index.navigateTo({
- url: `${item.route}?id=${id.value}`
- });
- };
- const toActivity = (item) => {
- common_vendor.index.navigateTo({
- url: `/pagesHome/activity/info?id=${item._id || item.id}&name=${item.name || ""}`
- });
- };
- const toSave = () => {
- common_vendor.index.navigateTo({
- url: `/pagesHome/create/index?id=${id.value}`
- });
- };
- const getDayOfWeek = (dateString) => {
- if (dateString) {
- const date = new Date(dateString);
- const dayOfWeek = date.getDay();
- const weekdays = ["星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六"];
- return weekdays[dayOfWeek];
- } else
- return "暂无日期";
- };
- const getStatus = (value) => {
- if (value) {
- const data = statusList.value.find((i) => i.dictValue == value);
- if (data)
- return data.dictLabel;
- } else
- return "暂无状态";
- };
- return (_ctx, _cache) => {
- return {
- a: info.value.logo || "/static/qiudui.png",
- b: common_vendor.t(info.value.name || "暂无名称"),
- c: common_vendor.t(info.value.ranking || "暂无排名"),
- d: common_vendor.o(($event) => toEdit(info.value)),
- e: common_vendor.p({
- type: "plusempty",
- size: "12",
- color: "#ffffff"
- }),
- f: common_vendor.o(toSave),
- g: common_vendor.o(toSave),
- h: common_vendor.p({
- type: "list",
- size: "18"
- }),
- i: common_vendor.o(($event) => toInfo({
- route: "/pagesHome/activity/index"
- })),
- j: common_vendor.f(menuList.value, (item, index, i0) => {
- return {
- a: "b14ffc51-2-" + i0,
- b: common_vendor.p({
- ["custom-prefix"]: "iconfont",
- type: item.icon,
- size: "25",
- color: item.color
- }),
- c: common_vendor.t(item.name),
- d: index,
- e: common_vendor.o(($event) => toInfo(item), index)
- };
- }),
- k: common_vendor.t(total.value || 0),
- l: common_vendor.p({
- pro: 16 / 100,
- border_back_color: "#f1f1f1",
- border_color: "#FF0000",
- content: "16"
- }),
- m: common_vendor.p({
- pro: 5 / 100,
- border_back_color: "#f1f1f1",
- border_color: "#35BD7B",
- content: "5"
- }),
- n: common_vendor.p({
- pro: 17 / 100,
- border_back_color: "#f1f1f1",
- border_color: "#FFA500",
- content: "17"
- }),
- o: common_vendor.p({
- type: "forward",
- size: "25",
- color: "#858585"
- }),
- p: common_vendor.p({
- ["custom-prefix"]: "iconfont",
- type: "icon-xiangce",
- size: "20",
- color: "#333333"
- }),
- q: common_vendor.o(($event) => toInfo({
- route: "/pagesHome/team/album"
- })),
- r: common_vendor.f(list.value, (item, index, i0) => {
- var _a2, _b, _c, _d, _e, _f;
- return common_vendor.e({
- a: common_vendor.t(common_vendor.unref(common_vendor.hooks)(item.startTime).format("MM-DD") || "暂无日期"),
- b: common_vendor.t(getDayOfWeek(item.startTime)),
- c: common_vendor.t(getStatus(item.status)),
- d: common_vendor.n(item.status == "0" ? "status0" : item.status == "1" ? "status1" : item.status == "2" ? "status2" : "status3"),
- e: item.type == "0"
- }, item.type == "0" ? {
- f: common_vendor.t(((_a2 = item == null ? void 0 : item.matchInfo) == null ? void 0 : _a2.title) || "友谊赛")
- } : {
- g: common_vendor.t(((_b = item == null ? void 0 : item.leagueInfo) == null ? void 0 : _b.title) || "联赛")
- }, {
- h: common_vendor.t(((_c = item == null ? void 0 : item.redInfo) == null ? void 0 : _c.name) || "暂无红方名称"),
- i: ((_d = item == null ? void 0 : item.redInfo) == null ? void 0 : _d.logo) || config.value.logoUrl,
- j: common_vendor.t(item.redScore || 0),
- k: common_vendor.t(item.blueScore || 0),
- l: ((_e = item == null ? void 0 : item.blueInfo) == null ? void 0 : _e.logo) || config.value.logoUrl,
- m: common_vendor.t(((_f = item == null ? void 0 : item.blueInfo) == null ? void 0 : _f.name) || "暂无蓝方名称"),
- n: index,
- o: common_vendor.o(($event) => toActivity(item), index)
- });
- })
- };
- };
- }
- });
- const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-b14ffc51"], ["__file", "D:/project/足球比赛/match_applet/pagesHome/team/info.vue"]]);
- wx.createPage(MiniProgramPage);
|