"use strict";const e=require("../../common/vendor.js"),o=require("../../common/libraries/apiLoading.js"),i=require("../../gen/Apis.js"),l=require("./model.js"),t={getHouseDetail(e){},setCanvas(l){console.log(l,"data");const t=e.index.createCanvasContext("poster_firstCanvas");((l,t)=>{o.getApiLoading(i.Apis.WorkOrder.HouseWorkOrders.GetWorkOrderPayQrCode,{id:null==l?void 0:l.id}).then(o=>{var i;const l=e.index.getFileSystemManager();let s=(new Date).getTime(),n=e.wx$1.env.USER_DATA_PATH+"/"+s+".png";console.log(n,"二维码路径"),l.writeFile({filePath:n,data:null==(i=null==o?void 0:o.data)?void 0:i.qr_code.slice(22),encoding:"base64",success:()=>null==t?void 0:t(n)})})})(l,o=>{e.index.downloadFile({url:"https://pay-prod-1369486729.cos.ap-guangzhou.myqcloud.com/uploads/cs-test/01KFYRR5Y37PR2C1EDJYZYCDJK.png",success(e){t.drawImage(e.tempFilePath,0,0,345,504),t.font="bold 18px Arial",t.fillStyle="#3D3D3D",t.setTextAlign("center"),t.fillText((null==l?void 0:l.full_name)||"-",172.5,45),t.font="bold 20px Arial",t.fillStyle="#3D3D3D",t.fillText(`¥${(null==l?void 0:l.amount)||"-"}元`,172.5,85),t.font="12px Arial",t.fillStyle="#666",t.fillText("待支付",172.5,110),t.font="14px Arial",t.fillStyle="#00C800",t.fillText("请使用微信扫码支付",172.5,450),setTimeout(()=>{t.drawImage(o,72.5,150,200,200),t.restore(),t.draw()},500)}}),console.log(o,"二维码路径")})},onDownloadPosters(){e.index.showLoading({title:"正在保存中..."}),e.index.canvasToTempFilePath({x:0,y:0,width:345,height:504,destWidth:1380,destHeight:2016,canvasId:"poster_firstCanvas",success:function(o){console.log(o,"res"),e.index.saveImageToPhotosAlbum({filePath:o.tempFilePath,success:function(){console.log("save success"),e.index.hideLoading()},fail(){e.index.hideLoading()}}),console.log(o.tempFilePath)},fail(o){console.log(o,"err"),e.index.hideLoading()}})},initActualImages:async e=>{},choiceImgPopControl(){var e;this.initActualImages(null==(e=l.useModel.houseDetail.value)?void 0:e.id)},copyLink(){}};exports.method=t;
