|
|
@@ -25,6 +25,12 @@ type WalletRecordRechargeData = {
|
|
|
provider?: string
|
|
|
}
|
|
|
|
|
|
+type WalletRecordWithdrawData = {
|
|
|
+ amount?: number | string
|
|
|
+ actualAmount?: number | string
|
|
|
+ currency?: string
|
|
|
+}
|
|
|
+
|
|
|
const props = defineProps<{
|
|
|
records: WalletRecordVo[]
|
|
|
walletType: WalletType
|
|
|
@@ -98,6 +104,16 @@ const isWalletRecordRechargeData = (data: WalletRecordData): data is WalletRecor
|
|
|
return typeof data.provider === 'string'
|
|
|
}
|
|
|
|
|
|
+const isWalletRecordWithdrawData = (data: WalletRecordData): data is WalletRecordWithdrawData => {
|
|
|
+ return (
|
|
|
+ typeof data.amount === 'number'
|
|
|
+ || typeof data.amount === 'string'
|
|
|
+ || typeof data.actualAmount === 'number'
|
|
|
+ || typeof data.actualAmount === 'string'
|
|
|
+ || typeof data.currency === 'string'
|
|
|
+ )
|
|
|
+}
|
|
|
+
|
|
|
// Backend walletType (int) mapping: best-effort.
|
|
|
// Common patterns: 1=goldCoin, 2=diamond, 3=bean
|
|
|
const currencyNameByBackendWalletType = (walletType: unknown) => {
|
|
|
@@ -227,6 +243,16 @@ const buildTitleAndDescription = (type: WalletType, record: WalletRecordVo) => {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ // 3.5) Bean: withdraw apply
|
|
|
+ if (type === 'bean' && bizType === 30013) {
|
|
|
+ const wd = isWalletRecordWithdrawData(data) ? data : {}
|
|
|
+ const amountText = formatPlainNumber(wd.actualAmount ?? wd.amount ?? record.amount)
|
|
|
+ return {
|
|
|
+ title: t('wallet.record.title.withdrawApply'),
|
|
|
+ description: t('wallet.record.desc.withdrawApply', { amount: amountText }),
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
// 4) Fallback (no rule matched)
|
|
|
return {
|
|
|
title: t(`wallet.record.bizTypeFallback.${bizType}`),
|