"use strict";var e=require("../common/vendor.js"),a=require("../api/userVipOrder.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.getVipOrderById()},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"})}})},getVipOrderById(){var n={orderId:this.orderId};console.log(n),a.getVipOrderById(n).then(i=>{i.code==200&&(this.order=i.data,this.payMethod!=null&&this.payMethod=="app"&&this.payOrder())},i=>{})},payOrder(){var n={orderId:this.orderId},i=this;e.index.showLoading(),a.payment(n).then(r=>{if(r.code==200)if(r.isPay==1)e.index.redirectTo({url:"/pages_order/userVipOrderOrderPaySuccess?orderId="+i.orderId});else if(r.type=="tz"&&(e.index.setStorageSync("ztPayUrl",r.data.body.url),e.index.redirectTo({url:"/pages_order/tzPay"})),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(o){console.log(i.order.orderId),e.index.hideLoading(),e.index.redirectTo({url:"./userVipOrderOrderPaySuccess?orderId="+i.orderId})},fail:function(o){e.index.showToast({icon:"none",title:"fail:"+JSON.stringify(o)}),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(i.order.orderId),e.index.hideLoading(),e.index.redirectTo({url:"./userVipOrderOrderPaySuccess?orderId="+i.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(o){console.log(i.order.orderId),e.index.hideLoading(),e.index.redirectTo({url:"./userVipOrderOrderPaySuccess?orderId="+i.orderId})},fail:function(o){e.index.showToast({icon:"none",title:"fail:"+JSON.stringify(o)}),e.index.hideLoading()}});else e.index.showToast({icon:"none",title:r.msg})},r=>{})}}};function p(n,i,r,d,o,t){return e.e({a:o.order!=null},o.order!=null?{b:e.t(o.order.payMoney.toFixed(2)),c:e.t(o.order.orderCode),d:e.o(s=>t.copyTest(o.order.orderCode)),e:e.t(o.order.createTime)}:{},{f:o.order!=null},o.order!=null?{g:e.o(s=>t.payOrder())}:{})}var l=e._export_sfc(c,[["render",p],["__file","E:/Project/2023/\u95EE\u8BCA\u5E73\u53F0/his_user_miniapp/pages_order/userVipOrderPayment.vue"]]);wx.createPage(l);
