"use strict"; const common_vendor = require("../../common/vendor.js"); const common_config = require("../../common/config.js"); const api_index = require("../../api/index.js"); const leiDa = () => "../../components/mpvueEcharts/leiDa.js"; const unTable = () => "../components/unTable.js"; var _this; const _sfc_main = { name: "testResults", components: { leiDa, unTable }, data() { return { getBenDatas: null, avatarUrl: "", petName: "", showTestedPerson: false, baseUrl: common_config.baseUrl, name: "", time: "", totalScores: 0, symptomScore: [], symptomDescription: [], symptom: "", reference: [], scoreList: [], indicator: [], improvementSuggestions: "无", scoresList: [], resultId: "", subjectOrCognitiveId: "", testResult: 2, imgUrl: "", messageShare: 0, productList: [ { name: "谢谢您的参与,阅读本报告时,请注意以下内容:" }, { name: ". 本结果仅供参考,不可作为临床诊断的依据" }, { name: ". 如结果与你自己或他人感知的有出入,可回忆在测试" }, { name: "时是否有事情影响了你,或自己答题时是否有所顾虑" }, { name: ". 如对报告有不理解的地方,建议向专业人员进行咨询" } ], showResultText: false, relevantList: [], scaleInfo: {}, flag: "", treadStatu: false, //踩赞状态 praiseStatu: false, //点赞状态 treadId: "", praiseId: "", downloadBtn: { height: "80px !important", width: "250px !important", fontSize: "32px", color: "#FFFFFF", background: "#FF9710", border: "none" }, returnBtn: { height: "80px !important", width: "250px !important", fontSize: "32px", color: "#FF9710", background: "#FFE6C7", border: "none" }, shareBtn: { height: "80px !important", width: "80px !important", fontSize: "32px", color: "#FF9710", background: "#FFE6C7", border: "none" }, // arrow_left_bold: this.$imageUrl.urls.arrow_left_bold, //左侧箭头图标 likeNum: 0, //点赞数量 notLikeNum: 0, //不喜欢数量 commentNum: 0, //评论数量 showContent: false //等接口返回数据初始化完成再 }; }, onBackPress(event) { common_vendor.index.redirectTo({ url: "/pages/tab/scaleTest/index" }); return true; }, onLoad(options) { _this = this; let bings = common_vendor.index.getStorageSync("beginTextData"); if (bings) { let bing = JSON.parse(bings); _this.getBenDatas = bing; } if (options.resultId || options.scene) { if (options.messageShare == 1) { this.messageShare = options.messageShare; } _this.resultId = options.resultId || options.scene; _this.getScaleTestResults(_this.resultId); } }, onShow() { this.showTestedPerson = this.petName && this.avatarUrl; }, onReachBottom() { }, methods: { navBackTest() { common_vendor.index.$emit("updateData", encodeURIComponent(JSON.stringify(this.getBenDatas))); common_vendor.index.navigateBack({ delta: 2 }); }, leftClick() { console.log("-this.messageShare------>", this.messageShare); if (this.messageShare == 1) { common_vendor.index.switchTab({ url: "/pages/tab/scaleTest/index" }); } else { common_vendor.index.navigateBack(); } }, navBack() { this.leftClick(); }, getScaleTestResults(id) { console.log("111:", (/* @__PURE__ */ new Date()).getTime()); _this.$request.get({ url: `${api_index.getRecordById}?id=${id}`, loadingTip: "加载中...", data: {} }).then( (res) => { var _a, _b; console.log("222:", (/* @__PURE__ */ new Date()).getTime()); console.log("----测试结果--->", res); if (res.code == 200) { _this.testResult = parseInt(JSON.parse((_b = (_a = res.data) == null ? void 0 : _a.userRecordEntity) == null ? void 0 : _b.testResult)[0].version); _this.name = res.data.userRecordEntity.name; _this.flag = res.data.userRecordEntity.flag; _this.scaleInfo = res.data.userRecordEntity; let testDateTime = res.data.userRecordEntity.testDate; let yearMonthDay = testDateTime.replace("年", "/").replace("月", "/").replace("日", " ").replace("时", ":").replace("分", ":").replace("秒", ""); _this.time = yearMonthDay; if (_this.testResult == 2) { _this.getDataList(res.data); } else { _this.scoresList = JSON.parse(res.data.userRecordEntity.testResult); _this.init(_this.scoresList[0].tableContext[0].value[0]); } this.showContent = true; } else if (res.code == 401) ; else ; } ); }, init(v) { _this.totalScores = Number(v); }, getDataList(data) { let v = JSON.parse(data.userRecordEntity.testResult); _this.scoresList = v; console.log("-----传入的参数----->", v); v.forEach((items) => { var _a, _b, _c, _d, _e, _f; if (items.newTableContext.iconInfo != "") { let indicatorList = (_b = (_a = items == null ? void 0 : items.newTableContext) == null ? void 0 : _a.iconInfo) == null ? void 0 : _b.indicator; if (indicatorList.length > 0) { indicatorList.forEach((data2) => { _this.indicator.push({ text: data2.text, max: Number(data2.max) }); }); } let referenceList = ((_d = (_c = items == null ? void 0 : items.newTableContext) == null ? void 0 : _c.iconInfo) == null ? void 0 : _d.reference) || []; if (referenceList.length > 0) { referenceList.forEach((data2) => { _this.reference.push(Number(data2)); }); } let scoreLists = (_f = (_e = items == null ? void 0 : items.newTableContext) == null ? void 0 : _e.iconInfo) == null ? void 0 : _f.scoreList; if (scoreLists.length > 0) { scoreLists.forEach((data2) => { _this.scoreList.push(Number(data2)); }); } console.log("==1111=====>", _this.indicator); console.log("==2222=====>", _this.reference); console.log("==3333=====>", _this.scoreList); } items.newTableContext.result.forEach((item) => { if (!item) return; if (item.name === "总分" || item.name === "压力综合指数") { _this.init(item.score); _this.symptom = item.symptom; } if (item.isTotalScoreExplain === "是") { _this.improvementSuggestions = item.symptom; } _this.symptomScore.push({ name: item.name, score: item.score }); this.symptomDescription.push(item); }); if (this.symptomDescription && this.symptomDescription.length > 0) { this.showResultText = true; } console.log("0000-----000", _this.symptomDescription); }); } } }; if (!Array) { const _component_u_avatar = common_vendor.resolveComponent("u-avatar"); const _component_leiDa = common_vendor.resolveComponent("leiDa"); const _component_u_col = common_vendor.resolveComponent("u-col"); const _component_u_row = common_vendor.resolveComponent("u-row"); const _component_u_line = common_vendor.resolveComponent("u-line"); (_component_u_avatar + _component_leiDa + _component_u_col + _component_u_row + _component_u_line)(); } function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) { return common_vendor.e({ a: $data.name }, $data.name ? { b: common_vendor.t($data.name) } : {}, { c: $data.time }, $data.time ? { d: common_vendor.t($data.time) } : {}, { e: common_vendor.p({ size: "100", src: $data.avatarUrl }), f: $data.scoreList && $data.scoreList.length > 0 }, $data.scoreList && $data.scoreList.length > 0 ? {} : {}, { g: common_vendor.p({ reference: $data.reference, scoreList: $data.scoreList, indicator: $data.indicator }), h: $data.showResultText }, $data.showResultText ? {} : {}, { i: $data.showResultText }, $data.showResultText ? { j: common_vendor.f($data.symptomDescription, (list, j, i0) => { return common_vendor.e({ a: common_vendor.t(list.name), b: list.score && list.score != "无" }, list.score && list.score != "无" ? { c: common_vendor.t(list.percent) } : {}, { d: list.symptom && list.symptom != "无" }, list.symptom && list.symptom != "无" ? { e: common_vendor.t(list.symptom) } : {}, { f: list.improvementSuggestions && list.improvementSuggestions != "无" }, list.improvementSuggestions && list.improvementSuggestions != "无" ? { g: common_vendor.t(list.improvementSuggestions) } : {}, { h: list.suggestion && list.suggestion != "无" }, list.suggestion && list.suggestion != "无" ? { i: common_vendor.t(list.suggestion) } : {}, { j }); }) } : {}, { k: common_vendor.p({ span: "12" }), l: $data.showContent }); } const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-1d4e5843"], ["__file", "E:/psy_web_share/scaleTestResults/testResults/index.vue"]]); tt.createPage(MiniProgramPage);