choose_project.js
13.7 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
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
"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_swipe_action_item2 = common_vendor.resolveComponent("uni-swipe-action-item");
const _easycom_uni_swipe_action2 = common_vendor.resolveComponent("uni-swipe-action");
const _easycom_uni_list_item2 = common_vendor.resolveComponent("uni-list-item");
const _easycom_uni_list2 = common_vendor.resolveComponent("uni-list");
const _easycom_uni_collapse_item2 = common_vendor.resolveComponent("uni-collapse-item");
const _easycom_uni_collapse2 = common_vendor.resolveComponent("uni-collapse");
const _easycom_uni_popup2 = common_vendor.resolveComponent("uni-popup");
const _easycom_uni_data_checkbox2 = common_vendor.resolveComponent("uni-data-checkbox");
const _easycom_uni_section2 = common_vendor.resolveComponent("uni-section");
(_easycom_uni_swipe_action_item2 + _easycom_uni_swipe_action2 + _easycom_uni_list_item2 + _easycom_uni_list2 + _easycom_uni_collapse_item2 + _easycom_uni_collapse2 + _easycom_uni_popup2 + _easycom_uni_data_checkbox2 + _easycom_uni_section2)();
}
const _easycom_uni_swipe_action_item = () => "../../uni_modules/uni-swipe-action/components/uni-swipe-action-item/uni-swipe-action-item.js";
const _easycom_uni_swipe_action = () => "../../uni_modules/uni-swipe-action/components/uni-swipe-action/uni-swipe-action.js";
const _easycom_uni_list_item = () => "../../uni_modules/uni-list/components/uni-list-item/uni-list-item.js";
const _easycom_uni_list = () => "../../uni_modules/uni-list/components/uni-list/uni-list.js";
const _easycom_uni_collapse_item = () => "../../uni_modules/uni-collapse/components/uni-collapse-item/uni-collapse-item.js";
const _easycom_uni_collapse = () => "../../uni_modules/uni-collapse/components/uni-collapse/uni-collapse.js";
const _easycom_uni_popup = () => "../../uni_modules/uni-popup/components/uni-popup/uni-popup.js";
const _easycom_uni_data_checkbox = () => "../../uni_modules/uni-data-checkbox/components/uni-data-checkbox/uni-data-checkbox.js";
const _easycom_uni_section = () => "../../uni_modules/uni-section/components/uni-section/uni-section.js";
if (!Math) {
(_easycom_uni_swipe_action_item + _easycom_uni_swipe_action + _easycom_uni_list_item + _easycom_uni_list + _easycom_uni_collapse_item + _easycom_uni_collapse + _easycom_uni_popup + _easycom_uni_data_checkbox + _easycom_uni_section)();
}
const _sfc_main = {
__name: "choose_project",
setup(__props) {
const data = common_vendor.reactive({
baseFormData: {},
projectList: [],
matchId: "",
chooseList: [],
signGroupList: [],
signlevel0: [],
signlevel1: [],
signlevel2: [],
signlevelListPopup: null,
signlevelList: [],
signlevelListGirl: [],
signlevelListBoy: [],
popup: null
});
const {
baseFormData,
projectList,
matchId,
chooseList,
popup,
signGroupList,
signlevelList,
signlevelListGirl,
signlevelListBoy,
signlevelListPopup,
signlevel0,
signlevel1,
signlevel2
} = common_vendor.toRefs(data);
let personId = "";
let chargeFlag = "";
common_vendor.onLoad((option) => {
if (option.matchId) {
matchId.value = option.matchId;
}
getMyself();
common_match.getMatchById({
id: matchId.value
}).then((res) => {
chargeFlag = res.data.chargeFlag;
});
});
common_vendor.onShow(() => {
if (matchId.value) {
getMySignInfo();
}
});
function getMyself() {
common_match.getMyPersonInfo().then((res) => {
personId = res.data.id;
});
}
function addProject() {
if (signInfoType == "2") {
common_match.recoverMySign({ cptId: matchId.value }).then((res) => {
if (res.msg.indexOf("Exception:") > -1) {
let msg = res.msg.slice(10);
common_vendor.index.showModal({
title: "提示",
content: msg,
success: function(res2) {
if (res2.confirm) {
console.log("用户点击确定");
}
}
});
return;
}
getMySignInfo();
});
}
common_vendor.index.navigateTo({
url: `/pages_match/match/projectList?personId=${personId}&matchId=${matchId.value}&groupId=0`
});
}
function chooseThisProject(p) {
signGroupList.value = [];
common_match.getCanSignGroupListFromSelectPerson(p.id, personId).then((res) => {
for (var g of res.data) {
if (g.canSign == "1") {
signGroupList.value.push(g);
}
}
});
}
function removeThis(p, index) {
common_match.deleteSign(p.id).then((res) => {
chooseList.value = [];
getMySignInfo();
});
}
let nowLevel = "";
function findLevels(groupId) {
signlevelList.value = [];
signlevelListGirl.value = [];
signlevelListBoy.value = [];
common_match.getCanSignlevelListFromSelectPerson(groupId, personId).then((res) => {
for (let l of res.data) {
l.text = l.name;
l.value = l.id;
if (l.levelType == "1") {
signlevelListBoy.value.push(l);
} else if (l.levelType == "2") {
signlevelListGirl.value.push(l);
} else {
signlevelList.value.push(l);
}
}
signlevelListPopup.value.open();
});
}
function levelMaskClick() {
signlevelList.value = [];
signlevelListGirl.value = [];
signlevelListBoy.value = [];
signlevel0.value = "";
signlevel1.value = "";
signlevel2.value = "";
nowLevel = "";
}
function levelDone() {
console.log(signlevel0.value, signlevel1.value, signlevel2.value);
nowLevel = signlevel0.value + signlevel1.value + signlevel2.value;
if (!nowLevel) {
common_vendor.index.showToast({
title: "请选择级别",
icon: "none",
duration: 2e3
});
return;
}
let obj = {
levelId: nowLevel,
athleteIds: personId,
groupId: "",
teamId: ""
};
saveOne(obj);
}
function saveOne(obj) {
common_match.sportsmanDone(obj).then((res) => {
if (res.msg.indexOf("Exception:") > -1) {
let msg = res.msg.slice(10);
common_vendor.index.showModal({
title: "提示",
content: msg,
success: function(res2) {
if (res2.confirm)
;
}
});
return;
}
signlevel0.value = [];
signlevel1.value = [];
signlevel2.value = [];
nowLevel = "";
res.data;
signlevelListPopup.value.close();
popup.value.close();
getMySignInfo();
});
}
let signInfoType = null;
function getMySignInfo() {
common_match.getMySignInfo({
cptId: matchId.value,
groupId: ""
}).then((res) => {
console.log(res.data);
signInfoType = res.data.type;
if (!res.data.signInfo) {
return;
}
chooseList.value = res.data.signInfo;
if (signInfoType == "2") {
console.log("ff");
}
});
}
function goPrev() {
common_vendor.index.navigateBack();
}
function goNext() {
if (signInfoType == "1") {
common_vendor.index.showModal({
title: "提示",
content: "已报项,前往我的报项",
showCancel: false,
success: function(res) {
if (res.confirm) {
let path = `/pages/usercenter/match`;
common_vendor.index.reLaunch({
url: path
});
} else if (res.cancel) {
console.log("用户点击取消");
}
}
});
return;
}
if (signInfoType == "2") {
common_match.recoverMySign({ cptId: matchId.value }).then((res) => {
if (res.msg.indexOf("Exception:") > -1) {
let msg = res.msg.slice(10);
common_vendor.index.showModal({
title: "提示",
content: msg,
success: function(res2) {
if (res2.confirm) {
console.log("用户点击确定");
}
}
});
return;
} else {
afterRecover();
}
});
} else {
afterRecover();
}
}
function afterRecover() {
if (chooseList.length == 0) {
common_vendor.index.showToast({
title: "请至少选择一个项目",
icon: "none",
duration: 2e3
});
return;
}
if (chargeFlag == "0") {
var obj = {
cptId: matchId.value,
groupId: ""
};
common_match.commitSign(obj).then((res) => {
console.log(res.data);
let path = `/pages_match/match/matchPayDone?cptId=${matchId.value}&groupId=0&chargeFlag=${chargeFlag}&orderId=${res.data}`;
common_vendor.index.navigateTo({
url: path
});
});
} else {
common_vendor.index.navigateTo({
url: `/pages_match/match/matchBill?cptId=${matchId.value}&personId=${personId}`
});
}
}
return (_ctx, _cache) => {
return common_vendor.e({
a: common_vendor.o(addProject),
b: common_vendor.f(common_vendor.unref(chooseList), (p, index, i0) => {
return {
a: common_vendor.t(p.name),
b: common_vendor.t(p.cptProjectName),
c: common_vendor.t(p.cptGroupName),
d: common_vendor.t(p.cptLevelName),
e: common_vendor.o(($event) => removeThis(p), p.id),
f: "6169f0b4-1-" + i0 + "," + ("6169f0b4-0-" + i0),
g: "6169f0b4-0-" + i0,
h: p.id
};
}),
c: common_vendor.unref(chooseList).length == 0
}, common_vendor.unref(chooseList).length == 0 ? {} : {}, {
d: common_vendor.o(goPrev),
e: common_vendor.o(goNext),
f: common_vendor.f(common_vendor.unref(projectList), (p, index, i0) => {
return common_vendor.e({
a: common_vendor.t(p.name),
b: common_vendor.o(($event) => chooseThisProject(p), index),
c: common_vendor.f(common_vendor.unref(signGroupList), (group, index2, i1) => {
return {
a: index2,
b: common_vendor.o(($event) => findLevels(group.id), index2),
c: "6169f0b4-6-" + i0 + "-" + i1 + "," + ("6169f0b4-5-" + i0),
d: common_vendor.p({
title: group.name,
clickable: true
})
};
}),
d: "6169f0b4-5-" + i0 + "," + ("6169f0b4-4-" + i0)
}, common_vendor.unref(signGroupList).length == 0 ? {} : {}, {
e: index,
f: "6169f0b4-4-" + i0 + ",6169f0b4-3"
});
}),
g: common_vendor.p({
border: false
}),
h: common_vendor.unref(signGroupList).length == 0,
i: common_vendor.p({
["show-arrow"]: false,
border: false,
["title-border"]: "none"
}),
j: common_vendor.p({
accordion: true
}),
k: common_vendor.sr(popup, "6169f0b4-2", {
"k": "popup"
}),
l: common_vendor.p({
type: "bottom",
["background-color"]: "#fff"
}),
m: common_vendor.unref(signlevelList).length && common_vendor.unref(signlevelList).length > 0
}, common_vendor.unref(signlevelList).length && common_vendor.unref(signlevelList).length > 0 ? {
n: common_vendor.o(_ctx.changeSignlevel0),
o: common_vendor.o(($event) => common_vendor.isRef(signlevel0) ? signlevel0.value = $event : null),
p: common_vendor.p({
mode: "button",
localdata: common_vendor.unref(signlevelList),
modelValue: common_vendor.unref(signlevel0)
})
} : {}, {
q: common_vendor.unref(signlevelListBoy).length > 0
}, common_vendor.unref(signlevelListBoy).length > 0 ? {
r: common_vendor.o(_ctx.changeSignlevel1),
s: common_vendor.o(($event) => common_vendor.isRef(signlevel1) ? signlevel1.value = $event : null),
t: common_vendor.p({
mode: "button",
localdata: common_vendor.unref(signlevelListBoy),
modelValue: common_vendor.unref(signlevel1)
}),
v: common_vendor.p({
title: "男子组",
type: "line"
})
} : {}, {
w: common_vendor.unref(signlevelListGirl).length > 0
}, common_vendor.unref(signlevelListGirl).length > 0 ? {
x: common_vendor.o(_ctx.changeSignlevel2),
y: common_vendor.o(($event) => common_vendor.isRef(signlevel2) ? signlevel2.value = $event : null),
z: common_vendor.p({
mode: "button",
localdata: common_vendor.unref(signlevelListGirl),
modelValue: common_vendor.unref(signlevel2)
}),
A: common_vendor.p({
title: "女子组",
type: "line"
})
} : {}, {
B: common_vendor.o(levelDone),
C: common_vendor.sr(signlevelListPopup, "6169f0b4-7", {
"k": "signlevelListPopup"
}),
D: common_vendor.o(levelMaskClick)
});
};
}
};
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-6169f0b4"], ["__file", "/Users/yangyang/project/j-mini/Venue/pages_match/match/choose_project.vue"]]);
wx.createPage(MiniProgramPage);