feat(主播、代理的提现明细页): 针对提现增加状态
This commit is contained in:
parent
0f89fb7180
commit
e17a1af577
@ -125,30 +125,37 @@ const fetchData = async () => {
|
||||
transactions.value = response.body.map((item) => {
|
||||
// 根据 event 字段判断是加还是减
|
||||
let amount = item.amount
|
||||
let isPositive = false
|
||||
let withdrawStatus = '' // 提现状态
|
||||
|
||||
// 根据事件类型判断显示
|
||||
switch (item.event) {
|
||||
case 'RECEIVE_TRANSFER':
|
||||
// 接收转账 - 显示为正数(绿色)
|
||||
amount = Math.abs(item.amount)
|
||||
isPositive = true
|
||||
break
|
||||
case 'TRANSFER':
|
||||
// 转账支出 - 显示为负数(红色)
|
||||
amount = -Math.abs(item.amount)
|
||||
isPositive = false
|
||||
break
|
||||
default:
|
||||
case 'WITHDRAW':
|
||||
// 其他情况根据 type 字段处理
|
||||
// type: 0 表示收入,1 表示支出
|
||||
if (item.type === 0) {
|
||||
amount = Math.abs(item.amount)
|
||||
isPositive = true
|
||||
} else {
|
||||
amount = -Math.abs(item.amount)
|
||||
isPositive = false
|
||||
}
|
||||
|
||||
if (item.details.latestApprovalStatus == 'SUBMIT') {
|
||||
withdrawStatus = 'Under review'
|
||||
} else if (item.details.latestApprovalStatus == 'PASS') {
|
||||
withdrawStatus = 'Approved'
|
||||
} else if (item.details.latestApprovalStatus == 'NOT_PASS') {
|
||||
withdrawStatus = 'Rejection'
|
||||
}
|
||||
break
|
||||
default:
|
||||
break
|
||||
}
|
||||
|
||||
return {
|
||||
@ -158,7 +165,7 @@ const fetchData = async () => {
|
||||
amount: amount,
|
||||
balance: item.balance,
|
||||
event: item.event,
|
||||
isPositive: isPositive,
|
||||
withdrawStatus: withdrawStatus, // 提现状态
|
||||
// 添加用户信息字段
|
||||
userAvatar: item.details?.userAvatar || null,
|
||||
userNickname: item.details?.userNickname || null,
|
||||
@ -170,7 +177,6 @@ const fetchData = async () => {
|
||||
}
|
||||
} catch (err) {
|
||||
console.error('Failed to fetch wallet details:', err)
|
||||
error.value = err.message || t('failed_to_load_data')
|
||||
} finally {
|
||||
loading.value = false
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user