From 6557980b974ba2c1b1df00b30aa0c780d74169cf Mon Sep 17 00:00:00 2001
From: zhangtao <9480807882@qq.com>
Date: Wed, 27 Aug 2025 01:34:46 +0800
Subject: [PATCH] =?UTF-8?q?refactor(theme):=20=E7=A7=BB=E9=99=A4=E6=9A=97?=
=?UTF-8?q?=E9=BB=91=E6=A8=A1=E5=BC=8F=E7=9B=B8=E5=85=B3=E4=BB=A3=E7=A0=81?=
=?UTF-8?q?=E5=B9=B6=E7=AE=80=E5=8C=96=E4=B8=BB=E9=A2=98=E8=AE=BE=E7=BD=AE?=
=?UTF-8?q?=E9=A1=B5=E9=9D=A2?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
重构主题相关功能,移除不再使用的暗黑模式样式和配置
将主题颜色设置逻辑迁移到utils/theme模块
简化主题设置页面UI,移除预览区域
更新全局样式配置和页面路由类型定义
---
fastapp/index.html | 2 +-
fastapp/pages.config.ts | 52 ---------------
fastapp/src/pages.json | 29 ++++----
fastapp/src/pages/mine/index.vue | 3 -
.../src/pages/mine/settings/theme/index.vue | 44 +------------
fastapp/src/types/auto-imports.d.ts | 4 +-
fastapp/src/uni.scss | 66 -------------------
fastapp/uni-pages.d.ts | 36 ----------
fastapp/unocss.config.ts | 9 ---
9 files changed, 20 insertions(+), 225 deletions(-)
delete mode 100644 fastapp/pages.config.ts
delete mode 100644 fastapp/uni-pages.d.ts
diff --git a/fastapp/index.html b/fastapp/index.html
index bf8f7bcc..009e712b 100644
--- a/fastapp/index.html
+++ b/fastapp/index.html
@@ -2,7 +2,7 @@
-
+
@@ -414,12 +378,6 @@ const handleBack = () => {
}
}
-// 效果预览
-.preview-text {
- font-size: 28rpx;
- font-weight: 500;
-}
-
.preview-border {
display: flex;
align-items: center;
diff --git a/fastapp/src/types/auto-imports.d.ts b/fastapp/src/types/auto-imports.d.ts
index b6efc359..95ce652d 100644
--- a/fastapp/src/types/auto-imports.d.ts
+++ b/fastapp/src/types/auto-imports.d.ts
@@ -42,6 +42,7 @@ declare global {
const getDarkerColor: typeof import('../utils/colorUtils')['getDarkerColor']
const getLighterColor: typeof import('../utils/colorUtils')['getLighterColor']
const getRefreshToken: typeof import('../utils/auth')['getRefreshToken']
+ const getThemeColor: typeof import('../utils/theme')['getThemeColor']
const getToken: typeof import('../utils/storage')['getToken']
const getUserInfo: typeof import('../utils/auth')['getUserInfo']
const guessSerializerType: typeof import('@uni-helper/uni-use')['guessSerializerType']
@@ -117,7 +118,8 @@ declare global {
const setActivePinia: typeof import('pinia')['setActivePinia']
const setMapStoreSuffix: typeof import('pinia')['setMapStoreSuffix']
const setRefreshToken: typeof import('../utils/auth')['setRefreshToken']
- const setThemeColor: typeof import('../composables/useTheme')['setThemeColor']
+ const setThemeColor: typeof import('../utils/theme')['setThemeColor']
+ const setThemeColorCache: typeof import('../utils/theme')['setThemeColorCache']
const setToken: typeof import('../utils/storage')['setToken']
const setUserInfo: typeof import('../utils/auth')['setUserInfo']
const setupStore: typeof import('../store/index')['setupStore']
diff --git a/fastapp/src/uni.scss b/fastapp/src/uni.scss
index bbd676d9..d0551103 100644
--- a/fastapp/src/uni.scss
+++ b/fastapp/src/uni.scss
@@ -74,69 +74,3 @@ $uni-color-subtitle: #555; // 二级标题颜色
$uni-font-size-subtitle: 18px;
$uni-color-paragraph: #3f536e; // 文章段落颜色
$uni-font-size-paragraph: 15px;
-
-/* 暗黑模式全局样式 */
-.wot-theme-dark {
- color: #f5f5f5 !important;
- background-color: #1a1a1a !important;
-
- /* 页面背景 */
- page {
- color: #f5f5f5 !important;
- background-color: #1a1a1a !important;
- }
-
- /* H5 环境 body 样式 */
- body {
- color: #f5f5f5 !important;
- background-color: #1a1a1a !important;
- }
-
- /* 通用组件暗黑模式适配 */
- .uni-page-wrapper {
- color: #f5f5f5 !important;
- background-color: #1a1a1a !important;
- }
-
- /* 导航栏暗黑模式 */
- .uni-navbar {
- color: #f5f5f5 !important;
- background-color: #2a2a2a !important;
- border-bottom-color: #404040 !important;
- }
-
- /* 标签栏暗黑模式 */
- .uni-tabbar {
- background-color: #2a2a2a !important;
- border-top-color: #404040 !important;
- }
-
- /* 卡片组件暗黑模式 */
- .uni-card {
- color: #f5f5f5 !important;
- background-color: #2a2a2a !important;
- }
-
- /* 列表项暗黑模式 */
- .uni-list-item {
- color: #f5f5f5 !important;
- background-color: #2a2a2a !important;
- border-bottom-color: #404040 !important;
- }
-
- /* 输入框暗黑模式 */
- .uni-input {
- color: #f5f5f5 !important;
- background-color: #404040 !important;
- border-color: #606060 !important;
- }
-
- /* 按钮暗黑模式适配 */
- .uni-button {
- &.uni-button-default {
- color: #f5f5f5 !important;
- background-color: #404040 !important;
- border-color: #606060 !important;
- }
- }
-}
diff --git a/fastapp/uni-pages.d.ts b/fastapp/uni-pages.d.ts
deleted file mode 100644
index c92faa9b..00000000
--- a/fastapp/uni-pages.d.ts
+++ /dev/null
@@ -1,36 +0,0 @@
-/* eslint-disable */
-/* prettier-ignore */
-// @ts-nocheck
-// Generated by vite-plugin-uni-pages
-
-interface NavigateToOptions {
- url: "/pages/index/index" |
- "/pages/login/index" |
- "/pages/mine/index" |
- "/pages/work/index" |
- "/pages/mine/about/index" |
- "/pages/mine/faq/index" |
- "/pages/mine/feedback/index" |
- "/pages/mine/profile/complete-profile" |
- "/pages/mine/profile/index" |
- "/pages/mine/settings/index" |
- "/pages/mine/settings/account/index" |
- "/pages/mine/settings/agreement/index" |
- "/pages/mine/settings/network/index" |
- "/pages/mine/settings/privacy/index" |
- "/pages/mine/settings/theme/index";
-}
-interface RedirectToOptions extends NavigateToOptions {}
-
-interface SwitchTabOptions {
- url: "/pages/index/index" | "/pages/work/index" | "/pages/mine/index"
-}
-
-type ReLaunchOptions = NavigateToOptions | SwitchTabOptions;
-
-declare interface Uni {
- navigateTo(options: UniNamespace.NavigateToOptions & NavigateToOptions): void;
- redirectTo(options: UniNamespace.RedirectToOptions & RedirectToOptions): void;
- switchTab(options: UniNamespace.SwitchTabOptions & SwitchTabOptions): void;
- reLaunch(options: UniNamespace.ReLaunchOptions & ReLaunchOptions): void;
-}
diff --git a/fastapp/unocss.config.ts b/fastapp/unocss.config.ts
index bb13cccc..b65b035c 100644
--- a/fastapp/unocss.config.ts
+++ b/fastapp/unocss.config.ts
@@ -16,15 +16,6 @@ export default {
"flex-start": "flex justify-start items-center",
"flex-end": "flex justify-end items-center",
"flex-between": "flex justify-between items-center",
- "flex-around": "flex justify-around items-center",
- "flex-evenly": "flex justify-evenly items-center",
- "flex-stretch": "flex justify-stretch items-center",
- "flex-baseline": "flex justify-baseline items-center",
- "flex-column": "flex flex-col",
- "flex-row": "flex flex-row",
-
- // 垂直布局并居中对齐
- "flex-col-center": "flex flex-col items-center",
},
],