(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pages/coupon-buy/coupon-buy"],{"16ba":function(n,e,t){"use strict";(function(n,e){var o=t("47a9");t("2acb");o(t("3240"));var i=o(t("e12b"));n.__webpack_require_UNI_MP_PLUGIN__=t,e(i.default)}).call(this,t("3223")["default"],t("df3c")["createPage"])},"40a4":function(n,e,t){},"87ec":function(n,e,t){"use strict";t.d(e,"b",(function(){return i})),t.d(e,"c",(function(){return a})),t.d(e,"a",(function(){return o}));var o={axBody:function(){return t.e("components/ax-body/ax-body").then(t.bind(null,"8839"))},axIosIndicator:function(){return t.e("components/ax-ios-indicator/ax-ios-indicator").then(t.bind(null,"2348"))}},i=function(){var n=this.$createElement;this._self._c},a=[]},b77b:function(n,e,t){"use strict";var o=t("40a4"),i=t.n(o);i.a},bae2:function(n,e,t){"use strict";t.r(e);var o=t("eefc"),i=t.n(o);for(var a in o)["default"].indexOf(a)<0&&function(n){t.d(e,n,(function(){return o[n]}))}(a);e["default"]=i.a},e12b:function(n,e,t){"use strict";t.r(e);var o=t("87ec"),i=t("bae2");for(var a in i)["default"].indexOf(a)<0&&function(n){t.d(e,n,(function(){return i[n]}))}(a);t("b77b");var c=t("828b"),u=Object(c["a"])(i["default"],o["b"],o["c"],!1,null,"68d9c906",null,!1,o["a"],void 0);e["default"]=u.exports},eefc:function(n,e,t){"use strict";(function(n){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t={data:function(){return{userinfo:{},coupons:{index:-1,data:[]}}},onShow:function(){this.getMyAccount(),this.getLevel()},methods:{getLevel:function(){var n=this;this.$api.base("post","/orderApi/getReChargeLevel",{},{}).then((function(e){n.coupons.data=e.levels}))},choose:function(n,e){this.coupons.index=this.coupons.index!=e?e:-1},pay:function(){var e=this;this.userinfo.phone?this.$api.base("post","/orderApi/addOrder",{levelId:this.coupons.data[this.coupons.index].id},{}).then((function(t){t.orderId&&e.$api.base("post","/orderApi/payOrder",{orderId:t.orderId},{}).then((function(t){var o=JSON.parse(t.wx.wx.pay_info);n.requestPayment({provider:"wxpay",timeStamp:o.timeStamp,nonceStr:o.nonceStr,package:o.package,signType:o.signType,paySign:o.paySign,success:function(n){console.log("success:",n),e.$app.popup.alert("支付成功","温馨提示",{showCancel:!1}).then((function(){e.$app.url.back()}))},fail:function(n){console.log("fail:",n)}})}))})):this.$app.url.goto("/pages/login/login")},getMyAccount:function(){var n=this;this.$api.base("post","/userApi/getUserAccount",{},{}).then((function(e){n.userinfo=e.accountInfo}))}}};e.default=t}).call(this,t("df3c")["default"])}},[["16ba","common/runtime","common/vendor"]]]);