diff --git a/frontend/src/features/admin/views/AdminListingDetailView.vue b/frontend/src/features/admin/views/AdminListingDetailView.vue index cab8685..90ff04f 100644 --- a/frontend/src/features/admin/views/AdminListingDetailView.vue +++ b/frontend/src/features/admin/views/AdminListingDetailView.vue @@ -28,6 +28,7 @@ import { assetRegions, formatEstimatedRentalDuration, formatHafCoinM, + formatGameName, getCoinWan, getDailyLoss, getListingConsumablePrice, @@ -73,7 +74,7 @@ const assetRows = computed(() => { return [ { label: '商品编号', value: formatListingCode(listing.value) }, { label: '账号 ID', value: listing.value.account_id }, - { label: '游戏', value: listing.value.game_name || '-' }, + { label: '游戏', value: formatGameName(listing.value.game_name) }, { label: '区服', value: listing.value.server_region || '-' }, { label: '平台', value: listing.value.login_platform || '-' }, { label: '段位', value: listing.value.rank_level || '-' }, @@ -414,7 +415,7 @@ async function openScreenshot(url: string) {

账号属性

- {{ listing.game_name || 'delta_force' }} + {{ formatGameName(listing.game_name, '三角洲') }}
diff --git a/frontend/src/features/admin/views/AdminOrderDetailView.vue b/frontend/src/features/admin/views/AdminOrderDetailView.vue index 9303c69..be6158e 100644 --- a/frontend/src/features/admin/views/AdminOrderDetailView.vue +++ b/frontend/src/features/admin/views/AdminOrderDetailView.vue @@ -35,7 +35,7 @@ import { settlementStatusLabel, } from '@/shared/utils/statusLabels' import { formatDateTime } from '@/shared/utils/time' -import { formatListingNo } from '@/shared/utils/listingDisplay' +import { formatGameName, formatListingNo } from '@/shared/utils/listingDisplay' const route = useRoute() const loading = ref(false) @@ -218,7 +218,7 @@ const accountSnapshotItems = computed(() => { return [ { label: '账号ID', value: displayValue(snapshot.account_id) }, { label: '账号标题', value: displayValue(snapshot.title) }, - { label: '游戏名称', value: displayValue(snapshot.game_name) }, + { label: '游戏名称', value: formatGameName(snapshot.game_name, '-') }, { label: '所在区服', value: displayValue(snapshot.server_region) }, { label: '登录平台', value: displayValue(snapshot.login_platform) }, { label: '段位等级', value: displayValue(snapshot.rank_level) }, diff --git a/frontend/src/features/admin/views/AdminPickupDetailView.vue b/frontend/src/features/admin/views/AdminPickupDetailView.vue index 8061157..c73d542 100644 --- a/frontend/src/features/admin/views/AdminPickupDetailView.vue +++ b/frontend/src/features/admin/views/AdminPickupDetailView.vue @@ -11,7 +11,7 @@ import { } from '@/features/admin/api/adminPickup' import { quantity, readNumber, readUnitPrice } from '@/features/orders/composables/useOrderSnapshot' import { adminPath } from '@/shared/utils/adminPath' -import { formatListingNo } from '@/shared/utils/listingDisplay' +import { formatGameName, formatListingNo } from '@/shared/utils/listingDisplay' import { centToYuan, formatCentWithSymbol, @@ -61,7 +61,7 @@ const accountSnapshotItems = computed(() => { return [ { label: '账号ID', value: displayValue(row.account_id) }, { label: '账号标题', value: displayValue(row.title) }, - { label: '游戏名称', value: displayValue(row.game_name) }, + { label: '游戏名称', value: formatGameName(row.game_name, '-') }, { label: '所在区服', value: displayValue(row.server_region) }, { label: '登录平台', value: displayValue(row.login_platform) }, { label: '段位等级', value: displayValue(row.rank_level) }, diff --git a/frontend/src/features/listings/views/ListingDetailView.vue b/frontend/src/features/listings/views/ListingDetailView.vue index 12a35d3..0f70057 100644 --- a/frontend/src/features/listings/views/ListingDetailView.vue +++ b/frontend/src/features/listings/views/ListingDetailView.vue @@ -19,6 +19,7 @@ import { assetRegions, formatAssetNumber, formatEstimatedRentalDuration, + formatGameName, formatHafCoinM, formatListingCode, formatRatio, @@ -399,7 +400,7 @@ function handleToggleFavorite() {

账号资料

- {{ listing.game_name || '三角洲行动' }} + {{ formatGameName(listing.game_name, '三角洲') }}
diff --git a/frontend/src/features/orders/components/OrderAccountSnapshot.vue b/frontend/src/features/orders/components/OrderAccountSnapshot.vue index 0a0bf43..6e1754d 100644 --- a/frontend/src/features/orders/components/OrderAccountSnapshot.vue +++ b/frontend/src/features/orders/components/OrderAccountSnapshot.vue @@ -10,7 +10,7 @@ import { readSnapshotResources, } from '@/features/orders/composables/useOrderSnapshot' import AuthImage from '@/shared/components/business/AuthImage.vue' -import { formatOnlineTimeRange } from '@/shared/utils/listingDisplay' +import { formatGameName, formatOnlineTimeRange } from '@/shared/utils/listingDisplay' const props = withDefaults( defineProps<{ @@ -80,7 +80,7 @@ const primaryRows = computed(() => { { label: '区服', value: formatScalar(s.server_region || props.order.server_region) }, { label: '上号方式', value: formatScalar(s.login_platform || props.order.login_platform) }, { label: '游戏段位', value: formatScalar(s.rank_level) }, - { label: '游戏名称', value: formatScalar(s.game_name) }, + { label: '游戏名称', value: formatGameName(s.game_name, '-') }, { label: '纯币', value: coinM.value > 0 ? `${quantity(coinM.value)}M` : '--' }, { label: 'M单价/比例', value: formatRatioNumber(ratio) }, { diff --git a/frontend/src/shared/utils/listingDisplay.ts b/frontend/src/shared/utils/listingDisplay.ts index 5eb2209..e43de71 100644 --- a/frontend/src/shared/utils/listingDisplay.ts +++ b/frontend/src/shared/utils/listingDisplay.ts @@ -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))}`,