/** * 仪表板相关 API */ /** * 获取仪表板简要信息 * @param {Object} params 请求参数 * @param {string} params.joinUserId 用户ID * @param {string[]} params.keys 需要获取的数据键名数组 * @returns {Promise} 返回仪表板简要信息 */ export const getDashboardBrief = ({ joinUserId, keys }) => { // 构建查询参数字符串 let params=[] if (joinUserId) { params = [`joinUserId=${joinUserId}`]; } if (keys && Array.isArray(keys)) { keys.forEach((key) => { params.push(`keys=${encodeURIComponent(key)}`); }); } const queryString = params.join('&'); return uni.$uv.http.get(`dashboard/brief?${queryString}`, { custom: { auth: true // 启用 token 认证 } }); }; /** * 获取客户统计排行榜 * @returns {Promise} 返回排行榜数据,包含 today、week、month 三个时间段的数据 */ export const getCustomerStatistics = () => { return uni.$uv.http.get('/dashboard/customer/statistics', { custom: { auth: true // 启用 token 认证 } }); };