Commit e388752b authored by hewenhao's avatar hewenhao

feat: 限制单笔提现最多200

parent 8bdf869e
......@@ -20,11 +20,14 @@
type="primary"
round
color="#F1551E"
@click="withdrawAmount = withdrawableTotal"
@click="withdrawAmount = maxWithDraw"
>全部</van-button
>
</li>
<li class="input-valid">今日可提现金额¥{{ withdrawableTotal }}元</li>
<li class="input-tip">
<span>微信限制单笔提现不超过200元!</span>
</li>
<li class="input-tip">
<i class="iconfont icon-wenhao"></i>
<span>单日累计提现不超过{{ studentDailyWithdrawLimit }}元!</span>
......@@ -93,6 +96,7 @@ const Withdraw = defineComponent({
const state = reactive<State>({
withdrawAmount: 0,
withdrawableTotal: 0,
maxWithDraw: 0,
showWithdraw: false,
showWithdrawSuccess: false,
withdrawAccount: '',
......@@ -102,14 +106,15 @@ const Withdraw = defineComponent({
})
const { withdrawableTotal, withdrawAccount, withdrawAccountId } = route.query
state.withdrawableTotal = Number(withdrawableTotal)
state.maxWithDraw = Math.min(200, state.withdrawableTotal)
state.withdrawAccount = withdrawAccount as string
state.withdrawAccountId = withdrawAccountId as string
const formatter = (value: number) => {
if (value <= 0) return ''
if (value > state.withdrawableTotal) {
Toast(`今日可提现金额为:${state.withdrawableTotal}元`)
return state.withdrawableTotal.toFixed(2)
if (value > state.maxWithDraw) {
Toast(`今日可提现金额为:${state.maxWithDraw}元`)
return state.maxWithDraw.toFixed(2)
}
return value && Number(value).toFixed(2)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment