recharge.js 3.1 KB

1
  1. (global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pages/me/recharge"],{"0970":function(e,t,a){"use strict";a.r(t);var n=a("6648"),i=a.n(n);for(var r in n)"default"!==r&&function(e){a.d(t,e,(function(){return n[e]}))}(r);t["default"]=i.a},"1d2a":function(e,t,a){"use strict";a.r(t);var n=a("5e06"),i=a("0970");for(var r in i)"default"!==r&&function(e){a.d(t,e,(function(){return i[e]}))}(r);a("271a");var c,o=a("f0c5"),s=Object(o["a"])(i["default"],n["b"],n["c"],!1,null,null,null,!1,n["a"],c);t["default"]=s.exports},"271a":function(e,t,a){"use strict";var n=a("4e4b"),i=a.n(n);i.a},"4e4b":function(e,t,a){},"5e06":function(e,t,a){"use strict";a.d(t,"b",(function(){return i})),a.d(t,"c",(function(){return r})),a.d(t,"a",(function(){return n}));var n={uParse:function(){return Promise.all([a.e("common/vendor"),a.e("components/u-parse/u-parse")]).then(a.bind(null,"0c26"))}},i=function(){var e=this,t=e.$createElement;e._self._c},r=[]},6648:function(e,t,a){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var a={data:function(){return{capital:{box:0,coin:0},i:0,message:"",tips:"",payIndex:1,rechargeList:[],bili:0,payList:[{name:"微信支付",type:"0",image:"/static/image/me/weixin@2x.png"},{name:"支付宝支付",type:"1",image:"/static/image/me/zhifubao@2x.png"}]}},computed:{realCoin:function(){if(!this.rechargeList||this.rechargeList.length<1)return 0;var e=this.rechargeList[this.i];return e.rmb*this.bili}},created:function(){var e=this;this.$api.getUserCapital().then((function(t){var a=t.code,n=t.data;1==a&&(e.capital=n)})),this.getCategoryList()},methods:{submitPay:function(){var t=this;3!=this.payIndex?4!=this.payIndex?this.$api.createRechargeOrder({amount:this.rechargeList[this.i].coin}).then((function(a){if(1===a.code)if(2==t.payIndex)t.$http.post(a.data.wechat).then((function(t){1===t.code?WeixinJSBridge.invoke("getBrandWCPayRequest",{appId:t.data.appId,timeStamp:t.data.timeStamp,nonceStr:t.data.nonceStr,package:t.data.package,signType:t.data.signType,paySign:t.data.paySign},(function(t){"get_brand_wcpay_request:ok"==t.err_msg&&(e.showToast({title:"支付成功"}),setTimeout((function(){e.redirectTo({url:"/pages/me/wallet"})}),800))})):t.code}));else{var n="wechat";n=0==t.payIndex?"wechat":1==t.payIndex?"alipay":2==t.payIndex?"eepay":"wechat",location.href=a.data[n]+"?token="+e.getStorageSync("token")}})):this.rengong():this.rechargePassword()},changeI:function(e){this.i=e},changePay:function(e){this.payIndex=e},getRechargeList:function(){var e=this;this.$api.rechargeList().then((function(t){1===t.code&&(e.tips=t.data.tips,e.message=t.data.notice,e.rechargeList=t.data.list,e.bili=t.data.bili)}))},rechargePassword:function(){e.navigateTo({url:"/pages/me/passwordRecharge/passwordRecharge"})},rengong:function(){e.navigateTo({url:"/pagesB/pages/server"})}},onLoad:function(){this.getRechargeList()}};t.default=a}).call(this,a("543d")["default"])},cf7c:function(e,t,a){"use strict";(function(e){a("a940");n(a("66fd"));var t=n(a("1d2a"));function n(e){return e&&e.__esModule?e:{default:e}}wx.__webpack_require_UNI_MP_PLUGIN__=a,e(t.default)}).call(this,a("543d")["createPage"])}},[["cf7c","common/runtime","common/vendor"]]]);