refactor(components): 调整积分规则提示位置并优化样式
将积分规则提示从 PointsCollector 组件移至 Dashboard 页面 优化头部和底部容器的 padding 值 移除不再使用的 CSS 样式代码
Showing
3 changed files
with
79 additions
and
63 deletions
| ... | @@ -7,11 +7,6 @@ | ... | @@ -7,11 +7,6 @@ |
| 7 | 7 | ||
| 8 | <!-- 积分收集器主体 --> | 8 | <!-- 积分收集器主体 --> |
| 9 | <view class="points-collector" :style="{ height: height }"> | 9 | <view class="points-collector" :style="{ height: height }"> |
| 10 | - <!-- 积分规则提示 --> | ||
| 11 | - <view class="points-rule-tip" @tap="handleGoToPointsRule"> | ||
| 12 | - <view class="tip-icon">💡</view> | ||
| 13 | - <text class="tip-text">积分规则</text> | ||
| 14 | - </view> | ||
| 15 | 10 | ||
| 16 | <!-- 中心圆形显示总积分 --> | 11 | <!-- 中心圆形显示总积分 --> |
| 17 | <view class="center-circle"> | 12 | <view class="center-circle"> |
| ... | @@ -436,14 +431,7 @@ const handleGoToRewards = () => { | ... | @@ -436,14 +431,7 @@ const handleGoToRewards = () => { |
| 436 | }) | 431 | }) |
| 437 | } | 432 | } |
| 438 | 433 | ||
| 439 | -/** | 434 | + |
| 440 | - * 处理积分规则点击事件 | ||
| 441 | - */ | ||
| 442 | -const handleGoToPointsRule = () => { | ||
| 443 | - Taro.navigateTo({ | ||
| 444 | - url: '/pages/PointsList/index' | ||
| 445 | - }) | ||
| 446 | -} | ||
| 447 | 435 | ||
| 448 | </script> | 436 | </script> |
| 449 | 437 | ||
| ... | @@ -456,9 +444,14 @@ const handleGoToPointsRule = () => { | ... | @@ -456,9 +444,14 @@ const handleGoToPointsRule = () => { |
| 456 | overflow: hidden; | 444 | overflow: hidden; |
| 457 | } | 445 | } |
| 458 | 446 | ||
| 459 | -.points-collector-header, | 447 | +.points-collector-header { |
| 448 | + padding: 40rpx; | ||
| 449 | + padding-bottom: 20rpx; | ||
| 450 | +} | ||
| 451 | + | ||
| 460 | .points-collector-footer { | 452 | .points-collector-footer { |
| 461 | padding: 40rpx; | 453 | padding: 40rpx; |
| 454 | + padding-top: 20rpx; | ||
| 462 | } | 455 | } |
| 463 | 456 | ||
| 464 | .points-collector { | 457 | .points-collector { |
| ... | @@ -469,29 +462,7 @@ const handleGoToPointsRule = () => { | ... | @@ -469,29 +462,7 @@ const handleGoToPointsRule = () => { |
| 469 | overflow: hidden; | 462 | overflow: hidden; |
| 470 | } | 463 | } |
| 471 | 464 | ||
| 472 | -.points-rule-tip { | ||
| 473 | - position: absolute; | ||
| 474 | - // background-color: white; | ||
| 475 | - top: 0rpx; | ||
| 476 | - right: 15rpx; | ||
| 477 | - display: flex; | ||
| 478 | - flex-direction: column; | ||
| 479 | - align-items: center; | ||
| 480 | - justify-content: center; | ||
| 481 | - z-index: 999; | ||
| 482 | - cursor: pointer; | ||
| 483 | -} | ||
| 484 | - | ||
| 485 | -.tip-icon { | ||
| 486 | - font-size: 32rpx; | ||
| 487 | - margin-bottom: 4rpx; | ||
| 488 | -} | ||
| 489 | 465 | ||
| 490 | -.tip-text { | ||
| 491 | - font-size: 20rpx; | ||
| 492 | - color: #666; | ||
| 493 | - line-height: 1; | ||
| 494 | -} | ||
| 495 | 466 | ||
| 496 | .center-circle { | 467 | .center-circle { |
| 497 | position: absolute; | 468 | position: absolute; | ... | ... |
| ... | @@ -142,9 +142,14 @@ const handleGoToPointsRule = () => { | ... | @@ -142,9 +142,14 @@ const handleGoToPointsRule = () => { |
| 142 | overflow: hidden; | 142 | overflow: hidden; |
| 143 | } | 143 | } |
| 144 | 144 | ||
| 145 | -.total-points-display-header, | 145 | +.points-collector-header { |
| 146 | -.total-points-display-footer { | ||
| 147 | padding: 40rpx; | 146 | padding: 40rpx; |
| 147 | + padding-bottom: 20rpx; | ||
| 148 | +} | ||
| 149 | + | ||
| 150 | +.points-collector-footer { | ||
| 151 | + padding: 40rpx; | ||
| 152 | + padding-top: 20rpx; | ||
| 148 | } | 153 | } |
| 149 | 154 | ||
| 150 | .total-points-display { | 155 | .total-points-display { |
| ... | @@ -156,29 +161,29 @@ const handleGoToPointsRule = () => { | ... | @@ -156,29 +161,29 @@ const handleGoToPointsRule = () => { |
| 156 | align-items: center; | 161 | align-items: center; |
| 157 | } | 162 | } |
| 158 | 163 | ||
| 159 | -.points-rule-tip { | 164 | +// .points-rule-tip { |
| 160 | - position: absolute; | 165 | +// position: absolute; |
| 161 | - // background-color: white; | 166 | +// // background-color: white; |
| 162 | - top: 0rpx; | 167 | +// top: 0rpx; |
| 163 | - right: 10rpx; | 168 | +// right: 10rpx; |
| 164 | - display: flex; | 169 | +// display: flex; |
| 165 | - flex-direction: column; | 170 | +// flex-direction: column; |
| 166 | - align-items: center; | 171 | +// align-items: center; |
| 167 | - justify-content: center; | 172 | +// justify-content: center; |
| 168 | - z-index: 999; | 173 | +// z-index: 999; |
| 169 | - cursor: pointer; | 174 | +// cursor: pointer; |
| 170 | -} | 175 | +// } |
| 171 | - | 176 | + |
| 172 | -.tip-icon { | 177 | +// .tip-icon { |
| 173 | - font-size: 32rpx; | 178 | +// font-size: 32rpx; |
| 174 | - margin-bottom: 4rpx; | 179 | +// margin-bottom: 4rpx; |
| 175 | -} | 180 | +// } |
| 176 | - | 181 | + |
| 177 | -.tip-text { | 182 | +// .tip-text { |
| 178 | - font-size: 20rpx; | 183 | +// font-size: 20rpx; |
| 179 | - color: #666; | 184 | +// color: #666; |
| 180 | - line-height: 1; | 185 | +// line-height: 1; |
| 181 | -} | 186 | +// } |
| 182 | 187 | ||
| 183 | .center-circle1 { | 188 | .center-circle1 { |
| 184 | position: absolute; | 189 | position: absolute; | ... | ... |
| ... | @@ -26,7 +26,7 @@ | ... | @@ -26,7 +26,7 @@ |
| 26 | <template v-if="!showTotalPointsOnly"> | 26 | <template v-if="!showTotalPointsOnly"> |
| 27 | <PointsCollector | 27 | <PointsCollector |
| 28 | ref="pointsCollectorRef" | 28 | ref="pointsCollectorRef" |
| 29 | - height="30vh" | 29 | + height="25vh" |
| 30 | :total-points="finalTotalPoints" | 30 | :total-points="finalTotalPoints" |
| 31 | :pending-points="pendingPoints" | 31 | :pending-points="pendingPoints" |
| 32 | :family-id="family_id" | 32 | :family-id="family_id" |
| ... | @@ -35,8 +35,13 @@ | ... | @@ -35,8 +35,13 @@ |
| 35 | > | 35 | > |
| 36 | <!-- 头部:今日步数 --> | 36 | <!-- 头部:今日步数 --> |
| 37 | <template #header> | 37 | <template #header> |
| 38 | - <view class="flex justify-between items-center mb-1"> | 38 | + <view class="flex justify-between items-center mb-1 relative"> |
| 39 | <span class="text-gray-500">今日</span> | 39 | <span class="text-gray-500">今日</span> |
| 40 | + <!-- 积分规则提示 --> | ||
| 41 | + <view class="points-rule-tip" @tap="handleGoToPointsRule"> | ||
| 42 | + <view class="tip-icon">💡</view> | ||
| 43 | + <text class="tip-text">积分规则</text> | ||
| 44 | + </view> | ||
| 40 | </view> | 45 | </view> |
| 41 | <view class="flex justify-between items-center"> | 46 | <view class="flex justify-between items-center"> |
| 42 | <view class="flex items-baseline"> | 47 | <view class="flex items-baseline"> |
| ... | @@ -362,6 +367,15 @@ const openFamilyRank = () => { | ... | @@ -362,6 +367,15 @@ const openFamilyRank = () => { |
| 362 | Taro.navigateTo({ url: '/pages/FamilyRank/index' }); | 367 | Taro.navigateTo({ url: '/pages/FamilyRank/index' }); |
| 363 | } | 368 | } |
| 364 | 369 | ||
| 370 | +/** | ||
| 371 | + * 处理积分规则点击事件 | ||
| 372 | + */ | ||
| 373 | +const handleGoToPointsRule = () => { | ||
| 374 | + Taro.navigateTo({ | ||
| 375 | + url: '/pages/PointsList/index' | ||
| 376 | + }) | ||
| 377 | +} | ||
| 378 | + | ||
| 365 | const family_id = ref(''); | 379 | const family_id = ref(''); |
| 366 | const totalFamilySteps = ref(0); | 380 | const totalFamilySteps = ref(0); |
| 367 | 381 | ||
| ... | @@ -436,3 +450,29 @@ useReady(async () => { | ... | @@ -436,3 +450,29 @@ useReady(async () => { |
| 436 | }); | 450 | }); |
| 437 | }) | 451 | }) |
| 438 | </script> | 452 | </script> |
| 453 | + | ||
| 454 | +<style lang="less"> | ||
| 455 | +.points-rule-tip { | ||
| 456 | + position: absolute; | ||
| 457 | + // background-color: white; | ||
| 458 | + top: -35rpx; | ||
| 459 | + right: -25rpx; | ||
| 460 | + display: flex; | ||
| 461 | + flex-direction: column; | ||
| 462 | + align-items: center; | ||
| 463 | + justify-content: center; | ||
| 464 | + z-index: 999; | ||
| 465 | + cursor: pointer; | ||
| 466 | +} | ||
| 467 | + | ||
| 468 | +.tip-icon { | ||
| 469 | + font-size: 32rpx; | ||
| 470 | + margin-bottom: 4rpx; | ||
| 471 | +} | ||
| 472 | + | ||
| 473 | +.tip-text { | ||
| 474 | + font-size: 20rpx; | ||
| 475 | + color: #666; | ||
| 476 | + line-height: 1; | ||
| 477 | +} | ||
| 478 | +</style> | ... | ... |
-
Please register or login to post a comment