在顾客详情页的“过往照片和AI发型模拟”区块中,替换当前未开发占位卡片,展示该顾客历史 AI 发型模拟生成结果。每一张生成图对应一张卡片,按创建时间倒序展示,点击卡片进入对应任务详情页。
继续使用顾客详情页现有“过往照片和AI发型模拟”区块,不改变整体页面骨架、标题和右上角“AI发型模拟”入口按钮位置。
simulationId 下出现多张卡片属于预期行为/:locale/simulation/result/:simulationIdGET /api/v1/simulations/customer/:customerId/gallery返回扁平化卡片列表,而不是主任务嵌套结构。每条记录代表一张生成图卡片。
建议 DTO:
export type CustomerSimulationGalleryItemDto = {
simulationId: string;
taskId: string;
imageUrl: string;
templateName: string;
createdAt: string;
taskStatus: 'SUCCESSES';
};
响应示例:
{
"items": [
{
"simulationId": "91",
"taskId": "task-11",
"imageUrl": "https://cdn.example.com/result-1.png",
"templateName": "Layer Bob",
"createdAt": "2026-06-28T09:00:00.000Z",
"taskStatus": "SUCCESSES"
}
]
}
ai_hair_simulationai_hair_simulation_task 中 task_status = 'SUCCESSES' 的任务result_images 中展开真实图片列表create_time 倒序输出ai_hair_simulationai_hair_simulation_taskhair_template.template_namecustomerId 属于当前发型师在 frontend/src/services/api/simulations.ts 中新增顾客详情页所需的 gallery 查询方法,并在 contracts.ts 中补齐对应类型。
建议签名:
export async function listCustomerSimulationGallery(
customerId: string,
): Promise<{ items: CustomerSimulationGalleryItem[] }>
在 CustomerDetailPage.tsx 中替换原有 photoPlaceholders 占位卡片渲染逻辑:
Linkpath(\/simulation/result/${simulationId}`)`每张卡片展示:
imageUrltemplateNamecreatedAt 的格式化日期时间result_images 为空数组: