Files
apple f6227c0253 feat: 黄精粉前端功能集成 + 个人中心/资产/公排页面优化 + 去除admin copyright
主要改动:
- 个人中心: 去除HjfMemberBadge徽章, 会员等级改显示vip_name,
  "我的资产"/"公排查询"导航项改为与member-points一致风格
- 我的资产页面: 去除HjfMemberBadge, 美化卡片圆角和阴影
- 公排查询页面: 美化顶部渐变和订单卡片样式
- Admin登录页和后台布局: 彻底删除footer copyright信息
- 新增黄精粉业务页面/组件/API/Mock数据(Phase 1)
- 新增PHP环境配置文档和启动脚本

Made-with: Cursor
2026-03-13 00:49:22 +08:00

46 lines
1.5 KiB
JavaScript
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
/**
* 黄精粉健康商城 - 公排相关 API
* 公排状态、公排历史记录
* @see docs/frontend-new-pages-spec.md 2.2.1
*/
import request from '@/utils/request.js';
import { getMockQueueStatus, getMockQueueHistory } from '@/utils/hjfMockData.js';
/** @type {boolean} 是否使用 Mock 数据Phase 4 集成时改为 false */
const USE_MOCK = true;
/**
* Mock 包装:返回与 request.get() 相同形状的 Promise
* 300ms 延迟模拟网络JSON 深拷贝防止数据突变
* @param {*} data - 要返回的数据
* @param {number} [delay=300] - 延迟毫秒数
* @returns {Promise<{ status: number, data: * }>}
*/
function mockResponse(data, delay = 300) {
return new Promise(resolve => {
setTimeout(() => {
resolve({ status: 200, data: JSON.parse(JSON.stringify(data)) });
}, delay);
});
}
/**
* 获取公排状态(我的排队 + 全局进度)
* @returns {Promise<{ status: number, data: { totalOrders: number, myOrders: Array, progress: Object } }>}
*/
export function getQueueStatus() {
if (USE_MOCK) return mockResponse(getMockQueueStatus());
return request.get('hjf/queue/status');
}
/**
* 获取公排历史记录(分页)
* @param {Object} [params] - 查询参数,如 page、limit
* @returns {Promise<{ status: number, data: { list: Array, count: number, page: number, limit: number } }>}
*/
export function getQueueHistory(params) {
if (USE_MOCK) return mockResponse(getMockQueueHistory());
return request.get('hjf/queue/history', params);
}