index.js 8.0 KB

1
  1. require('../common/vendor.js');(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pages/users/user_payment/index"],{1753:function(t,e,n){"use strict";n.r(e);var i=n("8430"),a=n.n(i);for(var r in i)["default"].indexOf(r)<0&&function(t){n.d(e,t,(function(){return i[t]}))}(r);e["default"]=a.a},"3da0":function(t,e,n){"use strict";(function(t,e){var i=n("4ea4");n("4789");i(n("66fd"));var a=i(n("e3c6"));t.__webpack_require_UNI_MP_PLUGIN__=n,e(a.default)}).call(this,n("bc2e")["default"],n("543d")["createPage"])},"7e08":function(t,e,n){"use strict";var i=n("f6cd"),a=n.n(i);a.a},8430:function(t,e,n){"use strict";(function(t,i){var a=n("4ea4");Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var r=n("d1ea"),c=n("86eb"),o=n("26cb"),u=a(n("19b6")),s=n("4e39"),l={components:{payment:function(){Promise.all([n.e("common/vendor"),n.e("components/payment/index")]).then(function(){return resolve(n("470a"))}.bind(null,n)).catch(n.oe)},authorize:function(){n.e("components/Authorize").then(function(){return resolve(n("ad23"))}.bind(null,n)).catch(n.oe)},home:function(){Promise.all([n.e("common/vendor"),n.e("components/home/index")]).then(function(){return resolve(n("3b71"))}.bind(null,n)).catch(n.oe)}},mixins:[u.default],data:function(){return{now_money:0,navRecharge:[this.$t("账户充值"),this.$t("佣金转入")],active:0,number:"",formContent:"",userinfo:{},placeholder:"0.00",from:"",isAuto:!1,isShowAuth:!1,picList:[],activePic:0,money:"",numberPic:"",rechar_id:0,rechargeAttention:[],pay_close:!1,payMode:[{name:this.$t("微信支付"),icon:"icon-weixinzhifu",value:"weixin",title:this.$t("微信支付"),payStatus:!0}],totalPrice:0}},computed:(0,o.mapGetters)(["isLogin"]),watch:{isLogin:{handler:function(t,e){t&&(this.getUserInfo(),this.getRecharge())},deep:!0}},onLoad:function(t){this.isLogin?(this.getBasicConfig(),this.getUserInfo(),this.getRecharge()):(0,c.toLogin)()},methods:{replaceInput:function(t){var e=this;this.$nextTick((function(){e.money=t.target.value.match(/^\d*(\.?\d{0,2})/g)[0]}))},getBasicConfig:function(){var e=this;(0,s.basicConfig)().then((function(t){var n=t.data,i=(n.ali_pay_status,n.pay_weixin_open);e.payMode[0].payStatus=i,e.payMode[1].payStatus=!1})).catch((function(e){t.showToast({title:e,icon:"none"})}))},picCharge:function(t,e){this.activePic=t,void 0===e?(this.rechar_id=0,this.numberPic=""):(this.money="",this.rechar_id=e.id,this.numberPic=e.price)},getRecharge:function(){var t=this;(0,r.getRechargeApi)().then((function(e){t.picList=e.data.recharge_quota,t.picList[0]&&(t.rechar_id=t.picList[0].id,t.numberPic=t.picList[0].price),t.rechargeAttention=e.data.recharge_attention||[]})).catch((function(e){t.$util.Tips({title:e})}))},onLoadFun:function(){this.getUserInfo(),this.getRecharge()},authColse:function(t){this.isShowAuth=t},navRecharges:function(t){this.active=t},getUserInfo:function(){var t=this,e=this;(0,r.getUserInfo)().then((function(n){e.$set(e,"userinfo",n.data),n.data.extract_type.includes("3")||t.$set(t,"navRecharge",[t.$t("账户充值")])}))},onChangeFun:function(t){var e=t,n=e.action||null,i=void 0!=e.value?e.value:null;this.pay_close=!1,n&&this[n]&&this[n](i)},payCheck:function(e){var n=this,a=this;t.showLoading({title:a.$t("正在支付")}),(0,r.recharge)({price:0==a.rechar_id?a.money:a.numberPic,from:e,rechar_id:a.rechar_id,type:0}).then((function(e){var r=e.data.status,c=e.data.result.orderId,o=e.data.result.jsConfig;switch(r){case"ORDER_EXIST":case"EXTEND_ORDER":return t.hideLoading(),a.$util.Tips({title:e.msg});case"ALLINPAY_PAY":t.hideLoading(),n.initIn=!0,i.openEmbeddedMiniProgram({appId:"wxef277996acc166c3",extraData:{cusid:o.cusid,appid:o.appid,version:o.version,trxamt:o.trxamt,reqsn:o.reqsn,notify_url:o.notify_url,body:o.body,remark:o.remark,validtime:o.validtime,randomstr:o.randomstr,paytype:o.paytype,sign:o.sign,signtype:o.signtype}}),n.jumpData={orderId:e.data.result.orderId,msg:e.msg};break;case"PAY_ERROR":return t.hideLoading(),a.$util.Tips({title:e.msg});case"SUCCESS":return t.hideLoading(),a.$util.Tips({title:a.$t("支付成功"),icon:"success"},{tab:5,url:"/pages/users/user_money/index"});case"WECHAT_PAY":a.toPay=!0;var u="";u=t.requestOrderPayment?"requestOrderPayment":"requestPayment",t[u]({timeStamp:o.timestamp,nonceStr:o.nonceStr,package:o.package,signType:o.signType,paySign:o.paySign,success:function(e){return t.hideLoading(),a.$set(a,"userinfo.now_money",a.$util.$h.Add(this.number,a.userinfo.now_money)),a.$util.Tips({title:a.$t("支付成功"),icon:"success"},{tab:5,url:"/pages/users/user_money/index"})},fail:function(e){return t.hideLoading(),a.$util.Tips({title:a.$t("支付失败")})},complete:function(n){if(t.hideLoading(),"requestPayment:cancel"==e.errMsg||"requestOrderPayment:cancel"==n.errMsg)return a.$util.Tips({title:a.$t("取消支付")})}});break;case"PAY_DEFICIENCY":return t.hideLoading(),a.$util.Tips({title:e.msg},{tab:5,url:goPages+"&status=1"});case"WECHAT_H5_PAY":t.hideLoading(),setTimeout((function(){location.href=e.data.result.jsConfig.h5_url}),2e3);break;case"ALIPAY_PAY":t.navigateTo({url:"/pages/users/alipay_invoke/index?id=".concat(c,"&link=").concat(o.qrCode)});break}})).catch((function(e){return t.hideLoading(),a.$util.Tips({title:e})}))},formpost:function(t,e){var n=document.createElement("form");for(var i in n.action=t,n.method="post",n.target="_self",n.style.display="none",e){var a=document.createElement("input");a.name=i,a.value=e[i],n.appendChild(a)}document.body.appendChild(n),this.$nextTick((function(t){n.submit()}))},pay:function(){this.pay_close=!0},submitSub:function(){var e=this,n=this.number;if(e.active){if(parseFloat(n)<0||NaN==parseFloat(n)||void 0==n||""==n)return e.$util.Tips({title:e.$t("请输入金额")});t.showModal({title:e.$t("转入余额"),content:e.$t("转入余额后无法再次转出,确认是否转入余额"),success:function(t){if(t.confirm)(0,r.recharge)({price:parseFloat(n),type:1}).then((function(t){return e.$util.Tips({title:e.$t("转入成功"),icon:"success"},{tab:5,url:"/pages/users/user_money/index"})})).catch((function(t){return e.$util.Tips({title:t})}));else if(t.cancel)return e.$util.Tips({title:e.$t("已取消")})}})}else""==this.numberPic&&(this.numberPic=this.money),this.pay()}}};e.default=l}).call(this,n("543d")["default"],n("bc2e")["default"])},afb4:function(t,e,n){},ba64:function(t,e,n){"use strict";n.d(e,"b",(function(){return i})),n.d(e,"c",(function(){return a})),n.d(e,"a",(function(){}));var i=function(){var t=this,e=t.$createElement,n=(t._self._c,t.$t("我的余额")),i=t.$t("¥"),a=t.navRecharge.length,r=a>1?t.__map(t.navRecharge,(function(e,n){var i=t.__get_orig(e),a=t.$t(e);return{$orig:i,m2:a}})):null,c=t.active?null:t.__map(t.picList,(function(e,n){var i=t.__get_orig(e),a=e.price?t.$t("元"):null,r=e.price?t.$t("赠送"):null,c=e.price?t.$t("元"):null;return{$orig:i,m3:a,m4:r,m5:c}})),o=t.active?null:t.picList.length,u=t.active?null:t.picList.length,s=t.active?null:t.$t("其他"),l=t.active?null:t.picList.length,d=t.active?null:t.$t("注意事项"),h=t.active?null:t.__map(t.rechargeAttention,(function(e,n){var i=t.__get_orig(e),a=t.$t(e);return{$orig:i,m8:a}})),f=t.active?t.$t("¥"):null,p=t.active?t.$t("提示"):null,m=t.active?t.$t("当前可转入佣金为"):null,g=t.active?t.$t("¥"):null,v=t.active?t.$t("冻结佣金为"):null,_=t.active?t.$t("¥"):null,$=t.active?t.$t("注意事项"):null,y=t.active?t.__map(t.rechargeAttention,(function(e,n){var i=t.__get_orig(e),a=t.$t(e);return{$orig:i,m16:a}})):null,b=t.active?t.$t("立即转入"):null,P=t.active?null:t.$t("立即充值");t.$mp.data=Object.assign({},{$root:{m0:n,m1:i,g0:a,l0:r,l1:c,g1:o,g2:u,m6:s,g3:l,m7:d,l2:h,m9:f,m10:p,m11:m,m12:g,m13:v,m14:_,m15:$,l3:y,m17:b,m18:P}})},a=[]},d830:function(t,e,n){"use strict";var i=n("afb4"),a=n.n(i);a.a},e3c6:function(t,e,n){"use strict";n.r(e);var i=n("ba64"),a=n("1753");for(var r in a)["default"].indexOf(r)<0&&function(t){n.d(e,t,(function(){return a[t]}))}(r);n("7e08"),n("d830");var c=n("f0c5"),o=Object(c["a"])(a["default"],i["b"],i["c"],!1,null,"25fc02e9",null,!1,i["a"],void 0);e["default"]=o.exports},f6cd:function(t,e,n){}},[["3da0","common/runtime","common/vendor"]]]);