refactor(主题样式): 统一使用CSS变量定义主题颜色
将硬编码的主题颜色替换为CSS变量(--primary-color等),提高样式可维护性
Showing
5 changed files
with
19 additions
and
10 deletions
| ... | @@ -2,14 +2,23 @@ | ... | @@ -2,14 +2,23 @@ |
| 2 | @tailwind components; | 2 | @tailwind components; |
| 3 | @tailwind utilities; | 3 | @tailwind utilities; |
| 4 | 4 | ||
| 5 | +/* 主题色调定义 */ | ||
| 6 | +:root { | ||
| 7 | + --primary-color: #54ABAE; | ||
| 8 | + --secondary-color: #6B7280; | ||
| 9 | + --success-color: #10B981; | ||
| 10 | + --warning-color: #F59E0B; | ||
| 11 | + --error-color: #EF4444; | ||
| 12 | +} | ||
| 13 | + | ||
| 5 | .bg-blue-500 { | 14 | .bg-blue-500 { |
| 6 | - background-color: #54ABAE !important; | 15 | + background-color: var(--primary-color) !important; |
| 7 | } | 16 | } |
| 8 | 17 | ||
| 9 | .text-blue-500 { | 18 | .text-blue-500 { |
| 10 | - color: #54ABAE !important; | 19 | + color: var(--primary-color) !important; |
| 11 | } | 20 | } |
| 12 | 21 | ||
| 13 | .border-blue-500 { | 22 | .border-blue-500 { |
| 14 | - border-color: #54ABAE !important; | 23 | + border-color: var(--primary-color) !important; |
| 15 | } | 24 | } | ... | ... |
| ... | @@ -471,7 +471,7 @@ const handleGoToRewards = () => { | ... | @@ -471,7 +471,7 @@ const handleGoToRewards = () => { |
| 471 | transform: translate(-50%, -50%); | 471 | transform: translate(-50%, -50%); |
| 472 | width: 200rpx; | 472 | width: 200rpx; |
| 473 | height: 200rpx; | 473 | height: 200rpx; |
| 474 | - background: linear-gradient(135deg, #4A90E2, #4d96ea); | 474 | + background: linear-gradient(135deg, var(--primary-color), var(--primary-color)); |
| 475 | border-radius: 50%; | 475 | border-radius: 50%; |
| 476 | display: flex; | 476 | display: flex; |
| 477 | align-items: center; | 477 | align-items: center; |
| ... | @@ -508,7 +508,7 @@ const handleGoToRewards = () => { | ... | @@ -508,7 +508,7 @@ const handleGoToRewards = () => { |
| 508 | 508 | ||
| 509 | .floating-item { | 509 | .floating-item { |
| 510 | position: absolute; | 510 | position: absolute; |
| 511 | - background: rgb(100, 166, 240); | 511 | + background: var(--primary-color); |
| 512 | border-radius: 50%; | 512 | border-radius: 50%; |
| 513 | display: flex; | 513 | display: flex; |
| 514 | align-items: center; | 514 | align-items: center; | ... | ... |
| ... | @@ -186,7 +186,7 @@ const handleGoToPointsRule = () => { | ... | @@ -186,7 +186,7 @@ const handleGoToPointsRule = () => { |
| 186 | transform: translate(-50%, -50%); | 186 | transform: translate(-50%, -50%); |
| 187 | width: 170rpx; | 187 | width: 170rpx; |
| 188 | height: 170rpx; | 188 | height: 170rpx; |
| 189 | - background: linear-gradient(135deg, #4A90E2, #4d96ea); | 189 | + background: linear-gradient(135deg, var(--primary-color), var(--primary-color)); |
| 190 | border-radius: 50%; | 190 | border-radius: 50%; |
| 191 | display: flex; | 191 | display: flex; |
| 192 | align-items: center; | 192 | align-items: center; | ... | ... |
| 1 | <!-- | 1 | <!-- |
| 2 | * @Date: 2025-01-15 10:00:00 | 2 | * @Date: 2025-01-15 10:00:00 |
| 3 | * @LastEditors: hookehuyr hookehuyr@gmail.com | 3 | * @LastEditors: hookehuyr hookehuyr@gmail.com |
| 4 | - * @LastEditTime: 2025-09-03 14:54:12 | 4 | + * @LastEditTime: 2025-09-09 10:57:42 |
| 5 | * @FilePath: /lls_program/src/pages/CheckinList/index.vue | 5 | * @FilePath: /lls_program/src/pages/CheckinList/index.vue |
| 6 | * @Description: 打卡列表页面 - 显示已打卡的地点列表 | 6 | * @Description: 打卡列表页面 - 显示已打卡的地点列表 |
| 7 | --> | 7 | --> |
| ... | @@ -36,7 +36,7 @@ | ... | @@ -36,7 +36,7 @@ |
| 36 | v-if="location.checkedIn && location.hasPhoto" | 36 | v-if="location.checkedIn && location.hasPhoto" |
| 37 | type="primary" | 37 | type="primary" |
| 38 | size="normal" | 38 | size="normal" |
| 39 | - color="#4d96ea" | 39 | + :color="THEME_COLORS.PRIMARY" |
| 40 | @click="viewPhoto(location)" | 40 | @click="viewPhoto(location)" |
| 41 | > | 41 | > |
| 42 | 查看照片 | 42 | 查看照片 |
| ... | @@ -249,7 +249,7 @@ const loadCheckinData = async () => { | ... | @@ -249,7 +249,7 @@ const loadCheckinData = async () => { |
| 249 | 249 | ||
| 250 | .progress-info { | 250 | .progress-info { |
| 251 | font-size: 26rpx; | 251 | font-size: 26rpx; |
| 252 | - color: v-bind('THEME_COLORS.PRIMARY'); | 252 | + color: var(--primary-color); |
| 253 | background-color: #EBF4FF; | 253 | background-color: #EBF4FF; |
| 254 | padding: 12rpx 20rpx; | 254 | padding: 12rpx 20rpx; |
| 255 | border-radius: 20rpx; | 255 | border-radius: 20rpx; | ... | ... |
-
Please register or login to post a comment