123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138 |
- "use strict";
- var common_vendor = require("../common/vendor.js");
- var api_adv = require("../api/adv.js");
- var api_test = require("../api/test.js");
- require("../common/request.js");
- const _sfc_main = {
- data() {
- return {
- advImgs: [],
- advs: [],
- reportId: null,
- statusBarHeight: common_vendor.index.getStorageSync("menuInfo").statusBarHeight,
- report: null
- };
- },
- onLoad(option) {
- this.reportId = option.reportId;
- this.getTestReport();
- },
- onShow() {
- this.getAdvList();
- },
- methods: {
- shareImg() {
- var data = { reportId: this.reportId };
- api_test.getTestReportImg(data).then((res) => {
- if (res.code == 200) {
- console.log(res);
- wx.downloadFile({
- url: res.img,
- success: (res1) => {
- console.log(res1);
- wx.showShareImageMenu({
- path: res1.tempFilePath
- });
- },
- fail: (res2) => {
- console.log(res2);
- }
- });
- }
- }, (err) => {
- });
- },
- handleAdvClick(index) {
- var ad = this.advs[index];
- console.log(ad.advUrl);
- if (ad.showType == 1) {
- common_vendor.index.setStorageSync("url", ad.advUrl);
- common_vendor.index.navigateTo({
- url: "h5"
- });
- } else if (ad.showType == 2) {
- common_vendor.index.navigateTo({
- url: ad.advUrl
- });
- } else if (ad.showType == 3) {
- common_vendor.index.setStorageSync("content", ad.content);
- common_vendor.index.navigateTo({
- url: "content"
- });
- }
- },
- getAdvList() {
- var that = this;
- var data = {
- advType: 3
- };
- api_adv.getAdvList(data).then((res) => {
- if (res.code == 200) {
- that.advImgs = [];
- that.advs = res.data;
- that.advs.forEach(function(element) {
- if (element.imageUrl != null && element.imageUrl != "") {
- that.advImgs.push(element.imageUrl);
- }
- });
- console.log(that.advImgs);
- } else {
- common_vendor.index.showToast({
- icon: "none",
- title: "\u8BF7\u6C42\u5931\u8D25"
- });
- }
- });
- },
- getTestReport() {
- var data = { reportId: this.reportId };
- api_test.getTestReport(data).then((res) => {
- if (res.code == 200) {
- this.report = res.report;
- }
- }, (err) => {
- });
- },
- goBack() {
- common_vendor.index.navigateBack();
- }
- }
- };
- if (!Array) {
- const _easycom_u_swiper2 = common_vendor.resolveComponent("u-swiper");
- _easycom_u_swiper2();
- }
- const _easycom_u_swiper = () => "../uni_modules/uview-plus/components/u-swiper/u-swiper.js";
- if (!Math) {
- _easycom_u_swiper();
- }
- function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
- return common_vendor.e({
- a: $data.report != null
- }, $data.report != null ? common_vendor.e({
- b: JSON.parse($data.report.patientJson).avatar == null ? "https://fs-1319721001.cos.ap-chongqing.myqcloud.com/fs/20240229/22cb9518a55040dea74d8f730551a7a2.jpg" : JSON.parse($data.report.patientJson).avatar,
- c: common_vendor.t(JSON.parse($data.report.patientJson).sex == 1 ? "\u7537" : "\u5973"),
- d: common_vendor.t(JSON.parse($data.report.patientJson).age),
- e: common_vendor.t($data.report.createTime),
- f: common_vendor.t($data.report.testResult),
- g: common_vendor.t($data.report.testResult),
- h: common_vendor.f(JSON.parse($data.report.conditioningPlanJson), (item, index, i0) => {
- return common_vendor.e({
- a: common_vendor.t(item.name),
- b: common_vendor.t(item.value.replace(/\\n/g, "<br>")),
- c: index < JSON.parse($data.report.conditioningPlanJson).length - 2
- }, index < JSON.parse($data.report.conditioningPlanJson).length - 2 ? {} : {});
- }),
- i: $data.advImgs.length > 0
- }, $data.advImgs.length > 0 ? {
- j: common_vendor.o($options.handleAdvClick),
- k: common_vendor.p({
- list: $data.advImgs,
- circular: true
- })
- } : {}) : {}, {
- l: common_vendor.o(($event) => $options.shareImg())
- });
- }
- var MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render], ["__file", "E:/Project/2023/\u95EE\u8BCA\u5E73\u53F0/his_user_miniapp/pages_index/testResult.vue"]]);
- wx.createPage(MiniProgramPage);
|