refactor(theme): 移除未使用的主题CSS变量函数并更新文本样式

移除theme.store.ts中未使用的getThemeCSSVariables函数,该函数已被其他实现替代
在mine/index.vue中使用theme-text-secondary类统一文本颜色样式
This commit is contained in:
zhangtao
2025-09-26 00:07:58 +08:00
parent 8f5316df91
commit 3138fde133
2 changed files with 9 additions and 26 deletions
+9 -9
View File
@@ -54,7 +54,7 @@
<view class="card-header">
<view class="flex-start">
<wd-icon name="tools" size="18" :color="themeVars.colorTheme" />
<text class="ml-12rpx text-28rpx font-600">常用工具</text>
<text class="theme-text-secondary ml-12rpx text-28rpx font-600">常用工具</text>
</view>
</view>
<view class="flex flex-wrap p-20rpx pt-20rpx pb-10rpx">
@@ -62,25 +62,25 @@
<view class="tool-icon">
<wd-icon name="user" size="24" :color="currentThemeColor.primary" />
</view>
<view class="text-24rpx">个人资料</view>
<view class="theme-text-secondary text-24rpx">个人资料</view>
</view>
<view class="tool-item" @click="navigateToFAQ">
<view class="tool-icon">
<wd-icon name="help-circle" size="24" :color="currentThemeColor.primary" />
</view>
<view class="text-24rpx">常见问题</view>
<view class="theme-text-secondary text-24rpx">常见问题</view>
</view>
<view class="tool-item" @click="handleQuestionFeedback">
<view class="tool-icon">
<wd-icon name="check-circle" size="24" :color="currentThemeColor.primary" />
</view>
<view class="text-24rpx">问题反馈</view>
<view class="theme-text-secondary text-24rpx">问题反馈</view>
</view>
<view class="tool-item" @click="navigateToAbout">
<view class="tool-icon">
<wd-icon name="info-circle" size="24" :color="currentThemeColor.primary" />
</view>
<view class="text-24rpx">关于我们</view>
<view class="theme-text-secondary text-24rpx">关于我们</view>
</view>
</view>
</view>
@@ -90,7 +90,7 @@
<view class="card-header">
<view class="flex-start">
<wd-icon name="star" size="18" :color="currentThemeColor.primary" />
<text class="ml-12rpx text-28rpx font-600">推荐服务</text>
<text class="theme-text-secondary ml-12rpx text-28rpx font-600">推荐服务</text>
</view>
</view>
<view>
@@ -100,7 +100,7 @@
<wd-icon name="dong" size="22" :color="currentThemeColor.primary" />
</view>
<view>
<view class="text-28rpx font-500">会员中心</view>
<view class="theme-text-secondary text-28rpx font-500">会员中心</view>
<view class="mt-8rpx text-24rpx text-gray-500">解锁更多特权</view>
</view>
</view>
@@ -112,7 +112,7 @@
<wd-icon name="discount" size="22" :color="currentThemeColor.primary" />
</view>
<view>
<view class="text-28rpx font-500">优惠券</view>
<view class="theme-text-secondary text-28rpx font-500 text-28rpx font-500">优惠券</view>
<view class="mt-8rpx text-24rpx text-gray-500">查看我的优惠券</view>
</view>
</view>
@@ -124,7 +124,7 @@
<wd-icon name="share" size="22" :color="currentThemeColor.primary" />
</view>
<view>
<view class="text-28rpx font-500">邀请有礼</view>
<view class="theme-text-secondary text-28rpx font-500 text-28rpx font-500">邀请有礼</view>
<view class="mt-8rpx text-24rpx text-gray-500">邀请好友得奖励</view>
</view>
</view>
-17
View File
@@ -110,18 +110,6 @@ export const useThemeStore = defineStore("appTheme", () => {
Object.assign(themeVars, colors);
};
// 获取主题CSS变量配置
const getThemeCSSVariables = (isDark: boolean) => ({
'--wot-color-bg': isDark ? '#0f0f0f' : '#f8f8f8',
'--wot-color-title': isDark ? '#ffffff' : '#1d2129',
'--wot-color-content': isDark ? '#e0e0e0' : '#4e5969',
'--wot-color-secondary': isDark ? '#a0a0a0' : '#86909c',
'--wot-color-border': isDark ? '#2f2f2f' : '#e5e6eb',
'--wot-color-border-light': isDark ? '#3d3d3d' : '#f2f3f5',
'--wot-card-bg': isDark ? '#1a1a1a' : '#ffffff',
'--wot-card-content-border-color': isDark ? '#2f2f2f' : '#e5e6eb',
});
// 更新CSS变量
const updateCSSVariables = () => {
// 确保在客户端环境且DOM已准备好
@@ -136,11 +124,6 @@ export const useThemeStore = defineStore("appTheme", () => {
root.classList.toggle('dark', isDark);
root.classList.toggle('light', !isDark);
// 批量设置CSS变量
const cssVars = getThemeCSSVariables(isDark);
Object.entries(cssVars).forEach(([key, value]) => {
root.style.setProperty(key, value);
});
}
// 更新主题变量