fix(lang): 优化语言处理和数据加载逻辑

This commit is contained in:
JiaJun
2026-04-15 10:32:02 +08:00
parent e9d0d46244
commit bc87ef721a
6 changed files with 69 additions and 26 deletions

View File

@@ -103,20 +103,6 @@ function getOrderStatus(status?: string | number) {
}
function getOrderCategory(item: OrderItem) {
if (item.type?.trim()) {
const normalizedType = item.type.trim().toUpperCase()
switch (normalizedType) {
case 'BONUS':
return i18n.t('record.categories.bonus')
case 'PHYSICAL':
return i18n.t('record.categories.physical')
case 'WITHDRAW':
return i18n.t('record.categories.withdraw')
default:
return toTitleCase(normalizedType)
}
}
if (item.type_title) {
return item.type_title
}
@@ -126,15 +112,22 @@ function getOrderCategory(item: OrderItem) {
}
if (item.type) {
switch (item.type) {
const normalizedType = item.type.trim().toUpperCase()
switch (normalizedType) {
case 'BONUS':
return i18n.t('record.categories.bonus')
case 'PHYSICAL':
return i18n.t('record.categories.physical')
case 'WITHDRAW':
return i18n.t('record.categories.withdraw')
case '1':
return i18n.t('record.categories.withdraw')
case '2':
return i18n.t('record.categories.physical')
case '3':
return i18n.t('record.categories.bonus')
default:
return toTitleCase(item.type)
return toTitleCase(normalizedType)
}
}