From 6f6e6229eccc19658c70b94a1afbab221765261b Mon Sep 17 00:00:00 2001 From: wikiboss Date: Wed, 16 Sep 2026 20:46:32 +0800 Subject: [PATCH] =?UTF-8?q?feat(ui):=20=E7=A7=BB=E9=99=A4=E5=9B=9B?= =?UTF-8?q?=E5=A4=A7TabBar=E4=B8=BB=E9=A1=B5=E5=8E=9F=E7=94=9Fnavbar?= =?UTF-8?q?=E5=AE=9E=E7=8E=B0=E5=85=A8=E6=B2=89=E6=B5=B8=E5=BC=8F=E8=A7=86?= =?UTF-8?q?=E8=A7=89=E4=BD=93=E9=AA=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pwuniapp/pages.json | 4 ++++ pwuniapp/pages/activity/list.vue | 2 +- pwuniapp/pages/index/index.vue | 2 +- pwuniapp/pages/order/list.vue | 2 +- pwuniapp/pages/user/index.vue | 2 +- server/tests/theme.spec.ts | 30 ++++++++++++++++++++++++++++++ 6 files changed, 38 insertions(+), 4 deletions(-) diff --git a/pwuniapp/pages.json b/pwuniapp/pages.json index b40f538..f606317 100644 --- a/pwuniapp/pages.json +++ b/pwuniapp/pages.json @@ -3,6 +3,7 @@ { "path": "pages/index/index", "style": { + "navigationStyle": "custom", "navigationBarTitleText": "陪玩中心", "navigationBarBackgroundColor": "#0A0F1D", "navigationBarTextStyle": "white", @@ -12,6 +13,7 @@ { "path": "pages/activity/list", "style": { + "navigationStyle": "custom", "navigationBarTitleText": "组队活动大厅", "navigationBarBackgroundColor": "#0A0F1D", "navigationBarTextStyle": "white", @@ -57,6 +59,7 @@ { "path": "pages/order/list", "style": { + "navigationStyle": "custom", "navigationBarTitleText": "我的订单", "navigationBarBackgroundColor": "#0A0F1D", "navigationBarTextStyle": "white", @@ -66,6 +69,7 @@ { "path": "pages/user/index", "style": { + "navigationStyle": "custom", "navigationBarTitleText": "个人中心", "navigationBarBackgroundColor": "#0A0F1D", "navigationBarTextStyle": "white", diff --git a/pwuniapp/pages/activity/list.vue b/pwuniapp/pages/activity/list.vue index 0f342bb..c1571d9 100644 --- a/pwuniapp/pages/activity/list.vue +++ b/pwuniapp/pages/activity/list.vue @@ -231,7 +231,7 @@ const createActivity = () => { .activity-container { min-height: 100vh; background-color: #0A0F1D; - padding: 20rpx 32rpx calc(180rpx + env(safe-area-inset-bottom)); + padding: calc(24rpx + env(safe-area-inset-top, 0px)) 32rpx calc(180rpx + env(safe-area-inset-bottom)); } .tab-header { diff --git a/pwuniapp/pages/index/index.vue b/pwuniapp/pages/index/index.vue index 0e71f1b..3247820 100644 --- a/pwuniapp/pages/index/index.vue +++ b/pwuniapp/pages/index/index.vue @@ -236,7 +236,7 @@ const navTo = (url) => { } .header-search { - padding: 20rpx 32rpx; + padding: calc(20rpx + env(safe-area-inset-top, 0px)) 32rpx 20rpx; background-color: #0A0F1D; position: sticky; top: 0; diff --git a/pwuniapp/pages/order/list.vue b/pwuniapp/pages/order/list.vue index 0dc5a88..2dbc2ba 100644 --- a/pwuniapp/pages/order/list.vue +++ b/pwuniapp/pages/order/list.vue @@ -210,7 +210,7 @@ const rateExpert = (id) => { .order-list-container { min-height: 100vh; background-color: #0A0F1D; - padding: 20rpx 32rpx calc(160rpx + env(safe-area-inset-bottom)); + padding: calc(24rpx + env(safe-area-inset-top, 0px)) 32rpx calc(160rpx + env(safe-area-inset-bottom)); } .tab-header { diff --git a/pwuniapp/pages/user/index.vue b/pwuniapp/pages/user/index.vue index 6f2acd1..51f0f1c 100644 --- a/pwuniapp/pages/user/index.vue +++ b/pwuniapp/pages/user/index.vue @@ -258,7 +258,7 @@ const navTo = (url) => { .user-container { min-height: 100vh; background-color: #0A0F1D; - padding: 24rpx 32rpx calc(160rpx + env(safe-area-inset-bottom)); + padding: calc(24rpx + env(safe-area-inset-top, 0px)) 32rpx calc(160rpx + env(safe-area-inset-bottom)); } .profile-card { diff --git a/server/tests/theme.spec.ts b/server/tests/theme.spec.ts index 431adcf..cb4e470 100644 --- a/server/tests/theme.spec.ts +++ b/server/tests/theme.spec.ts @@ -329,7 +329,37 @@ describe('ThemeManager (TDD 测试套件: 暖色系与双主题设计系统)', ( expect(hasH5DomSupport).toBe(true); }); }); + + describe('9. 四大核心 TabBar 页面去掉原生 NavBar (custom) 门禁校验', () => { + const rootDir = path.resolve(__dirname, '../../'); + const pagesJsonPath = path.join(rootDir, 'pwuniapp', 'pages.json'); + + it('pages.json 中首页、活动项目、订单中心、我的 必须全部配置 navigationStyle: custom', () => { + const raw = fs.readFileSync(pagesJsonPath, 'utf-8'); + const pagesConfig = JSON.parse(raw); + + const targetPaths = [ + 'pages/index/index', + 'pages/activity/list', + 'pages/order/list', + 'pages/user/index' + ]; + + for (const targetPath of targetPaths) { + const pageItem = pagesConfig.pages.find((p: any) => p.path === targetPath); + expect(pageItem).toBeDefined(); + expect({ + page: targetPath, + navigationStyle: pageItem.style?.navigationStyle + }).toEqual({ + page: targetPath, + navigationStyle: 'custom' + }); + } + }); + }); }); +