(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pages/coupon-buy/coupon-buy"],{5418:function(e,o,n){"use strict";n.r(o);var t=n("a667"),a=n("b305");for(var r in a)["default"].indexOf(r)<0&&function(e){n.d(o,e,(function(){return a[e]}))}(r);n("bb98");var i=n("828b"),u=Object(i["a"])(a["default"],t["b"],t["c"],!1,null,"3e66cb09",null,!1,t["a"],void 0);o["default"]=u.exports},"75f1":function(e,o,n){},a667:function(e,o,n){"use strict";n.d(o,"b",(function(){return a})),n.d(o,"c",(function(){return r})),n.d(o,"a",(function(){return t}));var t={axBody:function(){return n.e("components/ax-body/ax-body").then(n.bind(null,"e199"))},axIosIndicator:function(){return n.e("components/ax-ios-indicator/ax-ios-indicator").then(n.bind(null,"6075"))}},a=function(){var e=this,o=e.$createElement,n=(e._self._c,null!=e.order_info&&1===e.order_info.maspStatus?(e.order_info.maspAmount+e.order_info.maspRealAmount).toFixed(2)||"0.00":null),t=null!=e.order_info&&1===e.order_info.maspStatus?(3+(e.order_info.maspAmount+e.order_info.maspRealAmount)).toFixed(2)||"0.00":null,a=null!=e.order_info&&1===e.order_info.maspStatus?(e.order_info.maspAmount+e.order_info.maspRealAmount).toFixed(2)||"0.00":null,r=null!=e.order_info&&e.coupons.index>=0?(e.order_info.maspAmount+e.order_info.maspRealAmount).toFixed(2):null,i=null!=e.order_info&&e.coupons.index>=0?(e.select_num-(e.order_info.maspAmount+e.order_info.maspRealAmount)).toFixed(2):null;e.$mp.data=Object.assign({},{$root:{g0:n,g1:t,g2:a,g3:r,g4:i}})},r=[]},b305:function(e,o,n){"use strict";n.r(o);var t=n("d7ee"),a=n.n(t);for(var r in t)["default"].indexOf(r)<0&&function(e){n.d(o,e,(function(){return t[e]}))}(r);o["default"]=a.a},bb98:function(e,o,n){"use strict";var t=n("75f1"),a=n.n(t);a.a},bc24:function(e,o,n){"use strict";(function(e,o){var t=n("47a9");n("6a42");t(n("3240"));var a=t(n("5418"));e.__webpack_require_UNI_MP_PLUGIN__=n,o(a.default)}).call(this,n("3223")["default"],n("df3c")["createPage"])},d7ee:function(e,o,n){"use strict";(function(e){var t=n("47a9");Object.defineProperty(o,"__esModule",{value:!0}),o.default=void 0;t(n("feec"));var a={data:function(){return{pageBg:"https://charge.hub.zswlgz.com/apifile//2025/11/17/X8YskVhD8AvJ9ac83ff9418869e4eec3c40fe1fd9146_20251117102852A001.png",userinfo:{},select_num:null,payment:null,order_info:null,order_status:[],coupons:{index:-1,data:[]}}},onShow:function(){this.getMyAccount(),this.getLevel()},onLoad:function(e){this.payment=e.payment},methods:{getLevel:function(){var e=this;this.$api.base("get","/applet/v1/order/getReChargeLevel",{},{}).then((function(o){e.coupons.data=o.data}))},choose:function(e,o){if(null!=this.order_info){var n=(this.order_info.maspAmount+this.order_info.maspRealAmount+3).toFixed(2);if(n>e.levelMoney)return void this.$app.popup.toast("购买金额必须大于".concat(n,"元"))}this.coupons.index=this.coupons.index!=o?o:-1,this.select_num=e.levelMoney},pay:function(){var o=this;this.userinfo.phone?this.order_status.length>0?this.$app.popup.confirm("您当前有正在进行中的订单，请结束订单后再进行充值并重新发起操作","提示",{showCancel:!0,confirmText:"查看订单"}).then((function(e){e&&o.$app.url.goto("/pages/order/order?index=1")})):this.$api.base("post","/applet/v1/wft/order/createOrder",{levelId:this.coupons.data[this.coupons.index].id},{}).then((function(n){console.log(n,"创建订单返回"),n.data.orderId&&o.$api.base("put","/applet/v1/wft/order/payOrder/".concat(n.data.orderId),{},{}).then((function(t){var a=JSON.parse(t.data.params.pay_info);console.log(a,"11"),e.requestPayment({provider:"wxpay",timeStamp:a.timeStamp,nonceStr:a.nonceStr,package:a.package,signType:a.signType,paySign:a.paySign,success:function(e){console.log("success:",e),o.$api.base("get","/applet/v1/wft/order/query/".concat(n.data.orderNo),{},{}).then((function(e){console.log(e,"查询订单返回"),e.data?setTimeout((function(){o.$app.popup.alert("支付成功","温馨提示",{showCancel:!1}).then((function(){o.$app.url.back()}))}),1e3):o.$app.popup.alert("支付失败，请稍后重试","温馨提示",{showCancel:!1}).then((function(){o.$app.url.back()}))}))},fail:function(e){console.log("fail:",e),o.$api.base("put","/applet/v1/wft/order/closeOrder/".concat(n.data.orderNo),{},{}).then((function(e){console.log(e,"取消订单返回"),e.data&&o.$app.popup.alert("支付已取消","温馨提示",{showCancel:!1})}))}})}))})):this.$app.url.goto("/pages/login/login")},select_orderstatus:function(){var e=this;this.$api.base("post","/chargeApi/queryOrderList",{type:1},{}).then((function(o){e.order_status=o.table.rows}))},get_orderPayment:function(){var e=this;this.$api.base("post","/chargeApi/queryOrderList-arrearage",{},{}).then((function(o){e.order_info=o.data}))},topage_order:function(){this.$app.url.goto("/pages/order-detail/order-detail?orderId="+this.order_info.id)},getMyAccount:function(){var e=this;this.$api.base("get","/applet/v1/user/getUserInfo",{},{}).then((function(o){e.userinfo=o.data}))}}};o.default=a}).call(this,n("df3c")["default"])}},[["bc24","common/runtime","common/vendor"]]]);