You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1 line
3.3 KiB

(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pagesB/pages/user/Recharge/index"],{"17f1":function(e,t,i){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=i("2f62"),c=i("bcec"),a=i("aa63"),o=i("8506"),r=i("c7f0"),s={name:"Recharge",components:{},props:{},data:function(){return{active:0,from:this.$deviceType,money:"",now_money:"",picList:[],activePic:0,numberPic:"",paid_price:"",rechar_id:0}},computed:(0,n.mapGetters)(["userInfo"]),mounted:function(){this.now_money=this.userInfo.nowMoney,this.getRecharge()},methods:{getRecharge:function(){var t=this;(0,a.getRechargeApi)().then((function(e){t.picList=e.data.recharge_price_ways||[],t.picList[0]&&(t.rechar_id=t.picList[0].id,t.paid_price=t.picList[0].value.price,t.numberPic=t.picList[0].value.give_price)})).catch((function(t){e.showToast({title:err.msg||err.response.data.msg||err.response.data.message,icon:"none",duration:2e3})}))},picCharge:function(e,t){this.activePic=e,e==this.picList.length?(this.rechar_id=0,this.paid_price="",this.numberPic=""):(this.money="",this.rechar_id=t.id,this.paid_price=t.value.give_price,this.numberPic=t.value.price)},recharge:function(){var t=this,i=this,n=Number(this.money);if(this.picList.length!=this.activePic||0!==n)if(this.picList.length==this.activePic&&n<.01)e.showToast({title:"充值金额不能低于0.01",icon:"none",duration:2e3});else if(this.picList.length==this.activePic&&n>99999)e.showToast({title:"充值金额不能大于99999",icon:"none",duration:2e3});else{var s="",u="";n?(s=n,u=0):(s=i.numberPic,u=i.paid_price),(0,a.rechargeWechat)({price:s,from:"weixin"==this.$deviceType||"weixinh5"==this.$deviceType?"uniappH5":this.$deviceType,paid_price:u,rechar_id:i.rechar_id}).then((function(n){n.data.data;(0,c.weappPay)(n.data.data).then((function(){s=(0,o.add)(s,u),i.now_money=(0,o.add)(s,parseFloat(i.userInfo.nowMoney)),e.showToast({title:"支付成功",icon:"success",duration:2e3}),(0,r.subscribeMessage)(),t.$yrouter.back()})).finally((function(t){e.showToast({title:t,icon:"none",duration:2e3})})).catch((function(){e.showToast({title:"支付失败",icon:"none",duration:2e3})}))})).catch((function(t){console.log(t),e.showToast({title:t.msg||t.response.data.msg||t.response.data.message,icon:"none",duration:2e3})}))}else e.showToast({title:"请输入您要充值的金额",icon:"none",duration:2e3})}}};t.default=s}).call(this,i("543d")["default"])},"29c2":function(e,t,i){"use strict";(function(e){i("ef82");n(i("66fd"));var t=n(i("e2ce"));function n(e){return e&&e.__esModule?e:{default:e}}e(t.default)}).call(this,i("543d")["createPage"])},"66e6":function(e,t,i){},b162:function(e,t,i){"use strict";var n;i.d(t,"b",(function(){return c})),i.d(t,"c",(function(){return a})),i.d(t,"a",(function(){return n}));var c=function(){var e=this,t=e.$createElement;e._self._c},a=[]},c6c9:function(e,t,i){"use strict";var n=i("66e6"),c=i.n(n);c.a},dbe7:function(e,t,i){"use strict";i.r(t);var n=i("17f1"),c=i.n(n);for(var a in n)"default"!==a&&function(e){i.d(t,e,(function(){return n[e]}))}(a);t["default"]=c.a},e2ce:function(e,t,i){"use strict";i.r(t);var n=i("b162"),c=i("dbe7");for(var a in c)"default"!==a&&function(e){i.d(t,e,(function(){return c[e]}))}(a);i("c6c9");var o,r=i("f0c5"),s=Object(r["a"])(c["default"],n["b"],n["c"],!1,null,"3ff0e0db",null,!1,n["a"],o);t["default"]=s.exports}},[["29c2","common/runtime","common/vendor"]]]);