diff --git a/apps/admin/src/features/services/ServicesPage.tsx b/apps/admin/src/features/services/ServicesPage.tsx index 6353dbf..083666b 100644 --- a/apps/admin/src/features/services/ServicesPage.tsx +++ b/apps/admin/src/features/services/ServicesPage.tsx @@ -28,8 +28,10 @@ import { readPresentationValue, } from "../brand/presentation-bindings.js"; import { MutationError, QueryState } from "../../components/QueryState.js"; +import { useNavigate } from "react-router-dom"; export function ServicesPage() { + const navigate = useNavigate(); const client = createApiClient(); const queryClient = useQueryClient(); const [offeringForm] = Form.useForm(); @@ -70,6 +72,13 @@ export function ServicesPage() { const detailSections = (workspace.data?.templateContent?.admin.sections ?? []).filter( (section) => section.target === "offering" && section.page === "detail", ); + const visualOfferingTarget = (workspace.data?.templateContent?.admin.sections ?? []) + .filter((section) => section.target === "offering" && section.page === "offerings") + .flatMap((section) => section.previewTargets ?? []) + .find((target) => templateFields.some((field) => field.previewTarget === target.key)) ?? { + key: "linjing-editorial.offerings.item", + label: "业务卡片", + }; const hasTemplateDetailCopy = templateFields.some( (field) => field.binding === "offering.config.details.background", ); @@ -320,6 +329,21 @@ export function ServicesPage() { 以下模板字段与小程序页面编辑的是同一份业务数据;可在此集中修改,也可到页面编辑中点选对应卡片。 + {editingOffering ? ( + + ) : null} ) : null}