"use strict";var e=require("../common/vendor.js"),t=require("../api/adv.js"),r=require("../api/test.js");require("../common/request.js");const o={data:()=>({advImgs:[],advs:[],reportId:null,statusBarHeight:e.index.getStorageSync("menuInfo").statusBarHeight,report:null}),onLoad(e){this.reportId=e.reportId,this.getTestReport()},onShow(){this.getAdvList()},methods:{shareImg(){var e={reportId:this.reportId};r.getTestReportImg(e).then((e=>{200==e.code&&(console.log(e),wx.downloadFile({url:e.img,success:e=>{console.log(e),wx.showShareImageMenu({path:e.tempFilePath})},fail:e=>{console.log(e)}}))}),(e=>{}))},handleAdvClick(t){var r=this.advs[t];console.log(r.advUrl),1==r.showType?(e.index.setStorageSync("url",r.advUrl),e.index.navigateTo({url:"h5"})):2==r.showType?e.index.navigateTo({url:r.advUrl}):3==r.showType&&(e.index.setStorageSync("content",r.content),e.index.navigateTo({url:"content"}))},getAdvList(){var r=this;t.getAdvList({advType:3}).then((t=>{200==t.code?(r.advImgs=[],r.advs=t.data,r.advs.forEach((function(e){null!=e.imageUrl&&""!=e.imageUrl&&r.advImgs.push(e.imageUrl)})),console.log(r.advImgs)):e.index.showToast({icon:"none",title:"请求失败"})}))},getTestReport(){var e={reportId:this.reportId};r.getTestReport(e).then((e=>{200==e.code&&(this.report=e.report)}),(e=>{}))},goBack(){e.index.navigateBack()}}};if(!Array){e.resolveComponent("u-swiper")()}Math;var a=e._export_sfc(o,[["render",function(t,r,o,a,n,s){return e.e({a:null!=n.report},null!=n.report?e.e({b:null==JSON.parse(n.report.patientJson).avatar?"https://fs-1319721001.cos.ap-chongqing.myqcloud.com/fs/20240229/22cb9518a55040dea74d8f730551a7a2.jpg":JSON.parse(n.report.patientJson).avatar,c:e.t(1==JSON.parse(n.report.patientJson).sex?"男":"女"),d:e.t(JSON.parse(n.report.patientJson).age),e:e.t(n.report.createTime),f:e.t(n.report.testResult),g:e.t(n.report.testResult),h:e.f(JSON.parse(n.report.conditioningPlanJson),((t,r,o)=>e.e({a:e.t(t.name),b:e.t(t.value.replace(/\\n/g,"<br>")),c:r<JSON.parse(n.report.conditioningPlanJson).length-2},(JSON.parse(n.report.conditioningPlanJson).length,{})))),i:n.advImgs.length>0},n.advImgs.length>0?{j:e.o(s.handleAdvClick),k:e.p({list:n.advImgs,circular:!0})}:{}):{},{l:e.o((e=>s.shareImg()))})}]]);wx.createPage(a);
