hookehuyr

feat(排行榜): 重构家庭排行榜页面并优化数据加载逻辑

重构家庭排行榜页面,使用真实API数据替代模拟数据
添加加载状态和暂无数据提示
优化区域切换逻辑,自动显示用户所在区县
改进步数显示格式,支持万单位显示
...@@ -46,7 +46,7 @@ export const getPointRangesAPI = (params) => fn(fetch.get(Api.POINT_RANGES, para ...@@ -46,7 +46,7 @@ export const getPointRangesAPI = (params) => fn(fetch.get(Api.POINT_RANGES, para
46 /** 46 /**
47 * @description: 获取优惠券列表 47 * @description: 获取优惠券列表
48 * @param {Object} params - 查询参数 48 * @param {Object} params - 查询参数
49 - * @param {string} params.id - 优惠模块ID 49 + * @param {string} params.category_id - 优惠模块ID
50 * @param {string} params.keyword - 搜索关键词(可选) 50 * @param {string} params.keyword - 搜索关键词(可选)
51 * @param {string} params.point_range - 积分范围(可选) 51 * @param {string} params.point_range - 积分范围(可选)
52 * @param {string} params.sort - 排序字段(可选)ASC=从小到大,DESC=从大到小 52 * @param {string} params.sort - 排序字段(可选)ASC=从小到大,DESC=从大到小
......
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 11:49:32 4 + * @LastEditTime: 2025-09-09 13:11:17
5 * @FilePath: /lls_program/src/api/points.js 5 * @FilePath: /lls_program/src/api/points.js
6 * @Description: 文件描述 6 * @Description: 文件描述
7 */ 7 */
...@@ -49,9 +49,9 @@ export const collectPointAPI = (params) => fn(fetch.post(Api.COLLECT_POINT, para ...@@ -49,9 +49,9 @@ export const collectPointAPI = (params) => fn(fetch.post(Api.COLLECT_POINT, para
49 export const getPointListAPI = (params) => fn(fetch.get(Api.POINT_LIST, params)); 49 export const getPointListAPI = (params) => fn(fetch.get(Api.POINT_LIST, params));
50 50
51 /** 51 /**
52 - * @description: 查询步数排行榜, 加上county参数查询的是相关区域的数据, 数据长度为10个, 不加上county参数查询的是上海数据, 数据长度是20个, 都是固定长度. 52 + * @description: 查询步数排行榜, 数据长度为10个, 不加上county参数查询的是上海数据, 数据长度是20个, 都是固定长度.
53 * @param {Object} params - 请求参数 53 * @param {Object} params - 请求参数
54 - * @param {string} params.county - 区县 54 + * @param {string} params.current_country - 是否只查我的当前家庭所在区县的排行榜。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 - 响应消息
...@@ -71,5 +71,6 @@ export const getPointListAPI = (params) => fn(fetch.get(Api.POINT_LIST, params)) ...@@ -71,5 +71,6 @@ export const getPointListAPI = (params) => fn(fetch.get(Api.POINT_LIST, params))
71 * @returns {string} response.data.current_family[].created_by_nickname - 创建人昵称 71 * @returns {string} response.data.current_family[].created_by_nickname - 创建人昵称
72 * @returns {number} response.data.current_family[].step - 步数 72 * @returns {number} response.data.current_family[].step - 步数
73 * @returns {number} response.data.current_family[].rank - 排名 73 * @returns {number} response.data.current_family[].rank - 排名
74 + * @returns {number} response.data.current_family[].country - 区县
74 */ 75 */
75 export const getStepLeaderboardAPI = (params) => fn(fetch.get(Api.STEP_LEADERBOARD, params)); 76 export const getStepLeaderboardAPI = (params) => fn(fetch.get(Api.STEP_LEADERBOARD, params));
......
This diff is collapsed. Click to expand it.
...@@ -278,7 +278,7 @@ const fetchCouponList = async (reset = false) => { ...@@ -278,7 +278,7 @@ const fetchCouponList = async (reset = false) => {
278 sort: sortOrder.value.toUpperCase(), 278 sort: sortOrder.value.toUpperCase(),
279 page: reset ? 0 : currentPage.value, 279 page: reset ? 0 : currentPage.value,
280 limit: 10, 280 limit: 10,
281 - id: pageParams.value.id || undefined 281 + category_id: pageParams.value.id || undefined
282 }; 282 };
283 283
284 const { code, data } = await getCouponListAPI(params); 284 const { code, data } = await getCouponListAPI(params);
......