取消项目创建阶段的视频时长选择

This commit is contained in:
Azmat@qq.com
2026-08-14 18:23:55 +08:00
parent 01698e28fc
commit 36e91aab3c
+6 -31
View File
@@ -11,14 +11,7 @@ import "../project-wizard-page.css";
const PROJ_PAGE_SIZE = 10; // 项目列表/网格每页条数 const PROJ_PAGE_SIZE = 10; // 项目列表/网格每页条数
// 时长 / 脚本风格 / 人设 — 与 projects-new.html 基线对齐(创建页仅作视觉选择, // 创建页只保留商品与项目名;时长在脚本阶段统一落定,避免前置参数脱钩。
// 脚本走向细节进入 Stage 1;onCreate 契约只携带 name + product)。
const WIZ_DURATIONS = [
{ id: "0-15", label: "0-15 秒", shots: [4, 5], tag: "精准短片", note: "适合短平快投放" },
{ id: "0-30", label: "0-30 秒", shots: [6, 8], tag: "卖点展开", note: "适合卖点展开" },
{ id: "0-60", label: "0-60 秒", shots: [10, 12], tag: "故事化", note: "适合故事化表达" }
];
const WIZ_PAGE_SIZE = 7; // 4 列 × 2 行 = 8 格,首格为「创建新商品」→ 每页 7 商品 const WIZ_PAGE_SIZE = 7; // 4 列 × 2 行 = 8 格,首格为「创建新商品」→ 每页 7 商品
type WizProductPayload = { type WizProductPayload = {
@@ -61,8 +54,7 @@ export function ProjectWizardPage({ products, projects = [], preselectProductId,
// 新建商品 · 右侧抽屉开关(抽屉实现与商品库共用 ProductCreateDrawer,保证同一流程) // 新建商品 · 右侧抽屉开关(抽屉实现与商品库共用 ProductCreateDrawer,保证同一流程)
const [npOpen, setNpOpen] = useState(false); const [npOpen, setNpOpen] = useState(false);
// Step 2 · 配置(基础配置只保留项目名 + 成片时长;脚本风格/人物设定已移到流水线第 1 步脚本助手) // Step 2 · 配置(基础配置只保留项目名脚本风格/人物设定与时长都在流水线第 1 步统一落定)
const [duration, setDuration] = useState<string | null>("0-15");
const [points, setPoints] = useState<Record<string, boolean>>({}); const [points, setPoints] = useState<Record<string, boolean>>({});
useEffect(() => { useEffect(() => {
@@ -129,11 +121,9 @@ export function ProjectWizardPage({ products, projects = [], preselectProductId,
setNpOpen(true); setNpOpen(true);
} }
const durObj = WIZ_DURATIONS.find((d) => d.id === duration);
const product1Done = !!productId; const product1Done = !!productId;
// 信息没填完(项目名 < 2 字 / 未选时长)时「开始」禁用 // 项目创建只要求选商品 + 输入项目名;时长在脚本阶段确认,避免阶段前置参数脱钩
const config2Done = !!durObj && name.trim().length >= 2; const config2Done = name.trim().length >= 2;
const canStart = product1Done && config2Done; const canStart = product1Done && config2Done;
// 提交中状态:创建项目后 App 端全量刷新需数秒,按钮要给「创建中…」反馈,避免用户以为没点上 // 提交中状态:创建项目后 App 端全量刷新需数秒,按钮要给「创建中…」反馈,避免用户以为没点上
@@ -150,7 +140,6 @@ export function ProjectWizardPage({ products, projects = [], preselectProductId,
product: product.id, product: product.id,
metadata: { metadata: {
wizard: { wizard: {
duration,
selling_point_ids: selectedPoints selling_point_ids: selectedPoints
} }
} }
@@ -197,7 +186,7 @@ export function ProjectWizardPage({ products, projects = [], preselectProductId,
) : "2"}</div> ) : "2"}</div>
<div> <div>
<div className="label"></div> <div className="label"></div>
<div className="desc">{durObj ? `${durObj.label} · ${name.trim() || "未命名"}` : "项目名 · 成片时长"}</div> <div className="desc">{name.trim() || "未命名"}</div>
</div> </div>
</div> </div>
</nav> </nav>
@@ -298,7 +287,7 @@ export function ProjectWizardPage({ products, projects = [], preselectProductId,
<div className="wiz-pane"> <div className="wiz-pane">
<div className="wiz-step-h"> <div className="wiz-step-h">
<h2> 2 · </h2> <h2> 2 · </h2>
<p>线 1 </p> <p>线 1 </p>
</div> </div>
<div className="field"> <div className="field">
@@ -306,20 +295,6 @@ export function ProjectWizardPage({ products, projects = [], preselectProductId,
<input className="input" value={name} onChange={(event) => { setName(event.target.value); setNameTouched(true); }} /> <input className="input" value={name} onChange={(event) => { setName(event.target.value); setNameTouched(true); }} />
</div> </div>
<div className="field">
<label className="field-label"><span className="req">*</span></label>
<div className="opt-row">
{WIZ_DURATIONS.map((d) => (
<div className={`opt-card${duration === d.id ? " selected" : ""}`} key={d.id} onClick={() => setDuration(d.id)}>
<span className="badge">[ {d.tag} ]</span>
<h4>{d.label}</h4>
<div className="sub">{d.shots[0]}-{d.shots[1]} · 9:16</div>
<div className="note">{d.note}</div>
</div>
))}
</div>
</div>
{Object.keys(points).length > 0 && ( {Object.keys(points).length > 0 && (
<div className="field" style={{ marginBottom: 0 }}> <div className="field" style={{ marginBottom: 0 }}>
<label className="field-label">()</label> <label className="field-label">()</label>