feat(主题): 统一使用主题颜色配置替换硬编码颜色
将多处硬编码的蓝色主题色替换为统一的主题颜色配置,便于维护和统一调整
Showing
8 changed files
with
30 additions
and
9 deletions
| ... | @@ -46,7 +46,7 @@ | ... | @@ -46,7 +46,7 @@ |
| 46 | type="primary" | 46 | type="primary" |
| 47 | size="large" | 47 | size="large" |
| 48 | class="join-button" | 48 | class="join-button" |
| 49 | - color="#3B82F6" | 49 | + :color="THEME_COLORS.PRIMARY" |
| 50 | :loading="isJoining" | 50 | :loading="isJoining" |
| 51 | @click="checkFamilyStatusAndJoinActivity" | 51 | @click="checkFamilyStatusAndJoinActivity" |
| 52 | > | 52 | > |
| ... | @@ -139,6 +139,8 @@ import ShareButton from '../../components/ShareButton/index.vue' | ... | @@ -139,6 +139,8 @@ import ShareButton from '../../components/ShareButton/index.vue' |
| 139 | // 接口信息 | 139 | // 接口信息 |
| 140 | import { getMyFamiliesAPI } from '@/api/family' | 140 | import { getMyFamiliesAPI } from '@/api/family' |
| 141 | import { handleSharePageAuth, addShareFlag } from '@/utils/authRedirect' | 141 | import { handleSharePageAuth, addShareFlag } from '@/utils/authRedirect' |
| 142 | +// 主题颜色配置 | ||
| 143 | +import { THEME_COLORS } from '@/utils/config' | ||
| 142 | 144 | ||
| 143 | // 默认海报图 | 145 | // 默认海报图 |
| 144 | const defaultPoster = 'https://cdn.ipadbiz.cn/lls_prog/images/welcome_1.png'; | 146 | const defaultPoster = 'https://cdn.ipadbiz.cn/lls_prog/images/welcome_1.png'; | ... | ... |
| ... | @@ -70,6 +70,8 @@ | ... | @@ -70,6 +70,8 @@ |
| 70 | import { ref, computed, onMounted } from 'vue' | 70 | import { ref, computed, onMounted } from 'vue' |
| 71 | import Taro from '@tarojs/taro' | 71 | import Taro from '@tarojs/taro' |
| 72 | import BottomNav from '../../components/BottomNav.vue' | 72 | import BottomNav from '../../components/BottomNav.vue' |
| 73 | +// 导入主题颜色 | ||
| 74 | +import { THEME_COLORS } from '@/utils/config' | ||
| 73 | 75 | ||
| 74 | /** | 76 | /** |
| 75 | * 打卡列表页面组件 | 77 | * 打卡列表页面组件 |
| ... | @@ -247,7 +249,7 @@ const loadCheckinData = async () => { | ... | @@ -247,7 +249,7 @@ const loadCheckinData = async () => { |
| 247 | 249 | ||
| 248 | .progress-info { | 250 | .progress-info { |
| 249 | font-size: 26rpx; | 251 | font-size: 26rpx; |
| 250 | - color: #3B82F6; | 252 | + color: v-bind('THEME_COLORS.PRIMARY'); |
| 251 | background-color: #EBF4FF; | 253 | background-color: #EBF4FF; |
| 252 | padding: 12rpx 20rpx; | 254 | padding: 12rpx 20rpx; |
| 253 | border-radius: 20rpx; | 255 | border-radius: 20rpx; | ... | ... |
| ... | @@ -54,7 +54,7 @@ | ... | @@ -54,7 +54,7 @@ |
| 54 | 54 | ||
| 55 | <!-- Bottom Button --> | 55 | <!-- Bottom Button --> |
| 56 | <view class="fixed bottom-0 left-0 right-0 p-4 bg-white border-t border-gray-100"> | 56 | <view class="fixed bottom-0 left-0 right-0 p-4 bg-white border-t border-gray-100"> |
| 57 | - <nut-button type="primary" size="large" block color="#3B82F6" @click="handleRedeem"> | 57 | + <nut-button type="primary" size="large" block :color="THEME_COLORS.PRIMARY" @click="handleRedeem"> |
| 58 | 立即核销 | 58 | 立即核销 |
| 59 | </nut-button> | 59 | </nut-button> |
| 60 | </view> | 60 | </view> |
| ... | @@ -65,6 +65,8 @@ | ... | @@ -65,6 +65,8 @@ |
| 65 | import { ref } from 'vue'; | 65 | import { ref } from 'vue'; |
| 66 | import Taro from '@tarojs/taro'; | 66 | import Taro from '@tarojs/taro'; |
| 67 | import AppHeader from '../../components/AppHeader.vue'; | 67 | import AppHeader from '../../components/AppHeader.vue'; |
| 68 | +// 导入主题颜色 | ||
| 69 | +import { THEME_COLORS } from '@/utils/config'; | ||
| 68 | 70 | ||
| 69 | // Mock reward data based on the image | 71 | // Mock reward data based on the image |
| 70 | const reward = ref({ | 72 | const reward = ref({ | ... | ... |
| ... | @@ -16,7 +16,7 @@ | ... | @@ -16,7 +16,7 @@ |
| 16 | :key="index" | 16 | :key="index" |
| 17 | class="motto-input-box" | 17 | class="motto-input-box" |
| 18 | :style="{ | 18 | :style="{ |
| 19 | - borderColor: focusedIndex === index ? '#3b82f6' : '#d1d5db' | 19 | + borderColor: focusedIndex === index ? THEME_COLORS.PRIMARY : '#d1d5db' |
| 20 | }" | 20 | }" |
| 21 | > | 21 | > |
| 22 | <input | 22 | <input |
| ... | @@ -150,7 +150,7 @@ | ... | @@ -150,7 +150,7 @@ |
| 150 | <nut-button | 150 | <nut-button |
| 151 | @click="confirmJoinFamily" | 151 | @click="confirmJoinFamily" |
| 152 | class="flex-1" | 152 | class="flex-1" |
| 153 | - :color="selectedFamilyId ? '#3b82f6' : 'gray'" | 153 | + :color="selectedFamilyId ? THEME_COLORS.PRIMARY : 'gray'" |
| 154 | :disabled="!selectedFamilyId" | 154 | :disabled="!selectedFamilyId" |
| 155 | size="large" | 155 | size="large" |
| 156 | > | 156 | > |
| ... | @@ -168,6 +168,8 @@ import Taro from '@tarojs/taro'; | ... | @@ -168,6 +168,8 @@ import Taro from '@tarojs/taro'; |
| 168 | import { My, Check } from '@nutui/icons-vue-taro'; | 168 | import { My, Check } from '@nutui/icons-vue-taro'; |
| 169 | // 获取接口信息 | 169 | // 获取接口信息 |
| 170 | import { searchFamilyByPassphraseAPI, joinFamilyAPI } from '@/api/family'; | 170 | import { searchFamilyByPassphraseAPI, joinFamilyAPI } from '@/api/family'; |
| 171 | +// 导入主题颜色 | ||
| 172 | +import { THEME_COLORS } from '@/utils/config'; | ||
| 171 | // 默认头像 | 173 | // 默认头像 |
| 172 | const defaultAvatar = 'https://cdn.ipadbiz.cn/mlaj/images/icon_1.jpeg' | 174 | const defaultAvatar = 'https://cdn.ipadbiz.cn/mlaj/images/icon_1.jpeg' |
| 173 | 175 | ... | ... |
| ... | @@ -62,7 +62,7 @@ | ... | @@ -62,7 +62,7 @@ |
| 62 | type="primary" | 62 | type="primary" |
| 63 | size="large" | 63 | size="large" |
| 64 | block | 64 | block |
| 65 | - :color="reward.can_redeem ? '#3B82F6' : '#D1D5DB'" | 65 | + :color="reward.can_redeem ? THEME_COLORS.PRIMARY : '#D1D5DB'" |
| 66 | :disabled="!reward.can_redeem" | 66 | :disabled="!reward.can_redeem" |
| 67 | @click="handleRedeem" | 67 | @click="handleRedeem" |
| 68 | > | 68 | > |
| ... | @@ -79,6 +79,8 @@ import { getUserProfileAPI } from '@/api/user'; | ... | @@ -79,6 +79,8 @@ import { getUserProfileAPI } from '@/api/user'; |
| 79 | import { handleSharePageAuth, addShareFlag } from '@/utils/authRedirect'; | 79 | import { handleSharePageAuth, addShareFlag } from '@/utils/authRedirect'; |
| 80 | // 导入接口 | 80 | // 导入接口 |
| 81 | import { getCouponDetailAPI, redeemCouponAPI } from '@/api/coupon'; | 81 | import { getCouponDetailAPI, redeemCouponAPI } from '@/api/coupon'; |
| 82 | +// 导入主题颜色 | ||
| 83 | +import { THEME_COLORS } from '@/utils/config'; | ||
| 82 | 84 | ||
| 83 | const isCreator = ref(false); | 85 | const isCreator = ref(false); |
| 84 | const couponId = ref(''); | 86 | const couponId = ref(''); | ... | ... |
| ... | @@ -145,7 +145,7 @@ | ... | @@ -145,7 +145,7 @@ |
| 145 | import { ref, onMounted } from 'vue'; | 145 | import { ref, onMounted } from 'vue'; |
| 146 | import Taro from '@tarojs/taro'; | 146 | import Taro from '@tarojs/taro'; |
| 147 | import { Left, Photograph, Close } from '@nutui/icons-vue-taro'; | 147 | import { Left, Photograph, Close } from '@nutui/icons-vue-taro'; |
| 148 | -import BASE_URL from '@/utils/config'; | 148 | +import BASE_URL, { THEME_COLORS } from '@/utils/config'; |
| 149 | 149 | ||
| 150 | // | 150 | // |
| 151 | const playIcon = 'https://cdn.ipadbiz.cn/lls_prog/icon/play.svg'; | 151 | const playIcon = 'https://cdn.ipadbiz.cn/lls_prog/icon/play.svg'; | ... | ... |
| 1 | /* | 1 | /* |
| 2 | * @Date: 2022-09-19 14:11:06 | 2 | * @Date: 2022-09-19 14:11:06 |
| 3 | * @LastEditors: hookehuyr hookehuyr@gmail.com | 3 | * @LastEditors: hookehuyr hookehuyr@gmail.com |
| 4 | - * @LastEditTime: 2025-09-06 13:24:57 | 4 | + * @LastEditTime: 2025-09-08 14:00:36 |
| 5 | * @FilePath: /lls_program/src/utils/config.js | 5 | * @FilePath: /lls_program/src/utils/config.js |
| 6 | * @Description: 环境配置文件 - 根据小程序运行环境自动切换API地址 | 6 | * @Description: 环境配置文件 - 根据小程序运行环境自动切换API地址 |
| 7 | */ | 7 | */ |
| ... | @@ -42,3 +42,14 @@ export default BASE_URL; | ... | @@ -42,3 +42,14 @@ export default BASE_URL; |
| 42 | 42 | ||
| 43 | // 默认封面图片地址 | 43 | // 默认封面图片地址 |
| 44 | export const DEFAULT_COVER_IMG = 'https://images.unsplash.com/photo-1558981806-ec527fa84c39?ixlib=rb-1.2.1&auto=format&fit=crop&w=800&q=60' | 44 | export const DEFAULT_COVER_IMG = 'https://images.unsplash.com/photo-1558981806-ec527fa84c39?ixlib=rb-1.2.1&auto=format&fit=crop&w=800&q=60' |
| 45 | + | ||
| 46 | +// 主题颜色配置 | ||
| 47 | +export const THEME_COLORS = { | ||
| 48 | + // 主题蓝色 - 可统一调整 | ||
| 49 | + PRIMARY: '#4A90E2', | ||
| 50 | + // 其他颜色可以在这里添加 | ||
| 51 | + SECONDARY: '#6B7280', | ||
| 52 | + SUCCESS: '#10B981', | ||
| 53 | + WARNING: '#F59E0B', | ||
| 54 | + ERROR: '#EF4444' | ||
| 55 | +} | ... | ... |
-
Please register or login to post a comment