detailPage.js
8.17 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
"use strict";
const common_vendor = require("../../../common/vendor.js");
const common_train = require("../../../common/train.js");
require("../../../common/request.js");
require("../../../config.js");
require("../../../common/login.js");
require("../../../common/api.js");
if (!Array) {
const _easycom_uni_segmented_control2 = common_vendor.resolveComponent("uni-segmented-control");
const _easycom_uni_icons2 = common_vendor.resolveComponent("uni-icons");
const _easycom_uni_popup2 = common_vendor.resolveComponent("uni-popup");
(_easycom_uni_segmented_control2 + _easycom_uni_icons2 + _easycom_uni_popup2)();
}
const _easycom_uni_segmented_control = () => "../../../uni_modules/uni-segmented-control/components/uni-segmented-control/uni-segmented-control.js";
const _easycom_uni_icons = () => "../../../uni_modules/uni-icons/components/uni-icons/uni-icons.js";
const _easycom_uni_popup = () => "../../../uni_modules/uni-popup/components/uni-popup/uni-popup.js";
if (!Math) {
(_easycom_uni_segmented_control + _easycom_uni_icons + trainnSchedule + _easycom_uni_popup)();
}
const trainnSchedule = () => "../../../components/train/trainSchedule/trainSchedule.js";
const _sfc_main = {
__name: "detailPage",
setup(__props) {
const items = common_vendor.ref(["详情", "日程"]);
const current = common_vendor.ref(0);
const show = common_vendor.ref(true);
const showMore = common_vendor.ref(false);
const popup = common_vendor.ref();
const state = common_vendor.ref();
const signStatusStr = common_vendor.ref();
const id = common_vendor.ref();
const userList = common_vendor.ref();
const type = common_vendor.ref("center");
const trainList = common_vendor.ref();
const text = common_vendor.ref();
const scheduleList = common_vendor.ref();
const height = common_vendor.ref();
const flag = common_vendor.ref(true);
const status = common_vendor.ref();
common_vendor.ref((/* @__PURE__ */ new Date()).getTime());
const newTime = common_vendor.ref();
const data = common_vendor.reactive({
addForm: {},
form: {}
});
const { addForm, form } = common_vendor.toRefs(data);
common_vendor.onLoad((option) => {
const item = JSON.parse(decodeURIComponent(option.item));
id.value = item.trainId;
status.value = item.status;
initData();
});
function filterTime(num) {
if (num)
return num.slice(0, 16);
}
async function initData() {
addForm.value.id = id.value;
let res = await common_train.trainParticulars(addForm.value);
form.value = res.data;
signStatusStr.value = res.data.signStatusStr;
state.value = res.data.signStatus;
newTime.value = new Date(res.data.enrollEndTime).getTime();
userList.value = res.data.userList[0];
scheduleList.value = res.data.scheduleList;
setTimeout(() => {
getbox();
}, 50);
}
function change(e) {
show.value = e.show;
}
async function trainFN(val) {
text.value = "培训科目";
popup.value.open(val);
trainList.value = form.value.trainProjectsList;
}
function examinationFN(val) {
text.value = "考试科目";
popup.value.open(val);
trainList.value = form.value.examProjectsList;
}
function onClickItem(e) {
if (current.values != e.currentIndex) {
current.value = e.currentIndex;
}
}
function getbox() {
const query = common_vendor.wx$1.createSelectorQuery();
query.select(".text-content").boundingClientRect(function(rect) {
height.value = rect.height;
if (rect.height > 60) {
showMore.value = true;
} else {
showMore.value = false;
}
}).exec();
}
const move = () => {
flag.value = !flag.value;
if (!flag.value) {
height.value = void 0;
} else {
height.value = 60;
}
};
function applyFN() {
let path = "/pages/train/apply/apply?data=" + [id.value, status.value];
common_vendor.wx$1.redirectTo({
url: path
});
}
function shut() {
popup.value.close();
}
return (_ctx, _cache) => {
return common_vendor.e({
a: common_vendor.unref(form).cover,
b: common_vendor.t(common_vendor.unref(form).trainName),
c: state.value == "报名中"
}, state.value == "报名中" ? {
d: common_vendor.t(state.value)
} : {}, {
e: state.value == "进行中"
}, state.value == "进行中" ? {
f: common_vendor.t(state.value)
} : {}, {
g: state.value == "即将开始"
}, state.value == "即将开始" ? {
h: common_vendor.t(state.value)
} : {}, {
i: state.value == "已结束"
}, state.value == "已结束" ? {
j: common_vendor.t(state.value)
} : {}, {
k: state.value == "报名未开始"
}, state.value == "报名未开始" ? {
l: common_vendor.t(state.value)
} : {}, {
m: state.value == "培训未开始"
}, state.value == "培训未开始" ? {
n: common_vendor.t(state.value)
} : {}, {
o: common_vendor.t(filterTime(common_vendor.unref(form).enrollEndTime)),
p: common_vendor.o(onClickItem),
q: common_vendor.p({
activeColor: "#000",
current: current.value,
values: items.value,
styleType: "text"
}),
r: common_vendor.t(common_vendor.unref(form).enrollNotice),
s: common_vendor.n(height.value ? "hidden" : ""),
t: showMore.value
}, showMore.value ? common_vendor.e({
v: common_vendor.t(flag.value ? "查看更多" : "收起"),
w: flag.value
}, flag.value ? {
x: common_vendor.p({
type: "right",
color: "#1ec886"
})
} : {
y: common_vendor.p({
type: "top",
color: "#1ec886"
})
}, {
z: common_vendor.o(move)
}) : {}, {
A: common_vendor.t(common_vendor.unref(form).organizer),
B: common_vendor.t(common_vendor.unref(form).undertaker),
C: common_vendor.t(common_vendor.unref(form).contactUs),
D: common_vendor.p({
type: "forward"
}),
E: common_vendor.o(($event) => trainFN("bottom")),
F: common_vendor.p({
type: "forward"
}),
G: common_vendor.o(($event) => examinationFN("bottom")),
H: current.value === 0,
I: common_vendor.p({
scheduleList: scheduleList.value
}),
J: current.value === 1,
K: current.value == 0
}, current.value == 0 ? common_vendor.e({}, {
M: state.value != 0 && state.value != 1 && state.value != 5 && signStatusStr.value != "报名结束" && signStatusStr.value != "报名未开始"
}, state.value != 0 && state.value != 1 && state.value != 5 && signStatusStr.value != "报名结束" && signStatusStr.value != "报名未开始" ? {
N: common_vendor.o(($event) => applyFN())
} : {}, {
O: signStatusStr.value == "报名结束"
}, signStatusStr.value == "报名结束" ? {} : {}, {
P: signStatusStr.value == "等待审核"
}, signStatusStr.value == "等待审核" ? {} : {}, {
Q: signStatusStr.value == "报名未开始"
}, signStatusStr.value == "报名未开始" ? {} : {}) : {}, {
R: common_vendor.t(text.value),
S: common_vendor.p({
type: "closeempty"
}),
T: common_vendor.o(shut),
U: common_vendor.f(trainList.value, (item, k0, i0) => {
return {
a: common_vendor.t(item.projectName),
b: common_vendor.t(item.isNecessary == 1 ? "必选" : "非必选"),
c: item.id
};
}),
V: type.value === "left" || type.value === "right" ? 1 : "",
W: common_vendor.sr(popup, "26574ee3-6", {
"k": "popup"
}),
X: common_vendor.o(change),
Y: common_vendor.p({
["background-color"]: "#fff"
})
});
};
}
};
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__file", "/Users/yangyang/project/j-mini/Venue/pages/train/detailPage/detailPage.vue"]]);
_sfc_main.__runtimeHooks = 6;
wx.createPage(MiniProgramPage);