feat(theme): 完善顶部导航栏与底部菜单浅色暖色系适配及多端Tab生命周期同步

这个提交包含在:
wikiboss
2026-09-16 20:27:07 +08:00
父节点 9641dfba47
当前提交 1a56ba2682
共有 8 个文件被更改,包括 370 次插入 和 14 次删除

查看文件

@@ -1,13 +1,15 @@
<script>
import { getCurrentThemeKey } from './common/theme.js';
import { getCurrentThemeKey, applyThemeToNativeUI } from './common/theme.js';
export default {
onLaunch: function () {
const currentTheme = getCurrentThemeKey();
applyThemeToNativeUI(currentTheme);
console.log('App Launch: 电竞陪玩小程序初始化, 当前主题:', currentTheme);
},
onShow: function () {
console.log('App Show');
const currentTheme = getCurrentThemeKey();
applyThemeToNativeUI(currentTheme);
},
onHide: function () {
console.log('App Hide');
@@ -33,6 +35,11 @@ export default {
--text-secondary: #94A3B8;
--text-muted: #64748B;
--shadow-brand: 0 8rpx 24rpx rgba(99, 102, 241, 0.35);
--nav-bg: #0A0F1D;
--nav-color: #F8FAFC;
--tab-bg: #151D30;
--tab-color: #94A3B8;
--tab-active: #6366F1;
}
/* 浅色暖阳晨曦主题 (Light Warm Sunset Morning) */
@@ -52,6 +59,11 @@ page.theme-warm, .theme-warm {
--text-secondary: #57534E;
--text-muted: #78716C;
--shadow-brand: 0 8rpx 24rpx rgba(234, 88, 12, 0.25);
--nav-bg: #FDFBF7;
--nav-color: #1C1917;
--tab-bg: #FFFFFF;
--tab-color: #78716C;
--tab-active: #EA580C;
background-color: #FDFBF7;
color: #1C1917;
@@ -161,8 +173,52 @@ html, body {
}
uni-tabbar .uni-tabbar__bd {
background-color: var(--bg-surface, #151D30) !important;
border-top: 1px solid rgba(255, 255, 255, 0.08) !important;
background-color: var(--tab-bg, var(--bg-surface, #151D30)) !important;
border-top: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.08)) !important;
transition: background-color 0.2s ease;
}
/* 顶部导航栏 (H5 端 uni-page-head 动态浅色/暗黑主题自适应) */
uni-page-head, .uni-page-head {
background-color: var(--nav-bg, var(--bg-primary, #0A0F1D)) !important;
color: var(--nav-color, var(--text-primary, #F8FAFC)) !important;
border-bottom: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.08)) !important;
transition: background-color 0.2s ease, color 0.2s ease;
}
uni-page-head .uni-page-head__title {
color: var(--nav-color, var(--text-primary, #F8FAFC)) !important;
}
/* 浅色暖阳晨曦模式下强制确保 TabBar 与 PageHead 呈现高质感浅色 */
body:has(.theme-warm) uni-page-head,
page.theme-warm ~ uni-page-head {
background-color: #FDFBF7 !important;
border-bottom: 1px solid #F0ECE4 !important;
}
body:has(.theme-warm) uni-page-head .uni-page-head__title,
page.theme-warm ~ uni-page-head .uni-page-head__title {
color: #1C1917 !important;
}
body:has(.theme-warm) uni-tabbar .uni-tabbar__bd,
page.theme-warm ~ uni-tabbar .uni-tabbar__bd {
background-color: #FFFFFF !important;
border-top: 1px solid #F0ECE4 !important;
box-shadow: 0 -4rpx 20rpx rgba(28, 25, 23, 0.04) !important;
}
body:has(.theme-warm) uni-tabbar .uni-tabbar__label,
page.theme-warm ~ uni-tabbar .uni-tabbar__label {
color: #78716C !important;
}
body:has(.theme-warm) uni-tabbar .uni-tabbar-item.active .uni-tabbar__label,
page.theme-warm ~ uni-tabbar .uni-tabbar-item.active .uni-tabbar__label,
body:has(.theme-warm) uni-tabbar .uni-tabbar__item.active .uni-tabbar__label,
page.theme-warm ~ uni-tabbar .uni-tabbar__item.active .uni-tabbar__label {
color: #EA580C !important;
}
/* #endif */
</style>