统一三角洲游戏名展示

This commit is contained in:
yml2213
2026-07-25 15:37:10 +08:00
parent 4cc35a1587
commit dabf147019
6 changed files with 22 additions and 9 deletions
@@ -102,6 +102,17 @@ export function getServerRegion(item: Listing) {
return item.server_region.trim()
}
// 把后端机读游戏名转成中文展示名。
export function formatGameName(value: unknown, fallback = '-') {
const text = String(value || '').trim()
if (!text) return fallback
const normalized = text.toLowerCase().replace(/[\s_-]+/g, '')
if (normalized === 'deltaforce') {
return '三角洲'
}
return text
}
export function getListingTitle(item: Listing) {
const parts = [
`纯币${formatHafCoinM(getCoinWan(item))}`,