分佣: 提现

pull/1/head
owen 2023-09-22 18:06:11 +08:00
parent 787d115e5a
commit d07f823326
2 changed files with 48 additions and 31 deletions

View File

@ -2,14 +2,15 @@
<view> <view>
<view class='cash-withdrawal'> <view class='cash-withdrawal'>
<view class='nav acea-row'> <view class='nav acea-row'>
<view v-for="(item,index) in navList" :key="index" class='item font-color' @click="swichNav(index)"> <view v-for="(item, index) in WithdrawTypeEnum" :key="index" v-if="withdrawTypes.includes(item.type)"
<view class='line bg-color' :class='currentTab==index ? "on":""'></view> class='item font-color' @click="switchWithdrawType(item.type)">
<view class='iconfont' :class='item.icon+" "+(currentTab==index ? "on":"")'></view> <view class='line bg-color' :class='withdrawType === item.type ? "on":""'></view>
<view class='iconfont' :class='item.icon+" "+(withdrawType === item.type ? "on":"")'></view>
<view>{{item.name}}</view> <view>{{item.name}}</view>
</view> </view>
</view> </view>
<view class='wrapper'> <view class='wrapper'>
<view :hidden='currentTab != 0' class='list'> <view :hidden='withdrawType !== WithdrawTypeEnum.BANK.type' class='list'>
<form @submit="subCash" report-submit='true'> <form @submit="subCash" report-submit='true'>
<view class='item acea-row row-between-wrapper'> <view class='item acea-row row-between-wrapper'>
<view class='name'>持卡人</view> <view class='name'>持卡人</view>
@ -41,7 +42,7 @@
<button formType="submit" class='bnt bg-color'>提现</button> <button formType="submit" class='bnt bg-color'>提现</button>
</form> </form>
</view> </view>
<view :hidden='currentTab != 1' class='list'> <view :hidden='withdrawType !== WithdrawTypeEnum.WECHAT.type' class='list'>
<form @submit="subCash" report-submit='true'> <form @submit="subCash" report-submit='true'>
<view class='item acea-row row-between-wrapper'> <view class='item acea-row row-between-wrapper'>
<view class='name'>账号</view> <view class='name'>账号</view>
@ -73,7 +74,7 @@
<button formType="submit" class='bnt bg-color'>提现</button> <button formType="submit" class='bnt bg-color'>提现</button>
</form> </form>
</view> </view>
<view :hidden='currentTab != 2' class='list'> <view :hidden='withdrawType !== WithdrawTypeEnum.ALIPAY.type' class='list'>
<form @submit="subCash" report-submit='true'> <form @submit="subCash" report-submit='true'>
<view class='item acea-row row-between-wrapper'> <view class='item acea-row row-between-wrapper'>
<view class='name'>账号</view> <view class='name'>账号</view>
@ -116,28 +117,17 @@
import * as BrokerageAPI from '@/api/trade/brokerage.js' import * as BrokerageAPI from '@/api/trade/brokerage.js'
import * as Util from '@/utils/util.js'; import * as Util from '@/utils/util.js';
import { getDicts } from "@/api/system/dict"; import { getDicts } from "@/api/system/dict";
import { DICT_TYPE } from "@/utils/dict"; import { DICT_TYPE, BrokerageWithdrawTypeEnum } from "@/utils/dict";
export default { export default {
data() { data() {
return { return {
navList: [{ WithdrawTypeEnum: BrokerageWithdrawTypeEnum,
'name': '银行卡', withdrawType: 0,
'icon': 'icon-yinhangqia'
},
{
'name': '微信',
'icon': 'icon-weixin2'
},
{
'name': '支付宝',
'icon': 'icon-icon34'
}
],
currentTab: 0,
bankIndex: 0, bankIndex: 0,
bankList: [], // bankList: [], //
minPrice: 0.00, // minPrice: 0.00, //
frozenDays: 0, // frozenDays: 0, //
withdrawTypes: [], //
isClone: false, isClone: false,
commission: {}, // commission: {}, //
qrcodeUrlW:"", qrcodeUrlW:"",
@ -190,8 +180,10 @@
this.commission = res.data; this.commission = res.data;
}) })
TradeConfigApi.getTradeConfig().then(res => { 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.frozenDays = res.data.brokerageFrozenDays || 0;
this.withdrawTypes = res.data.brokerageWithdrawType || [];
this.withdrawType = this.withdrawTypes[0]; //
}); });
}, },
getUserExtractBank: function() { getUserExtractBank: function() {
@ -202,8 +194,8 @@
that.$set(that, 'bankList', bankList); that.$set(that, 'bankList', bankList);
}); });
}, },
swichNav: function(current) { switchWithdrawType: function(current) {
this.currentTab = current; this.withdrawType = current;
}, },
bindPickerChange: function(e) { bindPickerChange: function(e) {
this.bankIndex = e.detail.value; this.bankIndex = e.detail.value;
@ -219,9 +211,8 @@
subCash: function(e) { subCash: function(e) {
let that = this, let that = this,
value = e.detail.value; value = e.detail.value;
const form = {}; const form = { type: this.withdrawType };
if (this.currentTab === 0) { // if (this.withdrawType === this.WithdrawTypeEnum.BANK.type) { //
form.type = 2;
if (value.name.length === 0) { if (value.name.length === 0) {
return this.$util.Tips({ return this.$util.Tips({
title: '请填写持卡人姓名' title: '请填写持卡人姓名'
@ -238,9 +229,9 @@
}); });
} }
form.name = value.name; form.name = value.name;
form.accountNo = value.cardum;
form.bankName = that.bankList[that.bankIndex].value; form.bankName = that.bankList[that.bankIndex].value;
} else if (that.currentTab === 1) { // } else if (that.withdrawType === this.WithdrawTypeEnum.WECHAT.type) { //
form.type = 3;
if (value.name.length === 0) { if (value.name.length === 0) {
return this.$util.Tips({ return this.$util.Tips({
title: '请填写微信号' title: '请填写微信号'
@ -248,8 +239,7 @@
} }
form.accountNo = value.name; form.accountNo = value.name;
form.accountQrCodeUrl = this.qrcodeUrlW; form.accountQrCodeUrl = this.qrcodeUrlW;
} else if (that.currentTab === 2) { // } else if (that.withdrawType === this.WithdrawTypeEnum.ALIPAY.type) { //
form.type = 4;
if (value.name.length === 0) { if (value.name.length === 0) {
return this.$util.Tips({ return this.$util.Tips({
title: '请填写账号' title: '请填写账号'

View File

@ -8,5 +8,32 @@ export const DICT_TYPE = {
// ========== MALL - 交易模块 ========== // ========== MALL - 交易模块 ==========
BROKERAGE_BANK_NAME: 'brokerage_bank_name', // 佣金提现银行 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'
}
}