"use strict";var e=require("../common/vendor.js"),o=require("../api/test.js");require("../common/request.js");const t={name:"Poster",components:{},props:{},data:function(){return{url:null}},mounted:function(){this.getTestReportImg()},methods:{shareImg:function(){wx.downloadFile({url:this.url,success:e=>{wx.showShareImageMenu({path:e.tempFilePath})}})},getTestReportImg:function(){let t=this;var n={reportId:this.reportId};o.getTestReportImg(n).then((e=>{t.url=e.url}),(o=>{e.index.showToast({title:o.msg,icon:"none",duration:2e3})}))},downloadIamge(e,o){this.isDown=!0;var t=e;this.downloadFile(t)},saveImg:function(){this.downloadIamge(this.url,"poster")},downloadFile(o){console.log(o),e.index.showLoading({title:"图片保存中..."}),e.index.downloadFile({url:o,fail:function(o){e.index.showModal({title:"提示",content:"保存失败"})},success:function(o){console.log(o);var t=o.tempFilePath;e.index.saveImageToPhotosAlbum({filePath:t,success:()=>{e.index.showToast({title:"保存成功",duration:2e3})},fail:()=>{console.log("saveImageToPhotosAlbum 失败"),e.index.hideLoading()},complete:function(){e.index.hideLoading()}})}})}}};var n=e._export_sfc(t,[["render",function(o,t,n,s,i,r){return{a:o.url,b:e.o((e=>r.shareImg()))}}]]);wx.createPage(n);
