fix(product-detail): 修素材类型标签映射 + 审核态只显送审类
- PD_ASSET_TYPE_LABEL 改对并补全:person→角色(原误为「模特上身图」)、scene→场景(原误为 「平台套图」)、补 model_portrait/model_tryon/platform_kit/free_create/storyboard/video_clip (老数据里分镜=scene、形象图=person 因此前张冠李戴) - 审核态(火山人像审核)只渲染在送审三类(person/tri_view/storyboard)上;其余素材根本不送审, 此前一律标「待审核」是误导,现不显 验收:tsc+build 绿;无头核对(角色显「角色」+待审核、商品图无审核态、0 console error) Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -545,9 +545,22 @@ function pdAssetPreview(asset?: Asset): string {
|
||||
if (!asset) return "";
|
||||
return asset.files?.find((file) => file.is_primary)?.preview_url || asset.files?.[0]?.preview_url || "";
|
||||
}
|
||||
// AI 素材分类 → 中文类型标签(用于缩图左上角 type-pill)
|
||||
// 送审类(火山人像审核真实作用的只有视频流程人脸三类):只有这几类才显审核态
|
||||
const PD_REVIEW_CATS = new Set(["person", "tri_view", "storyboard"]);
|
||||
// AI 素材分类 → 中文类型标签(用于缩图左上角 type-pill)。与资产库 CATEGORY_LABELS 保持一致。
|
||||
const PD_ASSET_TYPE_LABEL: Record<string, string> = {
|
||||
product_image: "商品图", person: "模特上身图", scene: "平台套图", tri_view: "三视图", background: "背景图"
|
||||
product_image: "商品图",
|
||||
person: "角色",
|
||||
model_portrait: "模特形象图",
|
||||
tri_view: "三视图",
|
||||
model_tryon: "模特上身图",
|
||||
platform_kit: "平台套图",
|
||||
free_create: "自由创作",
|
||||
scene: "场景",
|
||||
storyboard: "分镜图",
|
||||
video_clip: "视频素材",
|
||||
final_video: "最终成片",
|
||||
background: "背景图"
|
||||
};
|
||||
function pdAssetTypeLabel(asset: Asset): string {
|
||||
return PD_ASSET_TYPE_LABEL[asset.category] || PD_ASSET_TYPE_LABEL[asset.asset_type] || asset.category || "素材";
|
||||
@@ -1086,8 +1099,11 @@ export function ProductDetailPage({ product, projects, initialTab = "assets", na
|
||||
{url ? null : <span className="ph-frame">3:4</span>}
|
||||
</div>
|
||||
<div className="meta">
|
||||
{/* 审核状态(只读):团队审核给出 通过 / 不通过,未定论显示 待审核 —— 不再是可点切换的按钮 */}
|
||||
<span className={`pill ${status}`} data-status={status} title="素材审核状态 · 由团队审核决定">{PD_ASSET_STATUS_LABEL[status]}</span>
|
||||
{/* 审核状态(只读):仅视频流程人脸三类(角色/三视图/分镜)才真送火山审核 → 才显审核态;
|
||||
其余素材无需审核,不显(此前一律标「待审核」是误导)。 */}
|
||||
{PD_REVIEW_CATS.has(asset.category) && (
|
||||
<span className={`pill ${status}`} data-status={status} title="火山人像审核状态(仅含人脸的视频素材送审)">{PD_ASSET_STATUS_LABEL[status]}</span>
|
||||
)}
|
||||
<span className="date">{(asset.created_at || "").slice(0, 10)}</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user