feat(withdraw): 落地方案B一体化商城余额提现与手续费内扣模式,完善多端打款退款与对账闭环
这个提交包含在:
@@ -17,13 +17,20 @@
|
||||
预估总市值:¥{{ state.madowInfo.madow_value || '0.00' }} (1 dmepa ≈ ¥{{ state.madowInfo.madow_rate || '0' }})
|
||||
</view>
|
||||
</view>
|
||||
<view class="" v-else>
|
||||
<view class="" v-else-if="state.walletType === 'commission'">
|
||||
<view class="num-title">可提现佣金(元)</view>
|
||||
<view class="wallet-num">{{ userInfo.commission || '0.00' }}</view>
|
||||
<view class="ss-m-t-10" style="font-size: 22rpx; color: rgba(255,255,255,0.85);">
|
||||
商城可用余额:¥{{ userInfo.money || '0.00' }}
|
||||
</view>
|
||||
</view>
|
||||
<view class="" v-else>
|
||||
<view class="num-title">可提现金额(元)</view>
|
||||
<view class="wallet-num">{{ userInfo.money || '0.00' }}</view>
|
||||
<view class="ss-m-t-10" style="font-size: 22rpx; color: rgba(255,255,255,0.85);" v-if="Number(userInfo.commission || 0) > 0">
|
||||
历史存量佣金:¥{{ userInfo.commission || '0.00' }}
|
||||
</view>
|
||||
</view>
|
||||
<button class="ss-reset-button log-btn" @tap="sheep.$router.go('/pages/pay/withdraw-log')"
|
||||
>提现记录</button
|
||||
>
|
||||
@@ -39,6 +46,20 @@
|
||||
>
|
||||
全部提现
|
||||
</text>
|
||||
<text
|
||||
v-else-if="state.walletType === 'commission' && Number(userInfo.commission || 0) > 0"
|
||||
style="font-size: 24rpx; color: #b78328; font-weight: 500;"
|
||||
@tap="onWithdrawAllCommission"
|
||||
>
|
||||
全部提现
|
||||
</text>
|
||||
<text
|
||||
v-else-if="state.walletType !== 'madow' && Number(userInfo.money || 0) > 0"
|
||||
style="font-size: 24rpx; color: #b78328; font-weight: 500;"
|
||||
@tap="onWithdrawAllMoney"
|
||||
>
|
||||
全部提现
|
||||
</text>
|
||||
</view>
|
||||
<view class="input-box ss-flex ss-col-center border-bottom">
|
||||
<view class="unit">¥</view>
|
||||
@@ -54,9 +75,15 @@
|
||||
v-if="state.walletType === 'madow' && Number(state.amount) > 0"
|
||||
style="padding: 12rpx 0 16rpx; font-size: 22rpx; color: #999;"
|
||||
>
|
||||
预计扣除约 {{ estimatedDeductMadow }} dmepa(实时汇率 1 dmepa ≈ ¥{{ state.madowInfo.madow_rate || '0' }})
|
||||
预计扣除约 {{ estimatedDeductMadow }} 枚(实时汇率 1 dmepa ≈ ¥{{ state.madowInfo.madow_rate || '0' }})
|
||||
</view>
|
||||
<view class="bank-box ss-flex ss-col-center ss-row-between ss-m-b-30" :style="state.walletType === 'madow' && Number(state.amount) > 0 ? 'margin-top: 10rpx;' : ''">
|
||||
<view
|
||||
v-else-if="state.walletType !== 'madow' && Number(state.amount) > 0"
|
||||
style="padding: 12rpx 0 16rpx; font-size: 22rpx; color: #ff6000;"
|
||||
>
|
||||
预计到账:¥{{ estimatedArrivalMoney }}(手续费内扣 ¥{{ estimatedChargeFee }})
|
||||
</view>
|
||||
<view class="bank-box ss-flex ss-col-center ss-row-between ss-m-b-30" :style="Number(state.amount) > 0 ? 'margin-top: 10rpx;' : ''">
|
||||
<view class="name">提现至</view>
|
||||
<view class="bank-list ss-flex ss-col-center" @tap="onAccountSelect(true)">
|
||||
<view v-if="!state.accountInfo.type" class="empty-text">请选择提现方式</view>
|
||||
@@ -88,7 +115,7 @@
|
||||
<view class="draw-notice">
|
||||
<view class="title ss-m-b-20">提现说明</view>
|
||||
<view class="tip-banner ss-m-b-20" v-if="state.walletType !== 'madow'" style="background: #fff8f2; color: #ff6000; font-size: 22rpx; padding: 16rpx 20rpx; border-radius: 12rpx; line-height: 1.5;">
|
||||
💡 提示:商城收益分成已全额直接入账商城余额,可用于下单直接抵扣。历史存量佣金可转入商城余额消费。
|
||||
💡 提示:商城收益分成已全额直接入账商城余额,支持随时申请提现至银行卡/微信/支付宝,也可用于下单直接抵扣。历史存量佣金可转入商城余额消费。
|
||||
</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 将全额原路退回。
|
||||
@@ -146,7 +173,7 @@
|
||||
}
|
||||
|
||||
if (rules.charge_rate_format > 0) {
|
||||
list.push(`每次收取提现手续费 ${rules.charge_rate_format}%;`);
|
||||
list.push(`每次收取提现手续费 ${rules.charge_rate_format}%(从提现金额中扣除);`);
|
||||
}
|
||||
list.push(
|
||||
`提现申请后将${rules.auto_arrival ? '自动' : '审核后'}到账, 到账结果请查收对应渠道服务通知;`,
|
||||
@@ -159,7 +186,7 @@
|
||||
const userStore = sheep.$store('user');
|
||||
const userInfo = computed(() => userStore.userInfo);
|
||||
const state = reactive({
|
||||
walletType: '',
|
||||
walletType: 'money',
|
||||
amount: '',
|
||||
type: '',
|
||||
accountInfo: {},
|
||||
@@ -191,12 +218,37 @@
|
||||
return deduct.toFixed(4);
|
||||
});
|
||||
|
||||
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);
|
||||
return charge.toFixed(2);
|
||||
});
|
||||
|
||||
const estimatedArrivalMoney = computed(() => {
|
||||
if (!state.amount || Number(state.amount) <= 0) return '0.00';
|
||||
const charge = Number(state.amount) * Number(state.rules.charge_rate || 0);
|
||||
const arrival = Math.max(0, Number(state.amount) - charge);
|
||||
return arrival.toFixed(2);
|
||||
});
|
||||
|
||||
function onWithdrawAllMadow() {
|
||||
if (state.madowInfo.madow_value) {
|
||||
state.amount = String(state.madowInfo.madow_value);
|
||||
}
|
||||
}
|
||||
|
||||
function onWithdrawAllMoney() {
|
||||
if (userInfo.value?.money) {
|
||||
state.amount = String(userInfo.value.money);
|
||||
}
|
||||
}
|
||||
|
||||
function onWithdrawAllCommission() {
|
||||
if (userInfo.value?.commission) {
|
||||
state.amount = String(userInfo.value.commission);
|
||||
}
|
||||
}
|
||||
|
||||
async function fetchUserBankAccount() {
|
||||
try {
|
||||
let res = await sheep.$api.user.account.info({
|
||||
@@ -255,6 +307,7 @@
|
||||
|
||||
let payload = {
|
||||
money: state.amount,
|
||||
wallet_type: state.walletType,
|
||||
...state.accountInfo,
|
||||
};
|
||||
|
||||
@@ -275,8 +328,20 @@
|
||||
sheep.$helper.toast('提现金额超出持有dmepa可用市值');
|
||||
return;
|
||||
}
|
||||
} else if (state.walletType === 'commission') {
|
||||
payload.wallet_type = 'commission';
|
||||
if (Number(payload.money) > Number(userInfo.value?.commission || 0) || Number(payload.money) <= 0) {
|
||||
sheep.$helper.toast('请输入正确的提现金额');
|
||||
return;
|
||||
}
|
||||
|
||||
if (!payload.type) {
|
||||
sheep.$helper.toast('请选择提现方式');
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
if (payload.money > userInfo.commission || payload.money <= 0) {
|
||||
payload.wallet_type = 'money';
|
||||
if (Number(payload.money) > Number(userInfo.value?.money || 0) || Number(payload.money) <= 0) {
|
||||
sheep.$helper.toast('请输入正确的提现金额');
|
||||
return;
|
||||
}
|
||||
@@ -302,17 +367,17 @@
|
||||
sheep.$platform.useProvider('wechat').bind();
|
||||
}
|
||||
if (code === 1) {
|
||||
// 刷新用户佣金余额
|
||||
// 刷新用户佣金与商城余额
|
||||
userStore.getInfo();
|
||||
if (state.walletType === 'madow') {
|
||||
getMadowInfo();
|
||||
sheep.$helper.toast('提现申请已提交,等待审核打款');
|
||||
setTimeout(() => {
|
||||
sheep.$router.go('/pages/pay/withdraw-log');
|
||||
}, 1500);
|
||||
}
|
||||
sheep.$helper.toast('提现申请已提交,等待审核打款');
|
||||
setTimeout(() => {
|
||||
sheep.$router.go('/pages/pay/withdraw-log');
|
||||
}, 1500);
|
||||
|
||||
if (payload.type === 'wechat') {
|
||||
if (payload.type === 'wechat' && data?.transfer_data) {
|
||||
sheep.$platform.useProvider('wechat').transfer(data.transfer_data);
|
||||
}
|
||||
}
|
||||
@@ -361,6 +426,10 @@
|
||||
state.accountInfo.type = 'bank';
|
||||
await getMadowInfo();
|
||||
fetchUserBankAccount();
|
||||
} else if (options?.type === 'commission') {
|
||||
state.walletType = 'commission';
|
||||
} else {
|
||||
state.walletType = 'money';
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
在新工单中引用
屏蔽一个用户