统一三角洲游戏名展示

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
@@ -28,6 +28,7 @@ import {
assetRegions, assetRegions,
formatEstimatedRentalDuration, formatEstimatedRentalDuration,
formatHafCoinM, formatHafCoinM,
formatGameName,
getCoinWan, getCoinWan,
getDailyLoss, getDailyLoss,
getListingConsumablePrice, getListingConsumablePrice,
@@ -73,7 +74,7 @@ const assetRows = computed(() => {
return [ return [
{ label: '商品编号', value: formatListingCode(listing.value) }, { label: '商品编号', value: formatListingCode(listing.value) },
{ label: '账号 ID', value: listing.value.account_id }, { 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.server_region || '-' },
{ label: '平台', value: listing.value.login_platform || '-' }, { label: '平台', value: listing.value.login_platform || '-' },
{ label: '段位', value: listing.value.rank_level || '-' }, { label: '段位', value: listing.value.rank_level || '-' },
@@ -414,7 +415,7 @@ async function openScreenshot(url: string) {
<section class="detail-panel primary-panel"> <section class="detail-panel primary-panel">
<div class="panel-heading"> <div class="panel-heading">
<h2>账号属性</h2> <h2>账号属性</h2>
<span>{{ listing.game_name || 'delta_force' }}</span> <span>{{ formatGameName(listing.game_name, '三角洲') }}</span>
</div> </div>
<dl class="compact-detail-grid"> <dl class="compact-detail-grid">
<div v-for="row in assetRows" :key="row.label"> <div v-for="row in assetRows" :key="row.label">
@@ -35,7 +35,7 @@ import {
settlementStatusLabel, settlementStatusLabel,
} from '@/shared/utils/statusLabels' } from '@/shared/utils/statusLabels'
import { formatDateTime } from '@/shared/utils/time' import { formatDateTime } from '@/shared/utils/time'
import { formatListingNo } from '@/shared/utils/listingDisplay' import { formatGameName, formatListingNo } from '@/shared/utils/listingDisplay'
const route = useRoute() const route = useRoute()
const loading = ref(false) const loading = ref(false)
@@ -218,7 +218,7 @@ const accountSnapshotItems = computed(() => {
return [ return [
{ label: '账号ID', value: displayValue(snapshot.account_id) }, { label: '账号ID', value: displayValue(snapshot.account_id) },
{ label: '账号标题', value: displayValue(snapshot.title) }, { 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.server_region) },
{ label: '登录平台', value: displayValue(snapshot.login_platform) }, { label: '登录平台', value: displayValue(snapshot.login_platform) },
{ label: '段位等级', value: displayValue(snapshot.rank_level) }, { label: '段位等级', value: displayValue(snapshot.rank_level) },
@@ -11,7 +11,7 @@ import {
} from '@/features/admin/api/adminPickup' } from '@/features/admin/api/adminPickup'
import { quantity, readNumber, readUnitPrice } from '@/features/orders/composables/useOrderSnapshot' import { quantity, readNumber, readUnitPrice } from '@/features/orders/composables/useOrderSnapshot'
import { adminPath } from '@/shared/utils/adminPath' import { adminPath } from '@/shared/utils/adminPath'
import { formatListingNo } from '@/shared/utils/listingDisplay' import { formatGameName, formatListingNo } from '@/shared/utils/listingDisplay'
import { import {
centToYuan, centToYuan,
formatCentWithSymbol, formatCentWithSymbol,
@@ -61,7 +61,7 @@ const accountSnapshotItems = computed(() => {
return [ return [
{ label: '账号ID', value: displayValue(row.account_id) }, { label: '账号ID', value: displayValue(row.account_id) },
{ label: '账号标题', value: displayValue(row.title) }, { 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.server_region) },
{ label: '登录平台', value: displayValue(row.login_platform) }, { label: '登录平台', value: displayValue(row.login_platform) },
{ label: '段位等级', value: displayValue(row.rank_level) }, { label: '段位等级', value: displayValue(row.rank_level) },
@@ -19,6 +19,7 @@ import {
assetRegions, assetRegions,
formatAssetNumber, formatAssetNumber,
formatEstimatedRentalDuration, formatEstimatedRentalDuration,
formatGameName,
formatHafCoinM, formatHafCoinM,
formatListingCode, formatListingCode,
formatRatio, formatRatio,
@@ -399,7 +400,7 @@ function handleToggleFavorite() {
<section class="detail-section"> <section class="detail-section">
<div class="detail-section-head"> <div class="detail-section-head">
<h2>账号资料</h2> <h2>账号资料</h2>
<span>{{ listing.game_name || '三角洲行动' }}</span> <span>{{ formatGameName(listing.game_name, '三角洲') }}</span>
</div> </div>
<div class="detail-chip-row"> <div class="detail-chip-row">
<span v-for="chip in getListingChips(listing)" :key="chip.label"> <span v-for="chip in getListingChips(listing)" :key="chip.label">
@@ -10,7 +10,7 @@ import {
readSnapshotResources, readSnapshotResources,
} from '@/features/orders/composables/useOrderSnapshot' } from '@/features/orders/composables/useOrderSnapshot'
import AuthImage from '@/shared/components/business/AuthImage.vue' import AuthImage from '@/shared/components/business/AuthImage.vue'
import { formatOnlineTimeRange } from '@/shared/utils/listingDisplay' import { formatGameName, formatOnlineTimeRange } from '@/shared/utils/listingDisplay'
const props = withDefaults( const props = withDefaults(
defineProps<{ defineProps<{
@@ -80,7 +80,7 @@ const primaryRows = computed(() => {
{ label: '区服', value: formatScalar(s.server_region || props.order.server_region) }, { label: '区服', value: formatScalar(s.server_region || props.order.server_region) },
{ label: '上号方式', value: formatScalar(s.login_platform || props.order.login_platform) }, { label: '上号方式', value: formatScalar(s.login_platform || props.order.login_platform) },
{ label: '游戏段位', value: formatScalar(s.rank_level) }, { 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: '纯币', value: coinM.value > 0 ? `${quantity(coinM.value)}M` : '--' },
{ label: 'M单价/比例', value: formatRatioNumber(ratio) }, { label: 'M单价/比例', value: formatRatioNumber(ratio) },
{ {
@@ -102,6 +102,17 @@ export function getServerRegion(item: Listing) {
return item.server_region.trim() 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) { export function getListingTitle(item: Listing) {
const parts = [ const parts = [
`纯币${formatHafCoinM(getCoinWan(item))}`, `纯币${formatHafCoinM(getCoinWan(item))}`,