fix(lang): 优化语言处理和数据加载逻辑
This commit is contained in:
@@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user