assessment.js 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612
  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 = async (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. try {
  230. common_vendor.index.showLoading({ title: "投递中..." });
  231. const res = await api_assessment.applyPosition({ postId: item.postId });
  232. common_vendor.index.hideLoading();
  233. if (res.code === 200) {
  234. common_vendor.index.showToast({ title: "投递成功", icon: "success" });
  235. item.isApplied = true;
  236. common_vendor.index.setStorageSync(`candidate_applied_${item.postId}`, true);
  237. } else if (res.msg && res.msg.includes("已投递")) {
  238. item.isApplied = true;
  239. common_vendor.index.setStorageSync(`candidate_applied_${item.postId}`, true);
  240. common_vendor.index.showToast({ title: "您已投递过该岗位", icon: "none" });
  241. } else {
  242. common_vendor.index.showToast({ title: res.msg || "投递失败", icon: "none" });
  243. }
  244. } catch (err) {
  245. common_vendor.index.hideLoading();
  246. common_vendor.index.__f__("error", "at pages/assessment/assessment.vue:515", "投递失败:", err);
  247. const errMsg = String((err == null ? void 0 : err.msg) || (err == null ? void 0 : err.message) || "");
  248. if (errMsg.includes("已投递")) {
  249. item.isApplied = true;
  250. common_vendor.index.setStorageSync(`candidate_applied_${item.postId}`, true);
  251. common_vendor.index.showToast({ title: "您已投递过该岗位", icon: "none" });
  252. } else {
  253. common_vendor.index.showToast({ title: "网络错误,投递失败", icon: "none" });
  254. }
  255. }
  256. };
  257. const handleConsult = async (item) => {
  258. const userInfo = common_vendor.index.getStorageSync("userInfo") || {};
  259. const userId = userInfo.studentId || null;
  260. if (!userId) {
  261. common_vendor.index.showToast({ title: "请先登录", icon: "none" });
  262. setTimeout(() => {
  263. common_vendor.index.navigateTo({ url: "/pages/login/login" });
  264. }, 1e3);
  265. return;
  266. }
  267. try {
  268. common_vendor.index.showLoading({ title: "正在连接客服..." });
  269. const userName = userInfo.name || "用户";
  270. const userAvatar = userInfo.avatarUrl || "/static/images/user_avatar.svg";
  271. const res = await api_message.createOrGetSession({
  272. sessionType: 1,
  273. fromUserId: userId,
  274. fromUserName: userName,
  275. fromUserAvatar: userAvatar,
  276. sourceId: "assessment_" + ((item == null ? void 0 : item.id) || "")
  277. });
  278. common_vendor.index.hideLoading();
  279. if (res.data) {
  280. const session = res.data;
  281. const assessmentTitle = encodeURIComponent(item ? item.title || "" : "");
  282. const assessmentCover = encodeURIComponent(item ? item.cover || "" : "");
  283. const assessmentId = item ? item.id || "" : "";
  284. const assessmentLevel = encodeURIComponent(item ? item.level || "" : "");
  285. const assessmentPrice = item ? item.price || "" : "";
  286. common_vendor.index.navigateTo({
  287. 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}`
  288. });
  289. } else {
  290. common_vendor.index.showToast({ title: "创建会话失败", icon: "none" });
  291. }
  292. } catch (err) {
  293. common_vendor.index.hideLoading();
  294. common_vendor.index.__f__("error", "at pages/assessment/assessment.vue:576", "创建会话失败:", err);
  295. common_vendor.index.showToast({ title: "连接失败,请重试", icon: "none" });
  296. }
  297. };
  298. const activeFilterIndex = common_vendor.ref(-1);
  299. const assessmentFilterList = common_vendor.ref([
  300. {
  301. label: "岗位类型",
  302. selectedLabel: "",
  303. selectedValue: "",
  304. options: [{ label: "全部", value: "" }]
  305. },
  306. {
  307. label: "岗位等级",
  308. selectedLabel: "",
  309. selectedValue: "",
  310. options: [{ label: "全部", value: "" }]
  311. },
  312. {
  313. label: "岗位名称",
  314. selectedLabel: "",
  315. selectedValue: "",
  316. options: [
  317. { label: "全部", value: "" },
  318. { label: "审计岗位", value: "audit" },
  319. { label: "咨询岗位", value: "consult" },
  320. { label: "税务岗位", value: "tax" }
  321. ]
  322. }
  323. ]);
  324. const loadDicts = async () => {
  325. try {
  326. const [typeRes, levelRes] = await Promise.all([
  327. api_dict.getDicts("main_position_type"),
  328. api_dict.getDicts("main_position_level")
  329. ]);
  330. if (typeRes.code === 200) {
  331. const options = [
  332. { label: "全部", value: "" },
  333. ...typeRes.data.map((d) => ({ label: d.dictLabel, value: d.dictValue }))
  334. ];
  335. assessmentFilterList.value[0].options = options;
  336. trainingFilterList.value[1].options = options;
  337. }
  338. if (levelRes.code === 200) {
  339. assessmentFilterList.value[1].options = [
  340. { label: "全部", value: "" },
  341. ...levelRes.data.map((d) => ({ label: d.dictLabel, value: d.dictValue }))
  342. ];
  343. }
  344. } catch (e) {
  345. common_vendor.index.__f__("error", "at pages/assessment/assessment.vue:632", "加载字典失败", e);
  346. }
  347. };
  348. const trainingFilterList = common_vendor.ref([
  349. {
  350. label: "培训类型",
  351. selectedLabel: "线下培训",
  352. selectedValue: "offline",
  353. options: [
  354. { label: "线下培训", value: "offline" },
  355. { label: "视频培训", value: "video" },
  356. { label: "直播培训", value: "live" }
  357. ]
  358. },
  359. {
  360. label: "职位类型",
  361. selectedLabel: "",
  362. selectedValue: "",
  363. options: [
  364. { label: "全部", value: "" },
  365. { label: "全职", value: "full-time" },
  366. { label: "兼职", value: "part-time" },
  367. { label: "实习", value: "intern" }
  368. ]
  369. },
  370. {
  371. label: "岗位",
  372. selectedLabel: "",
  373. selectedValue: "",
  374. options: [
  375. { label: "全部", value: "" },
  376. { label: "审计", value: "audit" },
  377. { label: "咨询", value: "consult" },
  378. { label: "税务", value: "tax" }
  379. ]
  380. }
  381. ]);
  382. const currentFilters = common_vendor.computed(() => {
  383. return currentTab.value === 0 ? assessmentFilterList.value : trainingFilterList.value;
  384. });
  385. const currentOptions = common_vendor.computed(() => {
  386. if (activeFilterIndex.value === -1)
  387. return [];
  388. return currentFilters.value[activeFilterIndex.value].options;
  389. });
  390. const toggleFilter = (index) => {
  391. if (activeFilterIndex.value === index) {
  392. activeFilterIndex.value = -1;
  393. } else {
  394. activeFilterIndex.value = index;
  395. }
  396. };
  397. const closeFilter = () => {
  398. activeFilterIndex.value = -1;
  399. };
  400. const selectOption = (opt) => {
  401. const filter = currentFilters.value[activeFilterIndex.value];
  402. filter.selectedValue = opt.value;
  403. filter.selectedLabel = opt.value === "" ? "" : opt.label;
  404. closeFilter();
  405. if (currentTab.value === 0) {
  406. fetchAssessments();
  407. } else {
  408. fetchTrainings();
  409. }
  410. };
  411. const getTypeLabel = (type) => {
  412. const map = { "full-time": "全职", "part-time": "兼职", "intern": "实习" };
  413. return map[type] || type;
  414. };
  415. const getCategoryLabel = (cat) => {
  416. const map = { "audit": "审计", "consult": "咨询", "tax": "税务" };
  417. return map[cat] || cat;
  418. };
  419. const filteredAssessments = common_vendor.computed(() => assessments.value);
  420. const filteredTrainings = common_vendor.computed(() => trainings.value);
  421. const goToTrainingDetail = (item) => {
  422. common_vendor.index.navigateTo({
  423. url: `/pages/assessment/training-detail?type=${item.trainingType}&title=${item.title}&status=${item.status || ""}&views=${item.views || ""}&duration=${item.duration || ""}&spectators=${item.spectators || ""}`
  424. });
  425. };
  426. const scrollTop = common_vendor.computed(() => {
  427. const gradientHeight = statusBarHeight.value + titleBarMargin.value + menuButtonHeight.value + common_vendor.index.upx2px(20);
  428. const whiteAreaHeight = common_vendor.index.upx2px(158);
  429. return gradientHeight + whiteAreaHeight;
  430. });
  431. common_vendor.onMounted(() => {
  432. try {
  433. const sysInfo = common_vendor.index.getSystemInfoSync();
  434. const menuInfo = common_vendor.index.getMenuButtonBoundingClientRect();
  435. if (sysInfo && menuInfo) {
  436. statusBarHeight.value = sysInfo.statusBarHeight || 20;
  437. titleBarMargin.value = menuInfo.top - sysInfo.statusBarHeight;
  438. menuButtonHeight.value = menuInfo.height;
  439. }
  440. } catch (e) {
  441. }
  442. common_vendor.index.__f__("log", "at pages/assessment/assessment.vue:746", "assessment onMounted triggered");
  443. loadDicts();
  444. fetchAssessments();
  445. fetchTrainings();
  446. });
  447. common_vendor.onLoad(() => {
  448. common_vendor.index.__f__("log", "at pages/assessment/assessment.vue:753", "assessment onLoad triggered");
  449. });
  450. common_vendor.onShow(() => {
  451. common_vendor.index.__f__("log", "at pages/assessment/assessment.vue:757", "assessment onShow triggered");
  452. });
  453. common_vendor.onPullDownRefresh(async () => {
  454. common_vendor.index.stopPullDownRefresh();
  455. });
  456. return (_ctx, _cache) => {
  457. return common_vendor.e({
  458. a: common_assets._imports_0$3,
  459. b: common_vendor.o(fetchAssessments),
  460. c: searchQuery.value,
  461. d: common_vendor.o(($event) => searchQuery.value = $event.detail.value),
  462. e: menuButtonHeight.value + "px",
  463. f: statusBarHeight.value + titleBarMargin.value + "px",
  464. g: currentTab.value === 0 ? 1 : "",
  465. h: common_vendor.o(($event) => handleTabChange(0)),
  466. i: currentTab.value === 1 ? 1 : "",
  467. j: common_vendor.o(($event) => handleTabChange(1)),
  468. k: common_vendor.t(recordText.value),
  469. l: common_vendor.o(goToRecords),
  470. m: common_vendor.f(currentFilters.value, (filter, index, i0) => {
  471. return {
  472. a: common_vendor.t(filter.selectedLabel || filter.label),
  473. b: activeFilterIndex.value === index ? 1 : "",
  474. c: index,
  475. d: activeFilterIndex.value === index ? 1 : "",
  476. e: common_vendor.o(($event) => toggleFilter(index), index)
  477. };
  478. }),
  479. n: common_assets._imports_1$2,
  480. o: activeFilterIndex.value !== -1
  481. }, activeFilterIndex.value !== -1 ? {
  482. p: common_vendor.o(closeFilter),
  483. q: common_vendor.f(currentOptions.value, (opt, idx, i0) => {
  484. return common_vendor.e({
  485. a: common_vendor.t(opt.label),
  486. b: currentFilters.value[activeFilterIndex.value].selectedValue === opt.value
  487. }, currentFilters.value[activeFilterIndex.value].selectedValue === opt.value ? {
  488. c: common_assets._imports_2$4
  489. } : {}, {
  490. d: idx,
  491. e: currentFilters.value[activeFilterIndex.value].selectedValue === opt.value ? 1 : "",
  492. f: common_vendor.o(($event) => selectOption(opt), idx)
  493. });
  494. })
  495. } : {}, {
  496. r: loading.value && assessments.value.length === 0 && currentTab.value === 0
  497. }, loading.value && assessments.value.length === 0 && currentTab.value === 0 ? {} : {}, {
  498. s: currentTab.value === 0 && (!loading.value || assessments.value.length > 0)
  499. }, currentTab.value === 0 && (!loading.value || assessments.value.length > 0) ? common_vendor.e({
  500. t: common_vendor.f(filteredAssessments.value, (item, index, i0) => {
  501. return common_vendor.e({
  502. a: item.cover,
  503. b: common_vendor.t(item.title),
  504. c: common_vendor.t(item.level),
  505. d: common_vendor.t(getTypeLabel(item.type)),
  506. e: common_vendor.t(getCategoryLabel(item.category)),
  507. f: common_vendor.f(item.tags, (tag, tIdx, i1) => {
  508. return {
  509. a: common_vendor.t(tag),
  510. b: tIdx
  511. };
  512. }),
  513. g: common_vendor.t(item.desc),
  514. h: item.isPassed && !item.isApplied
  515. }, item.isPassed && !item.isApplied ? {
  516. i: common_vendor.o(($event) => handleApply(item), index)
  517. } : {}, {
  518. j: item.isPassed && item.isApplied
  519. }, item.isPassed && item.isApplied ? {} : {}, {
  520. k: item.hasRecord && !item.isPassed
  521. }, item.hasRecord && !item.isPassed ? {
  522. l: !item.isCompleted ? 1 : "",
  523. m: common_vendor.o(($event) => viewAssessmentReport(item), index)
  524. } : {}, {
  525. n: item.hasRecord && !item.isPassed
  526. }, item.hasRecord && !item.isPassed ? {
  527. o: common_vendor.o(($event) => goToDetail(item), index)
  528. } : {}, {
  529. p: !item.hasRecord
  530. }, !item.hasRecord ? {
  531. q: common_vendor.o(($event) => handleConsult(item), index)
  532. } : {}, {
  533. r: item.hasPaid && !item.hasRecord
  534. }, item.hasPaid && !item.hasRecord ? {
  535. s: common_vendor.o(($event) => goToDetail(item), index)
  536. } : {}, {
  537. t: index,
  538. v: common_vendor.o(($event) => goToDetail(item), index)
  539. });
  540. }),
  541. v: filteredAssessments.value.length === 0
  542. }, filteredAssessments.value.length === 0 ? {
  543. w: common_assets._imports_3$2
  544. } : {}, {
  545. x: scrollTop.value + "px"
  546. }) : {}, {
  547. y: trainingLoading.value && trainings.value.length === 0 && currentTab.value === 1
  548. }, trainingLoading.value && trainings.value.length === 0 && currentTab.value === 1 ? {} : {}, {
  549. z: currentTab.value === 1 && (!trainingLoading.value || trainings.value.length > 0)
  550. }, currentTab.value === 1 && (!trainingLoading.value || trainings.value.length > 0) ? common_vendor.e({
  551. A: common_vendor.f(filteredTrainings.value, (item, index, i0) => {
  552. return common_vendor.e({
  553. a: item.trainingType === "offline"
  554. }, item.trainingType === "offline" ? common_vendor.e({
  555. b: common_vendor.t(item.title),
  556. c: common_vendor.t(getTypeLabel(item.type)),
  557. d: common_vendor.t(getCategoryLabel(item.category)),
  558. e: common_vendor.f(item.tags, (tag, tIdx, i1) => {
  559. return {
  560. a: common_vendor.t(tag),
  561. b: tIdx
  562. };
  563. }),
  564. f: common_assets._imports_2$2,
  565. g: common_vendor.t(item.location),
  566. h: common_assets._imports_0$2,
  567. i: common_vendor.t(item.organizer),
  568. j: common_assets._imports_1$1,
  569. k: common_vendor.t(item.trainingTime),
  570. l: common_assets._imports_1$1,
  571. m: common_vendor.t(item.deadline),
  572. n: item.isEnding
  573. }, item.isEnding ? {} : {}, {
  574. o: common_vendor.o(($event) => goToTrainingDetail(item), index)
  575. }) : common_vendor.e({
  576. p: item.cover,
  577. q: common_assets._imports_7,
  578. r: common_vendor.t(item.views),
  579. s: common_assets._imports_8$1,
  580. t: common_vendor.t(item.duration),
  581. v: item.trainingType === "live"
  582. }, item.trainingType === "live" ? {
  583. w: common_vendor.t(item.status === "streaming" ? "直播中" : item.status === "upcoming" ? "即将开始" : item.status === "not-started" ? "未开始" : item.status === "finished" ? "已结束" : "直播"),
  584. x: common_vendor.n(item.status)
  585. } : {}, {
  586. y: common_vendor.t(item.title),
  587. z: item.trainingType === "live"
  588. }, item.trainingType === "live" ? {
  589. A: common_assets._imports_9,
  590. B: common_vendor.t(item.spectators)
  591. } : {}, {
  592. C: common_vendor.o(($event) => goToTrainingDetail(item), index)
  593. }), {
  594. D: index
  595. });
  596. }),
  597. B: filteredTrainings.value.length === 0
  598. }, filteredTrainings.value.length === 0 ? {
  599. C: common_assets._imports_3$2
  600. } : {}, {
  601. D: scrollTop.value + "px"
  602. }) : {}, {
  603. E: common_vendor.p({
  604. activeIndex: 1
  605. })
  606. });
  607. };
  608. }
  609. };
  610. const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-cc3734ea"]]);
  611. wx.createPage(MiniProgramPage);
  612. //# sourceMappingURL=../../../.sourcemap/mp-weixin/pages/assessment/assessment.js.map