From 4bcd1af1f4ea6177aa2c43769fbf21ad0db8881e Mon Sep 17 00:00:00 2001 From: lyf <2514544224@qq.com> Date: Fri, 24 Jul 2026 23:09:40 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E8=AE=B2=E8=A7=A3=E9=A1=B5?= =?UTF-8?q?=E6=A0=87=E9=A2=98=E4=B8=8E=E5=B5=8C=E5=85=A5=E5=AF=BC=E8=88=AA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/explain/ExplainHallSelect.vue | 2 +- src/pages.json | 2 +- src/pages/explain/list.vue | 2 +- tests/unit/ExplainHallSelect.spec.ts | 2 +- tests/unit/ExplainListNavigation.spec.ts | 4 ++-- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/components/explain/ExplainHallSelect.vue b/src/components/explain/ExplainHallSelect.vue index 3564ff8..2a70884 100644 --- a/src/components/explain/ExplainHallSelect.vue +++ b/src/components/explain/ExplainHallSelect.vue @@ -223,7 +223,7 @@ const shouldUseHostNavigation = computed(() => isEmbeddedInWechatMiniProgram()) const showInternalHeader = computed(() => props.forceInternalHeader || !shouldUseHostNavigation.value) const headerTitle = computed(() => { if (props.stage === 'stop') return props.selectedHallName || '讲解对象' - return '展厅讲解' + return '免费讲解' }) const loadingTitle = computed(() => { if (props.stage === 'stop') return '正在加载讲解对象' diff --git a/src/pages.json b/src/pages.json index b0ad303..b6a2272 100644 --- a/src/pages.json +++ b/src/pages.json @@ -25,7 +25,7 @@ { "path": "pages/explain/list", "style": { - "navigationBarTitleText": "全部讲解", + "navigationBarTitleText": "免费讲解", "navigationBarBackgroundColor": "#FFFFFF", "navigationStyle": "custom" } diff --git a/src/pages/explain/list.vue b/src/pages/explain/list.vue index 6adead1..7d4e4dc 100644 --- a/src/pages/explain/list.vue +++ b/src/pages/explain/list.vue @@ -10,7 +10,7 @@ { }) const card = wrapper.get('.hall-overview-card') - expect(wrapper.get('.header-title').text()).toBe('展厅讲解') + expect(wrapper.get('.header-title').text()).toBe('免费讲解') expect(card.attributes('style')).toContain('--hall-card-color: #d9b06c') expect(card.text()).toContain('恐龙厅') expect(card.text()).not.toContain('Dinosaur Hall') diff --git a/tests/unit/ExplainListNavigation.spec.ts b/tests/unit/ExplainListNavigation.spec.ts index 1836a95..095ea64 100644 --- a/tests/unit/ExplainListNavigation.spec.ts +++ b/tests/unit/ExplainListNavigation.spec.ts @@ -106,13 +106,13 @@ describe('讲解展厅列表返回', () => { wrapper.unmount() }) - it('独立页在微信嵌入态强制提供 H5 返回,并保留宿主识别参数', async () => { + it('微信嵌入态由宿主导航提供标题与返回,不渲染重复的 H5 页头', async () => { hostEnvironmentMocks.embeddedInWechatMiniProgram = true window.location.hash = '#/pages/explain/list?embedded=wechat-mini-program&weapp=1' window.history.replaceState({}, '', window.location.href) const wrapper = mountExplainList() - expect(wrapper.getComponent(ExplainHallSelectStub).props('forceInternalHeader')).toBe(true) + expect(wrapper.getComponent(ExplainHallSelectStub).props('forceInternalHeader')).toBe(false) await wrapper.get('[data-testid="explain-list-back"]').trigger('click') expect(uni.navigateBack).not.toHaveBeenCalled()