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

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

查看文件

@@ -153,9 +153,10 @@
<script setup>
import { ref, computed, onMounted, onUnmounted } from 'vue';
import { onShow } from '@dcloudio/uni-app';
import { ACTIVITIES_LIST } from '@/common/mock.js';
import { ICONS } from '@/common/icons.js';
import { getCurrentThemeKey } from '@/common/theme.js';
import { getCurrentThemeKey, applyThemeToNativeUI } from '@/common/theme.js';
const activities = ref(ACTIVITIES_LIST);
const currentTab = ref('ALL');
@@ -164,6 +165,7 @@ const currentThemeKey = ref(getCurrentThemeKey());
const onThemeChanged = (key) => {
currentThemeKey.value = key;
applyThemeToNativeUI(key);
};
onMounted(() => {
@@ -171,6 +173,11 @@ onMounted(() => {
uni.$on('theme-change', onThemeChanged);
});
onShow(() => {
currentThemeKey.value = getCurrentThemeKey();
applyThemeToNativeUI(currentThemeKey.value);
});
onUnmounted(() => {
uni.$off('theme-change', onThemeChanged);
});