teamList.js
3.25 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
"use strict";
const common_vendor = require("../../common/vendor.js");
const common_match = require("../../common/match.js");
require("../../common/request.js");
require("../../config.js");
require("../../common/login.js");
require("../../common/api.js");
if (!Array) {
const _easycom_uni_group2 = common_vendor.resolveComponent("uni-group");
_easycom_uni_group2();
}
const _easycom_uni_group = () => "../../uni_modules/uni-group/components/uni-group/uni-group.js";
if (!Math) {
_easycom_uni_group();
}
const _sfc_main = {
__name: "teamList",
setup(__props) {
common_vendor.ref({});
const dataList = common_vendor.ref([]);
common_vendor.ref([{ id: 1 }, { id: 2 }]);
common_vendor.ref("");
common_vendor.ref(["全部", "运动员", "教练", "领队", "其他"]);
common_vendor.ref([{ text: "运动员", value: 0 }, { text: "教练", value: 1 }, { text: "领队", value: 2 }, { text: "其他", value: 3 }]);
common_vendor.ref([{ text: "学校", value: 0 }, { text: "场馆", value: 1 }, { text: "俱乐部", value: 2 }, { text: "机构", value: 3 }]);
const regionsList = common_vendor.ref([]);
common_vendor.ref(0);
common_vendor.ref(false);
common_vendor.ref(false);
common_vendor.ref({
type: 0
});
common_vendor.onShow(() => {
getRegionsList();
getList();
});
function getList() {
common_match.getMyGroupList().then((res) => {
dataList.value = res.data;
});
}
function newGroup() {
common_vendor.index.navigateTo({
url: `/pages/usercenter/teamInfo`
});
}
function getRegionsList() {
common_match.regionsList().then((res) => {
regionsList.value = res.data;
});
}
function view(g) {
common_vendor.index.navigateTo({
url: `/pages/usercenter/teamInfo?groupId=${g.id}`
});
}
function del(g) {
common_vendor.index.showModal({
title: "提示",
content: "确定删除吗",
success: function(res) {
if (res.confirm) {
common_match.deleteMyGroup(g.id).then((res2) => {
common_vendor.index.showToast({
icon: "none",
title: res2.msg
});
getList();
});
} else if (res.cancel) {
console.log("用户点击取消");
}
}
});
}
return (_ctx, _cache) => {
return common_vendor.e({
a: common_vendor.o(newGroup),
b: common_vendor.f(dataList.value, (g, index, i0) => {
return {
a: g.imgUrl,
b: common_vendor.t(g.name),
c: common_vendor.t(g.regionStr),
d: common_vendor.t(g.typeStr),
e: common_vendor.o(($event) => view(g), index),
f: common_vendor.o(($event) => del(g), index),
g: index
};
}),
c: dataList.value.length == 0
}, dataList.value.length == 0 ? {} : {}, {
d: common_vendor.p({
mode: "card",
title: "我的参赛队",
top: "20"
})
});
};
}
};
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__file", "/Users/yangyang/project/j-mini/Venue/pages/usercenter/teamList.vue"]]);
wx.createPage(MiniProgramPage);