From 703deb17d0f3cda6dbd93a42e8d260ebdf077c33 Mon Sep 17 00:00:00 2001 From: yml2213 Date: Fri, 16 Oct 2026 13:07:25 +0800 Subject: [PATCH] =?UTF-8?q?feat(listing):=20=E5=8F=91=E5=B8=83=E6=96=B0?= =?UTF-8?q?=E5=A2=9E=E3=80=8C=E6=98=AF=E5=90=A6=E8=A7=A3=E9=94=81=E5=BE=B7?= =?UTF-8?q?=E7=A9=86=E5=85=B0=E3=80=8D=E5=BF=85=E5=A1=AB=E9=A1=B9=EF=BC=8C?= =?UTF-8?q?=E9=A6=96=E9=A1=B5=E4=BC=98=E5=85=88=E6=9B=BF=E6=8D=A2=E5=85=A8?= =?UTF-8?q?=E8=8B=B1=E9=9B=84=E5=B1=95=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/OrderAccountSnapshot.vue | 2 ++ .../seller/composables/usePublishDraft.ts | 1 + .../seller/composables/usePublishForm.ts | 3 ++ .../views/MobileSellerListingCreateView.vue | 18 +++++++++++ .../seller/views/SellerListingCreateView.vue | 10 ++++++ frontend/src/shared/types/publish.ts | 2 ++ .../utils/__tests__/listingDisplay.spec.ts | 32 +++++++++++++++++++ frontend/src/shared/utils/listingDisplay.ts | 7 ++-- 8 files changed, 73 insertions(+), 2 deletions(-) diff --git a/frontend/src/features/orders/components/OrderAccountSnapshot.vue b/frontend/src/features/orders/components/OrderAccountSnapshot.vue index 249f5d7..5ea98a9 100644 --- a/frontend/src/features/orders/components/OrderAccountSnapshot.vue +++ b/frontend/src/features/orders/components/OrderAccountSnapshot.vue @@ -99,6 +99,7 @@ const primaryRows = computed(() => { { label: '常用登录地', value: regions.length ? regions.join('、') : '--' }, { label: '人脸归属', value: formatScalar(a.face_owner) }, { label: '是否可以修改游戏名', value: formatScalar(a.can_change_game_name) }, + { label: '是否解锁德穆兰', value: formatScalar(a.unlock_demulan) }, { label: '封禁记录', value: formatScalar(a.ban_record) === '--' ? '无' : formatScalar(a.ban_record), @@ -142,6 +143,7 @@ const extraRows = computed(() => { 'screenshot_groups', 'online_time', 'can_change_game_name', + 'unlock_demulan', 'unlock_said', 'ban_record', 'common_regions', diff --git a/frontend/src/features/seller/composables/usePublishDraft.ts b/frontend/src/features/seller/composables/usePublishDraft.ts index 42f5089..6c5c68a 100644 --- a/frontend/src/features/seller/composables/usePublishDraft.ts +++ b/frontend/src/features/seller/composables/usePublishDraft.ts @@ -20,6 +20,7 @@ export function defaultPublishForm(): PublishForm { early_morning_response: '否', can_change_game_name: '', all_hero: '', + unlock_demulan: '', next_season_pass: '', ban_record: '', common_regions: [], diff --git a/frontend/src/features/seller/composables/usePublishForm.ts b/frontend/src/features/seller/composables/usePublishForm.ts index 725b03d..be30210 100644 --- a/frontend/src/features/seller/composables/usePublishForm.ts +++ b/frontend/src/features/seller/composables/usePublishForm.ts @@ -320,6 +320,7 @@ export function usePublishForm(options: UsePublishFormOptions) { early_morning_response: stringValue(summary.early_morning_response) || '否', can_change_game_name: stringValue(summary.can_change_game_name), all_hero: stringValue(summary.all_hero), + unlock_demulan: stringValue(summary.unlock_demulan), next_season_pass: stringValue(summary.next_season_pass), ban_record: stringValue(summary.ban_record), common_regions: stringArray(summary.common_regions), @@ -733,6 +734,7 @@ export function usePublishForm(options: UsePublishFormOptions) { if (pricing.banRecordOptions.value.length && !form.ban_record) return '请选择封禁记录' if (!form.can_change_game_name) return '请选择是否可以修改游戏名' if (!form.all_hero) return '请选择是否有全英雄' + if (!form.unlock_demulan) return '请选择是否解锁德穆兰' if (nextSeasonPassEnabled.value && !form.next_season_pass) { return '请选择下赛季是否购买通行证' } @@ -838,6 +840,7 @@ export function usePublishForm(options: UsePublishFormOptions) { early_morning_response: form.early_morning_response, can_change_game_name: form.can_change_game_name, all_hero: form.all_hero, + unlock_demulan: form.unlock_demulan, next_season_pass: form.next_season_pass, ban_record: form.ban_record, common_regions: form.common_regions, diff --git a/frontend/src/features/seller/views/MobileSellerListingCreateView.vue b/frontend/src/features/seller/views/MobileSellerListingCreateView.vue index 6b77770..479c160 100644 --- a/frontend/src/features/seller/views/MobileSellerListingCreateView.vue +++ b/frontend/src/features/seller/views/MobileSellerListingCreateView.vue @@ -123,6 +123,7 @@ function selectRadio(value: T, setter: (value: T) => void) { const canChangeGameNameOptions = ['是', '否'] const allHeroOptions = ['是', '否'] +const demulanUnlockOptions = ['是', '否'] const nextSeasonPassOptions = ['购买', '不购买'] const earlyMorningResponseOptions = ['是', '否'] @@ -443,6 +444,23 @@ const screenshotGuides: Record = { + + + + activeAgreement.value?.content || const canChangeGameNameOptions = ['是', '否'] const allHeroOptions = ['是', '否'] +const demulanUnlockOptions = ['是', '否'] const nextSeasonPassOptions = ['购买', '不购买'] const earlyMorningResponseOptions = ['是', '否'] @@ -359,6 +360,15 @@ function selectDailyLoss(value: string | number) { /> +
+ + +
+
{ expect(missing).toBeUndefined() }) }) + +describe('首页规格芯片 · 德穆兰优先级高于全英雄', () => { + it('解锁德穆兰时用「解锁德穆兰」替换「全英雄」', () => { + const chips = getListingChips(buildListing({ all_hero: '是', unlock_demulan: '是' })) + + expect(chips.find(chip => chip.label === '解锁德穆兰')).toEqual({ + label: '解锁德穆兰', + value: '是', + }) + expect(chips.find(chip => chip.label === '全英雄')).toBeUndefined() + }) + + it('未解锁德穆兰时保持原有全英雄展示逻辑', () => { + const chips = getListingChips(buildListing({ all_hero: '是', unlock_demulan: '否' })) + + expect(chips.find(chip => chip.label === '全英雄')).toEqual({ label: '全英雄', value: '是' }) + expect(chips.find(chip => chip.label === '解锁德穆兰')).toBeUndefined() + }) + + it('未解锁德穆兰且无全英雄时两者都不展示', () => { + const chips = getListingChips(buildListing({ all_hero: '否', unlock_demulan: '否' })) + + expect(chips.find(chip => chip.label === '全英雄')).toBeUndefined() + expect(chips.find(chip => chip.label === '解锁德穆兰')).toBeUndefined() + }) + + it('老数据缺少德穆兰字段时沿用全英雄展示', () => { + const chips = getListingChips(buildListing({ all_hero: '是' })) + + expect(chips.find(chip => chip.label === '全英雄')).toEqual({ label: '全英雄', value: '是' }) + }) +}) diff --git a/frontend/src/shared/utils/listingDisplay.ts b/frontend/src/shared/utils/listingDisplay.ts index c069637..0f65670 100644 --- a/frontend/src/shared/utils/listingDisplay.ts +++ b/frontend/src/shared/utils/listingDisplay.ts @@ -160,8 +160,11 @@ export function getListingChips(item: PublicListingItem): ListingDisplayChip[] { if (canChangeGameName === '是' || canChangeGameName === '否') { chips.push({ label: '可修改游戏名', value: canChangeGameName }) } - // 全英雄为必选项,仅在号主勾选「是」时展示 - if (readAssetString(item, 'all_hero') === '是') { + // 全英雄为必选项,仅在号主勾选「是」时展示;解锁德穆兰展示优先级更高,命中时替换「全英雄」。 + const allHero = readAssetString(item, 'all_hero') + if (readAssetString(item, 'unlock_demulan') === '是') { + chips.push({ label: '解锁德穆兰', value: '是' }) + } else if (allHero === '是') { chips.push({ label: '全英雄', value: '是' }) } const nextSeasonPass = readAssetString(item, 'next_season_pass')