This commit is contained in:
@@ -481,9 +481,18 @@
|
|||||||
);
|
);
|
||||||
|
|
||||||
const newData = (data.items || []).map(item => {
|
const newData = (data.items || []).map(item => {
|
||||||
|
// 格式化时间
|
||||||
|
let formattedCreatedAt = item.created_at;
|
||||||
|
if (formattedCreatedAt && formattedCreatedAt.includes('T')) {
|
||||||
|
formattedCreatedAt = formattedCreatedAt.replace('T', ' ').slice(0, 19);
|
||||||
|
}
|
||||||
|
|
||||||
// 后端已返回 status_name,优先使用
|
// 后端已返回 status_name,优先使用
|
||||||
if (item.status_name) {
|
if (item.status_name) {
|
||||||
return item;
|
return {
|
||||||
|
...item,
|
||||||
|
created_at: formattedCreatedAt
|
||||||
|
};
|
||||||
}
|
}
|
||||||
// 兼容旧版本,手动映射
|
// 兼容旧版本,手动映射
|
||||||
let statusName = '未知';
|
let statusName = '未知';
|
||||||
@@ -503,7 +512,8 @@
|
|||||||
}
|
}
|
||||||
return {
|
return {
|
||||||
...item,
|
...item,
|
||||||
status_name: statusName
|
status_name: statusName,
|
||||||
|
created_at: formattedCreatedAt
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -535,10 +545,19 @@
|
|||||||
transactionPageSize
|
transactionPageSize
|
||||||
);
|
);
|
||||||
|
|
||||||
const newData = (data.items || []).map(item => ({
|
const newData = (data.items || []).map(item => {
|
||||||
...item,
|
// 格式化时间
|
||||||
type_name: item.type === 'recharge' ? '充值' : item.type === 'purchase' ? '消费' : '其他'
|
let formattedCreatedAt = item.created_at;
|
||||||
}));
|
if (formattedCreatedAt && formattedCreatedAt.includes('T')) {
|
||||||
|
formattedCreatedAt = formattedCreatedAt.replace('T', ' ').slice(0, 19);
|
||||||
|
}
|
||||||
|
|
||||||
|
return {
|
||||||
|
...item,
|
||||||
|
type_name: item.type === 'recharge' ? '充值' : item.type === 'purchase' ? '消费' : '其他',
|
||||||
|
created_at: formattedCreatedAt
|
||||||
|
};
|
||||||
|
});
|
||||||
|
|
||||||
if (append) {
|
if (append) {
|
||||||
transactionList.push(...newData);
|
transactionList.push(...newData);
|
||||||
|
|||||||
Reference in New Issue
Block a user