"use strict";const e=require("../../common/vendor.js"),l=require("../../gen/Apis.js"),o=require("./model.js"),d=require("../../common/libraries/apiLoading.js"),a=require("../../common/libraries/pay.js"),u=d=>{var a,u,i;l.Apis.WorkOrder.HouseWorkOrders.Show({id:null==(i=null==(u=null==(a=o.useModel)?void 0:a.OrderInfo)?void 0:u.value)?void 0:i.id}).then((l=>{var a;o.useModel.loadingShowNumber.value+=1,o.useModel.orderShow.value=null==l?void 0:l.data,"Paid"===(null==(a=null==l?void 0:l.data)?void 0:a.payment_status)&&(o.useModel.payDisabled.value=!1,clearInterval(d),o.useModel.loadingLabel.value="",e.index.hideLoading(),e.index.redirectTo({url:"/INDEX/pay/success"})),console.log("orderShow",null==l?void 0:l.data)}))},i={onPay(){var e,u,i,r,n;o.useModel.loading.value=!0,d.getApiLoading(l.Apis.WorkOrder.HouseWorkOrders.WorkOrderPayment,{id:null==(i=null==(u=null==(e=o.useModel)?void 0:e.OrderInfo)?void 0:u.value)?void 0:i.id,amount:null==(n=null==(r=o.useModel)?void 0:r.orderShow.value)?void 0:n.amount}).then((e=>{console.log("onPay",null==e?void 0:e.data),o.useModel.loading.value=!1,o.useModel.payDisabled.value=!0,a.tongLianPay(null==e?void 0:e.data,(()=>{}),(()=>{o.useModel.loading.value=!1,o.useModel.payDisabled.value=!1}))}))},loadShow:()=>{o.useModel.loadingLabel.value="正在更新...",o.useModel.timer.value=setInterval((()=>{var l,d,a,i,r;if((null==(d=null==(l=o.useModel)?void 0:l.loadingShowNumber)?void 0:d.value)>5&&"Pending"===(null==(r=null==(i=null==(a=o.useModel)?void 0:a.orderShow)?void 0:i.value)?void 0:r.payment_status))return o.useModel.loading.value=!1,o.useModel.payDisabled.value=!1,o.useModel.loadingShowNumber.value=0,o.useModel.loadingLabel.value="",e.index.hideLoading(),void clearInterval(o.useModel.timer.value);o.useModel.loadingShowNumber.value<=5&&u(o.useModel.timer.value)}),1e3)},getShow:u};exports.method=i;
