hookehuyr

fix: 修复排行榜卡片和家庭排名页面的总家庭数显示问题

移除随机生成的家庭数,改为使用接口返回的真实数据
将数字滚动组件的位数固定为5位
在家庭参与排名文本前添加"+"符号
<!--
* @Date: 2025-01-09 00:00:00
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2025-10-25 20:13:01
* @LastEditTime: 2025-10-27 09:49:49
* @FilePath: /lls_program/src/components/RankingCard.vue
* @Description: 排行榜卡片组件
-->
......@@ -52,11 +52,11 @@
<NumberRoll
ref="numberRollRef"
:target-value="currentTotalFamilySum"
:digit-count="currentTotalFamilySum.length"
:digit-count="5"
:duration="1500"
:digit-delay="150"
/>
<text class="ml-2" style="font-size: 28rpx;">组家庭参与排名</text>
<text class="ml-2" style="font-size: 28rpx;"><text class="mr-1 text-base">+</text>组家庭参与排名</text>
</view>
</view>
......@@ -333,9 +333,8 @@ const loadLeaderboardData = async (isInitialLoad = false) => {
}
// 设置当前日期
currentDate.value = response.data.yesterday
// TODO: 设置总家庭数
// 生成随机的4位数
currentTotalFamilySum.value = Math.floor(1000 + Math.random() * 9000);
// 设置总家庭数
currentTotalFamilySum.value = response.data.family_count || 0;
}
} catch (error) {
console.error('获取排行榜数据失败:', error)
......
<!--
* @Date: 2025-09-01 13:07:52
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2025-10-25 19:36:34
* @LastEditTime: 2025-10-27 09:51:02
* @FilePath: /lls_program/src/pages/FamilyRank/index.vue
* @Description: 文件描述
-->
......@@ -51,11 +51,11 @@
<NumberRoll
ref="numberRollRef"
:target-value="currentTotalFamilySum"
:digit-count="currentTotalFamilySum.length"
:digit-count="5"
:duration="1500"
:digit-delay="150"
/>
<text class="ml-2" style="font-size: 28rpx;">组家庭参与排名</text>
<text class="ml-2" style="font-size: 28rpx;"><text class="mr-1 text-base">+</text>组家庭参与排名</text>
</view>
</view>
......@@ -370,9 +370,8 @@ const loadLeaderboardData = async (isInitialLoad = false) => {
leaderboardData.value = response.data
}
currentDate.value = response.data.yesterday
// TODO: 设置总家庭数
// 生成随机的4位数
currentTotalFamilySum.value = Math.floor(1000 + Math.random() * 9000);
// 设置总家庭数
currentTotalFamilySum.value = response.data.family_count || 0;
}
} catch (error) {
console.error('获取排行榜数据失败:', error)
......