diff --git a/src/components/WalletDepositHistoryPanel.vue b/src/components/WalletDepositHistoryPanel.vue new file mode 100644 index 0000000..480b1f3 --- /dev/null +++ b/src/components/WalletDepositHistoryPanel.vue @@ -0,0 +1,298 @@ + + + + + {{ t('common.loading') }} + + + {{ t('common.noData') }} + + + + + + mdi-currency-usd + + + + + {{ h.timeAgo || '—' }} + + + + {{ h.profitLoss ?? h.value }} + + + + + + + + diff --git a/src/components/WalletDepositModule.vue b/src/components/WalletDepositModule.vue new file mode 100644 index 0000000..6e04830 --- /dev/null +++ b/src/components/WalletDepositModule.vue @@ -0,0 +1,49 @@ + + + {{ t('wallet.deposit') }} + + + + + + + + + diff --git a/src/utils/walletFundingHistory.ts b/src/utils/walletFundingHistory.ts new file mode 100644 index 0000000..a5af080 --- /dev/null +++ b/src/utils/walletFundingHistory.ts @@ -0,0 +1,26 @@ +import type { HistoryDisplayItem } from '@/api/historyRecord' + +export function isWithdrawalHistory(h: HistoryDisplayItem): boolean { + const text = `${h.activity} ${h.activityDetail ?? ''} ${h.market}`.toLowerCase() + return text.includes('withdraw') || text.includes('提现') +} + +export function isFundingHistory(h: HistoryDisplayItem): boolean { + const text = `${h.activity} ${h.activityDetail ?? ''} ${h.market}`.toLowerCase() + return ( + text.includes('deposit') || + text.includes('充值') || + text.includes('withdraw') || + text.includes('提现') + ) +} + +export function getFundingTitle( + h: HistoryDisplayItem, + t: (key: string) => string, +): string { + if (h.market?.trim()) return h.market + return isWithdrawalHistory(h) + ? t('wallet.btcWithdrawHistoryLabel') + : t('wallet.usdtDepositHistoryLabel') +} diff --git a/src/views/Wallet.vue b/src/views/Wallet.vue index e29b7ee..f7e7858 100644 --- a/src/views/Wallet.vue +++ b/src/views/Wallet.vue @@ -12,14 +12,7 @@