feat(withdraw): DMEPA提现手续费与最小提现额度配置收敛至商城配置页面并实现内扣闭环
1. 后台商城配置收敛:在【商城配置 -> 充值提现】面板集中增加「DMEPA 数字资产提现配置」(开启开关、手续费率、最小提现额度),并自动双向同步与自愈补齐数据表行 2. 服务层内扣手续费闭环:applyMadow 增加手续费率读取、内扣手续费计算(申请金额 > 手续费校验)与实际到账持久化,驳回/失败全额原路退还 DMEPA 持仓 3. API 与前台联动:rules() 与 madow() 接口返回手续费率,withdraw.vue 实时动态计算扣除 DMEPA 枚数、手续费内扣金额与预计到账金额 4. 后台列表与导出优化:提现管理列表与导出功能支持展示换算市值、手续费与到账金额 5. 新增及更新 3 套自动化规格测试(累计 130 项断言全部通过)
这个提交包含在:
@@ -73,9 +73,14 @@
|
||||
</view>
|
||||
<view
|
||||
v-if="state.walletType === 'madow' && Number(state.amount) > 0"
|
||||
style="padding: 12rpx 0 16rpx; font-size: 22rpx; color: #999;"
|
||||
style="padding: 12rpx 0 16rpx; font-size: 22rpx;"
|
||||
>
|
||||
预计扣除约 {{ estimatedDeductMadow }} 枚(实时汇率 1 dmepa ≈ ¥{{ state.madowInfo.madow_rate || '0' }})
|
||||
<view style="color: #999;">
|
||||
预计扣除约 {{ estimatedDeductMadow }} 枚 DMEPA(实时汇率 1 DMEPA ≈ ¥{{ state.madowInfo.madow_rate || '0' }})
|
||||
</view>
|
||||
<view style="color: #ff6000; margin-top: 6rpx;">
|
||||
预计到账:¥{{ estimatedMadowArrivalMoney }}(手续费内扣 ¥{{ estimatedMadowChargeFee }})
|
||||
</view>
|
||||
</view>
|
||||
<view
|
||||
v-else-if="state.walletType !== 'madow' && Number(state.amount) > 0"
|
||||
@@ -118,7 +123,7 @@
|
||||
💡 提示:提现金额须为100的整数倍(如100、200、1200等)。商城收益分成已全额直接入账商城余额,支持随时申请提现至银行卡/微信/支付宝,也可用于下单直接抵扣。历史存量佣金可转入商城余额消费。
|
||||
</view>
|
||||
<view class="tip-banner ss-m-b-20" v-else style="background: #fdfbf7; color: #b78328; font-size: 22rpx; padding: 16rpx 20rpx; border-radius: 12rpx; line-height: 1.5;">
|
||||
💡 提示:dmepa 按大盘实时汇率折算为现金扣除持仓,提现渠道限定为银行卡转账。审核驳回后对应 dmepa 将全额原路退回。
|
||||
💡 提示:DMEPA 按大盘实时汇率折算为现金并内扣手续费打款,提现渠道限定为银行卡转账。审核驳回后对应 DMEPA 将全额原路退回。
|
||||
</view>
|
||||
<view class="draw-list" v-for="(rule, index) in state.rulesList" :key="index">
|
||||
{{ index + 1 }}.{{ rule }}
|
||||
@@ -199,6 +204,7 @@
|
||||
madow_value: '0.00',
|
||||
can_withdraw_madow: 1,
|
||||
madow_withdraw_min: 1,
|
||||
madow_withdraw_charge_rate: 0,
|
||||
},
|
||||
rules: {
|
||||
min_amount: 0,
|
||||
@@ -219,6 +225,19 @@
|
||||
return deduct.toFixed(4);
|
||||
});
|
||||
|
||||
const estimatedMadowChargeFee = computed(() => {
|
||||
if (!state.amount || Number(state.amount) <= 0 || !state.madowInfo.madow_withdraw_charge_rate) return '0.00';
|
||||
const charge = Number(state.amount) * (Number(state.madowInfo.madow_withdraw_charge_rate) * 0.01);
|
||||
return charge.toFixed(2);
|
||||
});
|
||||
|
||||
const estimatedMadowArrivalMoney = computed(() => {
|
||||
if (!state.amount || Number(state.amount) <= 0) return '0.00';
|
||||
const charge = Number(state.amount) * (Number(state.madowInfo.madow_withdraw_charge_rate || 0) * 0.01);
|
||||
const arrival = Math.max(0, Number(state.amount) - charge);
|
||||
return arrival.toFixed(2);
|
||||
});
|
||||
|
||||
const estimatedChargeFee = computed(() => {
|
||||
if (!state.amount || Number(state.amount) <= 0 || !state.rules.charge_rate) return '0.00';
|
||||
const charge = Number(state.amount) * Number(state.rules.charge_rate);
|
||||
@@ -286,18 +305,23 @@
|
||||
madow_value: res.data.madow_value || '0.00',
|
||||
can_withdraw_madow: res.data.can_withdraw_madow ?? 1,
|
||||
madow_withdraw_min: res.data.madow_withdraw_min ?? 1,
|
||||
madow_withdraw_charge_rate: res.data.madow_withdraw_charge_rate ?? 0,
|
||||
};
|
||||
const isOpen = state.madowInfo.can_withdraw_madow !== 0 && state.madowInfo.can_withdraw_madow !== false;
|
||||
state.isWithdrawOpen = Boolean(isOpen);
|
||||
if (!state.isWithdrawOpen) {
|
||||
sheep.$helper.toast('dmepa提现暂未开启');
|
||||
sheep.$helper.toast('DMEPA提现暂未开启');
|
||||
}
|
||||
state.rulesList = [
|
||||
`dmepa按大盘实时市值换算扣除(当前 1 dmepa ≈ ¥${state.madowInfo.madow_rate});`,
|
||||
let rulesArr = [
|
||||
`DMEPA按大盘实时市值换算扣除持仓(当前 1 DMEPA ≈ ¥${state.madowInfo.madow_rate});`,
|
||||
`单次提现金额最低 ${state.madowInfo.madow_withdraw_min || 1} 元;`,
|
||||
'提现仅支持打款至银行卡,申请提交后由财务人工审核;',
|
||||
'审核驳回或打款失败后,对应dmepa将全额原路退还至账户持仓。',
|
||||
];
|
||||
if (Number(state.madowInfo.madow_withdraw_charge_rate) > 0) {
|
||||
rulesArr.push(`提现手续费率 ${state.madowInfo.madow_withdraw_charge_rate}%(从到账金额中内扣);`);
|
||||
}
|
||||
rulesArr.push('提现仅支持打款至银行卡,申请提交后由财务人工审核;');
|
||||
rulesArr.push('审核驳回或打款失败后,对应DMEPA将全额原路退还至账户持仓。');
|
||||
state.rulesList = rulesArr;
|
||||
}
|
||||
} catch (e) {}
|
||||
}
|
||||
@@ -312,7 +336,7 @@
|
||||
|
||||
const onConfirm = async () => {
|
||||
if (!state.isWithdrawOpen) {
|
||||
sheep.$helper.toast(state.walletType === 'madow' ? 'dmepa提现暂未开启' : '系统提现功能暂未开启');
|
||||
sheep.$helper.toast(state.walletType === 'madow' ? 'DMEPA提现暂未开启' : '系统提现功能暂未开启');
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -336,9 +360,16 @@
|
||||
return;
|
||||
}
|
||||
if (Number(payload.money) > Number(state.madowInfo.madow_value || 0)) {
|
||||
sheep.$helper.toast('提现金额超出持有dmepa可用市值');
|
||||
sheep.$helper.toast('提现金额超出持有DMEPA可用市值');
|
||||
return;
|
||||
}
|
||||
if (Number(state.madowInfo.madow_withdraw_charge_rate) > 0) {
|
||||
const fee = Number(payload.money) * (Number(state.madowInfo.madow_withdraw_charge_rate) * 0.01);
|
||||
if (Number(payload.money) <= fee) {
|
||||
sheep.$helper.toast('提现金额须大于手续费');
|
||||
return;
|
||||
}
|
||||
}
|
||||
} else if (state.walletType === 'commission') {
|
||||
payload.wallet_type = 'commission';
|
||||
const moneyVal = Number(payload.money);
|
||||
|
||||
在新工单中引用
屏蔽一个用户