diff --git a/pages/users/user_cash/index.vue b/pages/users/user_cash/index.vue index 85216fdd..5cdfbb94 100644 --- a/pages/users/user_cash/index.vue +++ b/pages/users/user_cash/index.vue @@ -2,14 +2,15 @@ - - - + + + {{item.name}} - +
持卡人 @@ -41,7 +42,7 @@
- +
账号 @@ -73,7 +74,7 @@
- +
账号 @@ -116,28 +117,17 @@ import * as BrokerageAPI from '@/api/trade/brokerage.js' import * as Util from '@/utils/util.js'; import { getDicts } from "@/api/system/dict"; - import { DICT_TYPE } from "@/utils/dict"; + import { DICT_TYPE, BrokerageWithdrawTypeEnum } from "@/utils/dict"; export default { data() { return { - navList: [{ - 'name': '银行卡', - 'icon': 'icon-yinhangqia' - }, - { - 'name': '微信', - 'icon': 'icon-weixin2' - }, - { - 'name': '支付宝', - 'icon': 'icon-icon34' - } - ], - currentTab: 0, + WithdrawTypeEnum: BrokerageWithdrawTypeEnum, + withdrawType: 0, bankIndex: 0, bankList: [], // 提现银行 minPrice: 0.00, // 最低提现金额 frozenDays: 0, // 佣金冻结期 + withdrawTypes: [], // 提现方式 isClone: false, commission: {}, // 分销信息 qrcodeUrlW:"", @@ -190,8 +180,10 @@ this.commission = res.data; }) TradeConfigApi.getTradeConfig().then(res => { - this.minPrice = (res.data.brokerageWithdrawMinPrice || 0) / 100.0; + this.minPrice = Util.fen2yuan(res.data.brokerageWithdrawMinPrice || 0); this.frozenDays = res.data.brokerageFrozenDays || 0; + this.withdrawTypes = res.data.brokerageWithdrawType || []; + this.withdrawType = this.withdrawTypes[0]; // 默认选中第一个提现方式 }); }, getUserExtractBank: function() { @@ -202,8 +194,8 @@ that.$set(that, 'bankList', bankList); }); }, - swichNav: function(current) { - this.currentTab = current; + switchWithdrawType: function(current) { + this.withdrawType = current; }, bindPickerChange: function(e) { this.bankIndex = e.detail.value; @@ -219,9 +211,8 @@ subCash: function(e) { let that = this, value = e.detail.value; - const form = {}; - if (this.currentTab === 0) { // 银行卡 - form.type = 2; + const form = { type: this.withdrawType }; + if (this.withdrawType === this.WithdrawTypeEnum.BANK.type) { // 银行卡 if (value.name.length === 0) { return this.$util.Tips({ title: '请填写持卡人姓名' @@ -238,9 +229,9 @@ }); } form.name = value.name; + form.accountNo = value.cardum; form.bankName = that.bankList[that.bankIndex].value; - } else if (that.currentTab === 1) { // 微信 - form.type = 3; + } else if (that.withdrawType === this.WithdrawTypeEnum.WECHAT.type) { // 微信 if (value.name.length === 0) { return this.$util.Tips({ title: '请填写微信号' @@ -248,8 +239,7 @@ } form.accountNo = value.name; form.accountQrCodeUrl = this.qrcodeUrlW; - } else if (that.currentTab === 2) { // 支付宝 - form.type = 4; + } else if (that.withdrawType === this.WithdrawTypeEnum.ALIPAY.type) { // 支付宝 if (value.name.length === 0) { return this.$util.Tips({ title: '请填写账号' diff --git a/utils/dict.js b/utils/dict.js index df9da16b..ff1b2696 100644 --- a/utils/dict.js +++ b/utils/dict.js @@ -8,5 +8,32 @@ export const DICT_TYPE = { // ========== MALL - 交易模块 ========== BROKERAGE_BANK_NAME: 'brokerage_bank_name', // 佣金提现银行 + BROKERAGE_WITHDRAW_TYPE: 'brokerage_withdraw_type', // 佣金提现类型 } + +/** + * 佣金提现类型枚举 + */ +export const BrokerageWithdrawTypeEnum = { + WALLET: { + type: 1, + name: '钱包', + icon: 'icon-qiandai' + }, + BANK: { + type: 2, + name: '银行卡', + icon: 'icon-yinhangqia' + }, + WECHAT: { + type: 3, + name: '微信', + icon: 'icon-weixin2' + }, + ALIPAY: { + type: 4, + name: '支付宝', + icon: 'icon-icon34' + } +} \ No newline at end of file