hookehuyr

fix: 修正参数名current_country为current_county并修复排行榜显示逻辑

修复参数名拼写错误,将current_country统一改为current_county
修复排行榜页面加载时日期和前三名显示逻辑
1 /* 1 /*
2 * @Date: 2023-12-22 10:29:37 2 * @Date: 2023-12-22 10:29:37
3 * @LastEditors: hookehuyr hookehuyr@gmail.com 3 * @LastEditors: hookehuyr hookehuyr@gmail.com
4 - * @LastEditTime: 2025-09-09 13:11:17 4 + * @LastEditTime: 2025-09-09 14:56:34
5 * @FilePath: /lls_program/src/api/points.js 5 * @FilePath: /lls_program/src/api/points.js
6 * @Description: 文件描述 6 * @Description: 文件描述
7 */ 7 */
...@@ -51,7 +51,7 @@ export const getPointListAPI = (params) => fn(fetch.get(Api.POINT_LIST, params)) ...@@ -51,7 +51,7 @@ export const getPointListAPI = (params) => fn(fetch.get(Api.POINT_LIST, params))
51 /** 51 /**
52 * @description: 查询步数排行榜, 数据长度为10个, 不加上county参数查询的是上海数据, 数据长度是20个, 都是固定长度. 52 * @description: 查询步数排行榜, 数据长度为10个, 不加上county参数查询的是上海数据, 数据长度是20个, 都是固定长度.
53 * @param {Object} params - 请求参数 53 * @param {Object} params - 请求参数
54 - * @param {string} params.current_country - 是否只查我的当前家庭所在区县的排行榜。1=是,0=否。默认为否 54 + * @param {string} params.current_county - 是否只查我的当前家庭所在区县的排行榜。1=是,0=否。默认为否
55 * @returns {Object} response - 响应对象 55 * @returns {Object} response - 响应对象
56 * @returns {number} response.code - 响应状态码 56 * @returns {number} response.code - 响应状态码
57 * @returns {string} response.msg - 响应消息 57 * @returns {string} response.msg - 响应消息
......
...@@ -180,9 +180,9 @@ const loadLeaderboardData = async (isInitialLoad = false) => { ...@@ -180,9 +180,9 @@ const loadLeaderboardData = async (isInitialLoad = false) => {
180 loading.value = true 180 loading.value = true
181 const params = {} 181 const params = {}
182 182
183 - // 添加current_country参数:1=是,0=否,默认为否 183 + // 添加current_county参数:1=是,0=否,默认为否
184 // 根据activeTab动态设置:上海榜时为0,区域榜时为1 184 // 根据activeTab动态设置:上海榜时为0,区域榜时为1
185 - params.current_country = activeTab.value === 'shanghai' ? '0' : '1' 185 + params.current_county = activeTab.value === 'shanghai' ? '0' : '1'
186 186
187 const response = await getStepLeaderboardAPI(params) 187 const response = await getStepLeaderboardAPI(params)
188 if (response.code) { 188 if (response.code) {
...@@ -310,7 +310,7 @@ const myRank = computed(() => { ...@@ -310,7 +310,7 @@ const myRank = computed(() => {
310 * 页面初始化 310 * 页面初始化
311 */ 311 */
312 onMounted(async () => { 312 onMounted(async () => {
313 - // 直接加载排行榜数据,使用current_country参数获取当前家庭所在区县信息 313 + // 直接加载排行榜数据,使用current_county参数获取当前家庭所在区县信息
314 await loadLeaderboardData(true) 314 await loadLeaderboardData(true)
315 }) 315 })
316 </script> 316 </script>
......
...@@ -35,12 +35,12 @@ ...@@ -35,12 +35,12 @@
35 </view> 35 </view>
36 36
37 <!-- 排行榜日期 --> 37 <!-- 排行榜日期 -->
38 - <view class="rank-date"> 38 + <view v-if="!loading" class="rank-date">
39 {{ currentDate }} 39 {{ currentDate }}
40 </view> 40 </view>
41 41
42 <!-- 前三名展示 --> 42 <!-- 前三名展示 -->
43 - <view v-else-if="topThreeData.length > 0" class="top-three"> 43 + <view v-if="!loading && topThreeData.length > 0" class="top-three">
44 <!-- 第二名 --> 44 <!-- 第二名 -->
45 <view v-if="topThreeData[1]" class="rank-item second"> 45 <view v-if="topThreeData[1]" class="rank-item second">
46 <view class="crown crown-silver">👑</view> 46 <view class="crown crown-silver">👑</view>
...@@ -229,9 +229,9 @@ const loadLeaderboardData = async (isInitialLoad = false) => { ...@@ -229,9 +229,9 @@ const loadLeaderboardData = async (isInitialLoad = false) => {
229 loading.value = true 229 loading.value = true
230 const params = {} 230 const params = {}
231 231
232 - // 添加current_country参数:1=是,0=否,默认为否 232 + // 添加current_county参数:1=是,0=否,默认为否
233 // 根据activeTab动态设置:上海榜时为0,区域榜时为1 233 // 根据activeTab动态设置:上海榜时为0,区域榜时为1
234 - params.current_country = activeTab.value === 'shanghai' ? '0' : '1' 234 + params.current_county = activeTab.value === 'shanghai' ? '0' : '1'
235 235
236 const response = await getStepLeaderboardAPI(params) 236 const response = await getStepLeaderboardAPI(params)
237 if (response.code) { 237 if (response.code) {
...@@ -341,7 +341,7 @@ const myRankInfo = computed(() => { ...@@ -341,7 +341,7 @@ const myRankInfo = computed(() => {
341 * 页面初始化 341 * 页面初始化
342 */ 342 */
343 onMounted(async () => { 343 onMounted(async () => {
344 - // 直接加载排行榜数据,使用current_country参数获取当前家庭所在区县信息 344 + // 直接加载排行榜数据,使用current_county参数获取当前家庭所在区县信息
345 await loadLeaderboardData(true) 345 await loadLeaderboardData(true)
346 }) 346 })
347 </script> 347 </script>
......