assessment.js 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588
  1. "use strict";
  2. const common_vendor = require("../../common/vendor.js");
  3. const common_assets = require("../../common/assets.js");
  4. const api_assessment = require("../../api/assessment.js");
  5. const api_dict = require("../../api/dict.js");
  6. const api_message = require("../../api/message.js");
  7. if (!Math) {
  8. CustomTabbar();
  9. }
  10. const CustomTabbar = () => "../../components/custom-tabbar/custom-tabbar.js";
  11. const _sfc_main = {
  12. __name: "assessment",
  13. setup(__props) {
  14. const statusBarHeight = common_vendor.ref(20);
  15. const titleBarMargin = common_vendor.ref(8);
  16. const menuButtonHeight = common_vendor.ref(32);
  17. const currentTab = common_vendor.ref(0);
  18. const searchQuery = common_vendor.ref("");
  19. const assessments = common_vendor.ref([]);
  20. const trainings = common_vendor.ref([]);
  21. const loading = common_vendor.ref(false);
  22. const trainingLoading = common_vendor.ref(false);
  23. const passedEvaluationIds = common_vendor.ref(/* @__PURE__ */ new Set());
  24. const hasRecordEvaluationIds = common_vendor.ref(/* @__PURE__ */ new Set());
  25. const completedEvaluationIds = common_vendor.ref(/* @__PURE__ */ new Set());
  26. const decodeBase64Utf8 = (value) => {
  27. if (!value || typeof value !== "string")
  28. return "";
  29. try {
  30. const binary = atob(value);
  31. const bytes = Array.from(binary, (char) => char.charCodeAt(0));
  32. return decodeURIComponent(bytes.map((byte) => `%${byte.toString(16).padStart(2, "0")}`).join(""));
  33. } catch (e) {
  34. return value;
  35. }
  36. };
  37. const resolveDescription = (item, fallback = "") => {
  38. let desc = item.remark || item.description || item.desc;
  39. if (!desc && item.detail) {
  40. desc = /^[A-Za-z0-9+/=]+$/.test(item.detail) ? decodeBase64Utf8(item.detail) : item.detail;
  41. }
  42. return desc || fallback;
  43. };
  44. const recordText = common_vendor.computed(() => {
  45. return currentTab.value === 0 ? "测评记录" : "培训记录";
  46. });
  47. const fetchAssessments = async () => {
  48. if (loading.value)
  49. return;
  50. loading.value = true;
  51. try {
  52. const userInfo = common_vendor.index.getStorageSync("userInfo") || {};
  53. const userId = userInfo.studentId || null;
  54. if (userId) {
  55. const recordRes = await api_assessment.getAssessmentRecordList(userId);
  56. if (recordRes.code === 200 && recordRes.data) {
  57. const records = recordRes.data;
  58. passedEvaluationIds.value = new Set(
  59. records.filter((r) => r.finalResult === "1").map((r) => r.evaluationId)
  60. );
  61. hasRecordEvaluationIds.value = new Set(records.map((r) => r.evaluationId));
  62. completedEvaluationIds.value = new Set(
  63. records.filter((r) => r.finalResult === "1" || r.finalResult === "2").map((r) => r.evaluationId)
  64. );
  65. }
  66. }
  67. const typeFilter = assessmentFilterList.value[0].selectedValue;
  68. const levelFilter = assessmentFilterList.value[1].selectedValue;
  69. const params = {
  70. pageNum: 1,
  71. pageSize: 20
  72. };
  73. if (searchQuery.value)
  74. params.evaluationName = searchQuery.value;
  75. if (typeFilter)
  76. params.positionType = typeFilter;
  77. if (levelFilter)
  78. params.grade = levelFilter;
  79. const res = await api_assessment.getAssessmentList(params);
  80. if (res.code === 200 && res.rows) {
  81. common_vendor.index.__f__("log", "at pages/assessment/assessment.vue:322", "测评API返回数据:", res.rows[0]);
  82. assessments.value = res.rows.filter((item) => item.status === "1").map((item) => {
  83. let title = item.evaluationName || item.name || item.title || "未知测评";
  84. const desc = resolveDescription(item, "专业技能评估,助力职业发展");
  85. const hasPaid = common_vendor.index.getStorageSync(`audit_paid_${item.id}`) === true;
  86. const postId = item.positionId;
  87. const isApplied = postId ? common_vendor.index.getStorageSync(`candidate_applied_${postId}`) === true : false;
  88. return {
  89. id: item.id,
  90. title,
  91. level: item.gradeLabel || item.grade || "",
  92. type: item.positionTypeLabel || item.positionType || "",
  93. category: item.positionLabel || item.position || "",
  94. desc,
  95. cover: item.mainImageUrl || item.coverImage || "/static/images/assessment_default.svg",
  96. tags: item.tags ? item.tags.split(",") : [],
  97. price: item.price || "",
  98. isCollected: false,
  99. collectionId: null,
  100. isPassed: passedEvaluationIds.value.has(item.id),
  101. hasRecord: hasRecordEvaluationIds.value.has(item.id),
  102. isCompleted: completedEvaluationIds.value.has(item.id),
  103. hasPaid,
  104. postId,
  105. isApplied
  106. };
  107. });
  108. }
  109. } catch (err) {
  110. common_vendor.index.__f__("error", "at pages/assessment/assessment.vue:360", "获取测评列表失败", err);
  111. common_vendor.index.showToast({ title: "加载失败,请重试", icon: "none" });
  112. } finally {
  113. loading.value = false;
  114. }
  115. };
  116. const fetchTrainings = async () => {
  117. if (trainingLoading.value)
  118. return;
  119. trainingLoading.value = true;
  120. try {
  121. const trainingTypeFilter = trainingFilterList.value[0].selectedValue;
  122. const jobTypeFilter = trainingFilterList.value[1].selectedValue;
  123. const jobNameFilter = trainingFilterList.value[2].selectedValue;
  124. const params = {
  125. pageNum: 1,
  126. pageSize: 20,
  127. status: 1
  128. // 只查询已发布的
  129. };
  130. if (trainingTypeFilter)
  131. params.trainingType = trainingTypeFilter;
  132. if (jobTypeFilter)
  133. params.jobType = jobTypeFilter;
  134. if (jobNameFilter)
  135. params.job = jobNameFilter;
  136. if (searchQuery.value)
  137. params.name = searchQuery.value;
  138. const res = await api_assessment.getTrainingList(params);
  139. if (res.code === 200 && res.rows) {
  140. common_vendor.index.__f__("log", "at pages/assessment/assessment.vue:388", "培训API返回数据:", res.rows[0]);
  141. trainings.value = res.rows.map((item) => {
  142. common_vendor.index.__f__("log", "at pages/assessment/assessment.vue:390", "培训单项数据:", item);
  143. let title = item.name || item.trainingName || item.title;
  144. if (!title || title.trim() === "" || title.startsWith("test_")) {
  145. const job = item.job || item.position || "专业技能";
  146. title = `${job}培训课程`;
  147. }
  148. const desc = resolveDescription(item, "提升专业技能,助力职业发展");
  149. let location = "";
  150. if (item.trainingType === "offline") {
  151. const city = item.city || "";
  152. const area = item.area || "";
  153. const addressDetail = item.addressDetail || "";
  154. location = `${city}${area}${addressDetail}`.replace(/undefined|null/g, "").trim();
  155. if (!location)
  156. location = "线下培训";
  157. } else {
  158. location = "线上培训";
  159. }
  160. const trainingTime = item.trainingStartTime ? item.trainingStartTime.split(" ")[0] + (item.trainingEndTime ? " 至 " + item.trainingEndTime.split(" ")[0] : "") : "";
  161. const deadline = item.applyEndTime ? item.applyEndTime.split(" ")[0] : "";
  162. return {
  163. id: item.id,
  164. title,
  165. trainingType: item.trainingType || "offline",
  166. type: item.jobType || "",
  167. category: item.job || "",
  168. tags: item.tags ? item.tags.split(",") : [],
  169. location,
  170. organizer: item.organizer || "平台推荐",
  171. trainingTime,
  172. deadline,
  173. isEnding: false,
  174. // 可以根据applyEndTime判断是否即将截止
  175. cover: item.thumbnailUrl || "/static/images/training_default.svg",
  176. views: item.learnCount || "0",
  177. duration: item.duration || "",
  178. status: item.status === 1 ? "published" : "not-started",
  179. spectators: item.participantCount || "0",
  180. desc
  181. };
  182. });
  183. }
  184. } catch (err) {
  185. common_vendor.index.__f__("error", "at pages/assessment/assessment.vue:445", "获取培训列表失败", err);
  186. } finally {
  187. trainingLoading.value = false;
  188. }
  189. };
  190. const handleTabChange = (index) => {
  191. currentTab.value = index;
  192. if (index === 0 && assessments.value.length === 0) {
  193. fetchAssessments();
  194. } else if (index === 1 && trainings.value.length === 0) {
  195. fetchTrainings();
  196. }
  197. };
  198. common_vendor.watch(currentTab, (newTab) => {
  199. if (newTab === 0 && assessments.value.length === 0) {
  200. fetchAssessments();
  201. } else if (newTab === 1 && trainings.value.length === 0) {
  202. fetchTrainings();
  203. }
  204. });
  205. const goToRecords = () => {
  206. common_vendor.index.showToast({ title: recordText.value, icon: "none" });
  207. };
  208. const goToDetail = (item) => {
  209. common_vendor.index.navigateTo({ url: `/pages/assessment/detail?id=${item.id}` });
  210. };
  211. const viewAssessmentReport = (item) => {
  212. if (!item.isCompleted)
  213. return;
  214. common_vendor.index.navigateTo({ url: `/pages/assessment/report?id=${item.id}` });
  215. };
  216. const handleApply = (item) => {
  217. if (!item.postId) {
  218. common_vendor.index.showToast({ title: "该测评未关联岗位,无法投递", icon: "none" });
  219. return;
  220. }
  221. const userInfo = common_vendor.index.getStorageSync("userInfo") || {};
  222. if (!userInfo.studentId) {
  223. common_vendor.index.showToast({ title: "请先登录", icon: "none" });
  224. setTimeout(() => {
  225. common_vendor.index.navigateTo({ url: "/pages/login/login" });
  226. }, 1e3);
  227. return;
  228. }
  229. common_vendor.index.navigateTo({
  230. url: `/pages/my/select-resume?postId=${item.postId}`
  231. });
  232. };
  233. const handleConsult = async (item) => {
  234. const userInfo = common_vendor.index.getStorageSync("userInfo") || {};
  235. const userId = userInfo.studentId || null;
  236. if (!userId) {
  237. common_vendor.index.showToast({ title: "请先登录", icon: "none" });
  238. setTimeout(() => {
  239. common_vendor.index.navigateTo({ url: "/pages/login/login" });
  240. }, 1e3);
  241. return;
  242. }
  243. try {
  244. common_vendor.index.showLoading({ title: "正在连接客服..." });
  245. const userName = userInfo.name || "用户";
  246. const userAvatar = userInfo.avatarUrl || "/static/images/user_avatar.svg";
  247. const res = await api_message.createOrGetSession({
  248. sessionType: 1,
  249. fromUserId: userId,
  250. fromUserName: userName,
  251. fromUserAvatar: userAvatar,
  252. sourceId: "assessment_" + ((item == null ? void 0 : item.id) || "")
  253. });
  254. common_vendor.index.hideLoading();
  255. if (res.data) {
  256. const session = res.data;
  257. const assessmentTitle = encodeURIComponent(item ? item.title || "" : "");
  258. const assessmentCover = encodeURIComponent(item ? item.cover || "" : "");
  259. const assessmentId = item ? item.id || "" : "";
  260. const assessmentLevel = encodeURIComponent(item ? item.level || "" : "");
  261. const assessmentPrice = item ? item.price || "" : "";
  262. common_vendor.index.navigateTo({
  263. url: `/pages/chat/chat?sessionId=${session.sessionId}&sessionNo=${session.sessionNo || ""}&fromUserId=${userId}&userName=${encodeURIComponent(userName)}&type=assessment&title=${assessmentTitle}&cover=${assessmentCover}&assessmentId=${assessmentId}&level=${assessmentLevel}&price=${assessmentPrice}`
  264. });
  265. } else {
  266. common_vendor.index.showToast({ title: "创建会话失败", icon: "none" });
  267. }
  268. } catch (err) {
  269. common_vendor.index.hideLoading();
  270. common_vendor.index.__f__("error", "at pages/assessment/assessment.vue:550", "创建会话失败:", err);
  271. common_vendor.index.showToast({ title: "连接失败,请重试", icon: "none" });
  272. }
  273. };
  274. const activeFilterIndex = common_vendor.ref(-1);
  275. const assessmentFilterList = common_vendor.ref([
  276. {
  277. label: "岗位类型",
  278. selectedLabel: "",
  279. selectedValue: "",
  280. options: [{ label: "全部", value: "" }]
  281. },
  282. {
  283. label: "岗位等级",
  284. selectedLabel: "",
  285. selectedValue: "",
  286. options: [{ label: "全部", value: "" }]
  287. },
  288. {
  289. label: "岗位名称",
  290. selectedLabel: "",
  291. selectedValue: "",
  292. options: [
  293. { label: "全部", value: "" },
  294. { label: "审计岗位", value: "audit" },
  295. { label: "咨询岗位", value: "consult" },
  296. { label: "税务岗位", value: "tax" }
  297. ]
  298. }
  299. ]);
  300. const loadDicts = async () => {
  301. try {
  302. const [typeRes, levelRes] = await Promise.all([
  303. api_dict.getDicts("main_position_type"),
  304. api_dict.getDicts("main_position_level")
  305. ]);
  306. if (typeRes.code === 200) {
  307. const options = [
  308. { label: "全部", value: "" },
  309. ...typeRes.data.map((d) => ({ label: d.dictLabel, value: d.dictValue }))
  310. ];
  311. assessmentFilterList.value[0].options = options;
  312. trainingFilterList.value[1].options = options;
  313. }
  314. if (levelRes.code === 200) {
  315. assessmentFilterList.value[1].options = [
  316. { label: "全部", value: "" },
  317. ...levelRes.data.map((d) => ({ label: d.dictLabel, value: d.dictValue }))
  318. ];
  319. }
  320. } catch (e) {
  321. common_vendor.index.__f__("error", "at pages/assessment/assessment.vue:606", "加载字典失败", e);
  322. }
  323. };
  324. const trainingFilterList = common_vendor.ref([
  325. {
  326. label: "培训类型",
  327. selectedLabel: "线下培训",
  328. selectedValue: "offline",
  329. options: [
  330. { label: "线下培训", value: "offline" },
  331. { label: "视频培训", value: "video" },
  332. { label: "直播培训", value: "live" }
  333. ]
  334. },
  335. {
  336. label: "职位类型",
  337. selectedLabel: "",
  338. selectedValue: "",
  339. options: [
  340. { label: "全部", value: "" },
  341. { label: "全职", value: "full-time" },
  342. { label: "兼职", value: "part-time" },
  343. { label: "实习", value: "intern" }
  344. ]
  345. },
  346. {
  347. label: "岗位",
  348. selectedLabel: "",
  349. selectedValue: "",
  350. options: [
  351. { label: "全部", value: "" },
  352. { label: "审计", value: "audit" },
  353. { label: "咨询", value: "consult" },
  354. { label: "税务", value: "tax" }
  355. ]
  356. }
  357. ]);
  358. const currentFilters = common_vendor.computed(() => {
  359. return currentTab.value === 0 ? assessmentFilterList.value : trainingFilterList.value;
  360. });
  361. const currentOptions = common_vendor.computed(() => {
  362. if (activeFilterIndex.value === -1)
  363. return [];
  364. return currentFilters.value[activeFilterIndex.value].options;
  365. });
  366. const toggleFilter = (index) => {
  367. if (activeFilterIndex.value === index) {
  368. activeFilterIndex.value = -1;
  369. } else {
  370. activeFilterIndex.value = index;
  371. }
  372. };
  373. const closeFilter = () => {
  374. activeFilterIndex.value = -1;
  375. };
  376. const selectOption = (opt) => {
  377. const filter = currentFilters.value[activeFilterIndex.value];
  378. filter.selectedValue = opt.value;
  379. filter.selectedLabel = opt.value === "" ? "" : opt.label;
  380. closeFilter();
  381. if (currentTab.value === 0) {
  382. fetchAssessments();
  383. } else {
  384. fetchTrainings();
  385. }
  386. };
  387. const getTypeLabel = (type) => {
  388. const map = { "full-time": "全职", "part-time": "兼职", "intern": "实习" };
  389. return map[type] || type;
  390. };
  391. const getCategoryLabel = (cat) => {
  392. const map = { "audit": "审计", "consult": "咨询", "tax": "税务" };
  393. return map[cat] || cat;
  394. };
  395. const filteredAssessments = common_vendor.computed(() => assessments.value);
  396. const filteredTrainings = common_vendor.computed(() => trainings.value);
  397. const goToTrainingDetail = (item) => {
  398. common_vendor.index.navigateTo({
  399. url: `/pages/assessment/training-detail?type=${item.trainingType}&title=${item.title}&status=${item.status || ""}&views=${item.views || ""}&duration=${item.duration || ""}&spectators=${item.spectators || ""}`
  400. });
  401. };
  402. const scrollTop = common_vendor.computed(() => {
  403. const gradientHeight = statusBarHeight.value + titleBarMargin.value + menuButtonHeight.value + common_vendor.index.upx2px(20);
  404. const whiteAreaHeight = common_vendor.index.upx2px(158);
  405. return gradientHeight + whiteAreaHeight;
  406. });
  407. common_vendor.onMounted(() => {
  408. try {
  409. const sysInfo = common_vendor.index.getSystemInfoSync();
  410. const menuInfo = common_vendor.index.getMenuButtonBoundingClientRect();
  411. if (sysInfo && menuInfo) {
  412. statusBarHeight.value = sysInfo.statusBarHeight || 20;
  413. titleBarMargin.value = menuInfo.top - sysInfo.statusBarHeight;
  414. menuButtonHeight.value = menuInfo.height;
  415. }
  416. } catch (e) {
  417. }
  418. common_vendor.index.__f__("log", "at pages/assessment/assessment.vue:720", "assessment onMounted triggered");
  419. loadDicts();
  420. });
  421. common_vendor.onLoad(() => {
  422. common_vendor.index.__f__("log", "at pages/assessment/assessment.vue:725", "assessment onLoad triggered");
  423. });
  424. common_vendor.onShow(() => {
  425. common_vendor.index.__f__("log", "at pages/assessment/assessment.vue:729", "assessment onShow triggered");
  426. fetchAssessments();
  427. fetchTrainings();
  428. });
  429. common_vendor.onPullDownRefresh(async () => {
  430. common_vendor.index.stopPullDownRefresh();
  431. });
  432. return (_ctx, _cache) => {
  433. return common_vendor.e({
  434. a: common_assets._imports_0$3,
  435. b: common_vendor.o(fetchAssessments),
  436. c: searchQuery.value,
  437. d: common_vendor.o(($event) => searchQuery.value = $event.detail.value),
  438. e: menuButtonHeight.value + "px",
  439. f: statusBarHeight.value + titleBarMargin.value + "px",
  440. g: currentTab.value === 0 ? 1 : "",
  441. h: common_vendor.o(($event) => handleTabChange(0)),
  442. i: currentTab.value === 1 ? 1 : "",
  443. j: common_vendor.o(($event) => handleTabChange(1)),
  444. k: common_vendor.t(recordText.value),
  445. l: common_vendor.o(goToRecords),
  446. m: common_vendor.f(currentFilters.value, (filter, index, i0) => {
  447. return {
  448. a: common_vendor.t(filter.selectedLabel || filter.label),
  449. b: activeFilterIndex.value === index ? 1 : "",
  450. c: index,
  451. d: activeFilterIndex.value === index ? 1 : "",
  452. e: common_vendor.o(($event) => toggleFilter(index), index)
  453. };
  454. }),
  455. n: common_assets._imports_1$2,
  456. o: activeFilterIndex.value !== -1
  457. }, activeFilterIndex.value !== -1 ? {
  458. p: common_vendor.o(closeFilter),
  459. q: common_vendor.f(currentOptions.value, (opt, idx, i0) => {
  460. return common_vendor.e({
  461. a: common_vendor.t(opt.label),
  462. b: currentFilters.value[activeFilterIndex.value].selectedValue === opt.value
  463. }, currentFilters.value[activeFilterIndex.value].selectedValue === opt.value ? {
  464. c: common_assets._imports_2$4
  465. } : {}, {
  466. d: idx,
  467. e: currentFilters.value[activeFilterIndex.value].selectedValue === opt.value ? 1 : "",
  468. f: common_vendor.o(($event) => selectOption(opt), idx)
  469. });
  470. })
  471. } : {}, {
  472. r: loading.value && assessments.value.length === 0 && currentTab.value === 0
  473. }, loading.value && assessments.value.length === 0 && currentTab.value === 0 ? {} : {}, {
  474. s: currentTab.value === 0 && (!loading.value || assessments.value.length > 0)
  475. }, currentTab.value === 0 && (!loading.value || assessments.value.length > 0) ? common_vendor.e({
  476. t: common_vendor.f(filteredAssessments.value, (item, index, i0) => {
  477. return common_vendor.e({
  478. a: item.cover,
  479. b: common_vendor.t(item.title),
  480. c: common_vendor.t(item.level),
  481. d: common_vendor.t(getTypeLabel(item.type)),
  482. e: common_vendor.t(getCategoryLabel(item.category)),
  483. f: common_vendor.f(item.tags, (tag, tIdx, i1) => {
  484. return {
  485. a: common_vendor.t(tag),
  486. b: tIdx
  487. };
  488. }),
  489. g: common_vendor.t(item.desc),
  490. h: item.isPassed && !item.isApplied
  491. }, item.isPassed && !item.isApplied ? {
  492. i: common_vendor.o(($event) => handleApply(item), index)
  493. } : {}, {
  494. j: item.isPassed && item.isApplied
  495. }, item.isPassed && item.isApplied ? {} : {}, {
  496. k: item.hasRecord && !item.isPassed
  497. }, item.hasRecord && !item.isPassed ? {
  498. l: !item.isCompleted ? 1 : "",
  499. m: common_vendor.o(($event) => viewAssessmentReport(item), index)
  500. } : {}, {
  501. n: item.hasRecord && !item.isPassed
  502. }, item.hasRecord && !item.isPassed ? {
  503. o: common_vendor.o(($event) => goToDetail(item), index)
  504. } : {}, {
  505. p: !item.hasRecord
  506. }, !item.hasRecord ? {
  507. q: common_vendor.o(($event) => handleConsult(item), index)
  508. } : {}, {
  509. r: item.hasPaid && !item.hasRecord
  510. }, item.hasPaid && !item.hasRecord ? {
  511. s: common_vendor.o(($event) => goToDetail(item), index)
  512. } : {}, {
  513. t: index,
  514. v: common_vendor.o(($event) => goToDetail(item), index)
  515. });
  516. }),
  517. v: filteredAssessments.value.length === 0
  518. }, filteredAssessments.value.length === 0 ? {
  519. w: common_assets._imports_3$2
  520. } : {}, {
  521. x: scrollTop.value + "px"
  522. }) : {}, {
  523. y: trainingLoading.value && trainings.value.length === 0 && currentTab.value === 1
  524. }, trainingLoading.value && trainings.value.length === 0 && currentTab.value === 1 ? {} : {}, {
  525. z: currentTab.value === 1 && (!trainingLoading.value || trainings.value.length > 0)
  526. }, currentTab.value === 1 && (!trainingLoading.value || trainings.value.length > 0) ? common_vendor.e({
  527. A: common_vendor.f(filteredTrainings.value, (item, index, i0) => {
  528. return common_vendor.e({
  529. a: item.trainingType === "offline"
  530. }, item.trainingType === "offline" ? common_vendor.e({
  531. b: common_vendor.t(item.title),
  532. c: common_vendor.t(getTypeLabel(item.type)),
  533. d: common_vendor.t(getCategoryLabel(item.category)),
  534. e: common_vendor.f(item.tags, (tag, tIdx, i1) => {
  535. return {
  536. a: common_vendor.t(tag),
  537. b: tIdx
  538. };
  539. }),
  540. f: common_assets._imports_2$2,
  541. g: common_vendor.t(item.location),
  542. h: common_assets._imports_0$2,
  543. i: common_vendor.t(item.organizer),
  544. j: common_assets._imports_1$1,
  545. k: common_vendor.t(item.trainingTime),
  546. l: common_assets._imports_1$1,
  547. m: common_vendor.t(item.deadline),
  548. n: item.isEnding
  549. }, item.isEnding ? {} : {}, {
  550. o: common_vendor.o(($event) => goToTrainingDetail(item), index)
  551. }) : common_vendor.e({
  552. p: item.cover,
  553. q: common_assets._imports_7,
  554. r: common_vendor.t(item.views),
  555. s: common_assets._imports_8$1,
  556. t: common_vendor.t(item.duration),
  557. v: item.trainingType === "live"
  558. }, item.trainingType === "live" ? {
  559. w: common_vendor.t(item.status === "streaming" ? "直播中" : item.status === "upcoming" ? "即将开始" : item.status === "not-started" ? "未开始" : item.status === "finished" ? "已结束" : "直播"),
  560. x: common_vendor.n(item.status)
  561. } : {}, {
  562. y: common_vendor.t(item.title),
  563. z: item.trainingType === "live"
  564. }, item.trainingType === "live" ? {
  565. A: common_assets._imports_9,
  566. B: common_vendor.t(item.spectators)
  567. } : {}, {
  568. C: common_vendor.o(($event) => goToTrainingDetail(item), index)
  569. }), {
  570. D: index
  571. });
  572. }),
  573. B: filteredTrainings.value.length === 0
  574. }, filteredTrainings.value.length === 0 ? {
  575. C: common_assets._imports_3$2
  576. } : {}, {
  577. D: scrollTop.value + "px"
  578. }) : {}, {
  579. E: common_vendor.p({
  580. activeIndex: 1
  581. })
  582. });
  583. };
  584. }
  585. };
  586. const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-cc3734ea"]]);
  587. wx.createPage(MiniProgramPage);
  588. //# sourceMappingURL=../../../.sourcemap/mp-weixin/pages/assessment/assessment.js.map