(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pages/coupon-buy/coupon-buy"],{"0afc":function(e,o,n){},"16ba":function(e,o,n){"use strict";(function(e,o){var t=n("47a9");n("2acb");t(n("3240"));var a=t(n("e12b"));e.__webpack_require_UNI_MP_PLUGIN__=n,o(a.default)}).call(this,n("3223")["default"],n("df3c")["createPage"])},2130: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,"8839"))},axIosIndicator:function(){return n.e("components/ax-ios-indicator/ax-ios-indicator").then(n.bind(null,"2348"))}},a=function(){var e=this,o=e.$createElement,n=(e._self._c,1===e.order_info.maspStatus?(e.order_info.maspAmount+e.order_info.maspRealAmount).toFixed(2)||"0.00":null),t=1===e.order_info.maspStatus?(3+(e.order_info.maspAmount+e.order_info.maspRealAmount)).toFixed(2)||"0.00":null,a=1===e.order_info.maspStatus?(e.order_info.maspAmount+e.order_info.maspRealAmount).toFixed(2)||"0.00":null,r=(3+(e.order_info.maspAmount+e.order_info.maspRealAmount)).toFixed(2),i=e.coupons.index>=0?(e.order_info.maspAmount+e.order_info.maspRealAmount).toFixed(2):null,s=e.coupons.index>=0?(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,g5:s}})},r=[]},5034:function(e,o,n){"use strict";var t=n("0afc"),a=n.n(t);a.a},bae2:function(e,o,n){"use strict";n.r(o);var t=n("eefc"),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},e12b:function(e,o,n){"use strict";n.r(o);var t=n("2130"),a=n("bae2");for(var r in a)["default"].indexOf(r)<0&&function(e){n.d(o,e,(function(){return a[e]}))}(r);n("5034");var i=n("828b"),s=Object(i["a"])(a["default"],t["b"],t["c"],!1,null,"1846885f",null,!1,t["a"],void 0);o["default"]=s.exports},eefc:function(e,o,n){"use strict";(function(e){var t=n("47a9");Object.defineProperty(o,"__esModule",{value:!0}),o.default=void 0;t(n("516c"));var a={data:function(){return{userinfo:{},select_num:null,payment:null,order_info:{},order_status:[],coupons:{index:-1,data:[]}}},onShow:function(){this.getMyAccount(),this.getLevel(),this.select_orderstatus(),this.get_orderPayment()},onLoad:function(e){this.payment=e.payment},methods:{getLevel:function(){var e=this;this.$api.base("post","/orderApi/getReChargeLevel",{},{}).then((function(o){e.coupons.data=o.levels}))},choose:function(e,o){var n=(this.order_info.maspAmount+this.order_info.maspRealAmount+3).toFixed(2);n>e.levelMoney?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","/orderApi/addOrder",{levelId:this.coupons.data[this.coupons.index].id},{}).then((function(n){n.orderId&&o.$api.base("post","/orderApi/payOrder",{orderId:n.orderId},{}).then((function(n){var t=JSON.parse(n.wx.wx.pay_info);e.requestPayment({provider:"wxpay",timeStamp:t.timeStamp,nonceStr:t.nonceStr,package:t.package,signType:t.signType,paySign:t.paySign,success:function(e){console.log("success:",e),o.$app.popup.alert("支付成功","温馨提示",{showCancel:!1}).then((function(){o.$app.url.back()}))},fail:function(e){console.log("fail:",e)}})}))})):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("post","/userApi/getUserAccount",{},{}).then((function(o){e.userinfo=o.accountInfo}))}}};o.default=a}).call(this,n("df3c")["default"])}},[["16ba","common/runtime","common/vendor"]]]);