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