优化:VIP显示优化
This commit is contained in:
parent
7bc5831edd
commit
fc480dc4a8
@ -68,10 +68,12 @@ export function usdcToAmount(displayAmount: number): number {
|
|||||||
return Math.round(displayAmount * USDC_SCALE)
|
return Math.round(displayAmount * USDC_SCALE)
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 提现状态:审核中、提现成功、审核不通过、提现失败 */
|
/** 提现状态:审核中、提现成功(含 processed)、审核不通过、提现失败 */
|
||||||
export const WITHDRAW_STATUS = {
|
export const WITHDRAW_STATUS = {
|
||||||
PENDING: 'pending',
|
PENDING: 'pending',
|
||||||
SUCCESS: 'success',
|
SUCCESS: 'success',
|
||||||
|
/** 与 success 同义,后端已处理完成 */
|
||||||
|
PROCESSED: 'processed',
|
||||||
REJECTED: 'rejected',
|
REJECTED: 'rejected',
|
||||||
FAILED: 'failed',
|
FAILED: 'failed',
|
||||||
} as const
|
} as const
|
||||||
|
|||||||
@ -111,9 +111,8 @@ function formatTradingFee(rate: number): string {
|
|||||||
/** 与接口 needDeposit / accumulated 同一套口径:大额按 USDC 6 位小数,否则按美元数值 */
|
/** 与接口 needDeposit / accumulated 同一套口径:大额按 USDC 6 位小数,否则按美元数值 */
|
||||||
function depositRawToUsd(raw: number): number {
|
function depositRawToUsd(raw: number): number {
|
||||||
if (!Number.isFinite(raw) || raw <= 0) return 0
|
if (!Number.isFinite(raw) || raw <= 0) return 0
|
||||||
return raw >= 1_000_000_000 ? raw / 1_000_000 : raw
|
return raw / 1_000_000
|
||||||
}
|
}
|
||||||
|
|
||||||
function parseUserAccumulatedUsd(user: Record<string, unknown>): number {
|
function parseUserAccumulatedUsd(user: Record<string, unknown>): number {
|
||||||
const v = user.accumulated ?? user.Accumulated
|
const v = user.accumulated ?? user.Accumulated
|
||||||
if (typeof v === 'number' && Number.isFinite(v)) return depositRawToUsd(v)
|
if (typeof v === 'number' && Number.isFinite(v)) return depositRawToUsd(v)
|
||||||
|
|||||||
@ -1174,7 +1174,12 @@ function getWithdrawStatusLabel(status: string | undefined): string {
|
|||||||
const s = (status ?? '').toLowerCase()
|
const s = (status ?? '').toLowerCase()
|
||||||
if (s === WITHDRAW_STATUS.PENDING || s === '0' || s === 'pending')
|
if (s === WITHDRAW_STATUS.PENDING || s === '0' || s === 'pending')
|
||||||
return t('wallet.withdrawStatusPending')
|
return t('wallet.withdrawStatusPending')
|
||||||
if (s === WITHDRAW_STATUS.SUCCESS || s === '1' || s === 'success')
|
if (
|
||||||
|
s === WITHDRAW_STATUS.SUCCESS ||
|
||||||
|
s === WITHDRAW_STATUS.PROCESSED ||
|
||||||
|
s === '1' ||
|
||||||
|
s === 'success'
|
||||||
|
)
|
||||||
return t('wallet.withdrawStatusSuccess')
|
return t('wallet.withdrawStatusSuccess')
|
||||||
if (s === WITHDRAW_STATUS.REJECTED || s === '2' || s === 'rejected')
|
if (s === WITHDRAW_STATUS.REJECTED || s === '2' || s === 'rejected')
|
||||||
return t('wallet.withdrawStatusRejected')
|
return t('wallet.withdrawStatusRejected')
|
||||||
@ -1186,7 +1191,13 @@ function getWithdrawStatusLabel(status: string | undefined): string {
|
|||||||
function getWithdrawStatusClass(status: string | undefined): string {
|
function getWithdrawStatusClass(status: string | undefined): string {
|
||||||
const s = (status ?? '').toLowerCase()
|
const s = (status ?? '').toLowerCase()
|
||||||
if (s === WITHDRAW_STATUS.PENDING || s === '0' || s === 'pending') return 'status-pending'
|
if (s === WITHDRAW_STATUS.PENDING || s === '0' || s === 'pending') return 'status-pending'
|
||||||
if (s === WITHDRAW_STATUS.SUCCESS || s === '1' || s === 'success') return 'status-success'
|
if (
|
||||||
|
s === WITHDRAW_STATUS.SUCCESS ||
|
||||||
|
s === WITHDRAW_STATUS.PROCESSED ||
|
||||||
|
s === '1' ||
|
||||||
|
s === 'success'
|
||||||
|
)
|
||||||
|
return 'status-success'
|
||||||
if (s === WITHDRAW_STATUS.REJECTED || s === '2' || s === 'rejected') return 'status-rejected'
|
if (s === WITHDRAW_STATUS.REJECTED || s === '2' || s === 'rejected') return 'status-rejected'
|
||||||
if (s === WITHDRAW_STATUS.FAILED || s === '3' || s === 'failed') return 'status-failed'
|
if (s === WITHDRAW_STATUS.FAILED || s === '3' || s === 'failed') return 'status-failed'
|
||||||
return ''
|
return ''
|
||||||
@ -2731,12 +2742,17 @@ async function submitAuthorize() {
|
|||||||
flex-shrink: 0;
|
flex-shrink: 0;
|
||||||
}
|
}
|
||||||
.withdrawal-status-pill.status-pending,
|
.withdrawal-status-pill.status-pending,
|
||||||
.withdrawal-status-pill.status-success,
|
|
||||||
.withdrawal-status-pill.status-failed {
|
.withdrawal-status-pill.status-failed {
|
||||||
background: #f3f4f6;
|
background: #f3f4f6;
|
||||||
color: #374151;
|
color: #374151;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.withdrawal-status-pill.status-success {
|
||||||
|
background: #dcfce7;
|
||||||
|
color: #166534;
|
||||||
|
border: 1px solid #bbf7d0;
|
||||||
|
}
|
||||||
|
|
||||||
.withdrawal-status-pill.status-rejected {
|
.withdrawal-status-pill.status-rejected {
|
||||||
background: #fef2f2;
|
background: #fef2f2;
|
||||||
color: #b91c1c;
|
color: #b91c1c;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user