index.js
6.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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
"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_search_bar2 = common_vendor.resolveComponent("uni-search-bar");
const _easycom_uni_icons2 = common_vendor.resolveComponent("uni-icons");
const _easycom_uni_segmented_control2 = common_vendor.resolveComponent("uni-segmented-control");
(_easycom_uni_search_bar2 + _easycom_uni_icons2 + _easycom_uni_segmented_control2)();
}
const _easycom_uni_search_bar = () => "../../uni_modules/uni-search-bar/components/uni-search-bar/uni-search-bar.js";
const _easycom_uni_icons = () => "../../uni_modules/uni-icons/components/uni-icons/uni-icons.js";
const _easycom_uni_segmented_control = () => "../../uni_modules/uni-segmented-control/components/uni-segmented-control/uni-segmented-control.js";
if (!Math) {
(_easycom_uni_search_bar + _easycom_uni_icons + _easycom_uni_segmented_control)();
}
const _sfc_main = {
__name: "index",
setup(__props) {
const app = getApp();
const data = common_vendor.reactive({
// 1 报名未开始 2 报名进行中 3 即将开始 4 进行中 5已经结束
items: ["全部", "报名中", "进行中", "即将开始", "已结束"],
activeColor: "#00CAA6",
queryParam: {
projectId: "",
progressStatusCode: "",
name: ""
},
current: 0,
index: 0,
list: [],
projectList: [],
projectName: ""
});
const { items, activeColor, queryParam, current, index, list, projectList, projectName } = common_vendor.toRefs(data);
common_vendor.onShow((option) => {
projectList.value = [];
if (app.globalData.isLogin) {
getProjectList();
getList();
} else {
app.firstLoadCallback = () => {
getProjectList();
getList();
};
}
});
function getProjectList() {
common_match.getBaseProject().then((res) => {
projectList.value = res.rows;
let obj = {
id: "",
name: "全部"
};
projectList.value.unshift(obj);
});
}
function getList() {
common_match.getMaList(queryParam.value).then((res) => {
list.value = res.rows;
});
}
function changeProject(e) {
console.log(e.detail.value);
index.value = e.detail.value;
projectName.value = projectList.value[index.value].name;
queryParam.value.projectId = projectList.value[index.value].id;
getList();
}
function onclear() {
queryParam.value.name = "";
getList();
}
function onconfirm() {
console.log(queryParam.value.name);
getList();
}
function onClickItem(e) {
current.value = e.currentIndex;
if (current.value == 1) {
queryParam.value.progressStatusCode = "2";
} else if (current.value == 2) {
queryParam.value.progressStatusCode = "4";
} else if (current.value == 3) {
queryParam.value.progressStatusCode = "3";
} else if (current.value == 4) {
queryParam.value.progressStatusCode = "5";
} else {
queryParam.value.progressStatusCode = "";
}
getList();
}
function goSingle(item) {
if (item.type == 0) {
let path = `/pages_match/match/single?id=${item.id}`;
common_vendor.index.navigateTo({
url: path
});
} else {
let path = `/pages_match/match/singleLs?id=${item.id}`;
common_vendor.index.navigateTo({
url: path
});
}
}
return (_ctx, _cache) => {
return common_vendor.e({
a: common_vendor.o(($event) => onclear()),
b: common_vendor.o(($event) => onconfirm()),
c: common_vendor.o(($event) => common_vendor.unref(queryParam).name = $event),
d: common_vendor.p({
clearButton: "auto",
cancelButton: "none",
modelValue: common_vendor.unref(queryParam).name
}),
e: common_vendor.t(common_vendor.unref(projectName) ? common_vendor.unref(projectName) : "全部"),
f: common_vendor.p({
type: "bottom",
size: "16"
}),
g: common_vendor.o(changeProject),
h: common_vendor.unref(index),
i: common_vendor.unref(projectList),
j: common_vendor.o(onClickItem),
k: common_vendor.p({
current: common_vendor.unref(current),
values: common_vendor.unref(items),
["style-type"]: "text",
["active-color"]: common_vendor.unref(activeColor)
}),
l: common_vendor.f(common_vendor.unref(list), (item, index2, i0) => {
return common_vendor.e({
a: item.type == 0
}, item.type == 0 ? {} : {}, {
b: item.type == 1
}, item.type == 1 ? {} : {}, {
c: item.coverUrl,
d: common_vendor.t(item.name),
e: item.progressStatusCode == 3
}, item.progressStatusCode == 3 ? {} : {}, {
f: item.progressStatusCode == 2
}, item.progressStatusCode == 2 ? {} : {}, {
g: item.progressStatusCode == 4
}, item.progressStatusCode == 4 ? {} : {}, {
h: item.progressStatusCode == 5
}, item.progressStatusCode == 5 ? {} : {}, {
i: item.progressStatusCode == 1
}, item.progressStatusCode == 1 ? {} : {}, {
j: item.type == 0
}, item.type == 0 ? {
k: common_vendor.t(item.signEndTime.substring(0, 10))
} : {
l: common_vendor.t(item.beginTime.substring(0, 10))
}, {
m: item.type == 1
}, item.type == 1 ? {
n: common_vendor.t(item.endTime.substring(0, 10))
} : {}, {
o: common_vendor.o(($event) => goSingle(item), index2),
p: index2
});
}),
m: common_vendor.unref(list).length == 0
}, common_vendor.unref(list).length == 0 ? {} : {});
};
}
};
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-3bb03d67"], ["__file", "/Users/yangyang/project/j-mini/Venue/pages_match/match/index.vue"]]);
_sfc_main.__runtimeHooks = 6;
wx.createPage(MiniProgramPage);