assessment.js 25 KB

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