fix: 修复排行榜卡片和家庭排名页面的总家庭数显示问题
移除随机生成的家庭数,改为使用接口返回的真实数据 将数字滚动组件的位数固定为5位 在家庭参与排名文本前添加"+"符号
Showing
2 changed files
with
10 additions
and
12 deletions
| 1 | <!-- | 1 | <!-- |
| 2 | * @Date: 2025-01-09 00:00:00 | 2 | * @Date: 2025-01-09 00:00:00 |
| 3 | * @LastEditors: hookehuyr hookehuyr@gmail.com | 3 | * @LastEditors: hookehuyr hookehuyr@gmail.com |
| 4 | - * @LastEditTime: 2025-10-25 20:13:01 | 4 | + * @LastEditTime: 2025-10-27 09:49:49 |
| 5 | * @FilePath: /lls_program/src/components/RankingCard.vue | 5 | * @FilePath: /lls_program/src/components/RankingCard.vue |
| 6 | * @Description: 排行榜卡片组件 | 6 | * @Description: 排行榜卡片组件 |
| 7 | --> | 7 | --> |
| ... | @@ -52,11 +52,11 @@ | ... | @@ -52,11 +52,11 @@ |
| 52 | <NumberRoll | 52 | <NumberRoll |
| 53 | ref="numberRollRef" | 53 | ref="numberRollRef" |
| 54 | :target-value="currentTotalFamilySum" | 54 | :target-value="currentTotalFamilySum" |
| 55 | - :digit-count="currentTotalFamilySum.length" | 55 | + :digit-count="5" |
| 56 | :duration="1500" | 56 | :duration="1500" |
| 57 | :digit-delay="150" | 57 | :digit-delay="150" |
| 58 | /> | 58 | /> |
| 59 | - <text class="ml-2" style="font-size: 28rpx;">组家庭参与排名</text> | 59 | + <text class="ml-2" style="font-size: 28rpx;"><text class="mr-1 text-base">+</text>组家庭参与排名</text> |
| 60 | </view> | 60 | </view> |
| 61 | </view> | 61 | </view> |
| 62 | 62 | ||
| ... | @@ -333,9 +333,8 @@ const loadLeaderboardData = async (isInitialLoad = false) => { | ... | @@ -333,9 +333,8 @@ const loadLeaderboardData = async (isInitialLoad = false) => { |
| 333 | } | 333 | } |
| 334 | // 设置当前日期 | 334 | // 设置当前日期 |
| 335 | currentDate.value = response.data.yesterday | 335 | currentDate.value = response.data.yesterday |
| 336 | - // TODO: 设置总家庭数 | 336 | + // 设置总家庭数 |
| 337 | - // 生成随机的4位数 | 337 | + currentTotalFamilySum.value = response.data.family_count || 0; |
| 338 | - currentTotalFamilySum.value = Math.floor(1000 + Math.random() * 9000); | ||
| 339 | } | 338 | } |
| 340 | } catch (error) { | 339 | } catch (error) { |
| 341 | console.error('获取排行榜数据失败:', error) | 340 | console.error('获取排行榜数据失败:', error) | ... | ... |
| 1 | <!-- | 1 | <!-- |
| 2 | * @Date: 2025-09-01 13:07:52 | 2 | * @Date: 2025-09-01 13:07:52 |
| 3 | * @LastEditors: hookehuyr hookehuyr@gmail.com | 3 | * @LastEditors: hookehuyr hookehuyr@gmail.com |
| 4 | - * @LastEditTime: 2025-10-25 19:36:34 | 4 | + * @LastEditTime: 2025-10-27 09:51:02 |
| 5 | * @FilePath: /lls_program/src/pages/FamilyRank/index.vue | 5 | * @FilePath: /lls_program/src/pages/FamilyRank/index.vue |
| 6 | * @Description: 文件描述 | 6 | * @Description: 文件描述 |
| 7 | --> | 7 | --> |
| ... | @@ -51,11 +51,11 @@ | ... | @@ -51,11 +51,11 @@ |
| 51 | <NumberRoll | 51 | <NumberRoll |
| 52 | ref="numberRollRef" | 52 | ref="numberRollRef" |
| 53 | :target-value="currentTotalFamilySum" | 53 | :target-value="currentTotalFamilySum" |
| 54 | - :digit-count="currentTotalFamilySum.length" | 54 | + :digit-count="5" |
| 55 | :duration="1500" | 55 | :duration="1500" |
| 56 | :digit-delay="150" | 56 | :digit-delay="150" |
| 57 | /> | 57 | /> |
| 58 | - <text class="ml-2" style="font-size: 28rpx;">组家庭参与排名</text> | 58 | + <text class="ml-2" style="font-size: 28rpx;"><text class="mr-1 text-base">+</text>组家庭参与排名</text> |
| 59 | </view> | 59 | </view> |
| 60 | </view> | 60 | </view> |
| 61 | 61 | ||
| ... | @@ -370,9 +370,8 @@ const loadLeaderboardData = async (isInitialLoad = false) => { | ... | @@ -370,9 +370,8 @@ const loadLeaderboardData = async (isInitialLoad = false) => { |
| 370 | leaderboardData.value = response.data | 370 | leaderboardData.value = response.data |
| 371 | } | 371 | } |
| 372 | currentDate.value = response.data.yesterday | 372 | currentDate.value = response.data.yesterday |
| 373 | - // TODO: 设置总家庭数 | 373 | + // 设置总家庭数 |
| 374 | - // 生成随机的4位数 | 374 | + currentTotalFamilySum.value = response.data.family_count || 0; |
| 375 | - currentTotalFamilySum.value = Math.floor(1000 + Math.random() * 9000); | ||
| 376 | } | 375 | } |
| 377 | } catch (error) { | 376 | } catch (error) { |
| 378 | console.error('获取排行榜数据失败:', error) | 377 | console.error('获取排行榜数据失败:', error) | ... | ... |
-
Please register or login to post a comment