"use strict";var e=require("../common/vendor.js"),a=require("../api/inquiryOrder.js");require("../common/request.js");const c={data(){return{payMethod:null,orderId:null,order:null}},onLoad(n){this.orderId=n.orderId,this.payMethod=n.payMethod},onShow(){this.getInquiryOrderById()},methods:{copyTest(n){e.index.setClipboardData({data:n,success:()=>{e.index.showToast({title:"\u5185\u5BB9\u5DF2\u6210\u529F\u590D\u5236\u5230\u526A\u5207\u677F",icon:"none"})}})},getInquiryOrderById(){var n={orderId:this.orderId};console.log(n),a.getInquiryOrderById(n).then(o=>{o.code==200&&(this.order=o.data,this.payMethod!=null&&this.payMethod=="app"&&this.payOrder())},o=>{})},payOrder(){var n={orderId:this.orderId},o=this;e.index.showLoading(),a.payment(n).then(r=>{if(r.code==200)if(r.isPay==1)e.index.redirectTo({url:"/pages_order/inquiryOrderPaySuccess?orderId="+o.order.orderId});else if(r.type=="tz")e.index.setStorageSync("ztPayUrl",r.data.body.url),e.index.redirectTo({url:"/pages_order/tzPay"});else if(r.type=="yb"){var d=JSON.parse(r.data.pay_info);console.log(d),e.index.requestPayment({provider:"wxpay",timeStamp:d.timeStamp,nonceStr:d.nonceStr,package:d.package,signType:d.signType,paySign:d.paySign,success:function(i){console.log(o.order.orderId),e.index.hideLoading(),e.index.redirectTo({url:"/pages_order/inquiryOrderPaySuccess?orderId="+o.order.orderId})},fail:function(i){e.index.showToast({icon:"none",title:"fail:"+JSON.stringify(i)}),e.index.hideLoading()}})}else if(r.type=="hf"){var d=JSON.parse(r.data.pay_info);console.log(d),e.index.requestPayment({provider:"wxpay",timeStamp:d.timeStamp,nonceStr:d.nonceStr,package:d.package,signType:d.signType,paySign:d.paySign,success:function(t){console.log(o.order.orderId),e.index.hideLoading(),e.index.redirectTo({url:"/pages_order/inquiryOrderPaySuccess?orderId="+o.order.orderId})},fail:function(t){e.index.showToast({icon:"none",title:"fail:"+JSON.stringify(t)}),e.index.hideLoading()}})}else r.type=="wx"&&e.index.requestPayment({provider:"wxpay",timeStamp:r.data.timeStamp,nonceStr:r.data.nonceStr,package:r.data.packageValue,signType:r.data.signType,paySign:r.data.paySign,success:function(i){console.log(o.order.orderId),e.index.hideLoading(),e.index.redirectTo({url:"/pages_order/inquiryOrderPaySuccess?orderId="+o.order.orderId})},fail:function(i){e.index.showToast({icon:"none",title:"fail:"+JSON.stringify(i)}),e.index.hideLoading()}});else e.index.showToast({icon:"none",title:r.msg})},r=>{})}}};function p(n,o,r,d,i,t){return e.e({a:i.order!=null},i.order!=null?{b:e.t(i.order.payMoney.toFixed(2)),c:e.t(i.order.orderSn),d:e.o(s=>t.copyTest(i.order.orderSn)),e:e.t(i.order.createTime)}:{},{f:i.order!=null},i.order!=null?{g:e.o(s=>t.payOrder())}:{})}var y=e._export_sfc(c,[["render",p],["__file","E:/Project/2023/\u95EE\u8BCA\u5E73\u53F0/his_user_miniapp/pages_order/inquiryPayment.vue"]]);wx.createPage(y);