"use strict";var e=require("../common/vendor.js"),r=require("../api/inquiryOrder.js");require("../common/request.js");const d={data:()=>({payMethod:null,orderId:null,order:null}),onLoad(e){this.orderId=e.orderId,this.payMethod=e.payMethod},onShow(){this.getInquiryOrderById()},methods:{copyTest(r){e.index.setClipboardData({data:r,success:()=>{e.index.showToast({title:"内容已成功复制到剪切板",icon:"none"})}})},getInquiryOrderById(){var e={orderId:this.orderId};console.log(e),r.getInquiryOrderById(e).then((e=>{200==e.code&&(this.order=e.data,null!=this.payMethod&&"app"==this.payMethod&&this.payOrder())}),(e=>{}))},payOrder(){var d={orderId:this.orderId},o=this;e.index.showLoading(),r.payment(d).then((r=>{if(200==r.code)if(1==r.isPay)e.index.redirectTo({url:"/pages_order/inquiryOrderPaySuccess?orderId="+o.order.orderId});else if("tz"==r.type)e.index.setStorageSync("ztPayUrl",r.data.body.url),e.index.redirectTo({url:"/pages_order/tzPay"});else if("yb"==r.type){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(r){console.log(o.order.orderId),e.index.hideLoading(),e.index.redirectTo({url:"/pages_order/inquiryOrderPaySuccess?orderId="+o.order.orderId})},fail:function(r){e.index.showToast({icon:"none",title:"fail:"+JSON.stringify(r)}),e.index.hideLoading()}})}else if("hf"==r.type){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(r){console.log(o.order.orderId),e.index.hideLoading(),e.index.redirectTo({url:"/pages_order/inquiryOrderPaySuccess?orderId="+o.order.orderId})},fail:function(r){e.index.showToast({icon:"none",title:"fail:"+JSON.stringify(r)}),e.index.hideLoading()}})}else"wx"==r.type&&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(r){console.log(o.order.orderId),e.index.hideLoading(),e.index.redirectTo({url:"/pages_order/inquiryOrderPaySuccess?orderId="+o.order.orderId})},fail:function(r){e.index.showToast({icon:"none",title:"fail:"+JSON.stringify(r)}),e.index.hideLoading()}});else e.index.showToast({icon:"none",title:r.msg})}),(e=>{}))}}};var o=e._export_sfc(d,[["render",function(r,d,o,i,n,a){return e.e({a:null!=n.order},null!=n.order?{b:e.t(n.order.payMoney.toFixed(2)),c:e.t(n.order.orderSn),d:e.o((e=>a.copyTest(n.order.orderSn))),e:e.t(n.order.createTime)}:{},{f:null!=n.order},null!=n.order?{g:e.o((e=>a.payOrder()))}:{})}]]);wx.createPage(o);
