当前模板模块存在两个问题:
TemplateMakeTaskPage 提供的是“查看模板详情”入口,但用户当前真实后续动作是补充和确认模板基本信息。TemplateDetailPage 同时承担了详情展示和信息编辑职责,页面边界不清晰,不符合“新加一个编辑页面,并且只能编辑模板基本信息”的目标。本次设计将模板详情与模板编辑拆分:
本次改动完成后,应满足以下目标:
以下内容不在本次范围内:
当模板制作任务状态为 STEP2_SUCCESS 时:
任务页中的“返回模板列表”按钮保持不变。
模板详情页继续保留,作为展示页存在:
新增独立模板编辑页,路径与职责如下:
/:locale/templates/:templateId/edit允许编辑的字段:
templateNamestatuscategorytagsdescription不允许编辑的字段:
coverUrltemplateUrlrefHairUrlmodelUrlclothesUrlbackgroundUrl页面布局采用现有工作台编辑页骨架:
stylist-workbench-top ipad-top-space-margin mb-2新增路由:
templateEdit: '/:locale/templates/:templateId/edit'
路由注册到 App.tsx,使用登录保护,与其他工作台页面一致。
TemplateMakeTaskPage
TemplateDetailPage
TemplateEditPage
TemplateMakeTaskPage 轮询到 STEP2_SUCCESS/:locale/templates/:templateId/edittemplateId 请求模板基本信息新增接口:
GET /api/v1/templates/:templateId
职责:
返回字段最少包含:
{
"id": "43",
"templateName": "柔和层次长发",
"status": "DRAFT",
"category": "LONG",
"tags": ["层次", "首次建议"],
"description": "适合轻盈感修饰",
"coverUrl": "https://example.com/cover.jpg",
"templateUrl": "https://example.com/template.zip"
}
说明:
coverUrl / templateUrl,但允许后端返回,以便页面按需展示只读信息。新增接口:
PATCH /api/v1/templates/:templateId
仅允许更新以下字段:
{
"templateName": "空气感中长发",
"status": "PUBLIC",
"category": "MEDIUM",
"tags": ["空气感", "层次"],
"description": "适合脸部轮廓柔化"
}
后端必须保证:
模板模块新增两类能力:
getById(stylistId, templateId)updateBasicInfo(stylistId, templateId, dto)实现原则:
hair_template 为唯一事实来源hairstylist_id + id + is_deleted = 0 做范围限制tags 在数据库中仍按现有约定以逗号串存储,接口层负责数组与字符串之间的转换本次编辑页只能修改:
template_namestatuscategorytagsdescription以下字段必须保持只读:
cover_urltemplate_urlref_hair_urlmodel_urlclothes_urlbackground_urlis_system_templatehair_template_make_task 的全部字段至少覆盖以下场景:
/templates/:templateId/edit至少覆盖以下场景:
GET /templates/:templateId 成功返回模板基本信息GET /templates/:templateId 对不存在模板返回 404PATCH /templates/:templateId 可更新基本信息字段PATCH /templates/:templateId 不会改动非允许字段满足以下条件即视为本次需求完成: