diff --git a/src/views/usergold/gold/clientCountWallet.vue b/src/views/usergold/gold/clientCountWallet.vue index 7fb1bc1..fc49a9e 100644 --- a/src/views/usergold/gold/clientCountWallet.vue +++ b/src/views/usergold/gold/clientCountWallet.vue @@ -232,6 +232,20 @@ const walletDetailQuery = ref({ pageSize: 20 }) +const getWalletRecordTypeText = (item) => { + const type = Number(item.type) + if (type === 0) { + return t('clientCount.recharge') + } + if (type === 1) { + return t('clientCount.consume') + } + if (type === 2) { + return t('clientCount.refund') + } + return item.typeText || t('clientCount.other') +} + const getWalletDetail = async () => { walletDetailLoading.value = true try { @@ -253,9 +267,9 @@ const getWalletDetail = async () => { if (result.code === 200) { walletDetailList.value = result.data.list.map(item => ({ time: moment(item.createTime).format('YYYY-MM-DD HH:mm:ss'), - type: item.type === 0 ? t('common.recharge') : t('common.consume'), - amount: item.type === 1 ? -Math.abs(item.amount) : Math.abs(item.amount), - desc: item.description, + type: getWalletRecordTypeText(item), + amount: Number(item.amount) || 0, + desc: item.description || '', orderNo: item.orderCode, status: item.status === 0 ? 1 : 2 }))