diff --git a/.codex-tasks/template-audit-execution/raw/completion-evidence.json b/.codex-tasks/template-audit-execution/raw/completion-evidence.json index eec19bc..9cfda75 100644 --- a/.codex-tasks/template-audit-execution/raw/completion-evidence.json +++ b/.codex-tasks/template-audit-execution/raw/completion-evidence.json @@ -1,7 +1,7 @@ { "schemaVersion": 1, "scope": "模板完成证据登记,保留命令、日志与产物哈希", - "generatedAt": "2026-10-24T02:02:12.474Z", + "generatedAt": "2026-10-24T02:35:52.145Z", "templates": { "acheng-campus-food": { "real-manifest-interaction": { @@ -256,5 +256,5 @@ } } }, - "sourceTreeHash": "9d33ce8dbbddd34b91f045f49dc2316e36738ffec1429a93733d45d1b7b2a356" + "sourceTreeHash": "a5506179992f144e6b4afb0f0dfc295c5d722a5aadf7027fd785479a8276320f" } diff --git a/apps/admin/src/features/services/OfferingEditorModal.tsx b/apps/admin/src/features/services/OfferingEditorModal.tsx index 7e629eb..a328e22 100644 --- a/apps/admin/src/features/services/OfferingEditorModal.tsx +++ b/apps/admin/src/features/services/OfferingEditorModal.tsx @@ -13,6 +13,14 @@ import type { PreviewSelection, PreviewTarget } from "../brand/preview-selection import type { FormInstance } from "antd"; import "./ServicesPage.css"; +const OFFERING_BASE_FIELD_BINDINGS: Record = { + name: "offering.name", + summary: "offering.summary", + description: "offering.description", + priceText: "offering.priceText", + coverUrl: "offering.coverUrl", +}; + type OfferingEditorModalProps = { open: boolean; editingOffering: Offering | null; @@ -66,6 +74,23 @@ export function OfferingEditorModal({ ? { targetKey: previewSelectionTarget.key, recordId: editingOffering.id } : { targetKey: previewSelectionTarget.key } : undefined; + // 点选某个区块后,右侧只保留该区块真正会展示的字段;未点选时仍展示完整表单。 + const visibleBaseFields = (() => { + if (!selectedTarget) return undefined; + if (selectedTarget.source !== "offering") return new Set(); + const bindings = new Set(activePreviewBindings); + return new Set( + Object.entries(OFFERING_BASE_FIELD_BINDINGS) + .filter(([, binding]) => bindings.has(binding)) + .map(([name]) => name), + ); + })(); + const isBaseFieldVisible = (name: string) => !visibleBaseFields || visibleBaseFields.has(name); + const showDescriptionField = !hasTemplateDetailCopy && isBaseFieldVisible("description"); + const hasVisibleBaseFields = + ["kind", "name", "summary", "priceText", "coverUrl", "sortOrder", "isEnabled"].some((name) => + isBaseFieldVisible(name), + ) || showDescriptionField; // 点选区块后,在右侧滚动到并高亮对应的输入项;品牌通用区块没有对应输入项时只保留提示。 useEffect(() => { @@ -106,9 +131,11 @@ export function OfferingEditorModal({ showIcon title={previewPage === "offerings" ? "正在核对列表展示" : "正在核对详情展示"} description={ - previewPage === "offerings" - ? "右侧「列表展示」字段修改后,会实时反映在当前卡片。" - : "右侧「详情展示」字段修改后,会实时反映在当前详情内容。" + selectedTarget + ? `右侧只显示「${selectedTarget.label}」对应的字段,修改会实时反映在左侧预览;点击预览空白处或「查看全部字段」可恢复。` + : previewPage === "offerings" + ? "点击左侧区块后,右侧只显示该区块对应的字段;未点选时显示全部列表展示字段。" + : "点击左侧区块后,右侧只显示该区块对应的字段;未点选时显示全部详情展示字段。" } />
-

基础信息

- - - - - - - {!hasTemplateDetailCopy ? ( + {selectedTarget ? ( +
+
+ 正在编辑「{selectedTarget.label}」 +

+ 只显示这个区块对应的字段,其他字段已临时隐藏。 +

+
+ +
+ ) : null} + {hasVisibleBaseFields ?

基础信息

: null} + {isBaseFieldVisible("kind") ? ( + + + + ) : null} + {isBaseFieldVisible("summary") ? ( + + + + ) : null} + {showDescriptionField ? ( ) : null} - - - - - - - - - - - + + ) : null} + {isBaseFieldVisible("coverUrl") ? ( + + + + ) : null} + {isBaseFieldVisible("sortOrder") ? ( + + + + ) : null} + {isBaseFieldVisible("isEnabled") ? ( + +