cash.js 4.9 KB

1
  1. (global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pages/share/cash/cash"],{"076a":function(e,t,n){},"0e32":function(e,t,n){"use strict";var a;n.d(t,"b",(function(){return i})),n.d(t,"c",(function(){return o})),n.d(t,"a",(function(){return a}));var i=function(){var e=this,t=e.$createElement;e._self._c;e._isMounted||(e.e0=function(t){e.visible=!e.visible},e.e1=function(t){e.cashTypeModel=!0},e.e2=function(t){e.visible=!1})},o=[]},1454:function(e,t,n){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var a=n("2f62");function i(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function o(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?i(Object(n),!0).forEach((function(t){s(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):i(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function s(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var r=function(){n.e("components/page-component/app-cash-model/app-cash-model").then(function(){return resolve(n("77f5"))}.bind(null,n)).catch(n.oe)},c={data:function(){return{visible:!1,mark_num:-1,money:0,name:"",bank_name:"",mobile:"",moneyInput:"",pay_type:{auto:!1,alipay:!1,wechat:!1,bank:!1,balance:!1},config:[],template_message:[],cashTypeModel:!1,cashType:"",loading:!1}},components:{appCashModel:r},computed:o(o({},(0,a.mapState)({mall:function(e){return e.mallConfig.mall},custom_setting:function(e){return e.mallConfig.share_setting_custom},share_setting:function(e){return e.mallConfig.share_setting}})),{},{cashName:function(){switch(this.cashType){case"auto":return"微信零钱";case"wx":return"微信线下打款";case"alipay":return"支付宝线下打款";case"bank":return"银联线下打款";case"balance":return"商城余额";default:return}}}),methods:{getMoney:function(){var e=this.config.surplusCash?this.config.surplusCash:this.config.cash_max_day;+e<+this.money&&+e>-1?this.moneyInput=+e:this.moneyInput=+this.money},payTypeChange:function(e){switch(this.cashType=e,e){case"auto":this.mark_num=0;break;case"wx":this.mark_num=1;break;case"alipay":this.mark_num=2;break;case"bank":this.mark_num=3;break;case"balance":this.mark_num=4;break;default:this.mark_num=-1;break}},subscribe:function(){var t=this;if(-1!==this.mark_num){if(this.loading)return!1;this.loading=!0,this.$subscribe(this.template_message).then((function(e){t.submit()})).catch((function(e){t.submit()}))}else e.showToast({title:"请选择提现方式",icon:"none"})},submit:function(){var t=this,n=this,a={price:n.moneyInput,type:"auto"};if(e.showLoading({title:"申请中"}),4===n.mark_num)a.type="balance";else if(0===n.mark_num)a.type="auto";else switch(a.name=n.name,a.mobile=n.mobile,n.mark_num){case 1:a.type="wechat";break;case 2:a.type="alipay";break;case 3:a.type="bank",a.bank_name=n.bank_name;break}n.$request({url:n.$api.share.cash,data:a,method:"post"}).then((function(n){t.loading=!1,e.hideLoading(),0===n.code?(e.showToast({title:n.msg,duration:1e3}),setTimeout((function(){e.redirectTo({url:"/pages/share/cash-detail/cash-detail"})}),1e3)):e.showToast({title:n.msg,icon:"none",duration:1e3})})).catch((function(){t.loading=!1,e.hideLoading()}))},setting:function(){var t=this;t.$request({url:t.$api.share.setting}).then((function(n){if(t.$hideLoading(),0===n.code){t.config=n.msg.config,t.template_message=n.msg.template_message;for(var a=0;a<t.config.pay_type.length;a++)switch(t.config.pay_type[a]){case"auto":t.pay_type.auto=!0;break;case"alipay":t.pay_type.alipay=!0;break;case"wechat":t.pay_type.wechat=!0;break;case"balance":t.pay_type.balance=!0;break;case"bank":t.pay_type.bank=!0;break}}else e.showToast({title:n.msg,icon:"none",duration:1e3})})).catch((function(){t.$hideLoading()}))}},onLoad:function(t){this.$commonLoad.onload(t);var n=this;t.money>0&&(n.money=t.money),n.setting(),e.setNavigationBarTitle({title:n.custom_setting.menus.cash.name})}};t.default=c}).call(this,n("543d")["default"])},"4e86":function(e,t,n){"use strict";var a=n("076a"),i=n.n(a);i.a},7711:function(e,t,n){"use strict";n.r(t);var a=n("0e32"),i=n("d5a4");for(var o in i)"default"!==o&&function(e){n.d(t,e,(function(){return i[e]}))}(o);n("4e86");var s,r=n("f0c5"),c=Object(r["a"])(i["default"],a["b"],a["c"],!1,null,"18eb36d8",null,!1,a["a"],s);t["default"]=c.exports},ad1b:function(e,t,n){"use strict";(function(e){n("2d0a");a(n("66fd"));var t=a(n("7711"));function a(e){return e&&e.__esModule?e:{default:e}}e(t.default)}).call(this,n("543d")["createPage"])},d5a4:function(e,t,n){"use strict";n.r(t);var a=n("1454"),i=n.n(a);for(var o in a)"default"!==o&&function(e){n.d(t,e,(function(){return a[e]}))}(o);t["default"]=i.a}},[["ad1b","common/runtime","common/vendor"]]]);