diff --git a/AGENTS.md b/AGENTS.md index 200cb9e..d6083be 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -8,6 +8,7 @@ - The food template is supported, but it is an example template rather than the product definition. - Backend configuration is the source of truth for brand content, services, template selection, trust-building content, and industry-specific fields. The mini program only renders configuration and submits user input. - Template packages are the source of truth for template manifests, visual structure, default/sample content, field declarations, assets, and capabilities. Do not copy every template's sample data into Prisma seed or global database tables. A template's sample content may be copied into the database only when an administrator explicitly imports it for one specific brand; the resulting rows are brand content, not template registration. +- Templates have exactly one active package manifest/runtime contract. Do not add legacy readers, dual-write paths, inferred defaults, aliases, or silent fallbacks. Convert existing persisted data with a one-time, auditable migration that fails on ambiguity, then remove the old representation. - `apps/api/prisma/seed.ts` may contain a small, explicit development fixture for the seeded demo brands, but it must never become the catalog of all templates or require one seed block per production template. New templates must be discoverable and validated from their package manifest without editing global seed data. - Any delivered backend endpoint must have an automated test covering its authorization and successful behavior before it is considered complete. - Keep personal-brand trust details explicit: biography, positioning, credentials, portfolio/proof, process, expectations, availability, contact methods, and clear follow-up status. diff --git a/apps/admin/src/features/brand/component-renderers.jsx b/apps/admin/src/features/brand/component-renderers.jsx index d746106..09c8a72 100644 --- a/apps/admin/src/features/brand/component-renderers.jsx +++ b/apps/admin/src/features/brand/component-renderers.jsx @@ -17,11 +17,7 @@ function pageContent({ workspace, page }) { } export function resolveTemplateRenderer(workspace) { - const config = workspace?.brand?.config; - const key = - config && typeof config === "object" && !Array.isArray(config) - ? config.visualTemplateKey - : undefined; + const key = workspace?.visualTemplate?.key; if (typeof key !== "string") return null; if (resolvedRenderers.has(key)) return resolvedRenderers.get(key); const suffix = `/template-${key}/taro/index.tsx`; diff --git a/apps/admin/src/features/brand/presentation-editor-state.ts b/apps/admin/src/features/brand/presentation-editor-state.ts index ad01146..06d4dbc 100644 --- a/apps/admin/src/features/brand/presentation-editor-state.ts +++ b/apps/admin/src/features/brand/presentation-editor-state.ts @@ -111,8 +111,6 @@ export function useBrandSaveMutation({ return useMutation({ mutationFn: (values: PresentationValues) => { const nextConfig = applyPresentationValues(config, sections, values); - const contentConfig = { ...nextConfig }; - delete contentConfig.visualTemplateKey; const standard = applyStandardBrandValues( brand as unknown as Record, sections, @@ -124,7 +122,7 @@ export function useBrandSaveMutation({ key !== "config" && value !== (brand as unknown as Record)[key], ), ); - return createApiClient().updateAdminBrand({ ...changed, config: contentConfig }); + return createApiClient().updateAdminBrand({ ...changed, config: nextConfig }); }, onSuccess: () => { onSaved(); diff --git a/apps/admin/src/features/publication/PublicationPage.tsx b/apps/admin/src/features/publication/PublicationPage.tsx index 9bcbc3d..8f30d12 100644 --- a/apps/admin/src/features/publication/PublicationPage.tsx +++ b/apps/admin/src/features/publication/PublicationPage.tsx @@ -80,7 +80,7 @@ export function PublicationPage({ canManageTemplate }: { canManageTemplate: bool }; const mutations = usePublicationMutations({ refresh, - brandConfig: brand.data?.config, + currentTemplatePackageVersionId: workspace.data?.installations[0]?.templatePackageVersionId, onInstallClose: () => setIndustryTarget(null), onPublishClose: () => setConfirmAction(null), onNoteClear: () => setNote(""), @@ -104,16 +104,14 @@ export function PublicationPage({ canManageTemplate }: { canManageTemplate: bool workspace.data?.installations[0]?.templateKey ?? workspace.data?.brand?.templateKey ?? brand.data?.templateKey ?? - catalog.data?.industries[0]?.key ?? null; - const visuals = (catalog.data?.visuals ?? []).filter( + const selectablePackageVersions = (queries.packages.data?.items ?? []).filter( (item) => - typeof industryKey === "string" && item.supportedIndustryTemplates.includes(industryKey), + item.status === "published" && + typeof industryKey === "string" && + item.manifestSummary?.supportedIndustryTemplates.includes(industryKey), ); - const visualKey = - typeof brand.data?.config?.visualTemplateKey === "string" - ? brand.data.config.visualTemplateKey - : (visuals[0]?.key ?? null); + const visualKey = workspace.data?.installations[0]?.visualTemplateKey ?? null; const currentRelease = releases.data?.find((item) => item.status === "published"); const publishedHistory = (releases.data ?? []).filter( (item) => item.status === "published" || item.status === "superseded", @@ -182,8 +180,11 @@ export function PublicationPage({ canManageTemplate }: { canManageTemplate: bool value={visualKey} disabled={!canManageTemplate} loading={selectVisual.isPending} - options={visuals.map((item) => ({ value: item.key, label: item.name }))} - onChange={(key) => selectVisual.mutate(key)} + options={selectablePackageVersions.map((item) => ({ + value: item.id, + label: `${item.displayName} · ${item.version}`, + }))} + onChange={(versionId) => selectVisual.mutate(versionId)} /> {industryKey ? ( @@ -350,9 +351,7 @@ export function PublicationPage({ canManageTemplate }: { canManageTemplate: bool {sample.data && !sample.data.alreadyImported && (

来源:{sample.data.source.packageKey}@{sample.data.source.version} - {sample.data.source.contentChecksum - ? `(checksum ${sample.data.source.contentChecksum.slice(0, 12)})` - : "(兼容 registry 来源)"} + (checksum {(sample.data.source.contentChecksum ?? "").slice(0, 12)}) 。将向草稿添加{" "} {Object.entries(sample.data.counts) .map(([key, count]) => `${key} ${count} 项`) @@ -589,7 +588,15 @@ export function PublicationPage({ canManageTemplate }: { canManageTemplate: bool title="确认安装行业模板" open={industryTarget !== null} onCancel={() => setIndustryTarget(null)} - onOk={() => industryTarget && install.mutate({ key: industryTarget })} + okButtonProps={{ disabled: !templatePreview.data?.targetPackageVersionId }} + onOk={() => + industryTarget && + templatePreview.data?.targetPackageVersionId && + install.mutate({ + key: industryTarget, + versionId: templatePreview.data.targetPackageVersionId, + }) + } confirmLoading={install.isPending} > 模板会更新当前品牌的草稿结构,不会立即改变已发布的小程序。请安装后核对业务内容与视觉模板。 diff --git a/apps/admin/src/features/publication/use-publication-mutations.ts b/apps/admin/src/features/publication/use-publication-mutations.ts index 52b110e..b35318c 100644 --- a/apps/admin/src/features/publication/use-publication-mutations.ts +++ b/apps/admin/src/features/publication/use-publication-mutations.ts @@ -7,7 +7,7 @@ const client = createApiClient(); interface MutationOptions { refresh: () => void; - brandConfig: Record | null | undefined; + currentTemplatePackageVersionId: string | null | undefined; onInstallClose: () => void; onPublishClose: () => void; onNoteClear: () => void; @@ -20,11 +20,11 @@ export function usePublicationMutations({ onPublishClose, onNoteClear, onRollbackClose, - brandConfig, + currentTemplatePackageVersionId, }: MutationOptions) { const queryClient = useQueryClient(); const install = useMutation({ - mutationFn: ({ key, versionId }: { key: BrandTemplateKey; versionId?: string }) => + mutationFn: ({ key, versionId }: { key: BrandTemplateKey; versionId: string }) => client.installAdminTemplate(key, versionId), onSuccess: () => { onInstallClose(); @@ -55,12 +55,16 @@ export function usePublicationMutations({ }, }); const selectVisual = useMutation({ - mutationFn: (key: string) => - client.updateAdminBrand({ - config: { ...(brandConfig ?? {}), visualTemplateKey: key }, + mutationFn: (templatePackageVersionId: string) => + client.selectAdminTemplateVersion({ + templatePackageVersionId, + ...(currentTemplatePackageVersionId !== undefined + ? { expectedCurrentPackageVersionId: currentTemplatePackageVersionId } + : {}), + confirm: true, }), onSuccess: () => { - message.success("视觉模板已保存到草稿"); + message.success("模板版本已切换"); refresh(); }, }); diff --git a/apps/admin/src/features/publication/use-publication-queries.ts b/apps/admin/src/features/publication/use-publication-queries.ts index 7054bb9..0b5846c 100644 --- a/apps/admin/src/features/publication/use-publication-queries.ts +++ b/apps/admin/src/features/publication/use-publication-queries.ts @@ -24,6 +24,10 @@ export function usePublicationQueries( queryKey: ["publication-catalog"], queryFn: () => client.listPublicTemplates(), }); + const packages = useQuery>>({ + queryKey: ["publication-template-packages"], + queryFn: () => client.listAdminTemplatePackages({ page: 1, pageSize: 100 }), + }); const sample = useQuery>>({ queryKey: ["publication-sample", workspace.data?.installations[0]?.templatePackageVersionId], queryFn: () => @@ -82,6 +86,7 @@ export function usePublicationQueries( brand, workspace, catalog, + packages, readiness, releases, miniAppReleases, @@ -91,6 +96,7 @@ export function usePublicationQueries( brand, workspace, catalog, + packages, readiness, releases, miniAppReleases, @@ -100,6 +106,7 @@ export function usePublicationQueries( void brand.refetch(); void workspace.refetch(); void catalog.refetch(); + void packages.refetch(); void readiness.refetch(); void releases.refetch(); void miniAppReleases.refetch(); @@ -110,6 +117,7 @@ export function usePublicationQueries( brand, workspace, catalog, + packages, sample, readiness, releases, diff --git a/apps/api/prisma/migrations/20261018120000_enforce_single_template_contract/migration.sql b/apps/api/prisma/migrations/20261018120000_enforce_single_template_contract/migration.sql new file mode 100644 index 0000000..93e458b --- /dev/null +++ b/apps/api/prisma/migrations/20261018120000_enforce_single_template_contract/migration.sql @@ -0,0 +1,107 @@ +DO $$ +BEGIN + IF EXISTS ( + SELECT 1 + FROM "BrandTemplateInstallation" + GROUP BY "brandId" + HAVING COUNT(*) > 1 + ) THEN + RAISE EXCEPTION 'Template contract migration stopped: a brand has multiple template installations'; + END IF; + + IF EXISTS ( + SELECT 1 + FROM "BrandTemplateInstallation" installation + LEFT JOIN "TemplatePackageVersion" package_version + ON package_version."id" = installation."templatePackageVersionId" + WHERE installation."templatePackageVersionId" IS NULL + OR package_version."id" IS NULL + OR package_version."status" <> 'published' + ) THEN + RAISE EXCEPTION 'Template contract migration stopped: an installation has no exact package version'; + END IF; + + IF EXISTS ( + SELECT 1 + FROM "BrandTemplateInstallation" installation + JOIN "TemplatePackageVersion" package_version + ON package_version."id" = installation."templatePackageVersionId" + JOIN "BrandProfile" brand ON brand."id" = installation."brandId" + WHERE installation."visualTemplateKey" IS DISTINCT FROM package_version."visualTemplateKey" + OR package_version."visualTemplateKey" IS DISTINCT FROM package_version."packageKey" + OR package_version."manifestSnapshot"->>'visualTemplateKey' IS DISTINCT FROM package_version."visualTemplateKey" + OR package_version."manifestSnapshot"->>'packageKey' IS DISTINCT FROM package_version."packageKey" + OR package_version."manifestSnapshot"->>'version' IS DISTINCT FROM package_version."version" + OR NOT COALESCE(package_version."manifestSnapshot"->'supportedIndustryTemplates' ? brand."templateKey", false) + OR installation."templateKey" IS DISTINCT FROM brand."templateKey" + OR (installation."contentChecksum" IS NOT NULL AND installation."contentChecksum" IS DISTINCT FROM package_version."contentChecksum") + ) THEN + RAISE EXCEPTION 'Template contract migration stopped: installation, brand, package row, or manifest disagree'; + END IF; + + IF EXISTS ( + SELECT 1 + FROM "BrandProfile" brand + LEFT JOIN "BrandTemplateInstallation" installation ON installation."brandId" = brand."id" + WHERE installation."id" IS NULL + ) THEN + RAISE EXCEPTION 'Template contract migration stopped: a brand has no explicit template installation'; + END IF; + + IF EXISTS ( + SELECT 1 + FROM "BrandProfile" brand + JOIN "BrandTemplateInstallation" installation ON installation."brandId" = brand."id" + JOIN "TemplatePackageVersion" package_version + ON package_version."id" = installation."templatePackageVersionId" + WHERE brand."config" ? 'visualTemplateKey' + AND brand."config"->>'visualTemplateKey' IS DISTINCT FROM package_version."visualTemplateKey" + ) THEN + RAISE EXCEPTION 'Template contract migration stopped: brand config visualTemplateKey conflicts with its installation'; + END IF; + + IF EXISTS ( + SELECT 1 + FROM "BrandProfile" brand + LEFT JOIN "BrandTemplateInstallation" installation ON installation."brandId" = brand."id" + WHERE brand."config" ? 'visualTemplateKey' + AND installation."id" IS NULL + ) THEN + RAISE EXCEPTION 'Template contract migration stopped: brand config visualTemplateKey has no installation to verify against'; + END IF; +END $$; + +DO $$ +BEGIN + IF EXISTS ( + SELECT 1 FROM "TemplatePackageVersion" package_version + WHERE package_version."visualTemplateKey" IS DISTINCT FROM package_version."packageKey" + OR package_version."manifestSnapshot"->>'visualTemplateKey' IS DISTINCT FROM package_version."packageKey" + OR package_version."manifestSnapshot"->>'packageKey' IS DISTINCT FROM package_version."packageKey" + OR package_version."manifestSnapshot"->>'version' IS DISTINCT FROM package_version."version" + ) THEN + RAISE EXCEPTION 'Template contract migration stopped: package metadata conflicts with its manifest'; + END IF; +END $$; + +UPDATE "BrandTemplateInstallation" installation +SET "templateVersion" = package_version."version", + "contentChecksum" = package_version."contentChecksum" +FROM "TemplatePackageVersion" package_version +WHERE package_version."id" = installation."templatePackageVersionId"; + +UPDATE "BrandProfile" +SET "config" = "config" - 'visualTemplateKey' +WHERE "config" ? 'visualTemplateKey'; + +ALTER TABLE "BrandTemplateInstallation" + DROP CONSTRAINT "BrandTemplateInstallation_templatePackageVersionId_fkey", + DROP COLUMN "visualTemplateKey", + ALTER COLUMN "templatePackageVersionId" SET NOT NULL, + ADD CONSTRAINT "BrandTemplateInstallation_templatePackageVersionId_fkey" + FOREIGN KEY ("templatePackageVersionId") REFERENCES "TemplatePackageVersion"("id") ON DELETE RESTRICT ON UPDATE CASCADE; + +ALTER TABLE "TemplatePackageVersion" DROP COLUMN "visualTemplateKey"; + +DROP INDEX "BrandTemplateInstallation_brandId_templateKey_key"; +CREATE UNIQUE INDEX "BrandTemplateInstallation_brandId_key" ON "BrandTemplateInstallation"("brandId"); diff --git a/apps/api/prisma/schema.prisma b/apps/api/prisma/schema.prisma index 4ccc1e8..10d432e 100644 --- a/apps/api/prisma/schema.prisma +++ b/apps/api/prisma/schema.prisma @@ -223,22 +223,19 @@ model CapabilityAuditLog { } model BrandTemplateInstallation { - id String @id @default(uuid()) - brandId String - brand BrandProfile @relation(fields: [brandId], references: [id], onDelete: Cascade) + id String @id @default(uuid()) + brandId String @unique + brand BrandProfile @relation(fields: [brandId], references: [id], onDelete: Cascade) templateKey String - templateVersion String @default("1.0.0") - visualTemplateKey String? - templatePackageVersionId String? - templatePackageVersion TemplatePackageVersion? @relation("BrandTemplateInstallationPackageVersion", fields: [templatePackageVersionId], references: [id], onDelete: SetNull) + templateVersion String @default("1.0.0") + templatePackageVersionId String + templatePackageVersion TemplatePackageVersion @relation("BrandTemplateInstallationPackageVersion", fields: [templatePackageVersionId], references: [id], onDelete: Restrict) contentChecksum String? configSnapshot Json - previousSnapshots Json @default("[]") - installedAt DateTime @default(now()) - updatedAt DateTime @updatedAt + previousSnapshots Json @default("[]") + installedAt DateTime @default(now()) + updatedAt DateTime @updatedAt - @@unique([brandId, templateKey]) - @@index([brandId]) @@index([templatePackageVersionId]) } @@ -484,7 +481,6 @@ model TemplatePackageVersion { packageKey String version String displayName String - visualTemplateKey String? status TemplatePackageVersionStatus @default(imported) manifestSnapshot Json validationReport Json diff --git a/apps/api/prisma/seed.ts b/apps/api/prisma/seed.ts index 7108524..eccba8e 100644 --- a/apps/api/prisma/seed.ts +++ b/apps/api/prisma/seed.ts @@ -1,10 +1,5 @@ import { PrismaClient, type Prisma } from "@prisma/client"; -import { - getBrandTemplate, - getDefaultVisualTemplateKey, - getTemplatePackageManifestForVisualKey, - getVisualTemplateManifest, -} from "@personal-brand/config"; +import type { TemplatePackageManifest } from "@personal-brand/config"; import bcrypt from "bcryptjs"; import { buildBrandReleaseSnapshot } from "../src/brand-release.service.js"; @@ -28,6 +23,7 @@ type OfferingKind = "service" | "product" | "package" | "subscription"; interface RuntimeSeedTemplate { templateKey: "personal" | "food" | "doors"; + visualTemplateKey: string; brandConfig: Record; retiredOfferingNames?: string[]; offerings: Array<{ @@ -52,8 +48,8 @@ interface RuntimeSeedTemplate { const runtimeSeedTemplates: Record<"personal" | "food" | "doors", RuntimeSeedTemplate> = { personal: { templateKey: "personal", + visualTemplateKey: "linjing-editorial", brandConfig: { - visualTemplateKey: "linjing-editorial", templateData: { designPhilosophy: "先厘清问题,再设计表达" }, title: "品牌策略顾问", slogan: "用清晰的定位与可执行的表达,让专业被看见。", @@ -166,8 +162,8 @@ const runtimeSeedTemplates: Record<"personal" | "food" | "doors", RuntimeSeedTem }, food: { templateKey: "food", + visualTemplateKey: "acheng-campus-food", brandConfig: { - visualTemplateKey: "acheng-campus-food", founder: "阿成", title: "私房菜主理人", slogan: "认真做好每一顿家常饭。", @@ -293,9 +289,9 @@ const runtimeSeedTemplates: Record<"personal" | "food" | "doors", RuntimeSeedTem }, doors: { templateKey: "doors", + visualTemplateKey: "linjing-editorial", retiredOfferingNames: ["别墅入户大门", "院门与围合系统", "室内户内门系统"], brandConfig: { - visualTemplateKey: "linjing-editorial", templateData: { designPhilosophy: "让门与空间建立长期、克制的关系" }, founder: "林叙安 (Lin XUAN)", title: "高端门系统建筑研造主理人", @@ -645,11 +641,22 @@ const runtimeSeedTemplates: Record<"personal" | "food" | "doors", RuntimeSeedTem async function ensureRuntimeContent(brandId: string, template: RuntimeSeedTemplate): Promise { // 这里只初始化明确的开发演示品牌;业务内容统一来自视觉包 sampleContent, // 新增生产模板无需添加 seed 分支,品牌样例内容仍须由管理员显式导入。 - const visualKey = template.templateKey === "food" ? "acheng-campus-food" : "linjing-editorial"; - const packageSample = - getTemplatePackageManifestForVisualKey(visualKey)?.sampleContent?.[template.templateKey]; - if (!packageSample) - throw new Error(`Development sample is missing for ${visualKey}/${template.templateKey}`); + const installation = await prisma.brandTemplateInstallation.findFirst({ + where: { brandId }, + include: { templatePackageVersion: true }, + }); + const manifest = installation?.templatePackageVersion?.manifestSnapshot as unknown as + TemplatePackageManifest | undefined; + const packageSample = manifest?.sampleContent?.[template.templateKey]; + if ( + !installation?.templatePackageVersion || + manifest?.visualTemplateKey !== template.visualTemplateKey || + manifest.packageKey !== template.visualTemplateKey || + !packageSample + ) + throw new Error( + `Development package sample is missing for ${template.visualTemplateKey}/${template.templateKey}`, + ); const offerings = packageSample.offerings.map((item) => ({ name: item.name, summary: item.summary, @@ -787,36 +794,40 @@ async function ensureSeedRelease(brandId: string, actorId: string): Promise { const brand = await prisma.brandProfile.findUniqueOrThrow({ where: { id: brandId }, - select: { templateKey: true, config: true }, + select: { templateKey: true }, + }); + const template = runtimeSeedTemplates[brand.templateKey as keyof typeof runtimeSeedTemplates]; + if (!template) throw new Error("Development brand has no explicit template fixture"); + const visualKey = template.visualTemplateKey; + const existing = await prisma.brandTemplateInstallation.findUnique({ + where: { brandId }, + include: { templatePackageVersion: true }, }); - const template = getBrandTemplate(brand.templateKey); - if (!template) throw new Error("Development brand has an unknown industry template"); - const config = - brand.config && typeof brand.config === "object" && !Array.isArray(brand.config) - ? (brand.config as Record) - : {}; - const configuredVisual = - typeof config.visualTemplateKey === "string" ? config.visualTemplateKey : undefined; - const visualKey = configuredVisual ?? getDefaultVisualTemplateKey(template.key); - if (!getVisualTemplateManifest(visualKey)) - throw new Error("Development brand has an unknown visual template"); - const configSnapshot = { - schemaVersion: "1.0", - version: template.version, - industryTemplate: template, - visualTemplate: getVisualTemplateManifest(visualKey), - capabilities: template.capabilities, - } as unknown as Prisma.InputJsonValue; - const existing = await prisma.brandTemplateInstallation.findFirst({ where: { brandId } }); if (existing) { - await prisma.brandTemplateInstallation.update({ - where: { id: existing.id }, - data: { templateKey: template.key, templateVersion: template.version, configSnapshot }, - }); + if ( + existing.templateKey !== template.templateKey || + !existing.templatePackageVersionId || + !existing.templatePackageVersion + ) + throw new Error("Development brand installation does not satisfy the template contract"); return; } + const packageVersion = await prisma.templatePackageVersion.findFirst({ + where: { packageKey: visualKey, status: "published" }, + orderBy: { importedAt: "desc" }, + }); + if (!packageVersion) + throw new Error(`Development brand requires a published package version: ${visualKey}`); + const configSnapshot = packageVersion.manifestSnapshot as Prisma.InputJsonValue; await prisma.brandTemplateInstallation.create({ - data: { brandId, templateKey: template.key, templateVersion: template.version, configSnapshot }, + data: { + brandId, + templateKey: template.templateKey, + templateVersion: packageVersion.version, + templatePackageVersionId: packageVersion.id, + contentChecksum: packageVersion.contentChecksum, + configSnapshot, + }, }); } @@ -846,8 +857,8 @@ async function main(): Promise { }, }); - await ensureRuntimeContent(brand.id, runtimeSeedTemplates.food); await ensureTemplateInstallation(brand.id); + await ensureRuntimeContent(brand.id, runtimeSeedTemplates.food); for (const name of ["普通套餐", "私厨", "配送", "自取", "熟客", "重点跟进"]) { await prisma.tag.upsert({ @@ -904,8 +915,8 @@ async function main(): Promise { update: { isEnabled: true, role: "owner" }, create: { adminUserId: admin.id, brandId: doorsBrand.id, role: "owner" }, }); - await ensureRuntimeContent(doorsBrand.id, runtimeSeedTemplates.doors); await ensureTemplateInstallation(doorsBrand.id); + await ensureRuntimeContent(doorsBrand.id, runtimeSeedTemplates.doors); await ensureSeedRelease(brand.id, admin.id); await ensureSeedRelease(doorsBrand.id, admin.id); } diff --git a/apps/api/scripts/create-atelier-brand.mjs b/apps/api/scripts/create-atelier-brand.mjs index 0ea439e..0c6b97c 100644 --- a/apps/api/scripts/create-atelier-brand.mjs +++ b/apps/api/scripts/create-atelier-brand.mjs @@ -1,4 +1,5 @@ import assert from "node:assert/strict"; +import { getTemplatePackageManifestForVisualKey } from "@personal-brand/config"; import { PrismaService } from "../dist/prisma.service.js"; import { TemplateWorkspaceService } from "../dist/template-workspace.service.js"; @@ -19,18 +20,12 @@ try { let current = await tx.brandProfile.findUnique({ where: { slug } }); if (current) { assert.equal(current.templateKey, "personal", "Existing brand has a different industry"); - assert.equal( - current.config?.visualTemplateKey, - "atelier-solopreneur", - "Existing brand has a different visual template", - ); } else { current = await tx.brandProfile.create({ data: { slug, name: "独立工坊 · 品牌小程序", templateKey: "personal", - config: { visualTemplateKey: "atelier-solopreneur" }, }, }); } @@ -41,8 +36,31 @@ try { }); return current; }); - if (!(await prisma.brandTemplateInstallation.findFirst({ where: { brandId: brand.id } }))) { - await new TemplateWorkspaceService(prisma).install(brand.id, "personal"); + const manifest = getTemplatePackageManifestForVisualKey("atelier-solopreneur"); + if (!manifest) throw new Error("atelier-solopreneur package manifest is unavailable"); + const version = await prisma.templatePackageVersion.findUnique({ + where: { + templatePackageId_version: { + templatePackageId: ( + await prisma.templatePackage.findUniqueOrThrow({ + where: { packageKey: "atelier-solopreneur" }, + select: { id: true }, + }) + ).id, + version: manifest.version, + }, + }, + }); + if (!version || version.status !== "published") + throw new Error(`Published package version not found: atelier-solopreneur@${manifest.version}`); + const installation = await prisma.brandTemplateInstallation.findUnique({ + where: { brandId: brand.id }, + include: { templatePackageVersion: true }, + }); + if (installation) { + assert.equal(installation.templatePackageVersionId, version.id); + } else { + await new TemplateWorkspaceService(prisma).install(brand.id, "personal", version.id); } assert.deepEqual( await prisma.brandProfile.findMany({ where: { slug: { not: slug } }, orderBy: { id: "asc" } }), diff --git a/apps/api/scripts/migrate-food-owner-visual.ts b/apps/api/scripts/migrate-food-owner-visual.ts index 497901c..5c31ecf 100644 --- a/apps/api/scripts/migrate-food-owner-visual.ts +++ b/apps/api/scripts/migrate-food-owner-visual.ts @@ -10,8 +10,14 @@ const prisma = new PrismaClient(); const note = "餐饮主理人原型视觉槽位迁移 v1"; try { const brand = await prisma.brandProfile.findUniqueOrThrow({ where: { slug: "default-brand" } }); - const config = (brand.config ?? {}) as Record; - if (brand.templateKey !== "food" || config.visualTemplateKey !== "acheng-campus-food") + const installation = await prisma.brandTemplateInstallation.findUnique({ + where: { brandId: brand.id }, + include: { templatePackageVersion: true }, + }); + if ( + brand.templateKey !== "food" || + installation?.templatePackageVersion?.packageKey !== "acheng-campus-food" + ) throw new Error("Migration is restricted to the development food brand"); const previous = await prisma.brandRelease.findFirst({ where: { brandId: brand.id }, diff --git a/apps/api/src/admin.dto.ts b/apps/api/src/admin.dto.ts index 44ce693..d83cc87 100644 --- a/apps/api/src/admin.dto.ts +++ b/apps/api/src/admin.dto.ts @@ -106,7 +106,13 @@ export class UpdateBookingTagsDto { export class InstallTemplateDto { @IsIn(brandTemplateKeys) templateKey!: BrandTemplateKey; - @IsOptional() @IsUUID() templatePackageVersionId?: string; + @IsUUID() templatePackageVersionId!: string; +} + +export class SelectTemplateVersionDto { + @IsUUID() templatePackageVersionId!: string; + @IsOptional() @IsUUID() expectedCurrentPackageVersionId?: string | null; + @IsBoolean() confirm!: boolean; } export class UpgradeTemplateDto { diff --git a/apps/api/src/brand-release-api.service.ts b/apps/api/src/brand-release-api.service.ts index 8efd1e1..6bf7059 100644 --- a/apps/api/src/brand-release-api.service.ts +++ b/apps/api/src/brand-release-api.service.ts @@ -6,12 +6,9 @@ import { } from "@nestjs/common"; import { Prisma } from "@prisma/client"; import { - defaultBrandTemplateKey, getBrandTemplate, getVisualTemplate, isVisualTemplateCompatible, - getDefaultVisualTemplateKey, - getTemplatePackageManifestForVisualKey, validateTemplatePackageManifest, type TemplatePackageManifest, } from "@personal-brand/config"; @@ -61,9 +58,8 @@ export class BrandReleaseApiService { where: { id: brandId }, select: { name: true, tagline: true, description: true, templateKey: true, config: true }, }); - const installation = await database.brandTemplateInstallation.findFirst({ + const installation = await database.brandTemplateInstallation.findUnique({ where: { brandId }, - orderBy: { updatedAt: "desc" }, }); const packageVersion = installation?.templatePackageVersionId ? await database.templatePackageVersion.findUnique({ @@ -71,36 +67,30 @@ export class BrandReleaseApiService { select: { packageKey: true, version: true, - visualTemplateKey: true, status: true, contentChecksum: true, manifestSnapshot: true, }, }) : null; - const template = getBrandTemplate(installation?.templateKey ?? brand?.templateKey ?? ""); - const config = this.jsonObject(brand?.config); - const visualKey = - typeof config.visualTemplateKey === "string" - ? config.visualTemplateKey - : getDefaultVisualTemplateKey(brand?.templateKey ?? defaultBrandTemplateKey); + const template = getBrandTemplate(brand?.templateKey ?? ""); + const storedManifest = packageVersion?.manifestSnapshot as TemplatePackageManifest | undefined; + const visualKey = storedManifest?.visualTemplateKey ?? ""; const visual = getVisualTemplate(visualKey); - const storedManifest = packageVersion?.manifestSnapshot as unknown as - TemplatePackageManifest | undefined; - const packageManifest = storedManifest ?? getTemplatePackageManifestForVisualKey(visualKey); - const packageVersionValid = - !installation?.templatePackageVersionId || - Boolean( - packageVersion && - packageVersion.status === "published" && - /^[a-f0-9]{64}$/.test(packageVersion.contentChecksum) && - packageVersion.packageKey === (storedManifest?.packageKey ?? "") && - packageVersion.version === (storedManifest?.version ?? "") && - (packageVersion.visualTemplateKey ?? packageVersion.packageKey) === - (storedManifest?.visualTemplateKey ?? packageVersion.packageKey) && - storedManifest?.supportedIndustryTemplates.includes(brand?.templateKey ?? "") && - validateTemplatePackageManifest(storedManifest).length === 0, - ); + const packageManifest = storedManifest; + const packageVersionValid = Boolean( + installation?.templatePackageVersionId && + packageVersion && + packageVersion.status === "published" && + /^[a-f0-9]{64}$/.test(packageVersion.contentChecksum) && + packageVersion.packageKey === (storedManifest?.packageKey ?? "") && + packageVersion.version === (storedManifest?.version ?? "") && + packageVersion.packageKey === storedManifest?.packageKey && + packageVersion.packageKey === storedManifest?.visualTemplateKey && + storedManifest?.supportedIndustryTemplates.includes(brand?.templateKey ?? "") && + validateTemplatePackageManifest(storedManifest).length === 0, + ); + const config = this.jsonObject(brand?.config); const [offerings, forms, trustItems] = await Promise.all([ database.offering.findMany({ where: { brandId, isEnabled: true }, diff --git a/apps/api/src/brand-release.service.ts b/apps/api/src/brand-release.service.ts index 04899f5..6ed637b 100644 --- a/apps/api/src/brand-release.service.ts +++ b/apps/api/src/brand-release.service.ts @@ -1,12 +1,9 @@ import { Injectable } from "@nestjs/common"; import { Prisma } from "@prisma/client"; import { - defaultBrandTemplateKey, getBrandTemplate, getVisualTemplate, getVisualTemplateManifest, - getDefaultVisualTemplateKey, - getTemplatePackageManifestForVisualKey, } from "@personal-brand/config"; import type { TemplatePackageManifest } from "@personal-brand/config"; import { PrismaService } from "./prisma.service.js"; @@ -35,9 +32,8 @@ export async function buildBrandReleaseSnapshot( const [brand, installation, fields, offerings, forms, trustContents, capabilities] = await Promise.all([ database.brandProfile.findUnique({ where: { id: brandId } }), - database.brandTemplateInstallation.findFirst({ + database.brandTemplateInstallation.findUnique({ where: { brandId }, - orderBy: { updatedAt: "desc" }, include: { templatePackageVersion: true }, }), database.brandFieldDefinition.findMany({ where: { brandId }, orderBy: { sortOrder: "asc" } }), @@ -46,15 +42,14 @@ export async function buildBrandReleaseSnapshot( database.trustContent.findMany({ where: { brandId }, orderBy: { sortOrder: "asc" } }), database.capabilityInstallation.findMany({ where: { brandId } }), ]); - const templateKey = brand?.templateKey ?? installation?.templateKey ?? defaultBrandTemplateKey; - const config = - brand?.config && typeof brand.config === "object" && !Array.isArray(brand.config) - ? (brand.config as Record) - : {}; - const visualKey = - typeof config.visualTemplateKey === "string" - ? config.visualTemplateKey - : getDefaultVisualTemplateKey(brand?.templateKey ?? defaultBrandTemplateKey); + if (!brand) throw new Error("品牌不存在,不能生成发布快照"); + if (!installation?.templatePackageVersion) throw new Error("品牌安装没有锁定精确视觉模板包版本"); + const templateKey = brand.templateKey; + const packageManifest = installation.templatePackageVersion.manifestSnapshot as unknown as + TemplatePackageManifest | undefined; + const visualKey = packageManifest?.visualTemplateKey; + if (!packageManifest || typeof visualKey !== "string") + throw new Error("品牌安装与模板包 manifest 不一致"); const jsonObject = (value: object): Record => JSON.parse(JSON.stringify(value)) as Record; return { @@ -64,11 +59,7 @@ export async function buildBrandReleaseSnapshot( templateDefinition: getBrandTemplate(templateKey) ?? null, visualTemplateDefinition: getVisualTemplate(visualKey) ?? null, visualTemplateManifest: getVisualTemplateManifest(visualKey) ?? null, - templatePackageManifest: - (installation?.templatePackageVersion?.manifestSnapshot as unknown as - TemplatePackageManifest | undefined) ?? - getTemplatePackageManifestForVisualKey(visualKey) ?? - null, + templatePackageManifest: packageManifest, brand: brand ? jsonObject(brand) : null, installation: installation ? jsonObject(installation) : null, fields: fields.map((item) => jsonObject(item)), diff --git a/apps/api/src/modules/admin/admin-brand-config.service.ts b/apps/api/src/modules/admin/admin-brand-config.service.ts index e6f3f9f..5e1575f 100644 --- a/apps/api/src/modules/admin/admin-brand-config.service.ts +++ b/apps/api/src/modules/admin/admin-brand-config.service.ts @@ -1,23 +1,11 @@ import { BadRequestException, Injectable } from "@nestjs/common"; import { Prisma } from "@prisma/client"; -import { - defaultVisualTemplateKey, - getBrandTemplate, - getDefaultVisualTemplateKey, - getVisualTemplate, - isVisualTemplateCompatible, - listVisualTemplateKeys, -} from "@personal-brand/config"; import { PrismaService } from "../../prisma.service.js"; -import { TemplateWorkspaceService } from "../../template-workspace.service.js"; import type { UpdateBrandDto, UpdateBrandPresentationDto } from "../../admin.dto.js"; @Injectable() export class AdminBrandConfigService { - constructor( - private readonly prisma: PrismaService, - private readonly templateWorkspace: TemplateWorkspaceService, - ) {} + constructor(private readonly prisma: PrismaService) {} getBrand(brandId: string) { return this.prisma.brandProfile.findUnique({ where: { id: brandId } }); @@ -27,56 +15,28 @@ export class AdminBrandConfigService { const { config, ...fields } = body; const current = await this.prisma.brandProfile.findUnique({ where: { id: brandId }, - select: { config: true }, + select: { config: true, templateKey: true }, }); + if (!current) throw new BadRequestException("品牌不存在"); const currentConfig = this.jsonObject(current?.config); + if (config && Object.hasOwn(config, "visualTemplateKey")) + throw new BadRequestException("模板选择必须通过精确模板包版本操作"); + const configFields = config ?? {}; const nextConfig = { ...currentConfig, - ...(config ?? {}), - ...(fields.description !== undefined && config?.slogan === undefined + ...configFields, + ...(fields.description !== undefined && configFields.slogan === undefined ? { slogan: fields.description } : {}), }; - if (config?.visualTemplateKey && config.visualTemplateKey !== currentConfig.visualTemplateKey) { - const templateKey = await this.templateWorkspace.getEffectiveTemplateKey(brandId); - const visualTemplate = - typeof config.visualTemplateKey === "string" - ? getVisualTemplate(config.visualTemplateKey) - : undefined; - if ( - !visualTemplate || - !getBrandTemplate(templateKey) || - !isVisualTemplateCompatible(visualTemplate, templateKey) - ) - throw new BadRequestException("当前视觉模板不适配该行业模板"); - const installation = await this.prisma.brandTemplateInstallation.findFirst({ - where: { brandId }, + return this.prisma.$transaction(async (tx) => { + return tx.brandProfile.update({ + where: { id: brandId }, + data: { + ...fields, + ...(Object.keys(nextConfig).length ? { config: nextConfig } : {}), + }, }); - if (installation) { - const history = Array.isArray(installation.previousSnapshots) - ? installation.previousSnapshots - : []; - await this.prisma.brandTemplateInstallation.update({ - where: { id: installation.id }, - data: { - previousSnapshots: [ - ...history, - { - visualTemplateKey: - currentConfig.visualTemplateKey ?? getDefaultVisualTemplateKey(templateKey), - savedAt: new Date().toISOString(), - }, - ], - }, - }); - } - } - return this.prisma.brandProfile.update({ - where: { id: brandId }, - data: { - ...fields, - ...(Object.keys(nextConfig).length ? { config: nextConfig } : {}), - }, }); } @@ -130,91 +90,6 @@ export class AdminBrandConfigService { }; } - async visualTemplateHistory(brandId: string) { - const installation = await this.prisma.brandTemplateInstallation.findFirst({ - where: { brandId }, - select: { previousSnapshots: true }, - }); - return { - history: Array.isArray(installation?.previousSnapshots) - ? installation.previousSnapshots.filter( - (item) => - item && - typeof item === "object" && - !Array.isArray(item) && - "visualTemplateKey" in item, - ) - : [], - }; - } - - async rollbackVisualTemplate(brandId: string) { - const [brand, installation] = await Promise.all([ - this.prisma.brandProfile.findUnique({ where: { id: brandId }, select: { config: true } }), - this.prisma.brandTemplateInstallation.findFirst({ where: { brandId } }), - ]); - const config = this.jsonObject(brand?.config); - const history = Array.isArray(installation?.previousSnapshots) - ? installation.previousSnapshots - : []; - const index = [...history] - .map((item, i) => ({ item, i })) - .reverse() - .find( - ({ item }) => - item && typeof item === "object" && !Array.isArray(item) && "visualTemplateKey" in item, - )?.i; - const previous = - index === undefined ? undefined : (history[index] as { visualTemplateKey?: unknown }); - if (!previous || typeof previous.visualTemplateKey !== "string") - throw new BadRequestException("没有可回滚的视觉模板版本"); - await this.prisma.$transaction([ - this.prisma.brandProfile.update({ - where: { id: brandId }, - data: { - config: { - ...config, - visualTemplateKey: previous.visualTemplateKey, - }, - }, - }), - ...(installation - ? [ - this.prisma.brandTemplateInstallation.update({ - where: { id: installation.id }, - data: { previousSnapshots: history.slice(0, index) }, - }), - ] - : []), - ]); - return { visualTemplateKey: previous.visualTemplateKey, rolledBack: true }; - } - - async visualTemplatePreview(brandId: string) { - const brand = await this.prisma.brandProfile.findUnique({ - where: { id: brandId }, - select: { config: true }, - }); - const config = this.jsonObject(brand?.config); - const currentKey = - typeof config.visualTemplateKey === "string" - ? config.visualTemplateKey - : defaultVisualTemplateKey; - const current = getVisualTemplate(currentKey); - return { - current: current - ? { - key: current.key, - version: current.version, - name: current.name, - theme: current.theme, - variants: current.variants, - } - : null, - available: listVisualTemplateKeys(), - }; - } - private jsonObject(value: unknown): Record { return value && typeof value === "object" && !Array.isArray(value) ? (value as Record) diff --git a/apps/api/src/modules/admin/admin-config.controller.ts b/apps/api/src/modules/admin/admin-config.controller.ts index 54225e7..40348be 100644 --- a/apps/api/src/modules/admin/admin-config.controller.ts +++ b/apps/api/src/modules/admin/admin-config.controller.ts @@ -60,10 +60,6 @@ export class AdminConfigController { @Body() body: UpdateBrandDto, ): Promise { this.requireAdmin(request); - const { config } = body; - if (config?.visualTemplateKey !== undefined) { - await this.access.requireRole(request, ["owner", "admin", "platform-admin"]); - } return this.brandConfig.updateBrand(this.brandId(request), body); } @Patch("presentation") @@ -75,21 +71,6 @@ export class AdminConfigController { const brandId = this.brandId(request); return this.brandConfig.updatePresentation(brandId, body); } - @Get("visual-template/history") - getVisualTemplateHistory(@Req() request: FastifyRequest): unknown { - this.requireAdmin(request); - return this.brandConfig.visualTemplateHistory(this.brandId(request)); - } - @Post("visual-template/rollback") - async rollbackVisualTemplate(@Req() request: FastifyRequest): Promise { - this.requireAdmin(request); - return this.brandConfig.rollbackVisualTemplate(this.brandId(request)); - } - @Get("visual-template/preview") - getVisualTemplatePreview(@Req() request: FastifyRequest): unknown { - this.requireAdmin(request); - return this.brandConfig.visualTemplatePreview(this.brandId(request)); - } @Get("trust-content") listTrustContent(@Req() request: FastifyRequest): Promise { this.requireAdmin(request); diff --git a/apps/api/src/modules/admin/admin-template-package.service.ts b/apps/api/src/modules/admin/admin-template-package.service.ts index cb72b71..f1a8de9 100644 --- a/apps/api/src/modules/admin/admin-template-package.service.ts +++ b/apps/api/src/modules/admin/admin-template-package.service.ts @@ -26,9 +26,9 @@ type Manifest = { packageKey: string; version: string; displayName: string; - visualTemplateKey?: string; - supportedIndustryTemplates?: string[]; - previewFixture?: Prisma.InputJsonValue; + visualTemplateKey: string; + supportedIndustryTemplates: string[]; + previewFixture: Prisma.InputJsonValue; }; type ChecksumFile = { @@ -146,7 +146,6 @@ export class AdminTemplatePackageService { packageKey: true, version: true, displayName: true, - visualTemplateKey: true, status: true, contentChecksum: true, archiveChecksum: true, @@ -302,7 +301,6 @@ export class AdminTemplatePackageService { packageKey, version: manifest.version, displayName: manifest.displayName, - visualTemplateKey: manifest.visualTemplateKey ?? null, manifestSnapshot: manifest, validationReport: { formatVersion: "1", @@ -495,7 +493,6 @@ export class AdminTemplatePackageService { packageKey: string; version: string; displayName: string; - visualTemplateKey: string | null; status: string; contentChecksum: string; archiveChecksum: string; @@ -506,7 +503,6 @@ export class AdminTemplatePackageService { packageKey: version.packageKey, version: version.version, displayName: version.displayName, - visualTemplateKey: version.visualTemplateKey, status: version.status, contentChecksum: version.contentChecksum, archiveChecksum: version.archiveChecksum, diff --git a/apps/api/src/modules/admin/admin-template-preview.service.ts b/apps/api/src/modules/admin/admin-template-preview.service.ts index 9c3233b..fe69f48 100644 --- a/apps/api/src/modules/admin/admin-template-preview.service.ts +++ b/apps/api/src/modules/admin/admin-template-preview.service.ts @@ -184,22 +184,25 @@ export class AdminTemplatePreviewService { const rawManifest = record(version.manifestSnapshot); const packageKey = version.packageKey; - const visualTemplateKey = - typeof rawManifest.visualTemplateKey === "string" - ? rawManifest.visualTemplateKey - : packageKey; - const manifest = { - ...rawManifest, - visualTemplateKey, - } as unknown as TemplatePackageManifest; + const visualTemplateKey = rawManifest.visualTemplateKey as string; + const manifest = rawManifest as unknown as TemplatePackageManifest; + let manifestIssues: string[]; try { - if (validateTemplatePackageManifest(manifest).length || !hasPreviewStructure(rawManifest)) { - throw new Error("Invalid manifest"); - } + manifestIssues = validateTemplatePackageManifest(manifest); } catch { throw new BadRequestException("模板版本的 manifest 不符合预览契约"); } - if (manifest.packageKey !== packageKey || manifest.version !== version.version) + if (manifestIssues.length) + throw new BadRequestException( + `模板版本的 manifest 不符合预览契约:${manifestIssues.join(";")}`, + ); + if (!hasPreviewStructure(rawManifest)) + throw new BadRequestException("模板版本的 manifest 不符合预览契约"); + if ( + manifest.packageKey !== packageKey || + manifest.version !== version.version || + manifest.packageKey !== manifest.visualTemplateKey + ) throw new BadRequestException("模板版本与 manifest 元数据不一致"); const industryTemplate = getBrandTemplate(industry); const blockers: string[] = []; @@ -235,20 +238,14 @@ export class AdminTemplatePreviewService { } if (blockers.length) throw new BadRequestException(`模板预览被阻断:${blockers.join(";")}`); - const fixtureDeclared = rawManifest.previewFixture !== undefined; const fixture = record(rawManifest.previewFixture)[industry] as TemplatePreviewFixture | undefined; - if (fixtureDeclared) { - const issues = validateTemplatePreviewFixture(fixture); - if (issues.length) - throw new BadRequestException( - `模板 previewFixture 不符合预览契约:${issues.map((issue) => `${issue.path}: ${issue.message}`).join(";")}`, - ); - } - // 一旦包声明独立 fixture,缺失或无效时禁止偷偷回退到 bootstrap sample。 - const sample = fixtureDeclared - ? fixture!.content - : (record(rawManifest.sampleContent)[industry] as TemplateSampleContent | undefined); + const fixtureIssues = validateTemplatePreviewFixture(fixture); + if (fixtureIssues.length) + throw new BadRequestException( + `模板 previewFixture 不符合预览契约:${fixtureIssues.map((issue) => `${issue.path}: ${issue.message}`).join(";")}`, + ); + const sample = fixture!.content as TemplateSampleContent; const missingSampleSlots = this.missingSampleSlots(manifest, sample); if (missingSampleSlots.length) blockers.push(`preview sample 缺少必需数据:${missingSampleSlots.join("、")}`); @@ -331,26 +328,13 @@ export class AdminTemplatePreviewService { }, preview: { assetFiles: resources.files, - fixtureSource: fixtureDeclared - ? ("previewFixture" as const) - : ("legacy-sampleContent" as const), + fixtureSource: "previewFixture" as const, safety: { submissions: "disabled" as const, customerRecords: "disabled" as const, contactActions: "disabled" as const, }, - diagnostics: [ - ...resources.diagnostics, - ...(fixtureDeclared - ? [] - : [ - { - code: "LEGACY_PREVIEW_SAMPLE", - severity: "warning" as const, - message: "该版本尚未提供独立预览数据,当前兼容使用品牌起始内容。", - }, - ]), - ], + diagnostics: resources.diagnostics, pages: Object.keys(manifest.entrypoints).map((page) => ({ key: page, modules: manifest.admin.sections @@ -463,7 +447,7 @@ export class AdminTemplatePreviewService { deliveryNote: identity?.deliveryNote ?? "预览模式不会提交咨询或创建客户记录。", contactPhone: null, contactWechat: null, - config: { ...brandConfig, visualTemplateKey }, + config: brandConfig, }; const snapshot: BrandReleaseSnapshot = { schemaVersion: "1.0.0", @@ -477,6 +461,7 @@ export class AdminTemplatePreviewService { installation: { templateKey: industryTemplate.key, templateVersion: industryTemplate.version, + visualTemplateKey, }, fields: [], offerings: sample.offerings.map((item, sortOrder) => ({ diff --git a/apps/api/src/modules/public/public-workspace.snapshot-assembler.ts b/apps/api/src/modules/public/public-workspace.snapshot-assembler.ts index 7d9d1a1..e4ab426 100644 --- a/apps/api/src/modules/public/public-workspace.snapshot-assembler.ts +++ b/apps/api/src/modules/public/public-workspace.snapshot-assembler.ts @@ -3,13 +3,7 @@ import type { Prisma } from "@prisma/client"; import { capabilityMetadata, capabilityPlugins, - defaultBrandTemplateKey, type BrandTemplateKey, - getBrandTemplate, - getDefaultVisualTemplateKey, - getTemplatePackageManifestForVisualKey, - getVisualTemplate, - getVisualTemplateManifest, resolveCapabilities, } from "@personal-brand/config"; import type { RuntimeTrustItem, RuntimeWorkspace } from "@personal-brand/types"; @@ -94,12 +88,8 @@ export function assemblePublicWorkspace(input: { (item) => asRecord(item).isPublished === true, ) as Array>; const installationData = asRecord(releaseSnapshot.installation); - const templateKey = - asString(brandData.templateKey) || - asString(releaseSnapshot.templateKey) || - asString(installationData.templateKey) || - defaultBrandTemplateKey; - const template = releaseSnapshot.templateDefinition ?? getBrandTemplate(templateKey); + const templateKey = asString(releaseSnapshot.templateKey); + const template = releaseSnapshot.templateDefinition; const capabilityData = asArray(releaseSnapshot.capabilities) as Array>; const capabilityRecord = (item: Record, fallbackVersion = "1.0.0") => { const key = asString(item.capabilityKey) || asString(item.key); @@ -120,15 +110,19 @@ export function assemblePublicWorkspace(input: { ) : []; const brandConfig = asRecord(brandData.config); - const visualTemplateKey = - asString(brandConfig.visualTemplateKey) || getDefaultVisualTemplateKey(templateKey); - const visualTemplate = - releaseSnapshot.visualTemplateDefinition ?? getVisualTemplate(visualTemplateKey); - const visualTemplateManifest = - releaseSnapshot.visualTemplateManifest ?? getVisualTemplateManifest(visualTemplateKey); - const templatePackageManifest = - releaseSnapshot.templatePackageManifest ?? - getTemplatePackageManifestForVisualKey(visualTemplateKey); + const visualTemplate = releaseSnapshot.visualTemplateDefinition; + const visualTemplateManifest = releaseSnapshot.visualTemplateManifest; + const templatePackageManifest = releaseSnapshot.templatePackageManifest; + const visualTemplateKey = asString(templatePackageManifest?.visualTemplateKey); + if ( + !templateKey || + !visualTemplateKey || + !templatePackageManifest || + !template || + !visualTemplate || + !visualTemplateManifest + ) + throw new Error("发布快照缺少统一模板契约字段"); const categoryOptions = new Map( (templatePackageManifest?.admin.sections ?? []) .filter((section) => section.target === "offering") @@ -192,10 +186,8 @@ export function assemblePublicWorkspace(input: { status: "enabled" as const, config: capabilities.find((capability) => capability.key === plugin.key)?.config ?? {}, })), - theme: visualTemplate?.theme ?? { - colors: { background: "#F7F5F1", foreground: "#252525", accent: "#8A6846" }, - }, - ...(visualTemplate?.layout ? { layout: visualTemplate.layout } : {}), + theme: visualTemplate.theme, + ...(visualTemplate.layout ? { layout: visualTemplate.layout } : {}), }; return { ...runtimeWorkspace, diff --git a/apps/api/src/modules/public/public.controller.ts b/apps/api/src/modules/public/public.controller.ts index 7c3ef7e..251f358 100644 --- a/apps/api/src/modules/public/public.controller.ts +++ b/apps/api/src/modules/public/public.controller.ts @@ -2,8 +2,6 @@ import { BadRequestException, Controller, Get, Param, Query } from "@nestjs/comm import { PublicBrandContextService } from "./public-brand-context.service.js"; import { BrandReleaseService } from "../../brand-release.service.js"; import { - defaultBrandTemplateKey, - defaultVisualTemplateKey, brandTemplateKeys, getBrandTemplate, getVisualTemplate, @@ -82,10 +80,7 @@ export class PublicTemplateController { } @Get("preview") - preview( - @Query("industry") industry = defaultBrandTemplateKey, - @Query("visual") visual = defaultVisualTemplateKey, - ): unknown { + preview(@Query("industry") industry: string, @Query("visual") visual: string): unknown { const industryTemplate = getBrandTemplate(industry); const visualTemplate = getVisualTemplate(visual); if (!industryTemplate || !visualTemplate) throw new BadRequestException("模板组合不存在"); diff --git a/apps/api/src/modules/workspace/admin-sample-content.service.ts b/apps/api/src/modules/workspace/admin-sample-content.service.ts index e04e2ec..73cad3a 100644 --- a/apps/api/src/modules/workspace/admin-sample-content.service.ts +++ b/apps/api/src/modules/workspace/admin-sample-content.service.ts @@ -1,9 +1,6 @@ import { BadRequestException, Injectable, NotFoundException } from "@nestjs/common"; import { Prisma, type TemplatePackageVersion } from "@prisma/client"; import { - getDefaultVisualTemplateKey, - getTemplatePackageManifestForVisualKey, - getTemplateSampleContent, getVisualTemplate, isVisualTemplateCompatible, validateTemplatePackageManifest, @@ -15,10 +12,10 @@ import { PrismaService } from "../../prisma.service.js"; import { TemplateWorkspaceService } from "../../template-workspace.service.js"; type BootstrapSource = { - kind: "package_version" | "registry"; + kind: "package_version"; manifest: TemplatePackageManifest; sample: TemplateSampleContent; - version?: TemplatePackageVersion; + version: TemplatePackageVersion; }; type Counts = { @@ -111,8 +108,6 @@ export class AdminSampleContentService { throw new BadRequestException("当前只支持 missing_only 导入策略"); const { brand, source } = await this.resolveSource(brandId, body.templatePackageVersionId); - if (!source.version) - throw new BadRequestException("品牌尚未安装可追溯的已发布模板包版本,不能导入示例内容"); const plan = await this.buildPlan(brandId, brand.config, source); const priorImport = await this.prisma.templateBootstrapImport.findFirst({ where: { @@ -263,50 +258,35 @@ export class AdminSampleContentService { select: { templateKey: true, config: true }, }); if (!brand) throw new NotFoundException("品牌不存在"); - const config = record(brand.config); - const visualTemplateKey = - typeof config.visualTemplateKey === "string" - ? config.visualTemplateKey - : getDefaultVisualTemplateKey(brand.templateKey); const installation = requestedVersionId ? null - : await this.prisma.brandTemplateInstallation.findFirst({ + : await this.prisma.brandTemplateInstallation.findUnique({ where: { brandId }, - orderBy: { updatedAt: "desc" }, select: { templatePackageVersionId: true }, }); const versionId = requestedVersionId ?? installation?.templatePackageVersionId ?? undefined; - let source: BootstrapSource; - if (versionId) { - const version = await this.prisma.templatePackageVersion.findUnique({ - where: { id: versionId }, - }); - if (!version) throw new BadRequestException("指定的模板包版本不存在"); - if (version.status !== "published") - throw new BadRequestException("只有已发布的模板包版本可用于 bootstrap"); - const manifest = version.manifestSnapshot as unknown as TemplatePackageManifest; - const issues = validateTemplatePackageManifest(manifest); - if (issues.length) - throw new BadRequestException(`模板包 manifest 无效:${issues.join(";")}`); - if ( - manifest.packageKey !== version.packageKey || - manifest.version !== version.version || - !/^[a-f0-9]{64}$/.test(version.contentChecksum) || - (version.visualTemplateKey ?? version.packageKey) !== - (manifest.visualTemplateKey ?? version.packageKey) || - !manifest.supportedIndustryTemplates.includes(brand.templateKey) - ) - throw new BadRequestException("模板包版本与品牌行业或版本台账不匹配"); - const sample = manifest.sampleContent?.[brand.templateKey]; - if (!sample) throw new BadRequestException("该模板包没有当前行业的 bootstrap sampleContent"); - source = { kind: "package_version", version, manifest, sample }; - } else { - const manifest = getTemplatePackageManifestForVisualKey(visualTemplateKey); - const sample = getTemplateSampleContent(brand.templateKey, visualTemplateKey); - if (!manifest || !sample || requestedVersionId) - throw new BadRequestException("当前模板没有可用的 bootstrap sampleContent"); - source = { kind: "registry", manifest, sample }; - } + if (!versionId) throw new BadRequestException("品牌没有精确模板包安装版本,必须先完成模板安装"); + const version = await this.prisma.templatePackageVersion.findUnique({ + where: { id: versionId }, + }); + if (!version) throw new BadRequestException("指定的模板包版本不存在"); + if (version.status !== "published") + throw new BadRequestException("只有已发布的模板包版本可用于 bootstrap"); + const manifest = version.manifestSnapshot as unknown as TemplatePackageManifest; + const issues = validateTemplatePackageManifest(manifest); + if (issues.length) throw new BadRequestException(`模板包 manifest 无效:${issues.join(";")}`); + if ( + manifest.packageKey !== version.packageKey || + manifest.version !== version.version || + manifest.packageKey !== manifest.visualTemplateKey || + !/^[a-f0-9]{64}$/.test(version.contentChecksum) || + !manifest.supportedIndustryTemplates.includes(brand.templateKey) + ) + throw new BadRequestException("模板包版本与品牌行业或版本台账不匹配"); + const sample = manifest.sampleContent?.[brand.templateKey]; + if (!sample) throw new BadRequestException("该模板包没有当前行业的 bootstrap sampleContent"); + const source: BootstrapSource = { kind: "package_version", version, manifest, sample }; + const visualTemplateKey = manifest.visualTemplateKey; const visual = getVisualTemplate(visualTemplateKey); if (!visual || !isVisualTemplateCompatible(visual, brand.templateKey)) throw new BadRequestException("当前视觉模板与品牌行业不兼容"); @@ -417,8 +397,8 @@ export class AdminSampleContentService { kind: source.kind, packageKey: source.manifest.packageKey, version: source.manifest.version, - contentChecksum: source.version?.contentChecksum ?? null, - ...(source.version ? { templatePackageVersionId: source.version.id } : {}), + contentChecksum: source.version.contentChecksum, + templatePackageVersionId: source.version.id, }; } } diff --git a/apps/api/src/modules/workspace/admin-workspace-preview.controller.ts b/apps/api/src/modules/workspace/admin-workspace-preview.controller.ts index aff3649..7c249bf 100644 --- a/apps/api/src/modules/workspace/admin-workspace-preview.controller.ts +++ b/apps/api/src/modules/workspace/admin-workspace-preview.controller.ts @@ -1,6 +1,6 @@ import { Controller, Get, Post, Body, Req } from "@nestjs/common"; import type { FastifyRequest } from "fastify"; -import { InstallTemplateDto } from "../../admin.dto.js"; +import { InstallTemplateDto, SelectTemplateVersionDto } from "../../admin.dto.js"; import { TemplateWorkspaceService } from "../../template-workspace.service.js"; import { requireAdminIdentity } from "./admin-access.identity.js"; import { AdminWorkspaceService } from "./admin-workspace.service.js"; @@ -52,6 +52,21 @@ class AdminWorkspacePreviewController { throw error; } } + + @Post("template/select-version") + async selectVersion( + @Req() request: FastifyRequest, + @Body() body: SelectTemplateVersionDto, + ): Promise { + const identity = requireAdminIdentity(request); + const requestId = request.headers["x-request-id"]?.toString() ?? request.id; + return this.templateWorkspace.selectVersion( + identity.brandId, + body, + identity.subject, + requestId, + ); + } } export { AdminWorkspacePreviewController }; diff --git a/apps/api/src/modules/workspace/admin-workspace.service.ts b/apps/api/src/modules/workspace/admin-workspace.service.ts index b019862..c36729b 100644 --- a/apps/api/src/modules/workspace/admin-workspace.service.ts +++ b/apps/api/src/modules/workspace/admin-workspace.service.ts @@ -1,10 +1,5 @@ -import { Injectable } from "@nestjs/common"; +import { BadRequestException, Injectable } from "@nestjs/common"; import { PrismaService } from "../../prisma.service.js"; -import { - defaultBrandTemplateKey, - getDefaultVisualTemplateKey, - getTemplatePackageManifestForVisualKey, -} from "@personal-brand/config"; import { PublicWorkspaceService } from "../public/public-workspace.service.js"; @Injectable() @@ -15,11 +10,11 @@ export class AdminWorkspaceService { ) {} async get(brandId: string): Promise { - const [brand, installations, fields, offerings, forms] = await Promise.all([ + const [brand, installation, fields, offerings, forms] = await Promise.all([ this.prisma.brandProfile.findUnique({ where: { id: brandId } }), - this.prisma.brandTemplateInstallation.findMany({ + this.prisma.brandTemplateInstallation.findUnique({ where: { brandId }, - orderBy: { updatedAt: "desc" }, + include: { templatePackageVersion: true }, }), this.prisma.brandFieldDefinition.findMany({ where: { brandId }, @@ -28,36 +23,50 @@ export class AdminWorkspaceService { this.prisma.offering.findMany({ where: { brandId }, orderBy: { sortOrder: "asc" } }), this.prisma.inquiryForm.findMany({ where: { brandId }, orderBy: { updatedAt: "desc" } }), ]); - const config = this.jsonObject(brand?.config); - const templateKey = - typeof config.visualTemplateKey === "string" - ? config.visualTemplateKey - : getDefaultVisualTemplateKey(brand?.templateKey ?? defaultBrandTemplateKey); - const manifest = getTemplatePackageManifestForVisualKey(templateKey); + if (!installation?.templatePackageVersion) + throw new BadRequestException("品牌没有锁定精确视觉模板包版本"); + const manifest = installation.templatePackageVersion.manifestSnapshot as { + visualTemplateKey: string; + displayName: string; + admin: unknown; + navigation: Array<{ key: string; label: string; page: string }>; + templateFields?: Array & { key: string; binding?: string }>; + assetSlots: unknown[]; + trustContentTypes?: unknown[]; + }; return { brand, - installations, + installations: [ + { + ...installation, + visualTemplateKey: manifest.visualTemplateKey, + }, + ], fields, offerings, forms, - templateContent: manifest - ? { - displayName: manifest.displayName, - admin: manifest.admin, - navigation: manifest.navigation.map(({ key, label, page }) => ({ key, label, page })), - templateFields: (manifest.templateFields ?? []).map((field) => ({ - ...field, - binding: field.binding ?? `brand.config.templateData.${field.key}`, - })), - assetSlots: manifest.assetSlots, - trustContentTypes: manifest.trustContentTypes ?? [], - } - : null, + templateContent: { + displayName: manifest.displayName, + admin: manifest.admin, + navigation: manifest.navigation.map(({ key, label, page }) => ({ key, label, page })), + templateFields: (manifest.templateFields ?? []).map((field) => ({ + ...field, + binding: field.binding ?? `brand.config.templateData.${field.key}`, + })), + assetSlots: manifest.assetSlots, + trustContentTypes: manifest.trustContentTypes ?? [], + }, }; } - getPreview(brandId: string): Promise { + async getPreview(brandId: string): Promise { + const installation = await this.prisma.brandTemplateInstallation.findUnique({ + where: { brandId }, + select: { templatePackageVersionId: true }, + }); + if (!installation?.templatePackageVersionId) + throw new BadRequestException("品牌没有锁定精确模板包版本"); return this.publicWorkspace.getForBrandId(brandId, true); } diff --git a/apps/api/src/template-workspace.service.ts b/apps/api/src/template-workspace.service.ts index 1054562..7112200 100644 --- a/apps/api/src/template-workspace.service.ts +++ b/apps/api/src/template-workspace.service.ts @@ -1,45 +1,35 @@ import { BadRequestException, ConflictException, Injectable } from "@nestjs/common"; import type { TemplatePackageVersion } from "@prisma/client"; import { Prisma } from "@prisma/client"; -import { execFile } from "node:child_process"; -import { promisify } from "node:util"; import { type BrandTemplateKey, - defaultBrandTemplateKey, getBrandTemplate, getVisualTemplate, getVisualTemplateManifest, - getDefaultVisualTemplateKey, - getTemplatePackageManifestForVisualKey, isVisualTemplateCompatible, + validateTemplatePackageManifest, } from "@personal-brand/config"; +import type { TemplatePackageManifest } from "@personal-brand/config"; import type { CreateTrustContentDto, UpdateTrustContentDto } from "./admin.dto.js"; import type { RollbackTemplateDto, UpgradeTemplateDto } from "./admin.dto.js"; import { PrismaService } from "./prisma.service.js"; -const execFileAsync = promisify(execFile); - @Injectable() export class TemplateWorkspaceService { constructor(private readonly prisma: PrismaService) {} async getTrustContentTypes(brandId: string): Promise { - const brand = await this.prisma.brandProfile.findUnique({ - where: { id: brandId }, - select: { templateKey: true, config: true }, + const installation = await this.prisma.brandTemplateInstallation.findUnique({ + where: { brandId }, + include: { templatePackageVersion: true }, }); - const config = - brand?.config && typeof brand.config === "object" && !Array.isArray(brand.config) - ? (brand.config as Record) - : {}; - const visualKey = - typeof config.visualTemplateKey === "string" - ? config.visualTemplateKey - : getDefaultVisualTemplateKey(brand?.templateKey ?? defaultBrandTemplateKey); - return ( - getTemplatePackageManifestForVisualKey(visualKey)?.trustContentTypes?.map( - (item) => item.type, - ) ?? [] - ); + if (!installation?.templatePackageVersion) + throw new BadRequestException("品牌没有锁定精确视觉模板包版本"); + const manifest = record( + installation.templatePackageVersion.manifestSnapshot, + ) as unknown as TemplatePackageManifest; + if (validateTemplatePackageManifest(manifest as unknown as TemplatePackageManifest).length) + throw new BadRequestException("当前安装的模板包不符合统一模板契约"); + return manifest.trustContentTypes?.map((item) => item.type) ?? []; } async createTrustContent(brandId: string, body: CreateTrustContentDto) { if (!(await this.getTrustContentTypes(brandId)).includes(body.type)) @@ -87,28 +77,25 @@ export class TemplateWorkspaceService { where: { id: brandId }, select: { templateKey: true }, }), - this.prisma.brandTemplateInstallation.findFirst({ + this.prisma.brandTemplateInstallation.findUnique({ where: { brandId }, - orderBy: { updatedAt: "desc" }, select: { templateKey: true }, }), ]); - // BrandProfile.templateKey 是「品牌使用哪个行业模板」的唯一真相; - // 安装记录只是同一模板的版本台账,缺失时不能反过来改写品牌身份。 - for (const candidate of [brand?.templateKey, installation?.templateKey]) { - const template = candidate ? getBrandTemplate(candidate) : undefined; - if (template) return template.key; - } - return defaultBrandTemplateKey; + const template = brand?.templateKey ? getBrandTemplate(brand.templateKey) : undefined; + if (!template) throw new BadRequestException("品牌没有有效的行业模型声明"); + if (installation && installation.templateKey !== template.key) + throw new BadRequestException("品牌行业模型与模板安装不一致,请修复安装数据"); + return template.key; } - async install(brandId: string, templateKey: BrandTemplateKey, templatePackageVersionId?: string) { + async install(brandId: string, templateKey: BrandTemplateKey, templatePackageVersionId: string) { const template = getBrandTemplate(templateKey); if (!template) throw new BadRequestException("行业模板不存在"); const [existing, brand] = await Promise.all([ - this.prisma.brandTemplateInstallation.findFirst({ where: { brandId } }), + this.prisma.brandTemplateInstallation.findUnique({ where: { brandId } }), this.prisma.brandProfile.findUnique({ where: { id: brandId }, - select: { config: true, templateKey: true }, + select: { templateKey: true }, }), ]); // 一个品牌只使用一个行业模板(BrandProfile.templateKey 即身份)。安装只允许补建当前模板的版本台账, @@ -118,20 +105,13 @@ export class TemplateWorkspaceService { throw new BadRequestException( `当前品牌已在使用「${currentTemplate.name}」行业模板,更换行业模板不在本版本范围内`, ); - if (existing && existing.templateKey === templateKey) - throw new BadRequestException("该模板已经安装"); - const brandConfig = - brand?.config && typeof brand.config === "object" && !Array.isArray(brand.config) - ? (brand.config as Record) - : {}; - const configuredVisualTemplateKey = - typeof brandConfig.visualTemplateKey === "string" ? brandConfig.visualTemplateKey : undefined; - const visualTemplateKey = - configuredVisualTemplateKey && - getVisualTemplate(configuredVisualTemplateKey) && - isVisualTemplateCompatible(getVisualTemplate(configuredVisualTemplateKey)!, templateKey) - ? configuredVisualTemplateKey - : getDefaultVisualTemplateKey(templateKey); + if (existing) throw new BadRequestException("品牌已经安装模板包,请使用明确的升级流程"); + const packageVersion = await this.resolveInstallablePackageVersion( + templateKey, + templatePackageVersionId, + ); + const packageManifest = packageVersion.manifestSnapshot as unknown as TemplatePackageManifest; + const visualTemplateKey = packageManifest.visualTemplateKey; const visualManifest = getVisualTemplateManifest(visualTemplateKey); const visualTemplate = getVisualTemplate(visualTemplateKey); if ( @@ -140,39 +120,19 @@ export class TemplateWorkspaceService { !isVisualTemplateCompatible(visualTemplate, templateKey) ) throw new BadRequestException("当前视觉模板不适配行业模板"); - const templatePackageSnapshot = { - schemaVersion: "1.0", - version: template.version, - industryTemplate: template, - visualTemplate: visualManifest, - capabilities: template.capabilities, - }; - const packageVersion = await this.resolveInstallablePackageVersion( - templateKey, - visualTemplateKey, - templatePackageVersionId, - ); return this.prisma.$transaction(async (tx) => { - // 安装记录与品牌身份必须同时落库,否则会出现「品牌在跑 A 模板、台账记的是 B」的漂移。 - // 已经自定义过视觉模板的品牌,补建台账时保留原选择,只把行业模板身份写回。 - const nextConfig = ( - brandConfig.visualTemplateKey === undefined - ? { ...brandConfig, visualTemplateKey } - : brandConfig - ) as Prisma.InputJsonValue; await tx.brandProfile.update({ where: { id: brandId }, - data: { templateKey, config: nextConfig }, + data: { templateKey }, }); const installation = await tx.brandTemplateInstallation.create({ data: { brandId, templateKey, templateVersion: template.version, - visualTemplateKey, - templatePackageVersionId: packageVersion?.id ?? null, - contentChecksum: packageVersion?.contentChecksum ?? null, - configSnapshot: templatePackageSnapshot as unknown as Prisma.InputJsonValue, + templatePackageVersionId: packageVersion.id, + contentChecksum: packageVersion.contentChecksum, + configSnapshot: packageVersion.manifestSnapshot as Prisma.InputJsonValue, }, }); await tx.brandFieldDefinition.createMany({ @@ -192,42 +152,112 @@ export class TemplateWorkspaceService { } private async resolveInstallablePackageVersion( templateKey: BrandTemplateKey, - visualTemplateKey: string, - templatePackageVersionId?: string, - ): Promise { - const version = templatePackageVersionId - ? await this.prisma.templatePackageVersion.findUnique({ - where: { id: templatePackageVersionId }, - }) - : await this.prisma.templatePackageVersion.findFirst({ - where: { packageKey: visualTemplateKey, status: "published" }, - orderBy: { importedAt: "desc" }, - }); - if (!version) { - if (templatePackageVersionId) throw new BadRequestException("指定的模板包版本不存在"); - return null; - } + templatePackageVersionId: string, + ): Promise { + const version = await this.prisma.templatePackageVersion.findUnique({ + where: { id: templatePackageVersionId }, + }); + if (!version) throw new BadRequestException("指定的模板包版本不存在"); if (version.status !== "published") throw new BadRequestException("只有已发布的模板包版本可以安装到品牌"); const manifest = record(version.manifestSnapshot); - const manifestVisualTemplateKey = - typeof manifest.visualTemplateKey === "string" - ? manifest.visualTemplateKey - : version.packageKey; if ( manifest.packageKey !== version.packageKey || manifest.version !== version.version || - manifestVisualTemplateKey !== visualTemplateKey || + typeof manifest.visualTemplateKey !== "string" || + manifest.packageKey !== manifest.visualTemplateKey || !Array.isArray(manifest.supportedIndustryTemplates) || !manifest.supportedIndustryTemplates.includes(templateKey) ) { throw new BadRequestException("模板包版本与行业或视觉模板不匹配"); } + if (validateTemplatePackageManifest(manifest as unknown as TemplatePackageManifest).length) + throw new BadRequestException("模板包版本不符合统一模板契约"); return version; } + async selectVersion( + brandId: string, + body: { + templatePackageVersionId: string; + expectedCurrentPackageVersionId?: string | null; + confirm: boolean; + }, + actorId: string, + requestId?: string, + ) { + if (!body.confirm) throw new BadRequestException("选择模板版本必须显式确认"); + const [installation, brand, target] = await Promise.all([ + this.installation(brandId), + this.prisma.brandProfile.findUnique({ + where: { id: brandId }, + select: { templateKey: true }, + }), + this.prisma.templatePackageVersion.findUnique({ + where: { id: body.templatePackageVersionId }, + }), + ]); + if (!brand) throw new BadRequestException("品牌不存在"); + if (body.expectedCurrentPackageVersionId !== installation.templatePackageVersionId) + throw new ConflictException("当前模板版本已变化,请刷新后重试"); + if (!target || target.status !== "published") + throw new BadRequestException("指定模板包版本不存在或未发布"); + const manifest = record(target.manifestSnapshot) as unknown as TemplatePackageManifest; + if ( + target.packageKey !== manifest.packageKey || + target.version !== manifest.version || + manifest.packageKey !== manifest.visualTemplateKey || + !manifest.supportedIndustryTemplates?.includes(brand.templateKey) || + validateTemplatePackageManifest(manifest).length + ) + throw new BadRequestException("指定模板包版本不符合当前品牌的统一模板契约"); + if (target.id === installation.templatePackageVersionId) + return { installation, unchanged: true }; + const history = Array.isArray(installation.previousSnapshots) + ? installation.previousSnapshots + : []; + const updated = await this.prisma.$transaction(async (tx) => { + const changed = await tx.brandTemplateInstallation.updateMany({ + where: { + id: installation.id, + templatePackageVersionId: installation.templatePackageVersionId, + }, + data: { + templatePackageVersionId: target.id, + templateVersion: target.version, + contentChecksum: target.contentChecksum, + configSnapshot: manifest as unknown as Prisma.InputJsonValue, + previousSnapshots: [...history, installation.configSnapshot], + }, + }); + if (changed.count !== 1) throw new ConflictException("当前模板版本已变化,请刷新后重试"); + await tx.templatePackageAuditLog.create({ + data: { + templatePackageVersionId: target.id, + actorId, + action: "brand_template_selected", + ...(requestId ? { requestId } : {}), + metadata: { + brandId, + fromVersionId: installation.templatePackageVersionId, + toVersionId: target.id, + contentChecksum: target.contentChecksum, + }, + }, + }); + return tx.brandTemplateInstallation.findUniqueOrThrow({ + where: { id: installation.id }, + include: { templatePackageVersion: true }, + }); + }); + return { installation: updated, unchanged: false }; + } + private async installation(brandId: string) { - const item = await this.prisma.brandTemplateInstallation.findFirst({ where: { brandId } }); + const item = await this.prisma.brandTemplateInstallation.findUnique({ + where: { brandId }, + include: { templatePackageVersion: true }, + }); if (!item) throw new BadRequestException("尚未安装行业模板"); return item; } @@ -235,30 +265,37 @@ export class TemplateWorkspaceService { const templateKey = await this.getEffectiveTemplateKey(brandId); const template = getBrandTemplate(templateKey); if (!template) throw new BadRequestException("当前行业模板不存在"); - const [installation, brand] = await Promise.all([ - this.prisma.brandTemplateInstallation.findFirst({ where: { brandId } }), - this.prisma.brandProfile.findUnique({ where: { id: brandId }, select: { config: true } }), - ]); - // 品牌一直有行业模板,但版本台账可能还没建立;此时以模板目录的版本为准,不报错。 - const currentVersion = installation?.templateVersion ?? template.version; + const installation = await this.installation(brandId); + const brand = await this.prisma.brandProfile.findUnique({ + where: { id: brandId }, + select: { config: true }, + }); const config = record(brand?.config); - const visualTemplateKey = - installation?.visualTemplateKey ?? - (typeof config.visualTemplateKey === "string" ? config.visualTemplateKey : undefined) ?? - getDefaultVisualTemplateKey(templateKey); - const currentPackage = installation?.templatePackageVersionId - ? await this.prisma.templatePackageVersion.findUnique({ - where: { id: installation.templatePackageVersionId }, - }) - : null; - const targetPackage = visualTemplateKey - ? await this.prisma.templatePackageVersion.findFirst({ - where: { packageKey: visualTemplateKey, status: "published" }, - orderBy: { importedAt: "desc" }, - }) - : null; + if (!installation.templatePackageVersion || !installation.templatePackageVersionId) + throw new BadRequestException("品牌安装没有锁定精确视觉模板包版本"); + const currentVersion = installation.templateVersion; + const visualTemplateKey = record( + installation.templatePackageVersion.manifestSnapshot, + ).visualTemplateKey; + if (typeof visualTemplateKey !== "string") + throw new BadRequestException("已安装模板版本缺少 visualTemplateKey 声明"); + const [currentPackage, targetPackage] = await Promise.all([ + this.prisma.templatePackageVersion.findUnique({ + where: { id: installation.templatePackageVersionId }, + }), + this.prisma.templatePackageVersion.findFirst({ + where: { packageKey: visualTemplateKey, status: "published" }, + orderBy: { importedAt: "desc" }, + }), + ]); + if (!currentPackage) throw new BadRequestException("当前安装引用的模板包版本不存在"); + if ( + currentPackage.packageKey !== visualTemplateKey || + record(currentPackage.manifestSnapshot).visualTemplateKey !== visualTemplateKey + ) + throw new BadRequestException("品牌安装与模板包视觉声明不一致"); const targetManifest = record(targetPackage?.manifestSnapshot); - const currentManifest = record(currentPackage?.manifestSnapshot); + const currentManifest = record(currentPackage.manifestSnapshot); const currentDeclarations = manifestRecords(currentManifest.templateFields); const targetDeclarations = manifestRecords(targetManifest.templateFields); const currentByKey = new Map(currentDeclarations.map((item) => [String(item.key), item])); @@ -316,12 +353,11 @@ export class TemplateWorkspaceService { templateKey, currentVersion, latestVersion: targetPackage?.version ?? template.version, - currentPackageVersionId: currentPackage?.id ?? null, - currentContentChecksum: - currentPackage?.contentChecksum ?? installation?.contentChecksum ?? null, + currentPackageVersionId: currentPackage.id, + currentContentChecksum: currentPackage.contentChecksum, targetPackageVersionId: targetPackage?.id ?? null, targetContentChecksum: targetPackage?.contentChecksum ?? null, - canUpgrade: Boolean(targetPackage && targetPackage.id !== currentPackage?.id), + canUpgrade: Boolean(targetPackage && targetPackage.id !== currentPackage.id), canRollback: Array.isArray(installation?.previousSnapshots) && installation.previousSnapshots.length > 0, changes: { @@ -404,7 +440,8 @@ export class TemplateWorkspaceService { throw new ConflictException("冲突处理与当前预览不一致,请重新预览并逐项确认"); const manifest = record(target.manifestSnapshot); if ( - target.packageKey !== installation.visualTemplateKey || + target.packageKey !== + record(installation.templatePackageVersion?.manifestSnapshot).visualTemplateKey || manifest.packageKey !== target.packageKey || manifest.version !== target.version || !Array.isArray(manifest.supportedIndustryTemplates) || @@ -474,12 +511,15 @@ export class TemplateWorkspaceService { where: { packageKey: previousManifest.packageKey, version }, }) : null; + if (!previousPackage) + throw new BadRequestException("历史模板包版本不存在,不能回滚到未锁定版本"); if ( - previousPackage && - (previousPackage.packageKey !== installation.visualTemplateKey || - !stringList(record(previousPackage.manifestSnapshot).supportedIndustryTemplates).includes( - installation.templateKey, - )) + previousPackage.packageKey !== + record(installation.templatePackageVersion?.manifestSnapshot).visualTemplateKey || + previousPackage.packageKey !== record(previousPackage.manifestSnapshot).visualTemplateKey || + !stringList(record(previousPackage.manifestSnapshot).supportedIndustryTemplates).includes( + installation.templateKey, + ) ) throw new BadRequestException("上一版模板包与当前品牌行业或视觉模板不兼容"); const updated = await this.prisma.$transaction(async (tx) => { @@ -491,8 +531,8 @@ export class TemplateWorkspaceService { }, data: { templateVersion: version, - templatePackageVersionId: previousPackage?.id ?? null, - contentChecksum: previousPackage?.contentChecksum ?? null, + templatePackageVersionId: previousPackage.id, + contentChecksum: previousPackage.contentChecksum, configSnapshot: previous, previousSnapshots: history.slice(0, -1), }, @@ -509,7 +549,7 @@ export class TemplateWorkspaceService { brandId, fromVersionId: installation.templatePackageVersionId, fromVersion: installation.templateVersion, - toVersionId: previousPackage?.id ?? null, + toVersionId: previousPackage.id, toVersion: version, }, }, @@ -525,28 +565,9 @@ export class TemplateWorkspaceService { } async function readPackageFiles( - version: Pick< - TemplatePackageVersion, - "artifactPath" | "validationReport" | "packageKey" | "version" - >, + version: Pick, ): Promise[]> { - const stored = manifestRecords(record(version.validationReport).files); - if (stored.length) return stored; - const root = `${version.packageKey}-${version.version}`; - const checksumEntry = `${root}/checksums.json`; - if (!/^[a-z0-9]+(?:-[a-z0-9]+)*$/.test(version.packageKey) || root.includes("/")) return []; - try { - const { stdout: entries } = await execFileAsync("tar", ["-tzf", version.artifactPath], { - maxBuffer: 4 * 1024 * 1024, - }); - if (!entries.split("\n").some((entry) => entry === checksumEntry)) return []; - const { stdout } = await execFileAsync("tar", ["-xOzf", version.artifactPath, checksumEntry], { - maxBuffer: 4 * 1024 * 1024, - }); - return manifestRecords(record(JSON.parse(stdout)).files); - } catch { - return []; - } + return manifestRecords(record(version.validationReport).files); } function record(value: unknown): Record { diff --git a/apps/api/test/api-routes.test.ts b/apps/api/test/api-routes.test.ts index a3c563d..d02b35b 100644 --- a/apps/api/test/api-routes.test.ts +++ b/apps/api/test/api-routes.test.ts @@ -20,6 +20,7 @@ const expectedRoutes = new Set([ "GET /admin/workspace/template/preview", "POST /admin/workspace/template/upgrade", "POST /admin/workspace/template/rollback", + "POST /admin/workspace/template/select-version", "GET /admin/workspace/capabilities", "GET /admin/workspace/sample-content/preview", "POST /admin/workspace/sample-content/import", diff --git a/apps/api/test/http.integration.test.js b/apps/api/test/http.integration.test.js index 74f3a08..0d91f6f 100644 --- a/apps/api/test/http.integration.test.js +++ b/apps/api/test/http.integration.test.js @@ -66,11 +66,22 @@ function createTemplateArchive(template = "acheng-campus-food", mutateManifest) mutateManifest(manifest); const content = Buffer.from(JSON.stringify(manifest)); writeFileSync(manifestPath, content); + const packageJsonPath = path.join(directory, "package.json"); + const packageJson = JSON.parse(readFileSync(packageJsonPath, "utf8")); + packageJson.version = manifest.version; + const packageContent = Buffer.from(JSON.stringify(packageJson)); + writeFileSync(packageJsonPath, packageContent); const checksumPath = path.join(directory, "checksums.json"); const checksums = JSON.parse(readFileSync(checksumPath, "utf8")); + checksums.version = manifest.version; const entry = checksums.files.find((item) => item.path === "template.json"); entry.bytes = content.length; entry.sha256 = createHash("sha256").update(content).digest("hex"); + const packageEntry = checksums.files.find((item) => item.path === "package.json"); + if (packageEntry) { + packageEntry.bytes = packageContent.length; + packageEntry.sha256 = createHash("sha256").update(packageContent).digest("hex"); + } const canonicalEntries = checksums.files.map((item) => ({ bytes: item.bytes, path: item.path, @@ -122,16 +133,30 @@ test("模板目录只允许平台模板管理员访问,并支持安全、幂 const headers = { authorization: `Bearer ${JSON.parse(login.body).token}` }; const empty = await request("/admin/templates", { headers }); assert.equal(empty.statusCode, 200); - assert.deepEqual(JSON.parse(empty.body).items, []); - assert.equal(JSON.parse(empty.body).total, 0); + const baseline = JSON.parse(empty.body); + assert.deepEqual(baseline.items.map((item) => item.packageKey).sort(), [ + "acheng-campus-food", + "linjing-editorial", + ]); + const linjingVersion = baseline.items.find((item) => item.packageKey === "linjing-editorial"); + assert.ok(linjingVersion); + assert.equal(linjingVersion.version, "1.0.5"); + const linjingPreview = await request( + `/admin/templates/${linjingVersion.id}/preview?industry=doors`, + { headers }, + ); + assert.equal(linjingPreview.statusCode, 200, linjingPreview.body); + assert.equal(JSON.parse(linjingPreview.body).compatibility.renderer.key, "linjing-editorial"); - const archive = createTemplateArchive(); + const archive = createTemplateArchive("atelier-solopreneur", (manifest) => { + manifest.version = "99.0.0"; + }); const imported = await request("/admin/templates/import", { method: "POST", headers: { ...headers, ...multipartArchive(archive).headers }, rawPayload: multipartArchive(archive).payload, }); - assert.equal(imported.statusCode, 201); + assert.equal(imported.statusCode, 201, imported.body); assert.equal(JSON.parse(imported.body).imported, true); const repeated = await request("/admin/templates/import", { method: "POST", @@ -142,9 +167,13 @@ test("模板目录只允许平台模板管理员访问,并支持安全、幂 assert.equal(JSON.parse(repeated.body).idempotent, true); const listed = await request("/admin/templates", { headers }); const listedBody = JSON.parse(listed.body); - assert.equal(listedBody.items.length, 1); - assert.equal(listedBody.items[0].status, "imported"); - const versionId = listedBody.items[0].id; + assert.equal(listedBody.items.length, baseline.items.length + 1); + const newVersion = listedBody.items.find( + (item) => item.packageKey === "atelier-solopreneur" && item.version === "99.0.0", + ); + assert.ok(newVersion); + assert.equal(newVersion.status, "imported"); + const versionId = newVersion.id; const importedVersion = await prisma.templatePackageVersion.findUniqueOrThrow({ where: { id: versionId }, }); @@ -349,7 +378,7 @@ test("平台模板管理员可以按行业预览版本,且预览不写入品 assert.match(body.workspace.brand.id, /^template-preview:/); assert.equal(body.workspace.offerings.length > 0, true); assert.equal(body.workspace.inquiryForms.length, 1); - assert.equal(body.workspace.brand.config.visualTemplateKey, "atelier-solopreneur"); + assert.equal(Object.hasOwn(body.workspace.brand.config ?? {}, "visualTemplateKey"), false); assert.equal(body.template.pages.includes("profile"), true); assert.equal(body.template.pages.includes("inquiry"), true); assert.equal(body.preview.fixtureSource, "previewFixture"); @@ -483,10 +512,10 @@ test("平台模板管理员可以按行业预览版本,且预览不写入品 }, }, }, - /所属行业/, + /所属行业|must match its key/, ], [{ ...stored.manifestSnapshot, requiredCapabilities: ["unknown"] }, /未注册的 capability/], - [{ ...stored.manifestSnapshot, visualTemplateKey: "unknown" }, /renderer/], + [{ ...stored.manifestSnapshot, visualTemplateKey: "unknown" }, /元数据/], [{ ...stored.manifestSnapshot, runtimeContract: "9.0" }, /契约/], [{ ...stored.manifestSnapshot, dataSlots: [null] }, /契约/], [{ ...stored.manifestSnapshot, navigation: [null] }, /契约/], @@ -508,7 +537,7 @@ test("平台模板管理员可以按行业预览版本,且预览不写入品 where: { id: versionId }, data: { archiveChecksum: stored.archiveChecksum }, }); - // 独立演示内容不依赖 bootstrap;旧包则显式标明兼容来源。 + // 独立演示内容不依赖 bootstrap sampleContent。 await prisma.templatePackageVersion.update({ where: { id: versionId }, data: { manifestSnapshot: { ...stored.manifestSnapshot, sampleContent: {} } }, @@ -527,9 +556,8 @@ test("平台模板管理员可以按行业预览版本,且预览不写入品 const legacy = await request(`/admin/templates/${versionId}/preview?industry=personal`, { headers, }); - assert.equal(legacy.statusCode, 200, legacy.body); - assert.equal(JSON.parse(legacy.body).preview.fixtureSource, "legacy-sampleContent"); - assert.equal(JSON.parse(legacy.body).preview.diagnostics[0].code, "LEGACY_PREVIEW_SAMPLE"); + assert.equal(legacy.statusCode, 400, legacy.body); + assert.match(JSON.parse(legacy.body).error.message, /previewFixture/); for (const [manifestSnapshot, reason] of failures) { await prisma.templatePackageVersion.update({ where: { id: versionId }, @@ -1848,7 +1876,7 @@ test("health and public content are available without authentication", async () assert.equal(missingSlug.statusCode, 404); }); -test("visual template compatibility is enforced by catalog, preview, and brand switching", async () => { +test("visual template compatibility is enforced by catalog, preview, and version selection", async () => { const catalog = await request("/public/templates"); assert.equal(catalog.statusCode, 200); const visuals = JSON.parse(catalog.body).visuals; @@ -1875,12 +1903,20 @@ test("visual template compatibility is enforced by catalog, preview, and brand s payload: { username: "admin", password: process.env.SEED_ADMIN_PASSWORD }, }); const token = JSON.parse(login.body).data?.token ?? JSON.parse(login.body).token; - const compatibleSwitch = await request("/admin/config/brand", { - method: "PATCH", - headers: { authorization: `Bearer ${token}` }, - payload: { config: { visualTemplateKey: "acheng-campus-food" } }, + const installation = await prisma.brandTemplateInstallation.findUniqueOrThrow({ + where: { brandId }, }); - assert.equal(compatibleSwitch.statusCode, 200); + const compatibleSwitch = await request("/admin/workspace/template/select-version", { + method: "POST", + headers: { authorization: `Bearer ${token}` }, + payload: { + templatePackageVersionId: installation.templatePackageVersionId, + expectedCurrentPackageVersionId: installation.templatePackageVersionId, + confirm: true, + }, + }); + assert.equal(compatibleSwitch.statusCode, 201); + assert.equal(JSON.parse(compatibleSwitch.body).unchanged, true); }); test("industry template state has a single source of truth", async () => { @@ -1890,11 +1926,16 @@ test("industry template state has a single source of truth", async () => { }); assert.ok(brand); const templateKey = brand.templateKey; - const visualTemplateKey = brand.config?.visualTemplateKey; - const installationBefore = await prisma.brandTemplateInstallation.findFirst({ + assert.equal(Object.hasOwn(brand.config ?? {}, "visualTemplateKey"), false); + const installation = await prisma.brandTemplateInstallation.findUnique({ where: { brandId }, }); - const fieldsBefore = await prisma.brandFieldDefinition.findMany({ where: { brandId } }); + assert.ok(installation?.templatePackageVersionId); + const packageVersion = await prisma.templatePackageVersion.findUniqueOrThrow({ + where: { id: installation.templatePackageVersionId }, + }); + assert.equal(packageVersion.version, installation.templateVersion); + assert.equal(packageVersion.packageKey, installation.configSnapshot.packageKey); const unauthorized = await request("/admin/workspace/template/preview"); assert.equal(unauthorized.statusCode, 401); @@ -1912,22 +1953,24 @@ test("industry template state has a single source of truth", async () => { }; try { - // 品牌身份来自 BrandProfile.templateKey;即使版本台账缺失,预览也必须可用而不是 400。 const preview = await request("/admin/workspace/template/preview", { headers }); assert.equal(preview.statusCode, 200); const previewBody = JSON.parse(preview.body); assert.equal(previewBody.templateKey, templateKey); assert.equal(previewBody.currentVersion, previewBody.latestVersion); assert.equal(previewBody.canUpgrade, false); - assert.equal(previewBody.canRollback, Boolean(installationBefore?.previousSnapshots?.length)); + assert.equal(previewBody.canRollback, Boolean(installation.previousSnapshots?.length)); const otherKey = templateKey === "personal" ? "food" : "personal"; - // 安装其他行业模板必须被拒绝,且不能改写品牌身份或视觉模板。 + // 安装其他行业模板必须被拒绝,且不能改写品牌身份或版本引用。 const rejected = await request("/admin/workspace/install", { method: "POST", headers, - payload: { templateKey: otherKey }, + payload: { + templateKey: otherKey, + templatePackageVersionId: installation.templatePackageVersionId, + }, }); assert.equal(rejected.statusCode, 400); assert.match(errorMessage(rejected.body), /更换行业模板不在本版本范围内/); @@ -1936,58 +1979,17 @@ test("industry template state has a single source of truth", async () => { select: { templateKey: true, config: true }, }); assert.equal(afterRejected.templateKey, templateKey); - assert.equal(afterRejected.config?.visualTemplateKey, visualTemplateKey); + assert.equal(Object.hasOwn(afterRejected.config ?? {}, "visualTemplateKey"), false); - // 台账已存在时重复安装当前模板应被拒绝。 - if (installationBefore) { - const repeated = await request("/admin/workspace/install", { - method: "POST", - headers, - payload: { templateKey }, - }); - assert.equal(repeated.statusCode, 400); - assert.match(errorMessage(repeated.body), /已经安装/); - - // 缺失的版本台账可以由安装补齐,且不改动品牌身份与视觉模板。 - await prisma.brandTemplateInstallation.deleteMany({ where: { brandId } }); - const repaired = await request("/admin/workspace/install", { - method: "POST", - headers, - payload: { templateKey }, - }); - assert.equal(repaired.statusCode, 201, repaired.body); - const installationAfter = await prisma.brandTemplateInstallation.findFirst({ - where: { brandId }, - }); - assert.equal(installationAfter.templateKey, templateKey); - const afterRepair = await prisma.brandProfile.findUnique({ - where: { id: brandId }, - select: { templateKey: true, config: true }, - }); - assert.equal(afterRepair.templateKey, templateKey); - assert.equal(afterRepair.config?.visualTemplateKey, visualTemplateKey); - } - } finally { - const createdFieldIds = (await prisma.brandFieldDefinition.findMany({ where: { brandId } })) - .filter((item) => !fieldsBefore.some((current) => current.id === item.id)) - .map((item) => item.id); - if (createdFieldIds.length) - await prisma.brandFieldDefinition.deleteMany({ where: { id: { in: createdFieldIds } } }); - await prisma.brandTemplateInstallation.deleteMany({ where: { brandId } }); - if (installationBefore) { - await prisma.brandTemplateInstallation.create({ - data: { - brandId, - templateKey: installationBefore.templateKey, - templateVersion: installationBefore.templateVersion, - configSnapshot: installationBefore.configSnapshot, - }, - }); - } - await prisma.brandProfile.update({ - where: { id: brandId }, - data: { templateKey, config: brand.config }, + const repeated = await request("/admin/workspace/install", { + method: "POST", + headers, + payload: { templateKey, templatePackageVersionId: installation.templatePackageVersionId }, }); + assert.equal(repeated.statusCode, 400); + assert.match(errorMessage(repeated.body), /已经安装/); + } finally { + await prisma.brandTemplateInstallation.findUniqueOrThrow({ where: { brandId } }); } }); @@ -2158,16 +2160,12 @@ test("editor membership can manage brand content but cannot change system settin headers: { authorization: `Bearer ${token}` }, }); assert.equal(capabilities.statusCode, 403); - const visualHistory = await request("/admin/config/visual-template/history", { - headers: { authorization: `Bearer ${token}` }, - }); - assert.equal(visualHistory.statusCode, 403); const visualUpdate = await request("/admin/config/brand", { method: "PATCH", headers: { authorization: `Bearer ${token}` }, payload: { config: { visualTemplateKey: "unknown-visual" } }, }); - assert.equal(visualUpdate.statusCode, 403); + assert.equal(visualUpdate.statusCode, 400); } finally { await prisma.brandMembership.update({ where: { id: membership.id }, @@ -2352,10 +2350,9 @@ test("admin capability list includes template defaults and brand overrides", asy test("installing another industry template is rejected without drifting brand identity", async () => { const originalBrand = await prisma.brandProfile.findUniqueOrThrow({ where: { id: brandId } }); - await prisma.inquirySubmission.deleteMany({ where: { brandId } }); - await prisma.inquiryForm.deleteMany({ where: { brandId } }); - await prisma.brandFieldDefinition.deleteMany({ where: { brandId } }); - await prisma.brandTemplateInstallation.deleteMany({ where: { brandId } }); + const installationBefore = await prisma.brandTemplateInstallation.findUniqueOrThrow({ + where: { brandId }, + }); const login = await request("/admin/session/login", { method: "POST", payload: { username: "admin", password: process.env.SEED_ADMIN_PASSWORD }, @@ -2367,16 +2364,22 @@ test("installing another industry template is rejected without drifting brand id const installed = await request("/admin/workspace/install", { method: "POST", headers, - payload: { templateKey: "doors" }, + payload: { + templateKey: "doors", + templatePackageVersionId: installationBefore.templatePackageVersionId, + }, }); assert.equal(installed.statusCode, 400, installed.body); assert.match(errorMessage(installed.body), /更换行业模板不在本版本范围内/); - // 拒绝之后不能留下任何漂移:品牌身份、视觉模板、台账都不变。 + // 拒绝之后品牌身份和 package version 引用保持不变。 const brandAfter = await prisma.brandProfile.findUniqueOrThrow({ where: { id: brandId } }); assert.equal(brandAfter.templateKey, originalBrand.templateKey); - assert.deepEqual(brandAfter.config, originalBrand.config); - assert.equal(await prisma.brandTemplateInstallation.count({ where: { brandId } }), 0); + assert.equal(Object.hasOwn(brandAfter.config ?? {}, "visualTemplateKey"), false); + assert.deepEqual( + await prisma.brandTemplateInstallation.findUniqueOrThrow({ where: { brandId } }), + installationBefore, + ); // 公开运行时仍按品牌身份走 food 模板,没有被 doors 污染。 const workspace = await request("/public/workspace"); @@ -2389,28 +2392,17 @@ test("installing another industry template is rejected without drifting brand id assert.equal(samplePreview.statusCode, 200); assert.equal(JSON.parse(samplePreview.body).templateKey, originalBrand.templateKey); } finally { - await prisma.brandFieldDefinition.deleteMany({ where: { brandId } }); - await prisma.brandTemplateInstallation.deleteMany({ where: { brandId } }); - await prisma.brandProfile.update({ - where: { id: brandId }, - data: { templateKey: originalBrand.templateKey, config: originalBrand.config }, - }); + assert.equal( + (await prisma.brandProfile.findUniqueOrThrow({ where: { id: brandId } })).templateKey, + originalBrand.templateKey, + ); } }); -test("cross template requests are rejected even when a drifted ledger already exists", async () => { +test("cross template requests are rejected without creating a drifted installation", async () => { const originalBrand = await prisma.brandProfile.findUniqueOrThrow({ where: { id: brandId } }); - await prisma.inquirySubmission.deleteMany({ where: { brandId } }); - await prisma.inquiryForm.deleteMany({ where: { brandId } }); - await prisma.brandFieldDefinition.deleteMany({ where: { brandId } }); - await prisma.brandTemplateInstallation.deleteMany({ where: { brandId } }); - await prisma.brandTemplateInstallation.create({ - data: { - brandId, - templateKey: "doors", - templateVersion: "1.0.0", - configSnapshot: { schemaVersion: "1.0" }, - }, + const installationBefore = await prisma.brandTemplateInstallation.findUniqueOrThrow({ + where: { brandId }, }); const login = await request("/admin/session/login", { method: "POST", @@ -2423,36 +2415,44 @@ test("cross template requests are rejected even when a drifted ledger already ex const rejected = await request("/admin/workspace/install", { method: "POST", headers, - payload: { templateKey: "doors" }, + payload: { + templateKey: "doors", + templatePackageVersionId: installationBefore.templatePackageVersionId, + }, }); assert.equal(rejected.statusCode, 400, rejected.body); assert.match(errorMessage(rejected.body), /更换行业模板不在本版本范围内/); const brandAfter = await prisma.brandProfile.findUniqueOrThrow({ where: { id: brandId } }); assert.equal(brandAfter.templateKey, originalBrand.templateKey); - assert.equal(await prisma.brandTemplateInstallation.count({ where: { brandId } }), 1); + assert.deepEqual( + await prisma.brandTemplateInstallation.findUniqueOrThrow({ where: { brandId } }), + installationBefore, + ); const workspace = await request("/public/workspace"); assert.equal(workspace.statusCode, 200); assert.equal(JSON.parse(workspace.body).template.key, originalBrand.templateKey); } finally { - await prisma.brandFieldDefinition.deleteMany({ where: { brandId } }); - await prisma.brandTemplateInstallation.deleteMany({ where: { brandId } }); - await prisma.brandProfile.update({ - where: { id: brandId }, - data: { templateKey: originalBrand.templateKey, config: originalBrand.config }, - }); + assert.equal( + (await prisma.brandProfile.findUniqueOrThrow({ where: { id: brandId } })).templateKey, + originalBrand.templateKey, + ); } }); test("admin can preview and import sample content idempotently", async () => { const originalBrand = await prisma.brandProfile.findUnique({ where: { id: brandId } }); + const originalInstallation = await prisma.brandTemplateInstallation.findUniqueOrThrow({ + where: { brandId }, + }); const originalForms = await prisma.inquiryForm.findMany({ where: { brandId } }); const originalSampleTrust = await prisma.trustContent.findMany({ where: { brandId, content: "示例内容,待品牌主理人完善。" }, }); - await prisma.brandProfile.update({ where: { id: brandId }, data: { templateKey: "doors" } }); - await prisma.brandTemplateInstallation.deleteMany({ where: { brandId } }); + assert.equal(originalBrand?.templateKey, "food"); + const packageVersionId = originalInstallation.templatePackageVersionId; + assert.ok(packageVersionId); await prisma.offering.deleteMany({ where: { brandId, @@ -2463,53 +2463,23 @@ test("admin can preview and import sample content idempotently", async () => { where: { brandId, content: "示例内容,待品牌主理人完善。" }, }); await prisma.brandFieldDefinition.deleteMany({ where: { brandId, source: "sample" } }); - if (!originalForms.some((item) => item.isEnabled)) { - await prisma.inquiryForm.create({ - data: { - brandId, - name: "现有客户表单", - fieldsSnapshot: [{ key: "phone", label: "联系电话", type: "tel", required: true }], - }, - }); - } + await prisma.inquiryForm.create({ + data: { + brandId, + name: "现有客户表单", + fieldsSnapshot: [{ key: "phone", label: "联系电话", type: "tel", required: true }], + }, + }); const login = await request("/admin/session/login", { method: "POST", payload: { username: "admin", password: process.env.SEED_ADMIN_PASSWORD }, }); const token = JSON.parse(login.body).data?.token ?? JSON.parse(login.body).token; const headers = { authorization: `Bearer ${token}` }; - const archive = createTemplateArchive("acheng-campus-food"); - const uploaded = multipartArchive(archive); - const importedPackage = await request("/admin/templates/import", { - method: "POST", - headers: { ...headers, ...uploaded.headers }, - rawPayload: uploaded.payload, - }); - assert.equal(importedPackage.statusCode, 201, importedPackage.body); - const packageVersionId = JSON.parse(importedPackage.body).version.id; - const publishedPackage = await request(`/admin/templates/${packageVersionId}/publish`, { - method: "POST", - headers, - }); - assert.equal(publishedPackage.statusCode, 201, publishedPackage.body); - await prisma.brandProfile.update({ - where: { id: brandId }, - data: { templateKey: "food", config: { visualTemplateKey: "acheng-campus-food" } }, - }); - await prisma.brandTemplateInstallation.create({ - data: { - brandId, - templateKey: "food", - visualTemplateKey: "acheng-campus-food", - templatePackageVersionId: packageVersionId, - contentChecksum: JSON.parse(importedPackage.body).version.contentChecksum, - templateVersion: JSON.parse(importedPackage.body).version.version, - configSnapshot: { schemaVersion: "1.0" }, - }, - }); - const preview = await request("/admin/workspace/sample-content/preview", { - headers, - }); + const preview = await request( + `/admin/workspace/sample-content/preview?templatePackageVersionId=${packageVersionId}`, + { headers }, + ); assert.equal(preview.statusCode, 200); assert.equal(JSON.parse(preview.body).source.templatePackageVersionId, packageVersionId); assert.equal(JSON.parse(preview.body).source.kind, "package_version"); @@ -2566,6 +2536,7 @@ test("admin can preview and import sample content idempotently", async () => { } await prisma.brandFieldDefinition.deleteMany({ where: { brandId, source: "sample" } }); await prisma.inquiryForm.deleteMany({ where: { brandId, name: "门系统咨询表单" } }); + await prisma.inquiryForm.deleteMany({ where: { brandId, name: "现有客户表单" } }); if (originalForms.length) { await prisma.inquiryForm.createMany({ data: originalForms.map( @@ -2575,12 +2546,10 @@ test("admin can preview and import sample content idempotently", async () => { } await prisma.capabilityAuditLog.deleteMany({ where: { brandId, capabilityKey: "doors" } }); await prisma.templateBootstrapImport.deleteMany({ where: { brandId } }); - await prisma.brandTemplateInstallation.deleteMany({ where: { brandId } }); - await prisma.templatePackageAuditLog.deleteMany({ - where: { templatePackageVersionId: packageVersionId }, - }); - await prisma.templatePackageVersion.delete({ where: { id: packageVersionId } }); - await prisma.templatePackage.deleteMany({ where: { packageKey: "acheng-campus-food" } }); + assert.deepEqual( + await prisma.brandTemplateInstallation.findUniqueOrThrow({ where: { brandId } }), + originalInstallation, + ); await prisma.brandProfile.update({ where: { id: brandId }, data: { templateKey: originalBrand?.templateKey ?? "food", config: originalBrand?.config }, @@ -2588,6 +2557,9 @@ test("admin can preview and import sample content idempotently", async () => { }); test("template ledger install, upgrade preview, and rollback stay brand-scoped", async () => { + const originalInstallation = await prisma.brandTemplateInstallation.findUniqueOrThrow({ + where: { brandId }, + }); await prisma.inquirySubmission.deleteMany({ where: { brandId } }); await prisma.inquiryForm.deleteMany({ where: { brandId } }); await prisma.brandFieldDefinition.deleteMany({ where: { brandId } }); @@ -2611,13 +2583,19 @@ test("template ledger install, upgrade preview, and rollback stay brand-scoped", const crossTemplate = await request("/admin/workspace/install", { method: "POST", headers: { authorization: `Bearer ${token}` }, - payload: { templateKey: currentTemplateKey === "personal" ? "food" : "personal" }, + payload: { + templateKey: currentTemplateKey === "personal" ? "food" : "personal", + templatePackageVersionId: originalInstallation.templatePackageVersionId, + }, }); assert.equal(crossTemplate.statusCode, 400, crossTemplate.body); const installed = await request("/admin/workspace/install", { method: "POST", headers: { authorization: `Bearer ${token}` }, - payload: { templateKey: currentTemplateKey }, + payload: { + templateKey: currentTemplateKey, + templatePackageVersionId: originalInstallation.templatePackageVersionId, + }, }); assert.equal(installed.statusCode, 201, installed.body); assert.equal(JSON.parse(installed.body).template.key, currentTemplateKey); @@ -2627,7 +2605,10 @@ test("template ledger install, upgrade preview, and rollback stay brand-scoped", ), true, ); - assert.equal(JSON.parse(installed.body).installation.configSnapshot.schemaVersion, "1.0"); + assert.equal( + JSON.parse(installed.body).installation.configSnapshot.packageKey, + originalInstallation.configSnapshot.packageKey, + ); const installedRecord = JSON.parse(installed.body).installation; const createdVersionIds = []; let historicalReleaseId; @@ -2681,7 +2662,10 @@ test("template ledger install, upgrade preview, and rollback stay brand-scoped", }, }); historicalSubmissionId = historicalSubmission.id; - const packageKey = installedRecord.visualTemplateKey; + const installedPackageVersion = await prisma.templatePackageVersion.findUniqueOrThrow({ + where: { id: originalInstallation.templatePackageVersionId }, + }); + const packageKey = installedPackageVersion.packageKey; const packageVersion = `9.${Date.now()}.0`; const initialPackageVersion = "1.0.0-phase6-test"; const templatePackage = await prisma.templatePackage.upsert({ @@ -2689,23 +2673,22 @@ test("template ledger install, upgrade preview, and rollback stay brand-scoped", create: { packageKey }, update: {}, }); + const initialManifest = structuredClone(installedPackageVersion.manifestSnapshot); + initialManifest.version = initialPackageVersion; + initialManifest.templateFields = [ + { key: "founder", binding: "brand.config.founder", label: "主理人" }, + ]; + initialManifest.entrypoints = { home: "pages/index/index" }; + initialManifest.assetSlots = [{ key: "brand.logo", binding: "brand.avatarUrl" }]; + initialManifest.requiredCapabilities = ["offerings"]; const initialPackageVersionRecord = await prisma.templatePackageVersion.create({ data: { templatePackageId: templatePackage.id, packageKey, version: initialPackageVersion, displayName: "集成测试基线包", - visualTemplateKey: packageKey, status: "published", - manifestSnapshot: { - packageKey, - version: initialPackageVersion, - supportedIndustryTemplates: [currentTemplateKey], - requiredCapabilities: ["offerings"], - templateFields: [{ key: "founder", binding: "brand.config.founder", label: "主理人" }], - entrypoints: { home: "pages/index/index" }, - assetSlots: [{ key: "brand.logo", binding: "brand.avatarUrl" }], - }, + manifestSnapshot: initialManifest, validationReport: {}, contentChecksum: `checksum-${initialPackageVersion}`, archiveChecksum: `archive-${initialPackageVersion}`, @@ -2730,28 +2713,28 @@ test("template ledger install, upgrade preview, and rollback stay brand-scoped", configSnapshot: initialPackageVersionRecord.manifestSnapshot, }, }); + const targetManifest = structuredClone(initialManifest); + targetManifest.version = packageVersion; + targetManifest.templateFields = [ + { key: "founder", binding: "brand.config.founder", label: "品牌主理人" }, + ]; + targetManifest.entrypoints = { + home: "pages/home/index", + profile: "pages/profile/index", + }; + targetManifest.assetSlots = [ + { key: "brand.logo", binding: "brand.avatarUrl" }, + { key: "home.hero", binding: "brand.config.heroImage" }, + ]; + targetManifest.requiredCapabilities = []; const packageVersionRecord = await prisma.templatePackageVersion.create({ data: { templatePackageId: templatePackage.id, packageKey, version: packageVersion, displayName: "集成测试升级包", - visualTemplateKey: packageKey, status: "published", - manifestSnapshot: { - packageKey, - version: packageVersion, - supportedIndustryTemplates: [currentTemplateKey], - requiredCapabilities: [], - templateFields: [ - { key: "founder", binding: "brand.config.founder", label: "品牌主理人" }, - ], - entrypoints: { home: "pages/home/index", profile: "pages/profile/index" }, - assetSlots: [ - { key: "brand.logo", binding: "brand.avatarUrl" }, - { key: "home.hero", binding: "brand.config.heroImage" }, - ], - }, + manifestSnapshot: targetManifest, validationReport: {}, contentChecksum: `checksum-${packageVersion}`, archiveChecksum: `archive-${packageVersion}`, @@ -2913,7 +2896,6 @@ test("template ledger install, upgrade preview, and rollback stay brand-scoped", assert.equal(operationAudit[0].metadata.brandId, brandId); assert.equal(operationAudit[0].metadata.contentChecksum, packageVersionRecord.contentChecksum); assert.ok(operationAudit[0].requestId); - await prisma.templatePackageVersion.deleteMany({ where: { id: { in: createdVersionIds } } }); const workspace = await request("/admin/workspace", { headers: { authorization: `Bearer ${token}` }, }); @@ -2964,6 +2946,17 @@ test("template ledger install, upgrade preview, and rollback stay brand-scoped", await prisma.brandFieldDefinition.deleteMany({ where: { brandId } }); await prisma.brandTemplateInstallation.deleteMany({ where: { brandId } }); await prisma.templatePackageVersion.deleteMany({ where: { id: { in: createdVersionIds } } }); + await prisma.brandTemplateInstallation.create({ + data: { + brandId, + templateKey: originalInstallation.templateKey, + templateVersion: originalInstallation.templateVersion, + templatePackageVersionId: originalInstallation.templatePackageVersionId, + contentChecksum: originalInstallation.contentChecksum, + configSnapshot: originalInstallation.configSnapshot, + previousSnapshots: originalInstallation.previousSnapshots, + }, + }); await prisma.brandProfile.update({ where: { id: brandId }, data: { templateKey: originalBrand.templateKey, config: originalBrand.config }, @@ -2994,13 +2987,12 @@ test("admin preview workspace is authorized and brand-scoped draft runtime", asy workspace.brand.slug, (await prisma.brandProfile.findUniqueOrThrow({ where: { id: brandId } })).slug, ); - assert.equal(workspace.brand.visualTemplateKey, "acheng-campus-food"); + assert.equal(workspace.visualTemplate.key, "acheng-campus-food"); const unpublishedBrand = await prisma.brandProfile.create({ data: { slug: "unpublished-preview-fixture", name: "未发布预览品牌", templateKey: "personal", - config: { visualTemplateKey: "linjing-editorial" }, adminMemberships: { create: { adminUserId: user.id, role: "owner" } }, }, }); @@ -3013,9 +3005,7 @@ test("admin preview workspace is authorized and brand-scoped draft runtime", asy const draft = await request("/admin/workspace/preview", { headers: { authorization: `Bearer ${draftToken}` }, }); - assert.equal(draft.statusCode, 200); - assert.equal(JSON.parse(draft.body).brand.slug, unpublishedBrand.slug); - assert.equal(JSON.parse(draft.body).publication.status, "draft"); + assert.equal(draft.statusCode, 400); const publicResult = await request("/public/workspace?brandSlug=" + unpublishedBrand.slug); assert.equal(JSON.parse(publicResult.body).publication.status, "unpublished"); assert.equal(JSON.parse(publicResult.body).brand, null); @@ -3026,18 +3016,11 @@ test("admin preview workspace is authorized and brand-scoped draft runtime", asy test("admin can customize workspace fields with brand isolation", async () => { await prisma.brandFieldDefinition.deleteMany({ where: { brandId } }); - await prisma.brandTemplateInstallation.deleteMany({ where: { brandId } }); const login = await request("/admin/session/login", { method: "POST", payload: { username: "admin", password: process.env.SEED_ADMIN_PASSWORD }, }); const token = JSON.parse(login.body).data?.token ?? JSON.parse(login.body).token; - const install = await request("/admin/workspace/install", { - method: "POST", - headers: { authorization: `Bearer ${token}` }, - payload: { templateKey: "food" }, - }); - assert.equal(install.statusCode, 201); const workspace = await request("/admin/workspace", { headers: { authorization: `Bearer ${token}` }, }); @@ -3074,45 +3057,37 @@ test("admin can customize workspace fields with brand isolation", async () => { assert.equal(deletedField.statusCode, 200); } finally { await prisma.brandFieldDefinition.deleteMany({ where: { brandId } }); - await prisma.brandTemplateInstallation.deleteMany({ where: { brandId } }); } }); -test("admin visual template selection is reflected in public runtime workspace", async () => { +test("selected package version is reflected in public runtime workspace", async () => { const login = await request("/admin/session/login", { method: "POST", payload: { username: "admin", password: process.env.SEED_ADMIN_PASSWORD }, }); const token = JSON.parse(login.body).data?.token ?? JSON.parse(login.body).token; - const before = await request("/public/workspace"); - assert.equal(before.statusCode, 200); - const updated = await request("/admin/config/brand", { - method: "PATCH", - headers: { authorization: `Bearer ${token}` }, - payload: { config: { visualTemplateKey: "acheng-campus-food" } }, + const installation = await prisma.brandTemplateInstallation.findUniqueOrThrow({ + where: { brandId }, }); - assert.equal(updated.statusCode, 200); - try { - const runtime = await request("/public/workspace"); - assert.equal(runtime.statusCode, 200); - const body = JSON.parse(runtime.body); - assert.equal(body.visualTemplate.key, "acheng-campus-food"); - assert.equal(body.visualTemplate.version, "1.0.0"); - assert.equal(body.theme.colors.accent, "#E87532"); - assert.equal(body.visualTemplate.variants.hero, "stall-board"); - assert.equal(body.visualTemplateManifest.key, "acheng-campus-food"); - assert.equal(body.visualTemplateManifest.brandFirst, true); - assert.deepEqual( - body.visualTemplateManifest.pages.map((page) => page.key), - ["home", "offerings", "detail", "inquiry", "success", "records", "profile"], - ); - } finally { - await request("/admin/config/brand", { - method: "PATCH", - headers: { authorization: `Bearer ${token}` }, - payload: { config: JSON.parse(before.body).brand?.config ?? {} }, - }); - } + const selectedVersion = await prisma.templatePackageVersion.findUniqueOrThrow({ + where: { id: installation.templatePackageVersionId }, + }); + const updated = await request("/admin/workspace/template/select-version", { + method: "POST", + headers: { authorization: `Bearer ${token}` }, + payload: { + templatePackageVersionId: installation.templatePackageVersionId, + expectedCurrentPackageVersionId: installation.templatePackageVersionId, + confirm: true, + }, + }); + assert.equal(updated.statusCode, 201); + assert.equal(JSON.parse(updated.body).unchanged, true); + const runtime = await request("/public/workspace"); + assert.equal(runtime.statusCode, 200); + const body = JSON.parse(runtime.body); + assert.equal(body.visualTemplate.key, selectedVersion.manifestSnapshot.visualTemplateKey); + assert.equal(body.visualTemplateManifest.key, selectedVersion.manifestSnapshot.visualTemplateKey); }); test("public workspace exposes declared brand and trust presentation data", async () => { @@ -4445,7 +4420,6 @@ test("atelier template imports selected package and preserves draft publication tagline: "独立开发者 · 品牌小程序构建", description: "专注个人品牌表达、内容管理与咨询承接。", config: { - visualTemplateKey: "linjing-editorial", founder: "验收主理人", title: "产品设计 / 全栈开发", visualPresentation: { home: { subtitle: "保留已有品牌说明" } }, @@ -4478,11 +4452,20 @@ test("atelier template imports selected package and preserves draft publication 403, ); } - await json("/admin/config/brand", { - method: "PATCH", - headers, - payload: { config: { visualTemplateKey: "atelier-solopreneur" } }, - }); + const rejectSelectVersion = async (requestHeaders, expectedStatus) => { + const response = await request("/admin/workspace/template/select-version", { + method: "POST", + headers: requestHeaders, + payload: { + templatePackageVersionId: "00000000-0000-4000-8000-000000000001", + confirm: true, + }, + }); + assert.equal(response.statusCode, expectedStatus); + }; + await rejectSelectVersion({}, 401); + await rejectSelectVersion({ authorization: "Bearer invalid" }, 401); + await rejectSelectVersion({ authorization: `Bearer ${customerToken}` }, 403); const packageArchive = multipartArchive(createTemplateArchive("atelier-solopreneur")); const importedPackage = await request("/admin/templates/import", { method: "POST", @@ -4503,6 +4486,18 @@ test("atelier template imports selected package and preserves draft publication }); assert.equal(installation.visualTemplate.key, "atelier-solopreneur"); assert.equal(installation.visualTemplate.tokens.colors.accent, "#1f3a5f"); + const selectedAgain = await json("/admin/workspace/template/select-version", { + method: "POST", + headers, + payload: { + templatePackageVersionId: selectedPackage.id, + expectedCurrentPackageVersionId: selectedPackage.id, + confirm: true, + }, + }); + assert.equal(selectedAgain.unchanged, true); + const selectedBrand = await json("/admin/config/brand", { headers }); + assert.equal(Object.hasOwn(selectedBrand.config ?? {}, "visualTemplateKey"), false); const preview = await json("/admin/workspace/sample-content/preview", { headers }); assert.equal(preview.counts.fields, 5); await json("/admin/workspace/sample-content/import", { diff --git a/apps/api/test/prepare-integration-template-packages.mjs b/apps/api/test/prepare-integration-template-packages.mjs new file mode 100644 index 0000000..067c94d --- /dev/null +++ b/apps/api/test/prepare-integration-template-packages.mjs @@ -0,0 +1,106 @@ +import assert from "node:assert/strict"; +import { spawnSync } from "node:child_process"; +import { mkdtempSync, readdirSync, readFileSync, rmSync } from "node:fs"; +import os from "node:os"; +import path from "node:path"; +import bcrypt from "bcryptjs"; +import { PrismaClient } from "@prisma/client"; +import { createApp } from "../dist/main.js"; +import { signIdentity } from "../dist/auth.js"; + +const prisma = new PrismaClient(); +const packageKeys = ["acheng-campus-food", "linjing-editorial"]; + +function run(command, args, options = {}) { + const result = spawnSync(command, args, { stdio: "inherit", ...options }); + if (result.error) throw result.error; + if (result.status !== 0) throw new Error(`${command} exited with ${result.status}`); +} + +function archiveFor(packageKey) { + const output = mkdtempSync(path.join(os.tmpdir(), "pb-template-integration-")); + const repositoryRoot = path.resolve(process.cwd(), "../.."); + run( + "node", + [ + path.join(repositoryRoot, "scripts/template-pack.cjs"), + "--template", + packageKey, + "--out", + output, + ], + { cwd: repositoryRoot }, + ); + const filename = readdirSync(output).find((item) => item.endsWith(".tar.gz")); + assert.ok(filename, `template pack did not produce an archive for ${packageKey}`); + return { + directory: output, + filename, + content: readFileSync(path.join(output, filename)), + }; +} + +async function importPackage(app, token, archive) { + const boundary = `----pb-integration-${Date.now()}`; + const payload = Buffer.concat([ + Buffer.from( + `--${boundary}\r\nContent-Disposition: form-data; name="archive"; filename="${archive.filename}"\r\nContent-Type: application/gzip\r\n\r\n`, + ), + archive.content, + Buffer.from(`\r\n--${boundary}--\r\n`), + ]); + const response = await app.inject({ + method: "POST", + url: "/admin/templates/import", + headers: { + authorization: `Bearer ${token}`, + "content-type": `multipart/form-data; boundary=${boundary}`, + }, + payload, + }); + assert.equal(response.statusCode, 201, response.body); + const imported = response.json().version; + const publish = await app.inject({ + method: "POST", + url: `/admin/templates/${imported.id}/publish`, + headers: { authorization: `Bearer ${token}` }, + }); + assert.equal(publish.statusCode, 201, publish.body); +} + +async function main() { + const actor = await prisma.adminUser.upsert({ + where: { username: "integration-template-admin" }, + update: { + isEnabled: true, + mustChangePassword: false, + platformTemplateRole: "template_admin", + }, + create: { + username: "integration-template-admin", + passwordHash: await bcrypt.hash("integration-only-password", 4), + displayName: "Integration Template Admin", + platformTemplateRole: "template_admin", + }, + }); + const token = signIdentity({ subject: actor.id, brandId: "integration", role: "admin" }); + const app = await createApp(); + const archives = []; + try { + await app.init(); + for (const packageKey of packageKeys) { + const archive = archiveFor(packageKey); + archives.push(archive.directory); + await importPackage(app, token, archive); + } + } finally { + await app.close(); + for (const directory of archives) rmSync(directory, { recursive: true, force: true }); + await prisma.$disconnect(); + } +} + +main().catch((error) => { + console.error(error); + process.exitCode = 1; +}); diff --git a/apps/api/test/run-integration.cjs b/apps/api/test/run-integration.cjs index 1419bee..b270a6d 100644 --- a/apps/api/test/run-integration.cjs +++ b/apps/api/test/run-integration.cjs @@ -26,6 +26,8 @@ async function main() { await administrator.$executeRawUnsafe(`CREATE SCHEMA "${schema}"`); created = true; if (run("pnpm", ["exec", "prisma", "migrate", "deploy"]) !== 0) return status; + if (run(process.execPath, ["test/prepare-integration-template-packages.mjs"]) !== 0) + return status; if (run("pnpm", ["db:seed"]) !== 0) return status; const initialTrustCount = await fixtureDatabase.trustContent.count(); const initialFormCount = await fixtureDatabase.inquiryForm.count(); diff --git a/apps/api/test/template-preview-matrix.test.ts b/apps/api/test/template-preview-matrix.test.ts index 983e01f..888fe89 100644 --- a/apps/api/test/template-preview-matrix.test.ts +++ b/apps/api/test/template-preview-matrix.test.ts @@ -109,6 +109,7 @@ test("template preview matrix keeps every deployed package, industry, and versio packageKey: fixture.manifest.packageKey, version: fixture.manifest.version, displayName: fixture.manifest.displayName, + visualTemplateKey: fixture.manifest.visualTemplateKey, status: "imported" as const, manifestSnapshot: fixture.manifest, contentChecksum: fixture.contentChecksum, @@ -148,10 +149,7 @@ test("template preview matrix keeps every deployed package, industry, and versio assert.equal(firstPreview.template.packageKey, fixture.manifest.packageKey); assert.equal(firstPreview.industry.key, industry); assert.equal(firstPreview.workspace.brand.templateKey, industry); - assert.equal( - firstPreview.compatibility.renderer.key, - fixture.manifest.visualTemplateKey ?? fixture.manifest.packageKey, - ); + assert.equal(firstPreview.compatibility.renderer.key, fixture.manifest.visualTemplateKey); assert.equal(firstPreview.preview.safety.submissions, "disabled"); assert.ok(firstPreview.workspace.offerings.length > 0); @@ -163,16 +161,8 @@ test("template preview matrix keeps every deployed package, industry, and versio firstPreview.preview.assets.map((item) => item.status), fixture.manifest.assetSlots.map(() => "ready"), ); - assert.deepEqual( - firstPreview.preview.diagnostics.filter((item) => item.code !== "LEGACY_PREVIEW_SAMPLE"), - [], - ); - assert.equal( - firstPreview.preview.fixtureSource, - fixture.manifest.packageKey === "atelier-solopreneur" - ? "previewFixture" - : "legacy-sampleContent", - ); + assert.deepEqual(firstPreview.preview.diagnostics, []); + assert.equal(firstPreview.preview.fixtureSource, "previewFixture"); // 版本 ID 进入模拟品牌 ID,不同版本不会共享同一模拟品牌身份。 assert.match(firstPreview.workspace.brand.id, new RegExp(`^template-preview:${first.id}`)); diff --git a/apps/taro/src/runtime/preview-renderer.ts b/apps/taro/src/runtime/preview-renderer.ts index 1e9c161..ee10c48 100644 --- a/apps/taro/src/runtime/preview-renderer.ts +++ b/apps/taro/src/runtime/preview-renderer.ts @@ -1,9 +1,12 @@ export function resolvePreviewRenderer( modules: Record, - config: unknown, + workspace: unknown, ): T | undefined { - if (!config || typeof config !== "object" || Array.isArray(config)) return undefined; - const key = (config as Record).visualTemplateKey; + if (!workspace || typeof workspace !== "object" || Array.isArray(workspace)) return undefined; + const visualTemplate = (workspace as Record).visualTemplate; + if (!visualTemplate || typeof visualTemplate !== "object" || Array.isArray(visualTemplate)) + return undefined; + const key = (visualTemplate as Record).key; if (typeof key !== "string" || !key) return undefined; const suffix = `/template-${key}/taro/index.tsx`; return Object.entries(modules).find(([path]) => path.endsWith(suffix))?.[1]; diff --git a/apps/taro/src/runtime/template-preview-entry.tsx b/apps/taro/src/runtime/template-preview-entry.tsx index a2eff75..250af74 100644 --- a/apps/taro/src/runtime/template-preview-entry.tsx +++ b/apps/taro/src/runtime/template-preview-entry.tsx @@ -9,7 +9,7 @@ const renderers = import.meta.glob<{ }>("../../../../packages/template-*/taro/index.tsx", { eager: true }); export function TemplatePage(props: TemplateProps) { - const rendererModule = resolvePreviewRenderer(renderers, props.workspace.brand.config); + const rendererModule = resolvePreviewRenderer(renderers, props.workspace); if (!rendererModule) return

当前模板没有可用的 H5 预览 renderer
; const Renderer = rendererModule.TemplatePage; diff --git a/apps/taro/test/browser/services-editor.spec.ts b/apps/taro/test/browser/services-editor.spec.ts index 57bde4f..1737eca 100644 --- a/apps/taro/test/browser/services-editor.spec.ts +++ b/apps/taro/test/browser/services-editor.spec.ts @@ -20,7 +20,6 @@ const brand = { contactPhone: "13800138000", contactWechat: "food-example", config: { - visualTemplateKey: "acheng-campus-food", founder: "测试主理人", title: "私房菜主理人", heroImage: "", @@ -56,7 +55,11 @@ const runtimeWorkspace = { founder: brand.config.founder, title: brand.config.title, visualPresentation: {}, - visualTemplateKey: brand.config.visualTemplateKey, + }, + visualTemplate: { + key: "acheng-campus-food", + version: "1.0.2", + name: "阿成校园餐", }, templateData: {}, navigation: { tabs: [] }, diff --git a/apps/taro/test/preview-renderer.test.mjs b/apps/taro/test/preview-renderer.test.mjs index c95c278..61f3b16 100644 --- a/apps/taro/test/preview-renderer.test.mjs +++ b/apps/taro/test/preview-renderer.test.mjs @@ -15,24 +15,27 @@ const modules = Object.fromEntries( ]), ); -test("多模板预览随当前品牌配置切换所有真实模板,重复切换不保留旧 renderer", () => { +test("多模板预览随 Runtime 模板声明切换所有真实 renderer", () => { for (const manifest of [...manifests, ...manifests.reverse()]) { assert.equal( - resolvePreviewRenderer(modules, { visualTemplateKey: manifest.packageKey })?.key, + resolvePreviewRenderer(modules, { + visualTemplate: { key: manifest.visualTemplateKey }, + })?.key, manifest.packageKey, ); } }); -test("缺少或未知模板时不回落到首个模板", () => { - for (const config of [ +test("缺少或未知 Runtime 模板声明时不回落到首个模板", () => { + for (const workspace of [ undefined, null, [], {}, - { visualTemplateKey: "missing" }, - { visualTemplateKey: 1 }, + { brand: { config: { visualTemplateKey: "acheng-campus-food" } } }, + { visualTemplate: { key: "missing" } }, + { visualTemplate: { key: 1 } }, ]) { - assert.equal(resolvePreviewRenderer(modules, config), undefined); + assert.equal(resolvePreviewRenderer(modules, workspace), undefined); } }); diff --git a/docs/adr/0011-template-sample-selection.md b/docs/adr/0011-template-sample-selection.md index 9f3af78..6c1e470 100644 --- a/docs/adr/0011-template-sample-selection.md +++ b/docs/adr/0011-template-sample-selection.md @@ -6,7 +6,9 @@ ## Decision -示例预览和导入先读取当前品牌的 `templateKey`,再从 `getTemplateSampleContent` 选择对应注册表内容。个人品牌、餐饮、门窗均提供基础示例包。 +> 本 ADR 已被 [ADR 0031:模板只维护一套正式契约](0031-single-template-contract.md) 取代。以下内容仅保留历史决策记录,不再作为实现依据。 + +历史方案曾让示例预览和导入从 `getTemplateSampleContent` 的全局注册表读取内容;该注册表与 manifest 重复,现已禁止继续作为模板事实来源。 ## Consequences diff --git a/docs/adr/0031-single-template-contract.md b/docs/adr/0031-single-template-contract.md new file mode 100644 index 0000000..41e7987 --- /dev/null +++ b/docs/adr/0031-single-template-contract.md @@ -0,0 +1,43 @@ +# 0031 模板只维护一套正式契约 + +## 状态 + +已采纳 + +## 背景 + +模板运行时逐步积累了默认行业映射、品牌 config 与安装台账双读、旧注册表 sample fallback、旧包 manifest 推断和聚合发布状态等路径。它们允许契约外的数据继续运行,使模板选择的事实来源不确定,也让每次修改都必须同时维护新旧行为。产品要求模板只维护一套契约,不建设长期兼容层。 + +## 决策 + +- 所有模板包必须通过唯一的 `TemplatePackageManifest` 契约及其 `runtimeContract` 校验。契约外字段、缺失字段、未知 renderer 或不匹配的行业声明均明确失败,不推断、不静默回退。 +- 品牌当前使用的模板方案必须有明确、持久化的唯一安装记录,并锁定一个已发布的 `TemplatePackageVersion`。package key、版本、视觉 renderer key 和 checksum 只由该版本的 package manifest 与不可变归档确定;数据库不重复存 renderer key。运行时不得从品牌行业、全局默认值或本地注册表推测视觉模板。 +- 模板 manifest 是模板结构、资源、编辑绑定、能力声明、preview fixture 和 bootstrap sample 的唯一事实来源。删除包外的重复 sample 注册表和 fallback。 +- `BrandProfile.templateKey` 表示行业模型,不是视觉模板;模板版本选择只由正式安装记录的精确 package version 引用表达。视觉 renderer key 只存在于 package manifest。禁止在 `BrandProfile.config.visualTemplateKey` 或安装/版本表再存一份副本。 +- 预览 fixture 与显式 bootstrap sample 是同一 manifest 契约中的不同用途;不为旧字段提供静默替代。必需声明缺失时阻断导入或操作。 +- 不保留旧运行时读路径、双写、兼容窗口、字段别名或格式推断。现存数据库状态通过一次性、可审计、失败即停止的 migration 转成正式状态;迁移完成后删除旧列/JSON 键和旧代码路径。 +- 不可变包版本、发布快照、显式升级和回滚属于当前契约下的正常生命周期能力,不属于兼容层。 +- Web API、Admin Client、数据库模型和 package manifest 是同一契约的边界。任一形状变更必须在同一变更中更新生产者、消费者、迁移和测试,不另设旧格式分支。 + +## 考虑过的方案 + +- 长期双读并在缺字段时 fallback:拒绝。它保留歧义并使旧数据问题无法暴露。 +- 先新增新模型并永久保留旧模型:拒绝。模型迁移必须有明确的切换和旧字段删除步骤。 +- 一次性数据转换:采用。转换可保留既有品牌内容,但所有无法无歧义映射的记录必须报告并阻断,不能猜值。 +- 删除所有历史模板版本:拒绝。历史版本可留作审计或回滚,但每个版本都必须满足同一 manifest 契约。 + +## 后果 + +- 缺少安装或包版本的品牌会显式报错,直到完成一次性数据迁移;不再被默认视觉模板掩盖。 +- 需要清理重复的视觉模板状态、包外 sample registry、旧 manifest 推断、聚合状态读写和相应文档。 +- 数据迁移需先生成只读差异报告;遇到缺失、冲突或未知 key 时停止,不覆盖品牌编辑内容。 +- 模板包契约的 breaking change 必须通过一次整体迁移升级所有仓库包,不维护多份 runtime parser。 + +## 迁移计划 + +1. 盘点品牌行业、config 视觉键、安装行、包版本和发布快照,输出只读不一致报告。 +2. 对存在唯一明确来源的品牌,迁移为每品牌唯一安装行,并绑定已发布 package version、版本与 checksum;无法唯一映射的品牌保持不变并列为阻断项。 +3. 在失败即停迁移中校验一品牌一安装、精确版本引用、package key/version/checksum/行业声明及旧视觉键一致;成功后删除 config JSON 键及安装/版本表重复 renderer 列,并约束一品牌唯一安装。 +4. 将 API、Admin、Runtime、发布快照、bootstrap 和构建路径切换到安装记录;缺失/损坏状态显式失败。 +5. 删除默认映射、包外 sample fallback、旧格式推断和聚合字段兼容读写,补授权、成功和失败集成测试。 +6. 运行 template doctor、数据库迁移、API integration、Admin production build、Taro 双端构建及完整格式/类型门禁。 diff --git a/docs/template-data-flow.md b/docs/template-data-flow.md index 70ecfe1..75a8fd6 100644 --- a/docs/template-data-flow.md +++ b/docs/template-data-flow.md @@ -4,14 +4,14 @@ This document records where template-controlled content is stored and how it rea ## Storage And Runtime Mapping -| Content | Template declaration | Brand-scoped storage | Admin editor | Published runtime | -| -------------------------------- | ------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------- | -| Brand identity and contact facts | `admin.sections` bindings such as `brand.config.founder`; platform identity fields are shared | `BrandProfile` columns and `BrandProfile.config` JSON | Brand profile and page configuration | Brand data is copied into `BrandRelease.snapshot`; public workspace merges the brand config into `RuntimeWorkspace.brand` | -| Page copy and presentation | `admin.sections` with exact page binding | `BrandProfile.config.visualPresentation` and related config objects | Template-driven page editor | Public workspace exposes the saved config; Mini Program renderers consume the matching page fields | -| Offerings and details | Offering-target `admin.sections` | `Offering` columns and `Offering.config` JSON | Services editor | Release snapshot offerings are normalized by public workspace; disabled offerings are filtered | -| Trust content | `trustContentTypes`, including page destinations and Admin labels for `title`, `summary`, and `content` | Brand-scoped `TrustContent` rows | Trust content editor; form labels/options come from the selected template manifest | Only published rows are copied to public runtime; template pages render declared types | -| Inquiry forms | The template package provides an explicit sample form name and sample fields | Brand-scoped `InquiryForm.fieldsSnapshot`; submissions keep their own snapshots | Workspace form editor; explicit sample import creates a form only when no enabled form exists | Release snapshot forms are normalized into `RuntimeWorkspace.inquiryForms` | -| Template and visual selection | Package manifest and visual template manifest | `BrandTemplateInstallation` snapshot plus `BrandProfile.templateKey/config.visualTemplateKey` | Workspace/template selection | Release snapshot pins package and visual manifest versions | +| Content | Template declaration | Brand-scoped storage | Admin editor | Published runtime | +| -------------------------------- | ------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------- | +| Brand identity and contact facts | `admin.sections` bindings such as `brand.config.founder`; platform identity fields are shared | `BrandProfile` columns and `BrandProfile.config` JSON | Brand profile and page configuration | Brand data is copied into `BrandRelease.snapshot`; public workspace merges the brand config into `RuntimeWorkspace.brand` | +| Page copy and presentation | `admin.sections` with exact page binding | `BrandProfile.config.visualPresentation` and related config objects | Template-driven page editor | Public workspace exposes the saved config; Mini Program renderers consume the matching page fields | +| Offerings and details | Offering-target `admin.sections` | `Offering` columns and `Offering.config` JSON | Services editor | Release snapshot offerings are normalized by public workspace; disabled offerings are filtered | +| Trust content | `trustContentTypes`, including page destinations and Admin labels for `title`, `summary`, and `content` | Brand-scoped `TrustContent` rows | Trust content editor; form labels/options come from the selected template manifest | Only published rows are copied to public runtime; template pages render declared types | +| Inquiry forms | The template package provides an explicit sample form name and sample fields | Brand-scoped `InquiryForm.fieldsSnapshot`; submissions keep their own snapshots | Workspace form editor; explicit sample import creates a form only when no enabled form exists | Release snapshot forms are normalized into `RuntimeWorkspace.inquiryForms` | +| Template and visual selection | Exact published package version and its manifest | `BrandTemplateInstallation.templatePackageVersionId`; `BrandProfile.templateKey` identifies the industry model | Workspace selects an explicit package version | Release snapshot pins the package manifest and visual manifest versions | ## Food Schedule Example diff --git a/docs/template-management-delivery-plan.md b/docs/template-management-delivery-plan.md index 438d0fe..778f9ee 100644 --- a/docs/template-management-delivery-plan.md +++ b/docs/template-management-delivery-plan.md @@ -59,6 +59,7 @@ - 不把所有模板 sample content 复制进 Prisma seed,也不把 seed 当成模板目录; - 不把品牌 owner 的权限扩展为平台模板管理员权限; - 不把一次性的线上修复脚本当成模板安装能力; +- 不建设模板兼容层:运行时只读唯一正式 manifest/runtime contract;历史数据通过失败即停止的一次性迁移转换,不能保留双读、双写、默认映射或旧格式 fallback; - 不在同一阶段长期维护两套业务 renderer。Taro 是统一的双端业务 renderer,旧原生实现只作为迁移和回滚基线; - 不承诺第一阶段可以导入任意全新 renderer 源码后立即运行。第一阶段只接收声明式 manifest、资源、演示数据和已部署的受信 renderer 引用; - 不把生成一张预览图、静态文件存在或页面能打开当成模板交付完成。 @@ -67,16 +68,16 @@ ## 3. 当前状态和目标状态 -| 领域 | 当前状态 | 目标状态 | 进入目标状态的证据 | -| ------------ | ------------------------------------------------------------------ | -------------------------------------------------------------- | --------------------------------------------------- | -| 模板发现 | packages/config 有生成注册表,文档注册表仍是手工清单 | 所有可用版本由可校验包 manifest 发现,生成注册表只作为构建产物 | 包发现测试、目录接口测试、无手工重复定义 | -| 版本 | 当前模板包 metadata 已与 manifest 对齐,导入 checksum 闭环尚未实现 | key + version + checksum 唯一且不可变 | 导出 checksum、重复导入、冲突导入测试 | -| 行业与视觉 | 行业安装和视觉选择已有部分能力,但没有完整版本化目录 | 行业兼容性、视觉包版本、renderer contract 一起校验 | 组合矩阵、安装快照和跨行业测试 | -| 示例内容 | 包内 sample 可用于部分预览和显式导入 | preview fixture、bootstrap 内容、品牌真实数据严格分离 | 预览无品牌写入、显式导入审计、缺失值规则测试 | -| 模板管理页面 | 现有工作台可以选择部分已注册模板 | 独立 /admin/templates 管理导入、校验、预览、发布和版本 | 页面状态测试、API 权限测试、错误重试测试 | -| 安装和升级 | BrandTemplateInstallation 主要承担行业安装 | 行业安装、视觉包安装、样例导入、升级计划和发布快照各有边界 | schema 迁移、旧数据回填、升级/回滚 integration test | -| 构建发布 | 构建、上传和发布曾共用状态,容易死锁或误报 | build、upload、review、publish 分层,attempt/lease/产物隔离 | 并发、重启、超时、错误收敛、真实参数产物测试 | -| 版本事实 | atelier-solopreneur 的 manifest 和 package metadata 已统一为 1.1.0 | 包内版本字段和导出元数据在导出前强一致 | validate:templates 的版本一致性检查 | +| 领域 | 当前状态 | 目标状态 | 进入目标状态的证据 | +| ------------ | ------------------------------------------------------------------ | -------------------------------------------------------------- | ------------------------------------------------------ | +| 模板发现 | packages/config 有生成注册表,文档注册表仍是手工清单 | 所有可用版本由可校验包 manifest 发现,生成注册表只作为构建产物 | 包发现测试、目录接口测试、无手工重复定义 | +| 版本 | 当前模板包 metadata 已与 manifest 对齐,导入 checksum 闭环尚未实现 | key + version + checksum 唯一且不可变 | 导出 checksum、重复导入、冲突导入测试 | +| 行业与视觉 | 行业安装和视觉选择已有部分能力,但没有完整版本化目录 | 行业兼容性、视觉包版本、renderer contract 一起校验 | 组合矩阵、安装快照和跨行业测试 | +| 示例内容 | 包内 sample 可用于部分预览和显式导入 | preview fixture、bootstrap 内容、品牌真实数据严格分离 | 预览无品牌写入、显式导入审计、缺失值规则测试 | +| 模板管理页面 | 现有工作台可以选择部分已注册模板 | 独立 /admin/templates 管理导入、校验、预览、发布和版本 | 页面状态测试、API 权限测试、错误重试测试 | +| 安装和升级 | 品牌配置、行业安装和视觉选择存在重复来源 | 唯一安装记录锁定行业模型与精确视觉包版本 | 一次性数据转换、唯一性约束、升级/回滚 integration test | +| 构建发布 | 构建、上传和发布曾共用状态,容易死锁或误报 | build、upload、review、publish 分层,attempt/lease/产物隔离 | 并发、重启、超时、错误收敛、真实参数产物测试 | +| 版本事实 | atelier-solopreneur 的 manifest 和 package metadata 已统一为 1.1.0 | 包内版本字段和导出元数据在导出前强一致 | validate:templates 的版本一致性检查 | 当前存在的 Runtime Workspace、模板 manifest、样例导入和 Taro 构建能力是基础组件,不代表本任务已完成。实施进度必须引用本文的阶段和证据。 @@ -251,15 +252,15 @@ admin.sections 和 renderer 必须互相校验:每个可见、可编辑的品 | TemplateUpgradePlan | from/to、差异、冲突、用户确认和执行结果 | 支持 dry-run、重试和回滚 | | TemplateOperationJob | 导入、校验、资源处理、build/upload 的 attempt 和 lease | 支持重启恢复和终态收敛 | -现有 BrandTemplateInstallation 当前主要承担行业模板安装记录,不能直接把它改成视觉包版本记录并破坏旧快照。实施前先盘点其查询、发布快照和旧回滚行为;优先新增边界清晰的模型或新增可为空字段,完成兼容读取后再考虑收敛。 +BrandTemplateInstallation 必须收敛为品牌唯一的当前模板安装,记录行业模型及精确视觉包版本。先只读盘点数据,再以一次性事务迁移完成无歧义映射;迁移后删除重复状态和旧字段,不保留兼容读取窗口。发布历史通过不可变 release snapshot 保留,不依赖旧安装形状。 数据库迁移必须遵循以下顺序: 1. 备份并记录当前 schema、模板安装、品牌配置和发布快照数量; 2. 先增加可为空的新字段或新表,不改变旧读路径; 3. 回填只写可从旧数据确定推导出的值,不能猜测版本、checksum 或样例来源; -4. 双读对比旧路径和新路径,记录不一致; -5. 切换写入,再保留旧读兼容窗口; +4. 生成新旧数据的只读差异报告;有歧义时停止迁移并修正数据; +5. 执行一次性事务迁移,校验唯一安装及 package/version/checksum/industry 一致后删除旧表示; 6. 清理旧字段前提供备份、回滚脚本和历史快照验证; 7. 重复执行迁移和导入不得生成重复安装、重复 offering、重复 inquiry form 或重复审计。 @@ -419,7 +420,7 @@ Phase 3 初版实现(提交 `6edde5a`,2026-10-16): Phase 3 独立 fixture 与资源进展(2026-10-16): - 新增 `previewFixture.`:`schemaVersion: "1"`、身份白名单 `brand`、独立 `content` 和固定禁用策略 `safety`;使用 `packages/validation` 的同一 Zod 规则校验本地包和线上导入,不引入新校验体系。声明 fixture 的包必须覆盖全部兼容行业;无效声明不能回退到 `sampleContent`。 -- atelier 升为 `1.2.0`,保持旧版本不可变;预览主理人和品牌身份单独声明,`sampleContent` 仍只用于品牌起始内容,不修改 seed 或自动安装到现有品牌。尚未迁移的旧包走明确标注的兼容路径。 +- atelier 升为 `1.2.0`,保持不可变版本;预览主理人和品牌身份单独声明,`sampleContent` 只用于显式品牌起始内容。所有可发布包必须满足同一 manifest 契约;不提供旧包运行兼容路径。 - 管理页展示当前页面的 Admin 模块声明顺序、字段 binding、资源配置数量和缺失状态。这是声明诊断,不代表已经验证 renderer 的实际视觉顺序或全部字段消费。 - 预览读取已导入 archive,核对 archive/content checksum 及逐图片 SHA-256,校验实际图片格式后以内嵌 data URL 提供给画布;不执行源码、不解压到公共目录、不回退到当前部署的同名图片。每图最多 2 MiB、总图片最多 8 MiB、最多 128 张,超出限额返回明确诊断;外链图片仍为待验证。 - 同一预览响应同时包含版本 checksum、Runtime 和图片映射,切换版本/行业不会复用另一份图片;当前实现尚不包含可公开访问的资源 URL、远程资源探测或 CDN 缓存。 @@ -442,7 +443,7 @@ Phase 3 现场验收纠偏(2026-10-16): - 现场核对发现旧模板 `sampleContent` 只有少量业务数据,`brandConfig` 和媒体槽位为空,导致 food/linjing 预览像缺数据。已为 `acheng-campus-food@1.0.1`、`linjing-editorial@1.0.3` 补齐包内演示主图、头像、封面和视觉文案;旧版本保持 immutable 并撤回。 - atelier 独立 fixture 也没有头像。已升为 `atelier-solopreneur@1.3.0`,在 `previewFixture.personal.brand` 中加入包内头像,继续保持预览数据与 bootstrap sample 分离。 - 修复 Admin 导入包预览中 food renderer 的资源 key 前缀映射:包内 `/assets/service/*.png` 等图标现在可从 archive 校验后的 data URL 渲染,不回退到本地部署资源。 -- 矩阵 API 回归新增断言:每个支持行业的主理人身份非空、头像指向包内资源、所有 asset slot 都是 `ready`、除 `LEGACY_PREVIEW_SAMPLE` 外没有诊断。 +- 矩阵 API 回归新增断言:每个支持行业的主理人身份非空、头像指向包内资源、所有 asset slot 都是 `ready`、没有诊断。 - 新增 Playwright 媒体矩阵:覆盖 `acheng/food`、`atelier/personal`、`linjing/personal`、`linjing/doors`,使用真实 `template:pack` 产物和 API preview service;验证失败重试、founder 可见、所有 `data:` 图像 `naturalWidth > 0`、无“内容缺失”、无真实写入请求。四张截图已人工检查。 - 本轮本地目录以最新已发布版本为准:`acheng-campus-food@1.0.1`、`atelier-solopreneur@1.3.0`、`linjing-editorial@1.0.3`;被取代的旧演示版本进入 retired。 @@ -466,15 +467,15 @@ Phase 3 隔离、导航和矩阵收口(2026-10-16): - [x] 通过 shared client、Admin 页面和 API integration test 验证跨品牌隔离; - [x] 验证模板安装不自动导入未确认的身份、背书、案例和咨询数据。 -当前进展:安装台账已保存 `templatePackageVersionId`、视觉 key 和 `contentChecksum`;bootstrap 只读取已发布 package version 的 `manifestSnapshot.sampleContent`,preview 只 dry-run,import 必须显式传入 `strategy: "missing_only"` 和 `confirm: true`。已有品牌值(包括显式空值)、同名 offering、相同 `type + title` 的 trust content、相同 inquiry field,以及已启用表单都会被保留;重复导入按品牌、版本和 checksum 幂等返回,并写入 `TemplateBootstrapImport` 和 capability audit。 +当前进展:安装台账只引用精确的 `templatePackageVersionId` 并记录 `contentChecksum`;renderer key 只从该版本的 package manifest 读取。bootstrap 只读取已发布 package version 的 `manifestSnapshot.sampleContent`,preview 只 dry-run,import 必须显式传入 `strategy: "missing_only"` 和 `confirm: true`。已有品牌值(包括显式空值)、同名 offering、相同 `type + title` 的 trust content、相同 inquiry field,以及已启用表单都会被保留;重复导入按品牌、版本和 checksum 幂等返回,并写入 `TemplateBootstrapImport` 和 capability audit。 -seed 边界已收口:`ensureRuntimeContent` 写入的 offerings、trust content、inquiry fields、表单名称和模板品牌样例均来自对应 package 的 `sampleContent`,food、doors 的媒体和结构化展示字段已通过真实公开 workspace 验证;`runtimeSeedTemplates` 仅保留明确的开发演示品牌 profile 以及旧 offering 停用兼容 fixture,不作为模板目录或业务样例来源。新增模板不需要修改全局 seed;没有 package version 台账的历史 seed 品牌继续使用 registry 兼容路径,新安装品牌必须使用精确已发布版本。 +seed 边界已收口:`ensureRuntimeContent` 写入的 offerings、trust content、inquiry fields、表单名称和模板品牌样例均来自对应 package 的 `sampleContent`,food、doors 的媒体和结构化展示字段已通过真实公开 workspace 验证;`runtimeSeedTemplates` 仅保留明确的开发演示品牌 profile,不作为模板目录或业务样例来源。新增模板不需要修改全局 seed;每个运行品牌都必须有精确已发布 package version 安装,缺失时启动/操作明确失败,不走 registry fallback。 退出门禁:干净品牌可以通过安装和显式导入完成编辑发布;已有用户值、主动清空值和历史发布快照均不被覆盖;错误请求不会改变表单。 ### Phase 5:构建、上传和线上发布闭环 -- [x] 将 build、upload、review 状态拆分,并为构建/上传增加持久化 attempt 和 lease;旧聚合 `status` 暂时保留兼容; +- [x] 将 build、upload、review 状态拆分,并为构建/上传增加持久化 attempt 和 lease; - [x] 产物路径包含品牌 slug、模板 key、模板包精确版本和 build attempt id; - [x] 生产依赖闭包通过 Node 24 release package、干净 `--prod --frozen-lockfile` 安装、Prisma Client generate、API runtime import 和 production API health check 验证;API app 重建后的 attempt 恢复由真实 Prisma integration 覆盖; - [x] 构建失败、上传失败、超时、进程退出、重试和恢复有自动化测试;覆盖 build worker 非零退出/watchdog kill、失败构建、上传子进程超时、attempt lease 竞争/接管、真实 Prisma/API app 重建恢复;本机 Node 24 production bundle 已启动、停止并重启验证;生产机 PM2/主机重启仍属于部署环境验收; @@ -528,7 +529,7 @@ Phase 7 进展记录(2026-10-17): - 新增 `pnpm template:compatibility`,通过 TypeScript AST 读取行业、能力和视觉注册表,自动发现所有 package manifest;比较平台视觉 renderer、Admin glob、Taro renderer 导出、行业 capability 和 package/platform Taro/React 依赖主次版本,支持 JSON 报告。 - API 模板预览矩阵自动扫描真实 manifest,逐个验证声明行业、版本隔离、品牌隔离和归档资源;CI 静态 job 显式执行 package validation、compatibility、API matrix 和 conformance。CI browser job 已执行真实包 fixture 的页面/资源/编辑回归截图。 - 自动化验证:`pnpm template:check` 通过(contract `22/22`、scaffold/compatibility `3/3`、pack `3/3`、conformance `1/1`、compiler `10/10`、miniapp fixture `3/3`);API matrix `2/2`;compatibility 报告有 4 个支持组合;API unit `65/65`、HTTP integration `54/54`、upload integration `2/2`、API Client `8/8`、Admin `6/6`;API/API Client/Admin typecheck、Admin production build、Prettier 和 `git diff --check` 通过。 -- 剩余:指标已有统一持久化和平台管理员查询接口,但定期审阅流程仍需运营安排;旧 renderer/默认行业映射仍有兼容职责,暂不能删除。模板 doctor 的真实品牌编辑保存重载发布与原型视觉证据仍为 `unverified`,不能以 CI smoke 代替;因此 Phase 7 整体继续进行。 +- 剩余:指标已有统一持久化和平台管理员查询接口,但定期审阅流程仍需运营安排;模板运行时仍有旧 renderer/默认行业映射等兼容路径待移除。模板 doctor 的真实品牌编辑保存重载发布与原型视觉证据仍为 `unverified`,不能以 CI smoke 代替;因此 Phase 7 整体继续进行。 运营指标说明:新增 `TemplateOperationFailureEvent` 记录导入、预览、安装/冲突、升级和回滚失败;构建/上传从已有 release attempt 聚合。事件只保留 action、稳定 `HTTP_*` resultCode、可选实体标识和 requestId,查询只返回类别/数量;按 180 天 best-effort 清理,不回填历史失败数。定期审阅仍需运营流程和负责人。 @@ -541,7 +542,7 @@ Phase 7 进展记录(2026-10-17): - [ ] 使用真实部署参数完成 H5 和 weapp 构建,检查 AppID、API 地址、媒体地址、模板版本和产物路径; - [ ] 在微信开发者工具或真机完成 request、media、拨号、复制、表单提交和安全区验证;外部上传、审核、发布结果单独归档; - [ ] 由平台模板管理员执行一次失败指标审阅,确认高频问题、负责人和后续动作,形成审阅记录; -- [ ] 基于实际迁移证据决定旧 registry/default mapping 是否可以逐项下线;未完成历史品牌回填和兼容验证前不得删除兼容层。 +- [ ] 完成一次性品牌安装与 package version 数据转换,之后删除旧 registry/default mapping 和所有模板兼容读写;迁移歧义必须阻断,不得延长兼容窗口。 Phase 8 启动记录(2026-10-17): @@ -559,9 +560,9 @@ Phase 8 自动化持久化与兼容审查(2026-10-17): - API unit `65/65`、API Client `8/8`、Admin `6/6`、发布验证/部署测试 `8/8` 通过;隔离 PostgreSQL schema 中执行完整 `pnpm --filter @personal-brand/api test:integration`,HTTP integration `54/54`、upload integration `2/2` 通过,schema migration 与重复 seed 幂等性通过; - 隔离 integration 中真实 manifest bindings 经数据库持久化、草稿预览和发布快照测试通过(193 个 manifest bindings);这证明自动化数据链,不等价于人工在 Admin 实际点选编辑,也不替代独立模板视觉审查; -- 旧默认视觉映射仍被 seed、草稿/公开 Runtime、release snapshot 和显式 bootstrap 调用。当前没有完整的历史品牌回填与双读/回滚机制,故不能安全删除;后续应先为现有品牌持久化明确 visual package version/checksum,再验证旧行兼容读取,最后分批移除 fallback。 +- 旧默认视觉映射仍被 seed、草稿/公开 Runtime、release snapshot 和显式 bootstrap 调用,违反单一契约决策。必须先输出只读迁移报告,将每个运行品牌明确绑定到已发布 visual package version/checksum;无法唯一映射时阻断。完成一次性转换后删除所有 fallback,不提供双读或兼容窗口。 -退出门禁:真实品牌保存重载发布、视觉证据、双端外部验证和运营审阅记录全部归档;旧兼容层只有在历史品牌迁移验证后才允许删除。 +退出门禁:真实品牌保存重载发布、视觉证据、双端外部验证和运营审阅记录全部归档;历史品牌通过一次性迁移满足唯一模板契约,所有兼容层和旧字段已删除。 Phase 8 编辑闭环回归(2026-10-18): @@ -647,16 +648,16 @@ Phase 8 编辑闭环回归(2026-10-18): 以下问题必须在对应阶段开始前作出可审阅决定,不允许用临时默认值带过: -| 问题 | 推荐方向 | 最晚决定阶段 | -| ----------------------------------------------- | ------------------------------------------------------------------- | ------------ | -| 平台模板管理员角色名称和权限来源 | 独立于品牌 owner 的平台级权限,所有操作审计 | Phase 0 | -| artifact 存储 | 版本化对象存储或受控 release 目录,按 checksum/版本寻址 | Phase 2 | -| preview session 存储 | 第一阶段使用短期 token + 服务端受控数据;需要审计时再持久化 session | Phase 3 | -| 视觉安装模型 | 新增清晰的视觉包安装边界,兼容读取旧行业安装 | Phase 4 | -| renderer 分发 | 第一阶段只引用预部署 renderer;任意新 renderer 走独立可信构建方案 | Phase 1 | -| 包签名 | 内网 MVP 先 checksum,跨环境或第三方来源前增加签名和信任根 | Phase 2 | -| 目录可见性 | 未发布版本只给平台管理员,已发布版本才给品牌管理员 | Phase 2 | -| template package version 与 npm package version | 导出前强制一致,若不一致直接阻断 | Phase 1 | +| 问题 | 推荐方向 | 最晚决定阶段 | +| ----------------------------------------------- | ------------------------------------------------------------------------ | ------------ | +| 平台模板管理员角色名称和权限来源 | 独立于品牌 owner 的平台级权限,所有操作审计 | Phase 0 | +| artifact 存储 | 版本化对象存储或受控 release 目录,按 checksum/版本寻址 | Phase 2 | +| preview session 存储 | 第一阶段使用短期 token + 服务端受控数据;需要审计时再持久化 session | Phase 3 | +| 视觉安装模型 | 唯一品牌安装记录锁定行业模型和精确视觉包版本,完成一次性迁移并删除旧状态 | Phase 4 | +| renderer 分发 | 第一阶段只引用预部署 renderer;任意新 renderer 走独立可信构建方案 | Phase 1 | +| 包签名 | 内网 MVP 先 checksum,跨环境或第三方来源前增加签名和信任根 | Phase 2 | +| 目录可见性 | 未发布版本只给平台管理员,已发布版本才给品牌管理员 | Phase 2 | +| template package version 与 npm package version | 导出前强制一致,若不一致直接阻断 | Phase 1 | ## 17. 可观察性和风险 diff --git a/docs/template-registry.md b/docs/template-registry.md index 3d7c430..6d8d4e6 100644 --- a/docs/template-registry.md +++ b/docs/template-registry.md @@ -30,7 +30,7 @@ - [x] 版本导出、导入、checksum 幂等、目录发布/撤回与审计已由 template pack 和管理 API 实现; - [x] `/admin/templates` 覆盖导入、校验、预览、发布、撤回和审计; -- [x] 行业安装与视觉包精确版本通过兼容读取和不可变版本台账关联;新安装保存 package version/checksum; +- [ ] 品牌安装统一锁定行业模型与精确视觉包版本;当前兼容读取及多处视觉选择状态待由一次性数据迁移收敛后删除; - [x] 预览 fixture 与显式 bootstrap 内容分离,预览不写入品牌; - [x] `pnpm template:compatibility` 自动检查 package、行业、平台视觉 manifest、Taro renderer 和 Admin renderer discovery;Runtime contract 及 package schema 由 `pnpm validate:templates` 校验;toolchain 产物由 `pnpm template:conformance` 验证; - [x] atelier-solopreneur 的 manifest/package metadata 版本已统一,并由 validate:templates 阻断后续漂移; diff --git a/packages/api-client/src/index.ts b/packages/api-client/src/index.ts index 2b272be..2e66094 100644 --- a/packages/api-client/src/index.ts +++ b/packages/api-client/src/index.ts @@ -193,15 +193,6 @@ export class ApiClient this.resources.brand.createAdminMember(...arguments_); updateAdminMember = (...arguments_: Parameters) => this.resources.brand.updateAdminMember(...arguments_); - getAdminVisualTemplatePreview = ( - ...arguments_: Parameters - ) => this.resources.brand.getAdminVisualTemplatePreview(...arguments_); - getAdminVisualTemplateHistory = ( - ...arguments_: Parameters - ) => this.resources.brand.getAdminVisualTemplateHistory(...arguments_); - rollbackAdminVisualTemplate = ( - ...arguments_: Parameters - ) => this.resources.brand.rollbackAdminVisualTemplate(...arguments_); updateAdminBrand = (...arguments_: Parameters) => this.resources.brand.updateAdminBrand(...arguments_); updateAdminBrandPresentation = ( @@ -270,6 +261,9 @@ export class ApiClient ) => this.resources.template.getAdminPreviewWorkspace(...arguments_); installAdminTemplate = (...arguments_: Parameters) => this.resources.template.installAdminTemplate(...arguments_); + selectAdminTemplateVersion = ( + ...arguments_: Parameters + ) => this.resources.template.selectAdminTemplateVersion(...arguments_); listAdminCapabilities = (...arguments_: Parameters) => this.resources.template.listAdminCapabilities(...arguments_); updateAdminCapability = (...arguments_: Parameters) => diff --git a/packages/api-client/src/resources/brand.ts b/packages/api-client/src/resources/brand.ts index 79019bc..5392fba 100644 --- a/packages/api-client/src/resources/brand.ts +++ b/packages/api-client/src/resources/brand.ts @@ -27,20 +27,6 @@ export interface BrandMethods { id: string, body: Partial>, ): Promise; - getAdminVisualTemplatePreview(): Promise<{ - current: { - key: string; - version: string; - name: string; - theme: { colors: Record }; - variants: Record; - } | null; - available: string[]; - }>; - getAdminVisualTemplateHistory(): Promise<{ - history: Array<{ visualTemplateKey: string; savedAt: string }>; - }>; - rollbackAdminVisualTemplate(): Promise<{ visualTemplateKey: string; rolledBack: boolean }>; updateAdminBrand(body: BrandUpdate): Promise; updateAdminBrandPresentation(body: BrandPresentationUpdate): Promise<{ visualPresentation: Record>; @@ -97,10 +83,6 @@ export function brandMethods({ request }: { request: RequestFn }): BrandMethods method: "PATCH", body, }), - getAdminVisualTemplatePreview: () => request("/admin/config/visual-template/preview"), - getAdminVisualTemplateHistory: () => request("/admin/config/visual-template/history"), - rollbackAdminVisualTemplate: () => - request("/admin/config/visual-template/rollback", { method: "POST" }), updateAdminBrand: (body) => request("/admin/config/brand", { method: "PATCH", body }), updateAdminBrandPresentation: (body) => request("/admin/config/presentation", { method: "PATCH", body }), diff --git a/packages/api-client/src/resources/template.ts b/packages/api-client/src/resources/template.ts index f901606..ad7e120 100644 --- a/packages/api-client/src/resources/template.ts +++ b/packages/api-client/src/resources/template.ts @@ -67,9 +67,9 @@ export interface TemplateMethods { id: string; templateKey: BrandTemplateKey; templateVersion: string; - visualTemplateKey: string | null; - templatePackageVersionId: string | null; - contentChecksum: string | null; + visualTemplateKey: string; + templatePackageVersionId: string; + contentChecksum: string; }>; fields: BrandFieldDefinition[]; offerings: Offering[]; @@ -80,8 +80,13 @@ export interface TemplateMethods { getAdminPreviewWorkspace(): Promise; installAdminTemplate( templateKey: BrandTemplateKey, - templatePackageVersionId?: string, + templatePackageVersionId: string, ): Promise; + selectAdminTemplateVersion(input: { + templatePackageVersionId: string; + expectedCurrentPackageVersionId?: string | null; + confirm: true; + }): Promise; listAdminCapabilities(): Promise; updateAdminCapability( key: string, @@ -97,11 +102,11 @@ export interface TemplateMethods { templateKey: string; visualTemplateKey: string; source: { - kind: "package_version" | "registry"; + kind: "package_version"; packageKey: string; version: string; - contentChecksum: string | null; - templatePackageVersionId?: string; + contentChecksum: string; + templatePackageVersionId: string; }; alreadyImported: boolean; counts: Record< @@ -124,11 +129,11 @@ export interface TemplateMethods { imported: boolean; alreadyImported: boolean; source: { - kind: "package_version" | "registry"; + kind: "package_version"; packageKey: string; version: string; - contentChecksum: string | null; - templatePackageVersionId?: string; + contentChecksum: string; + templatePackageVersionId: string; }; counts: Record; }>; @@ -201,7 +206,6 @@ export interface TemplatePackageVersion { packageKey: string; version: string; displayName: string; - visualTemplateKey: string | null; status: "imported" | "published" | "retired" | "disabled"; contentChecksum: string; archiveChecksum: string; @@ -235,7 +239,7 @@ export interface TemplatePackagePreview { workspace: RuntimeWorkspace; preview: { assetFiles: Record; - fixtureSource: "previewFixture" | "legacy-sampleContent"; + fixtureSource: "previewFixture"; safety: { submissions: "disabled"; customerRecords: "disabled"; contactActions: "disabled" }; session: { token: string; expiresAt: string }; diagnostics: Array<{ code: string; severity: "warning"; message: string }>; @@ -270,7 +274,6 @@ export interface TemplatePackageActionResult { | "packageKey" | "version" | "displayName" - | "visualTemplateKey" | "status" | "contentChecksum" | "archiveChecksum" @@ -298,7 +301,6 @@ export interface TemplatePackageImportResult { | "packageKey" | "version" | "displayName" - | "visualTemplateKey" | "status" | "contentChecksum" | "archiveChecksum" @@ -375,8 +377,10 @@ export function templateMethods({ request }: { request: RequestFn }): TemplateMe installAdminTemplate: (templateKey, templatePackageVersionId) => request("/admin/workspace/install", { method: "POST", - body: { templateKey, ...(templatePackageVersionId ? { templatePackageVersionId } : {}) }, + body: { templateKey, templatePackageVersionId }, }), + selectAdminTemplateVersion: (input) => + request("/admin/workspace/template/select-version", { method: "POST", body: input }), listAdminCapabilities: () => request("/admin/workspace/capabilities"), updateAdminCapability: (key, body) => request(`/admin/workspace/capabilities/${encodeURIComponent(key)}`, { diff --git a/packages/config/package.json b/packages/config/package.json index 268e188..54573d1 100644 --- a/packages/config/package.json +++ b/packages/config/package.json @@ -8,6 +8,9 @@ "import": "./dist/index.js" } }, + "dependencies": { + "@personal-brand/template-contract": "workspace:^" + }, "scripts": { "build": "tsc -p tsconfig.json", "lint": "eslint .", diff --git a/packages/config/src/generated-template-packages.ts b/packages/config/src/generated-template-packages.ts index 12f9020..83067f4 100644 --- a/packages/config/src/generated-template-packages.ts +++ b/packages/config/src/generated-template-packages.ts @@ -1,5826 +1,6871 @@ -// prettier-ignore import type { TemplatePackageManifest } from "./index.js"; +// prettier-ignore export const generatedTemplatePackageRegistry: readonly TemplatePackageManifest[] = [ { - packageKey: "acheng-campus-food", - version: "1.0.2", - displayName: "阿成校园餐", - defaultBrandSlug: "default-brand", - runtimeContract: "1.0", - supportedIndustryTemplates: ["food"], - entrypoints: { - home: "pages/index/index", - offerings: "pages/services/index", - service: "pages/stall-service/index", - detail: "pages/offering/detail", - inquiry: "pages/inquiry/index", - success: "pages/inquiry-success/index", - records: "pages/records/index", - profile: "pages/bookings/index", + "packageKey": "acheng-campus-food", + "version": "1.0.2", + "displayName": "阿成校园餐", + "defaultBrandSlug": "default-brand", + "runtimeContract": "1.0", + "supportedIndustryTemplates": [ + "food" + ], + "entrypoints": { + "home": "pages/index/index", + "offerings": "pages/services/index", + "service": "pages/stall-service/index", + "detail": "pages/offering/detail", + "inquiry": "pages/inquiry/index", + "success": "pages/inquiry-success/index", + "records": "pages/records/index", + "profile": "pages/bookings/index" }, - navigation: [ + "navigation": [ { - key: "home", - label: "首页/摊位", - page: "home", - iconPath: "assets/tab/home.png", - selectedIconPath: "assets/tab/home-selected.png", + "key": "home", + "label": "首页/摊位", + "page": "home", + "iconPath": "assets/tab/home.png", + "selectedIconPath": "assets/tab/home-selected.png" }, { - key: "dishes", - label: "套餐餐品", - page: "offerings", - iconPath: "assets/tab/dishes.png", - selectedIconPath: "assets/tab/dishes-selected.png", + "key": "dishes", + "label": "套餐餐品", + "page": "offerings", + "iconPath": "assets/tab/dishes.png", + "selectedIconPath": "assets/tab/dishes-selected.png" }, { - key: "service", - label: "出摊服务", - page: "service", - iconPath: "assets/tab/service.png", - selectedIconPath: "assets/tab/service-selected.png", + "key": "service", + "label": "出摊服务", + "page": "service", + "iconPath": "assets/tab/service.png", + "selectedIconPath": "assets/tab/service-selected.png" }, { - key: "owner", - label: "主理人", - page: "profile", - iconPath: "assets/tab/owner.png", - selectedIconPath: "assets/tab/owner-selected.png", + "key": "owner", + "label": "主理人", + "page": "profile", + "iconPath": "assets/tab/owner.png", + "selectedIconPath": "assets/tab/owner-selected.png" }, { - key: "booking", - label: "定制/咨询", - page: "inquiry", - iconPath: "assets/tab/booking.png", - selectedIconPath: "assets/tab/booking-selected.png", - }, + "key": "booking", + "label": "定制/咨询", + "page": "inquiry", + "iconPath": "assets/tab/booking.png", + "selectedIconPath": "assets/tab/booking-selected.png" + } ], - requiredCapabilities: ["offerings", "inquiry"], - dataSlots: [ - { - key: "brand.identity", - source: "brand", - required: true, - description: "摊位名称、主理人和公开联系方式", - }, - { - key: "brand.hero", - source: "brand", - required: true, - description: "出摊现场和首页营业信息", - }, - { - key: "trust.proof", - source: "trust", - required: true, - description: "卫生、履约和订餐信任内容", - }, - { - key: "offerings.list", - source: "offering", - required: true, - description: "今日餐品、套餐和定制服务", - }, - { - key: "offering.detail", - source: "offering", - required: true, - description: "单个餐品或定制服务详情", - }, - { - key: "inquiry.form", - source: "inquiry", - required: true, - description: "预订和定制咨询问题", - }, - { - key: "records.items", - source: "records", - required: true, - description: "访客自己的预订记录", - }, + "requiredCapabilities": [ + "offerings", + "inquiry" ], - assetSlots: [ + "dataSlots": [ { - key: "brand.portrait", - binding: "brand.avatarUrl", - target: "brand", - label: "主理人照片", - help: "用于首页和主理人页,建议使用清晰正面照片。", - required: false, - kind: "portrait", - aspectRatio: "1:1", + "key": "brand.identity", + "source": "brand", + "required": true, + "description": "摊位名称、主理人和公开联系方式" }, { - key: "brand.stallHero", - binding: "brand.config.heroImage", - target: "brand", - label: "出摊现场主图", - help: "展示真实摊位、餐品或取餐场景,避免使用无关的通用图片。", - required: true, - kind: "image", - aspectRatio: "16:9", + "key": "brand.hero", + "source": "brand", + "required": true, + "description": "出摊现场和首页营业信息" }, { - key: "offering.cover", - binding: "offering.coverUrl", - target: "offering", - label: "餐品或服务封面", - help: "每项餐品或服务使用一张清晰图片,方便访客快速选择。", - required: true, - kind: "image", - aspectRatio: "1:1", + "key": "trust.proof", + "source": "trust", + "required": true, + "description": "卫生、履约和订餐信任内容" }, + { + "key": "offerings.list", + "source": "offering", + "required": true, + "description": "今日餐品、套餐和定制服务" + }, + { + "key": "offering.detail", + "source": "offering", + "required": true, + "description": "单个餐品或定制服务详情" + }, + { + "key": "inquiry.form", + "source": "inquiry", + "required": true, + "description": "预订和定制咨询问题" + }, + { + "key": "records.items", + "source": "records", + "required": true, + "description": "访客自己的预订记录" + } ], - admin: { - sections: [ + "assetSlots": [ + { + "key": "brand.portrait", + "binding": "brand.avatarUrl", + "target": "brand", + "label": "主理人照片", + "help": "用于首页和主理人页,建议使用清晰正面照片。", + "required": false, + "kind": "portrait", + "aspectRatio": "1:1" + }, + { + "key": "brand.stallHero", + "binding": "brand.config.heroImage", + "target": "brand", + "label": "出摊现场主图", + "help": "展示真实摊位、餐品或取餐场景,避免使用无关的通用图片。", + "required": true, + "kind": "image", + "aspectRatio": "16:9" + }, + { + "key": "offering.cover", + "binding": "offering.coverUrl", + "target": "offering", + "label": "餐品或服务封面", + "help": "每项餐品或服务使用一张清晰图片,方便访客快速选择。", + "required": true, + "kind": "image", + "aspectRatio": "1:1" + } + ], + "admin": { + "sections": [ { - key: "identity", - title: "摊位与主理人", - description: "配置主理人姓名与身份,介绍、头像和联系方式在品牌资料中编辑。", - page: "profile", - target: "brand", - fields: [ + "key": "identity", + "title": "摊位与主理人", + "description": "配置主理人姓名与身份,介绍、头像和联系方式在品牌资料中编辑。", + "page": "profile", + "target": "brand", + "fields": [ { - key: "founder", - binding: "brand.config.founder", - label: "主理人姓名", - input: "text", - required: true, - placeholder: "例如:阿成", - previewTarget: "acheng-campus-food.profile.identity", + "key": "founder", + "binding": "brand.config.founder", + "label": "主理人姓名", + "input": "text", + "required": true, + "placeholder": "例如:阿成", + "previewTarget": "acheng-campus-food.profile.identity" }, { - key: "title", - binding: "brand.config.title", - label: "你的身份", - help: "例如:校园餐饮主理人。", - input: "text", - required: true, - previewTarget: "acheng-campus-food.profile.identity", + "key": "title", + "binding": "brand.config.title", + "label": "你的身份", + "help": "例如:校园餐饮主理人。", + "input": "text", + "required": true, + "previewTarget": "acheng-campus-food.profile.identity" }, { - key: "badge", - binding: "brand.config.visualPresentation.profile.badge", - label: "写真角标", - input: "text", - help: "显示在主理人写真上,可填写经验或服务定位。", - previewTarget: "acheng-campus-food.profile.identity", + "key": "badge", + "binding": "brand.config.visualPresentation.profile.badge", + "label": "写真角标", + "input": "text", + "help": "显示在主理人写真上,可填写经验或服务定位。", + "previewTarget": "acheng-campus-food.profile.identity" }, { - key: "storyLead", - binding: "brand.config.visualPresentation.profile.storyLead", - label: "故事引言", - input: "textarea", - help: "故事开头的强调段落,下面的正文使用品牌简介。", - previewTarget: "acheng-campus-food.profile.identity", + "key": "storyLead", + "binding": "brand.config.visualPresentation.profile.storyLead", + "label": "故事引言", + "input": "textarea", + "help": "故事开头的强调段落,下面的正文使用品牌简介。", + "previewTarget": "acheng-campus-food.profile.identity" }, { - key: "recordsTitle", - binding: "brand.config.visualPresentation.profile.recordsTitle", - label: "记录入口文案", - input: "text", - previewTarget: "acheng-campus-food.profile.identity", + "key": "recordsTitle", + "binding": "brand.config.visualPresentation.profile.recordsTitle", + "label": "记录入口文案", + "input": "text", + "previewTarget": "acheng-campus-food.profile.identity" }, { - key: "recordsCountUnit", - binding: "brand.config.visualPresentation.profile.recordsCountUnit", - label: "记录数量单位", - input: "text", - previewTarget: "acheng-campus-food.profile.identity", + "key": "recordsCountUnit", + "binding": "brand.config.visualPresentation.profile.recordsCountUnit", + "label": "记录数量单位", + "input": "text", + "previewTarget": "acheng-campus-food.profile.identity" }, { - key: "acheng-campus-food_profile_identity_avatarUrl", - binding: "brand.avatarUrl", - label: "主理人头像", - input: "image", - previewTarget: "acheng-campus-food.profile.identity", - help: "共享品牌资料,修改后同步影响其他展示位置。", + "key": "acheng-campus-food_profile_identity_avatarUrl", + "binding": "brand.avatarUrl", + "label": "主理人头像", + "input": "image", + "previewTarget": "acheng-campus-food.profile.identity", + "help": "共享品牌资料,修改后同步影响其他展示位置。" }, { - key: "acheng-campus-food_profile_identity_name", - binding: "brand.name", - label: "品牌名称", - input: "text", - previewTarget: "acheng-campus-food.profile.identity", - help: "共享品牌资料,修改后同步影响其他展示位置。", + "key": "acheng-campus-food_profile_identity_name", + "binding": "brand.name", + "label": "品牌名称", + "input": "text", + "previewTarget": "acheng-campus-food.profile.identity", + "help": "共享品牌资料,修改后同步影响其他展示位置。" }, { - key: "acheng-campus-food_profile_identity_description", - binding: "brand.description", - label: "主理人简介", - input: "textarea", - previewTarget: "acheng-campus-food.profile.identity", - help: "共享品牌资料,修改后同步影响其他展示位置。", - }, + "key": "acheng-campus-food_profile_identity_description", + "binding": "brand.description", + "label": "主理人简介", + "input": "textarea", + "previewTarget": "acheng-campus-food.profile.identity", + "help": "共享品牌资料,修改后同步影响其他展示位置。" + } ], - previewTargets: [ + "previewTargets": [ { - key: "acheng-campus-food.profile.identity", - label: "摊位与主理人", - }, - ], + "key": "acheng-campus-food.profile.identity", + "label": "摊位与主理人" + } + ] }, { - key: "homeOffering", - title: "首页业务卡片", - description: "点选预览中的单条内容,修改对应业务记录。", - page: "home", - target: "offering", - fields: [ + "key": "homeOffering", + "title": "首页业务卡片", + "description": "点选预览中的单条内容,修改对应业务记录。", + "page": "home", + "target": "offering", + "fields": [ { - key: "name", - binding: "offering.name", - label: "名称", - input: "text", - previewTarget: "acheng-campus-food.home.offering", + "key": "name", + "binding": "offering.name", + "label": "名称", + "input": "text", + "previewTarget": "acheng-campus-food.home.offering" }, { - key: "summary", - binding: "offering.summary", - label: "简介", - input: "textarea", - previewTarget: "acheng-campus-food.home.offering", + "key": "summary", + "binding": "offering.summary", + "label": "简介", + "input": "textarea", + "previewTarget": "acheng-campus-food.home.offering" }, { - key: "priceText", - binding: "offering.priceText", - label: "价格说明", - input: "text", - previewTarget: "acheng-campus-food.home.offering", + "key": "priceText", + "binding": "offering.priceText", + "label": "价格说明", + "input": "text", + "previewTarget": "acheng-campus-food.home.offering" }, { - key: "coverUrl", - binding: "offering.coverUrl", - label: "封面图片", - input: "image", - previewTarget: "acheng-campus-food.home.offering", + "key": "coverUrl", + "binding": "offering.coverUrl", + "label": "封面图片", + "input": "image", + "previewTarget": "acheng-campus-food.home.offering" }, { - key: "detailHero", - binding: "offering.config.detailHero", - label: "详情主图", - input: "image", - previewTarget: "acheng-campus-food.home.offering", - help: "此图优先用于卡片和详情;未填写时使用封面图片。", - }, + "key": "detailHero", + "binding": "offering.config.detailHero", + "label": "详情主图", + "input": "image", + "previewTarget": "acheng-campus-food.home.offering", + "help": "此图优先用于卡片和详情;未填写时使用封面图片。" + } ], - previewTargets: [ + "previewTargets": [ { - key: "acheng-campus-food.home.offering", - label: "首页业务卡片", - }, - ], + "key": "acheng-campus-food.home.offering", + "label": "首页业务卡片" + } + ] }, { - key: "home", - title: "首页出摊信息", - description: "说明今天在哪里、何时营业,以及餐品有什么特点。", - page: "home", - target: "brand", - previewTargets: [ + "key": "home", + "title": "首页出摊信息", + "description": "说明今天在哪里、何时营业,以及餐品有什么特点。", + "page": "home", + "target": "brand", + "previewTargets": [ { - key: "food.home.brand-card", - label: "品牌信息区", - composite: true, - children: ["food.home.identity", "food.home.location", "food.home.actions"], + "key": "food.home.brand-card", + "label": "品牌信息区", + "composite": true, + "children": [ + "food.home.identity", + "food.home.location", + "food.home.actions" + ] }, { - key: "food.home.identity", - label: "主理人身份", + "key": "food.home.identity", + "label": "主理人身份" }, { - key: "food.home.location", - label: "服务地点", + "key": "food.home.location", + "label": "服务地点" }, { - key: "food.home.hero", - label: "出摊现场图片", + "key": "food.home.hero", + "label": "出摊现场图片" }, { - key: "food.home.offerings-heading", - label: "餐品区域标题", + "key": "food.home.offerings-heading", + "label": "餐品区域标题" }, { - key: "food.home.actions", - label: "首页操作按钮", + "key": "food.home.actions", + "label": "首页操作按钮" }, { - key: "food.home.promise-heading", - label: "出餐承诺标题", - }, + "key": "food.home.promise-heading", + "label": "出餐承诺标题" + } ], - fields: [ + "fields": [ { - key: "founder", - binding: "brand.config.founder", - label: "主理人姓名", - input: "text", - previewTarget: "food.home.identity", + "key": "founder", + "binding": "brand.config.founder", + "label": "主理人姓名", + "input": "text", + "previewTarget": "food.home.identity" }, { - key: "title", - binding: "brand.config.title", - label: "身份说明", - input: "text", - previewTarget: "food.home.identity", + "key": "title", + "binding": "brand.config.title", + "label": "身份说明", + "input": "text", + "previewTarget": "food.home.identity" }, { - key: "stallTitle", - previewTarget: "food.home.location", - binding: "brand.config.visualPresentation.home.stallTitle", - label: "出摊信息标题", - input: "text", - placeholder: "例如:今日出摊点", + "key": "stallTitle", + "previewTarget": "food.home.location", + "binding": "brand.config.visualPresentation.home.stallTitle", + "label": "出摊信息标题", + "input": "text", + "placeholder": "例如:今日出摊点" }, { - key: "heroImage", - previewTarget: "food.home.hero", - binding: "brand.config.heroImage", - label: "出摊现场主图", - help: "展示真实摊位、餐品或取餐场景,建议使用横向图片。", - input: "image", - required: true, + "key": "heroImage", + "previewTarget": "food.home.hero", + "binding": "brand.config.heroImage", + "label": "出摊现场主图", + "help": "展示真实摊位、餐品或取餐场景,建议使用横向图片。", + "input": "image", + "required": true }, { - key: "stallTime", - previewTarget: "food.home.location", - binding: "brand.config.visualPresentation.home.stallTime", - label: "营业时间说明", - input: "text", - placeholder: "例如:17:00 - 22:30 · 今日营业中", + "key": "stallTime", + "previewTarget": "food.home.location", + "binding": "brand.config.visualPresentation.home.stallTime", + "label": "营业时间说明", + "input": "text", + "placeholder": "例如:17:00 - 22:30 · 今日营业中" }, { - key: "worksEyebrow", - previewTarget: "food.home.offerings-heading", - binding: "brand.config.visualPresentation.home.worksEyebrow", - label: "餐品区域小标题", - input: "text", + "key": "worksEyebrow", + "previewTarget": "food.home.offerings-heading", + "binding": "brand.config.visualPresentation.home.worksEyebrow", + "label": "餐品区域小标题", + "input": "text" }, { - key: "worksTitle", - previewTarget: "food.home.offerings-heading", - binding: "brand.config.visualPresentation.home.worksTitle", - label: "招牌餐品标题", - input: "text", + "key": "worksTitle", + "previewTarget": "food.home.offerings-heading", + "binding": "brand.config.visualPresentation.home.worksTitle", + "label": "招牌餐品标题", + "input": "text" }, { - key: "moreAction", - previewTarget: "food.home.offerings-heading", - binding: "brand.config.visualPresentation.home.moreAction", - label: "查看全部按钮", - input: "text", + "key": "moreAction", + "previewTarget": "food.home.offerings-heading", + "binding": "brand.config.visualPresentation.home.moreAction", + "label": "查看全部按钮", + "input": "text" }, { - key: "primaryAction", - previewTarget: "food.home.actions", - binding: "brand.config.visualPresentation.home.primaryAction", - label: "咨询按钮", - input: "text", + "key": "primaryAction", + "previewTarget": "food.home.actions", + "binding": "brand.config.visualPresentation.home.primaryAction", + "label": "咨询按钮", + "input": "text" }, { - key: "secondaryAction", - previewTarget: "food.home.actions", - binding: "brand.config.visualPresentation.home.secondaryAction", - label: "餐品按钮", - input: "text", + "key": "secondaryAction", + "previewTarget": "food.home.actions", + "binding": "brand.config.visualPresentation.home.secondaryAction", + "label": "餐品按钮", + "input": "text" }, { - key: "manifestoTitle", - previewTarget: "food.home.promise-heading", - binding: "brand.config.visualPresentation.home.manifestoTitle", - label: "出餐承诺标题", - input: "text", + "key": "manifestoTitle", + "previewTarget": "food.home.promise-heading", + "binding": "brand.config.visualPresentation.home.manifestoTitle", + "label": "出餐承诺标题", + "input": "text" }, { - key: "food_home_identity_avatarUrl", - binding: "brand.avatarUrl", - label: "主理人头像", - input: "image", - previewTarget: "food.home.identity", - help: "共享品牌资料,修改后同步影响其他展示位置。", + "key": "food_home_identity_avatarUrl", + "binding": "brand.avatarUrl", + "label": "主理人头像", + "input": "image", + "previewTarget": "food.home.identity", + "help": "共享品牌资料,修改后同步影响其他展示位置。" }, { - key: "food_home_identity_description", - binding: "brand.description", - label: "主理人简介", - input: "textarea", - previewTarget: "food.home.identity", - help: "共享品牌资料,修改后同步影响其他展示位置。", + "key": "food_home_identity_description", + "binding": "brand.description", + "label": "主理人简介", + "input": "textarea", + "previewTarget": "food.home.identity", + "help": "共享品牌资料,修改后同步影响其他展示位置。" }, { - key: "food_home_location_address", - binding: "brand.address", - label: "服务地址", - input: "text", - previewTarget: "food.home.location", - help: "共享品牌资料,修改后同步影响其他展示位置。", + "key": "food_home_location_address", + "binding": "brand.address", + "label": "服务地址", + "input": "text", + "previewTarget": "food.home.location", + "help": "共享品牌资料,修改后同步影响其他展示位置。" }, { - key: "food_home_hero_name", - binding: "brand.name", - label: "品牌名称", - input: "text", - previewTarget: "food.home.hero", - help: "共享品牌资料,修改后同步影响其他展示位置。", - }, - ], + "key": "food_home_hero_name", + "binding": "brand.name", + "label": "品牌名称", + "input": "text", + "previewTarget": "food.home.hero", + "help": "共享品牌资料,修改后同步影响其他展示位置。" + } + ] }, { - key: "service", - title: "出摊服务页说明", - description: "设置出摊服务页的咨询按钮;日程、取餐配送和流程在对应内容编辑器中维护。", - page: "service", - target: "brand", - fields: [ + "key": "service", + "title": "出摊服务页说明", + "description": "设置出摊服务页的咨询按钮;日程、取餐配送和流程在对应内容编辑器中维护。", + "page": "service", + "target": "brand", + "fields": [ { - key: "processAction", - binding: "brand.config.visualPresentation.service.processAction", - label: "咨询按钮文字", - input: "text", - previewTarget: "food.service.process-action", - }, + "key": "processAction", + "binding": "brand.config.visualPresentation.service.processAction", + "label": "咨询按钮文字", + "input": "text", + "previewTarget": "food.service.process-action" + } ], - previewTargets: [ + "previewTargets": [ { - key: "acheng-campus-food.service.service", - label: "出摊服务页说明", - composite: true, - children: ["food.service.process-action"], + "key": "acheng-campus-food.service.service", + "label": "出摊服务页说明", + "composite": true, + "children": [ + "food.service.process-action" + ] }, { - key: "food.service.process-action", - label: "咨询按钮文字", - }, - ], + "key": "food.service.process-action", + "label": "咨询按钮文字" + } + ] }, { - key: "offeringsOffering", - title: "业务卡片", - description: "点选预览中的单条内容,修改对应业务记录。", - page: "offerings", - target: "offering", - fields: [ + "key": "offeringsOffering", + "title": "业务卡片", + "description": "点选预览中的单条内容,修改对应业务记录。", + "page": "offerings", + "target": "offering", + "fields": [ { - key: "name", - binding: "offering.name", - label: "名称", - input: "text", - previewTarget: "acheng-campus-food.offerings.item", + "key": "name", + "binding": "offering.name", + "label": "名称", + "input": "text", + "previewTarget": "acheng-campus-food.offerings.item" }, { - key: "summary", - binding: "offering.summary", - label: "简介", - input: "textarea", - previewTarget: "acheng-campus-food.offerings.item", + "key": "summary", + "binding": "offering.summary", + "label": "简介", + "input": "textarea", + "previewTarget": "acheng-campus-food.offerings.item" }, { - key: "priceText", - binding: "offering.priceText", - label: "价格说明", - input: "text", - previewTarget: "acheng-campus-food.offerings.item", + "key": "priceText", + "binding": "offering.priceText", + "label": "价格说明", + "input": "text", + "previewTarget": "acheng-campus-food.offerings.item" }, { - key: "coverUrl", - binding: "offering.coverUrl", - label: "封面图片", - input: "image", - previewTarget: "acheng-campus-food.offerings.item", + "key": "coverUrl", + "binding": "offering.coverUrl", + "label": "封面图片", + "input": "image", + "previewTarget": "acheng-campus-food.offerings.item" }, { - key: "detailHero", - binding: "offering.config.detailHero", - label: "详情主图", - input: "image", - previewTarget: "acheng-campus-food.offerings.item", - help: "此图优先用于卡片和详情;未填写时使用封面图片。", + "key": "detailHero", + "binding": "offering.config.detailHero", + "label": "详情主图", + "input": "image", + "previewTarget": "acheng-campus-food.offerings.item", + "help": "此图优先用于卡片和详情;未填写时使用封面图片。" }, { - key: "categoryLabel", - binding: "offering.config.categoryKey", - label: "餐品类别", - input: "select", - options: [ + "key": "categoryLabel", + "binding": "offering.config.categoryKey", + "label": "餐品类别", + "input": "select", + "options": [ { - value: "set-meal", - label: "套餐", + "value": "set-meal", + "label": "套餐" }, { - value: "private-chef", - label: "私厨", + "value": "private-chef", + "label": "私厨" }, { - value: "custom", - label: "定制餐品", - }, + "value": "custom", + "label": "定制餐品" + } ], - previewTarget: "acheng-campus-food.offerings.item", - }, + "previewTarget": "acheng-campus-food.offerings.item" + } ], - previewTargets: [ + "previewTargets": [ { - key: "acheng-campus-food.offerings.item", - label: "业务卡片", - }, - ], + "key": "acheng-campus-food.offerings.item", + "label": "业务卡片" + } + ] }, { - key: "menu", - title: "菜单页说明", - description: "帮助顾客理解日常餐品和团体定制的选择方式。", - page: "offerings", - target: "brand", - fields: [ + "key": "menu", + "title": "菜单页说明", + "description": "帮助顾客理解日常餐品和团体定制的选择方式。", + "page": "offerings", + "target": "brand", + "fields": [ { - key: "title", - binding: "brand.config.visualPresentation.offerings.title", - label: "菜单页标题", - input: "text", - previewTarget: "acheng-campus-food.offerings.menu", + "key": "title", + "binding": "brand.config.visualPresentation.offerings.title", + "label": "菜单页标题", + "input": "text", + "previewTarget": "acheng-campus-food.offerings.menu" }, { - key: "subtitle", - binding: "brand.config.visualPresentation.offerings.subtitle", - label: "菜单页说明", - input: "textarea", - maxLength: 120, - previewTarget: "acheng-campus-food.offerings.menu", + "key": "subtitle", + "binding": "brand.config.visualPresentation.offerings.subtitle", + "label": "菜单页说明", + "input": "textarea", + "maxLength": 120, + "previewTarget": "acheng-campus-food.offerings.menu" }, { - key: "menuTip", - binding: "brand.config.visualPresentation.offerings.menuTip", - label: "菜单提示", - help: "只填写当前实际提供的取餐、加菜或定制服务。", - input: "textarea", - previewTarget: "acheng-campus-food.offerings.menu", - }, + "key": "menuTip", + "binding": "brand.config.visualPresentation.offerings.menuTip", + "label": "菜单提示", + "help": "只填写当前实际提供的取餐、加菜或定制服务。", + "input": "textarea", + "previewTarget": "acheng-campus-food.offerings.menu" + } ], - previewTargets: [ + "previewTargets": [ { - key: "acheng-campus-food.offerings.menu", - label: "菜单页说明", - }, - ], + "key": "acheng-campus-food.offerings.menu", + "label": "菜单页说明" + } + ] }, { - key: "booking", - title: "预订与定制", - description: "告诉顾客提交信息后会如何确认餐品和时间。", - page: "inquiry", - target: "inquiry", - fields: [ + "key": "booking", + "title": "预订与定制", + "description": "告诉顾客提交信息后会如何确认餐品和时间。", + "page": "inquiry", + "target": "inquiry", + "fields": [ { - key: "title", - binding: "brand.config.visualPresentation.inquiry.title", - label: "预订页面标题", - input: "text", - previewTarget: "acheng-campus-food.inquiry.booking", + "key": "title", + "binding": "brand.config.visualPresentation.inquiry.title", + "label": "预订页面标题", + "input": "text", + "previewTarget": "acheng-campus-food.inquiry.booking" }, { - key: "subtitle", - binding: "brand.config.visualPresentation.inquiry.subtitle", - label: "预订说明", - input: "textarea", - maxLength: 120, - previewTarget: "acheng-campus-food.inquiry.booking", + "key": "subtitle", + "binding": "brand.config.visualPresentation.inquiry.subtitle", + "label": "预订说明", + "input": "textarea", + "maxLength": 120, + "previewTarget": "acheng-campus-food.inquiry.booking" }, { - key: "submitLabel", - binding: "brand.config.visualPresentation.inquiry.submitLabel", - label: "提交按钮文字", - input: "text", - placeholder: "例如:提交预订需求", - previewTarget: "acheng-campus-food.inquiry.booking", + "key": "submitLabel", + "binding": "brand.config.visualPresentation.inquiry.submitLabel", + "label": "提交按钮文字", + "input": "text", + "placeholder": "例如:提交预订需求", + "previewTarget": "acheng-campus-food.inquiry.booking" }, { - key: "promise", - binding: "brand.config.visualPresentation.inquiry.promise", - label: "真实服务承诺", - help: "仅填写能兑现的回复时间、订金和联系规则;留空则不显示。", - input: "textarea", - previewTarget: "acheng-campus-food.inquiry.booking", - }, + "key": "promise", + "binding": "brand.config.visualPresentation.inquiry.promise", + "label": "真实服务承诺", + "help": "仅填写能兑现的回复时间、订金和联系规则;留空则不显示。", + "input": "textarea", + "previewTarget": "acheng-campus-food.inquiry.booking" + } ], - previewTargets: [ + "previewTargets": [ { - key: "acheng-campus-food.inquiry.booking", - label: "预订与定制", - }, - ], + "key": "acheng-campus-food.inquiry.booking", + "label": "预订与定制" + } + ] }, { - key: "dishDetail", - title: "餐品与服务详情", - description: "每项餐品或服务单独填写;没有内容的详情区块不会展示。", - page: "detail", - target: "offering", - fields: [ + "key": "dishDetail", + "title": "餐品与服务详情", + "description": "每项餐品或服务单独填写;没有内容的详情区块不会展示。", + "page": "detail", + "target": "offering", + "fields": [ { - key: "categoryLabel", - binding: "offering.config.categoryKey", - label: "餐品类别", - input: "select", - options: [ + "key": "categoryLabel", + "binding": "offering.config.categoryKey", + "label": "餐品类别", + "input": "select", + "options": [ { - value: "set-meal", - label: "套餐", + "value": "set-meal", + "label": "套餐" }, { - value: "private-chef", - label: "私厨", + "value": "private-chef", + "label": "私厨" }, { - value: "custom", - label: "定制餐品", - }, + "value": "custom", + "label": "定制餐品" + } ], - previewTarget: "acheng-campus-food.detail.dishDetail", + "previewTarget": "acheng-campus-food.detail.dishDetail" }, { - key: "detailHero", - binding: "offering.config.detailHero", - label: "详情主图", - input: "image", - previewTarget: "acheng-campus-food.detail.dishDetail", + "key": "detailHero", + "binding": "offering.config.detailHero", + "label": "详情主图", + "input": "image", + "previewTarget": "acheng-campus-food.detail.dishDetail" }, { - key: "area", - binding: "offering.config.area", - label: "供应地点", - input: "text", - previewTarget: "acheng-campus-food.detail.dishDetail", + "key": "area", + "binding": "offering.config.area", + "label": "供应地点", + "input": "text", + "previewTarget": "acheng-campus-food.detail.dishDetail" }, { - key: "series", - binding: "offering.config.series", - label: "套餐或系列说明", - input: "text", - previewTarget: "acheng-campus-food.detail.dishDetail", + "key": "series", + "binding": "offering.config.series", + "label": "套餐或系列说明", + "input": "text", + "previewTarget": "acheng-campus-food.detail.dishDetail" }, { - key: "spaceType", - binding: "offering.config.spaceType", - label: "适合场景", - input: "text", - previewTarget: "acheng-campus-food.detail.dishDetail", + "key": "spaceType", + "binding": "offering.config.spaceType", + "label": "适合场景", + "input": "text", + "previewTarget": "acheng-campus-food.detail.dishDetail" }, { - key: "background", - binding: "offering.config.details.background", - label: "餐品介绍", - input: "textarea", - previewTarget: "acheng-campus-food.detail.dishDetail", + "key": "background", + "binding": "offering.config.details.background", + "label": "餐品介绍", + "input": "textarea", + "previewTarget": "acheng-campus-food.detail.dishDetail" }, { - key: "designConcept", - binding: "offering.config.details.designConcept", - label: "口味与分量", - input: "textarea", - previewTarget: "acheng-campus-food.detail.dishDetail", + "key": "designConcept", + "binding": "offering.config.details.designConcept", + "label": "口味与分量", + "input": "textarea", + "previewTarget": "acheng-campus-food.detail.dishDetail" }, { - key: "keywords", - binding: "offering.config.keywords", - label: "餐品特色", - input: "list", - itemValueKey: "value", - itemFields: [ + "key": "keywords", + "binding": "offering.config.keywords", + "label": "餐品特色", + "input": "list", + "itemValueKey": "value", + "itemFields": [ { - key: "value", - label: "特色", - }, + "key": "value", + "label": "特色" + } ], - previewTarget: "acheng-campus-food.detail.dishDetail", + "previewTarget": "acheng-campus-food.detail.dishDetail" }, { - key: "crafts", - binding: "offering.config.details.crafts", - label: "制作方式", - input: "list", - itemValueKey: "value", - itemFields: [ + "key": "crafts", + "binding": "offering.config.details.crafts", + "label": "制作方式", + "input": "list", + "itemValueKey": "value", + "itemFields": [ { - key: "value", - label: "制作说明", - }, + "key": "value", + "label": "制作说明" + } ], - previewTarget: "acheng-campus-food.detail.dishDetail", + "previewTarget": "acheng-campus-food.detail.dishDetail" }, { - key: "materialsList", - binding: "offering.config.details.materialsList", - label: "食材与搭配", - input: "list", - itemFields: [ + "key": "materialsList", + "binding": "offering.config.details.materialsList", + "label": "食材与搭配", + "input": "list", + "itemFields": [ { - key: "name", - label: "食材或搭配", + "key": "name", + "label": "食材或搭配" }, { - key: "spec", - label: "说明", - }, + "key": "spec", + "label": "说明" + } ], - previewTarget: "acheng-campus-food.detail.dishDetail", - }, + "previewTarget": "acheng-campus-food.detail.dishDetail" + } ], - previewTargets: [ + "previewTargets": [ { - key: "acheng-campus-food.detail.dishDetail", - label: "餐品与服务详情", - }, - ], + "key": "acheng-campus-food.detail.dishDetail", + "label": "餐品与服务详情" + } + ] }, { - key: "detailCopy", - title: "详情页说明", - description: "解释价格、餐品内容和咨询后会怎样处理。", - page: "detail", - target: "brand", - fields: [ + "key": "detailCopy", + "title": "详情页说明", + "description": "解释价格、餐品内容和咨询后会怎样处理。", + "page": "detail", + "target": "brand", + "fields": [ { - key: "priceLabel", - binding: "brand.config.visualPresentation.detail.priceLabel", - label: "价格说明标题", - input: "text", - previewTarget: "acheng-campus-food.detail.detailCopy", + "key": "priceLabel", + "binding": "brand.config.visualPresentation.detail.priceLabel", + "label": "价格说明标题", + "input": "text", + "previewTarget": "acheng-campus-food.detail.detailCopy" }, { - key: "spaceLabel", - binding: "brand.config.visualPresentation.detail.spaceLabel", - label: "适合场景标题", - input: "text", - previewTarget: "acheng-campus-food.detail.detailCopy", + "key": "spaceLabel", + "binding": "brand.config.visualPresentation.detail.spaceLabel", + "label": "适合场景标题", + "input": "text", + "previewTarget": "acheng-campus-food.detail.detailCopy" }, { - key: "backgroundTitle", - binding: "brand.config.visualPresentation.detail.backgroundTitle", - label: "餐品介绍标题", - input: "text", - previewTarget: "acheng-campus-food.detail.detailCopy", + "key": "backgroundTitle", + "binding": "brand.config.visualPresentation.detail.backgroundTitle", + "label": "餐品介绍标题", + "input": "text", + "previewTarget": "acheng-campus-food.detail.detailCopy" }, { - key: "conceptTitle", - binding: "brand.config.visualPresentation.detail.conceptTitle", - label: "口味与分量标题", - input: "text", - previewTarget: "acheng-campus-food.detail.detailCopy", + "key": "conceptTitle", + "binding": "brand.config.visualPresentation.detail.conceptTitle", + "label": "口味与分量标题", + "input": "text", + "previewTarget": "acheng-campus-food.detail.detailCopy" }, { - key: "craftsTitle", - binding: "brand.config.visualPresentation.detail.craftsTitle", - label: "制作方式标题", - input: "text", - previewTarget: "acheng-campus-food.detail.detailCopy", + "key": "craftsTitle", + "binding": "brand.config.visualPresentation.detail.craftsTitle", + "label": "制作方式标题", + "input": "text", + "previewTarget": "acheng-campus-food.detail.detailCopy" }, { - key: "materialsTitle", - binding: "brand.config.visualPresentation.detail.materialsTitle", - label: "食材与搭配标题", - input: "text", - previewTarget: "acheng-campus-food.detail.detailCopy", - }, + "key": "materialsTitle", + "binding": "brand.config.visualPresentation.detail.materialsTitle", + "label": "食材与搭配标题", + "input": "text", + "previewTarget": "acheng-campus-food.detail.detailCopy" + } ], - previewTargets: [ + "previewTargets": [ { - key: "acheng-campus-food.detail.detailCopy", - label: "详情页说明", - }, - ], + "key": "acheng-campus-food.detail.detailCopy", + "label": "详情页说明" + } + ] }, { - key: "successCopy", - title: "提交成功页", - description: "顾客提交后看到的确认信息与后续预期。", - page: "success", - target: "brand", - fields: [ + "key": "successCopy", + "title": "提交成功页", + "description": "顾客提交后看到的确认信息与后续预期。", + "page": "success", + "target": "brand", + "fields": [ { - key: "eyebrow", - binding: "brand.config.visualPresentation.success.eyebrow", - label: "页面小标题", - input: "text", - previewTarget: "acheng-campus-food.success.successCopy", + "key": "eyebrow", + "binding": "brand.config.visualPresentation.success.eyebrow", + "label": "页面小标题", + "input": "text", + "previewTarget": "acheng-campus-food.success.successCopy" }, { - key: "title", - binding: "brand.config.visualPresentation.success.title", - label: "确认标题", - input: "text", - previewTarget: "acheng-campus-food.success.successCopy", + "key": "title", + "binding": "brand.config.visualPresentation.success.title", + "label": "确认标题", + "input": "text", + "previewTarget": "acheng-campus-food.success.successCopy" }, { - key: "intro", - binding: "brand.config.visualPresentation.success.intro", - label: "后续联系说明", - help: "若写回复时间,请确认日常能兑现。", - input: "textarea", - previewTarget: "acheng-campus-food.success.successCopy", + "key": "intro", + "binding": "brand.config.visualPresentation.success.intro", + "label": "后续联系说明", + "help": "若写回复时间,请确认日常能兑现。", + "input": "textarea", + "previewTarget": "acheng-campus-food.success.successCopy" }, { - key: "recordsAction", - binding: "brand.config.visualPresentation.success.recordsAction", - label: "查看记录按钮", - input: "text", - previewTarget: "acheng-campus-food.success.successCopy", + "key": "recordsAction", + "binding": "brand.config.visualPresentation.success.recordsAction", + "label": "查看记录按钮", + "input": "text", + "previewTarget": "acheng-campus-food.success.successCopy" }, { - key: "homeAction", - binding: "brand.config.visualPresentation.success.homeAction", - label: "返回首页按钮", - input: "text", - previewTarget: "acheng-campus-food.success.successCopy", - }, + "key": "homeAction", + "binding": "brand.config.visualPresentation.success.homeAction", + "label": "返回首页按钮", + "input": "text", + "previewTarget": "acheng-campus-food.success.successCopy" + } ], - previewTargets: [ + "previewTargets": [ { - key: "acheng-campus-food.success.successCopy", - label: "提交成功页", - }, - ], + "key": "acheng-campus-food.success.successCopy", + "label": "提交成功页" + } + ] }, { - key: "recordsCopy", - title: "咨询记录页", - description: "顾客查看预订与咨询处理进度时看到的内容。", - page: "records", - target: "brand", - fields: [ + "key": "recordsCopy", + "title": "咨询记录页", + "description": "顾客查看预订与咨询处理进度时看到的内容。", + "page": "records", + "target": "brand", + "fields": [ { - key: "title", - binding: "brand.config.visualPresentation.records.title", - label: "记录页标题", - input: "text", - previewTarget: "acheng-campus-food.records.recordsCopy", + "key": "title", + "binding": "brand.config.visualPresentation.records.title", + "label": "记录页标题", + "input": "text", + "previewTarget": "acheng-campus-food.records.recordsCopy" }, { - key: "createAction", - binding: "brand.config.visualPresentation.records.createAction", - label: "新增咨询按钮", - input: "text", - previewTarget: "acheng-campus-food.records.recordsCopy", + "key": "createAction", + "binding": "brand.config.visualPresentation.records.createAction", + "label": "新增咨询按钮", + "input": "text", + "previewTarget": "acheng-campus-food.records.recordsCopy" }, { - key: "emptyTitle", - binding: "brand.config.visualPresentation.records.emptyTitle", - label: "暂无记录标题", - input: "text", - previewTarget: "acheng-campus-food.records.recordsCopy", + "key": "emptyTitle", + "binding": "brand.config.visualPresentation.records.emptyTitle", + "label": "暂无记录标题", + "input": "text", + "previewTarget": "acheng-campus-food.records.recordsCopy" }, { - key: "emptyDescription", - binding: "brand.config.visualPresentation.records.emptyDescription", - label: "暂无记录说明", - input: "textarea", - previewTarget: "acheng-campus-food.records.recordsCopy", + "key": "emptyDescription", + "binding": "brand.config.visualPresentation.records.emptyDescription", + "label": "暂无记录说明", + "input": "textarea", + "previewTarget": "acheng-campus-food.records.recordsCopy" }, { - key: "emptyAction", - binding: "brand.config.visualPresentation.records.emptyAction", - label: "空状态按钮", - input: "text", - previewTarget: "acheng-campus-food.records.recordsCopy", - }, + "key": "emptyAction", + "binding": "brand.config.visualPresentation.records.emptyAction", + "label": "空状态按钮", + "input": "text", + "previewTarget": "acheng-campus-food.records.recordsCopy" + } ], - previewTargets: [ + "previewTargets": [ { - key: "acheng-campus-food.records.recordsCopy", - label: "咨询记录页", - }, - ], + "key": "acheng-campus-food.records.recordsCopy", + "label": "咨询记录页" + } + ] }, { - key: "offerings_detailAction", - title: "详情按钮文字", - description: "此页同类按钮共用此文案。", - page: "offerings", - target: "brand", - previewTargets: [ + "key": "offerings_detailAction", + "title": "详情按钮文字", + "description": "此页同类按钮共用此文案。", + "page": "offerings", + "target": "brand", + "previewTargets": [ { - key: "acheng-campus-food.offerings.action", - label: "详情按钮文字", - }, + "key": "acheng-campus-food.offerings.action", + "label": "详情按钮文字" + } ], - fields: [ + "fields": [ { - key: "detailAction", - binding: "brand.config.visualPresentation.offerings.detailAction", - label: "详情按钮文字", - input: "text", - previewTarget: "acheng-campus-food.offerings.action", - }, - ], + "key": "detailAction", + "binding": "brand.config.visualPresentation.offerings.detailAction", + "label": "详情按钮文字", + "input": "text", + "previewTarget": "acheng-campus-food.offerings.action" + } + ] }, { - key: "detailAction", - title: "详情页咨询入口", - description: "公共按钮与提示,对所有业务详情生效。", - page: "detail", - target: "brand", - fields: [ + "key": "detailAction", + "title": "详情页咨询入口", + "description": "公共按钮与提示,对所有业务详情生效。", + "page": "detail", + "target": "brand", + "fields": [ { - key: "inquiryAction", - binding: "brand.config.visualPresentation.detail.inquiryAction", - label: "咨询按钮文字", - input: "text", - previewTarget: "acheng-campus-food.detail.action", + "key": "inquiryAction", + "binding": "brand.config.visualPresentation.detail.inquiryAction", + "label": "咨询按钮文字", + "input": "text", + "previewTarget": "acheng-campus-food.detail.action" }, { - key: "inquiryHint", - binding: "brand.config.visualPresentation.detail.inquiryHint", - label: "咨询后的处理说明", - help: "只写能够兑现的联系和确认方式。", - input: "textarea", - previewTarget: "acheng-campus-food.detail.action", - }, + "key": "inquiryHint", + "binding": "brand.config.visualPresentation.detail.inquiryHint", + "label": "咨询后的处理说明", + "help": "只写能够兑现的联系和确认方式。", + "input": "textarea", + "previewTarget": "acheng-campus-food.detail.action" + } ], - previewTargets: [ + "previewTargets": [ { - key: "acheng-campus-food.detail.action", - label: "详情页咨询入口", - }, - ], - }, - ], + "key": "acheng-campus-food.detail.action", + "label": "详情页咨询入口" + } + ] + } + ] }, - trustContentTypes: [ + "trustContentTypes": [ { - type: "schedule", - label: "每周出摊安排", - adminFields: { - title: "安排标题", - summary: "主要时段(周一至周五)", - content: "其他时段与补充安排(周末等)", - summaryHelp: "此摘要作为出摊服务页的主要时段展示。", - summaryPlaceholder: "周一至周五 17:00 - 22:30", + "type": "schedule", + "label": "每周出摊安排", + "adminFields": { + "title": "安排标题", + "summary": "主要时段(周一至周五)", + "content": "其他时段与补充安排(周末等)", + "summaryHelp": "此摘要作为出摊服务页的主要时段展示。", + "summaryPlaceholder": "周一至周五 17:00 - 22:30" }, - configFields: [ + "configFields": [ { - key: "status", - binding: "trust.config.status", - label: "状态标签", - input: "text", - required: false, + "key": "status", + "binding": "trust.config.status", + "label": "状态标签", + "input": "text", + "required": false }, { - key: "weekdayLabel", - binding: "trust.config.weekdayLabel", - label: "工作日标题", - input: "text", - required: true, + "key": "weekdayLabel", + "binding": "trust.config.weekdayLabel", + "label": "工作日标题", + "input": "text", + "required": true }, { - key: "weekdayTag", - binding: "trust.config.weekdayTag", - label: "工作日标签", - input: "text", - required: false, + "key": "weekdayTag", + "binding": "trust.config.weekdayTag", + "label": "工作日标签", + "input": "text", + "required": false }, { - key: "weekdayDetail", - binding: "trust.config.weekdayDetail", - label: "工作日地点", - input: "textarea", - required: true, + "key": "weekdayDetail", + "binding": "trust.config.weekdayDetail", + "label": "工作日地点", + "input": "textarea", + "required": true }, { - key: "weekdayHours", - binding: "trust.config.weekdayHours", - label: "工作日营业时间", - input: "text", - required: false, + "key": "weekdayHours", + "binding": "trust.config.weekdayHours", + "label": "工作日营业时间", + "input": "text", + "required": false }, { - key: "weekendLabel", - binding: "trust.config.weekendLabel", - label: "周末标题", - input: "text", - required: true, + "key": "weekendLabel", + "binding": "trust.config.weekendLabel", + "label": "周末标题", + "input": "text", + "required": true }, { - key: "weekendTag", - binding: "trust.config.weekendTag", - label: "周末标签", - input: "text", - required: false, + "key": "weekendTag", + "binding": "trust.config.weekendTag", + "label": "周末标签", + "input": "text", + "required": false }, { - key: "weekendDetail", - binding: "trust.config.weekendDetail", - label: "周末白天安排", - input: "textarea", - required: true, + "key": "weekendDetail", + "binding": "trust.config.weekendDetail", + "label": "周末白天安排", + "input": "textarea", + "required": true }, { - key: "weekendHours", - binding: "trust.config.weekendHours", - label: "周末晚间安排", - input: "text", - required: false, - }, + "key": "weekendHours", + "binding": "trust.config.weekendHours", + "label": "周末晚间安排", + "input": "text", + "required": false + } ], - hideStandardFields: ["summary", "content"], - pages: ["service"], - help: "分别编辑工作日和周末两张日程小卡,不再使用摘要或正文拼接时间。", - placeholder: "例如:\n周一至周五 17:00 - 22:30\n周六、周日承接团体单与夜市流动出摊", - required: true, - maxPublishedItems: 1, + "hideStandardFields": [ + "summary", + "content" + ], + "pages": [ + "service" + ], + "help": "分别编辑工作日和周末两张日程小卡,不再使用摘要或正文拼接时间。", + "placeholder": "例如:\n周一至周五 17:00 - 22:30\n周六、周日承接团体单与夜市流动出摊", + "required": true, + "maxPublishedItems": 1 }, { - type: "coverage", - label: "取餐与配送范围", - adminFields: { - title: "范围标题", - summary: "方式摘要", - content: "取餐与配送说明", + "type": "coverage", + "label": "取餐与配送范围", + "adminFields": { + "title": "范围标题", + "summary": "方式摘要", + "content": "取餐与配送说明" }, - configFields: [ + "configFields": [ { - key: "pickupTitle", - binding: "trust.config.pickupTitle", - label: "现场自取标题", - input: "text", - required: true, + "key": "pickupTitle", + "binding": "trust.config.pickupTitle", + "label": "现场自取标题", + "input": "text", + "required": true }, { - key: "pickupDetail", - binding: "trust.config.pickupDetail", - label: "现场自取说明", - input: "textarea", - required: true, + "key": "pickupDetail", + "binding": "trust.config.pickupDetail", + "label": "现场自取说明", + "input": "textarea", + "required": true }, { - key: "deliveryTitle", - binding: "trust.config.deliveryTitle", - label: "校内配送标题", - input: "text", - required: true, + "key": "deliveryTitle", + "binding": "trust.config.deliveryTitle", + "label": "校内配送标题", + "input": "text", + "required": true }, { - key: "deliveryDetail", - binding: "trust.config.deliveryDetail", - label: "校内配送说明", - input: "textarea", - required: true, - }, + "key": "deliveryDetail", + "binding": "trust.config.deliveryDetail", + "label": "校内配送说明", + "input": "textarea", + "required": true + } ], - hideStandardFields: ["summary", "content"], - pages: ["service"], - help: "说明服务地点、取餐方式和可配送范围。", - placeholder: "例如:支持校内宿舍楼下配送", - required: true, - maxPublishedItems: 1, + "hideStandardFields": [ + "summary", + "content" + ], + "pages": [ + "service" + ], + "help": "说明服务地点、取餐方式和可配送范围。", + "placeholder": "例如:支持校内宿舍楼下配送", + "required": true, + "maxPublishedItems": 1 }, { - type: "process", - label: "定制餐品流程", - adminFields: { - title: "流程标题", - summary: "流程摘要", - content: "流程步骤", + "type": "process", + "label": "定制餐品流程", + "adminFields": { + "title": "流程标题", + "summary": "流程摘要", + "content": "流程步骤" }, - configFields: [ + "configFields": [ { - key: "steps", - binding: "trust.config.steps", - label: "流程步骤", - input: "list", - itemFields: [ + "key": "steps", + "binding": "trust.config.steps", + "label": "流程步骤", + "input": "list", + "itemFields": [ { - key: "title", - label: "步骤标题", - input: "text", - required: true, + "key": "title", + "label": "步骤标题", + "input": "text", + "required": true }, { - key: "detail", - label: "步骤说明", - input: "textarea", - required: true, - }, + "key": "detail", + "label": "步骤说明", + "input": "textarea", + "required": true + } ], - required: true, + "required": true }, { - key: "intro", - binding: "trust.config.intro", - label: "流程介绍", - input: "text", + "key": "intro", + "binding": "trust.config.intro", + "label": "流程介绍", + "input": "text" }, { - key: "minimumNote", - binding: "trust.config.minimumNote", - label: "起订说明", - input: "text", + "key": "minimumNote", + "binding": "trust.config.minimumNote", + "label": "起订说明", + "input": "text" }, { - key: "refundNote", - binding: "trust.config.refundNote", - label: "退改说明", - input: "text", - }, + "key": "refundNote", + "binding": "trust.config.refundNote", + "label": "退改说明", + "input": "text" + } ], - hideStandardFields: ["summary", "content"], - pages: ["service"], - help: "每个步骤分别填写标题和说明,按列表顺序展示。", - placeholder: "例如:提交需求\n确认菜单\n制作交付", - required: true, - maxPublishedItems: 1, + "hideStandardFields": [ + "summary", + "content" + ], + "pages": [ + "service" + ], + "help": "每个步骤分别填写标题和说明,按列表顺序展示。", + "placeholder": "例如:提交需求\n确认菜单\n制作交付", + "required": true, + "maxPublishedItems": 1 }, { - type: "credential", - label: "食品安全与制作标准", - adminFields: { - title: "证明标题", - summary: "标准摘要", - content: "资质与制作说明", + "type": "credential", + "label": "食品安全与制作标准", + "adminFields": { + "title": "证明标题", + "summary": "标准摘要", + "content": "资质与制作说明" }, - pages: ["profile"], - help: "填写让顾客放心的资质、卫生或制作标准。", - configFields: [ - { - key: "standards", - binding: "trust.config.standards", - label: "资质与卫生小卡", - input: "list", - itemFields: [ - { - key: "title", - label: "小卡标题", - required: true, - }, - { - key: "detail", - label: "小卡说明", - required: true, - }, - ], - }, + "pages": [ + "profile" ], + "help": "填写让顾客放心的资质、卫生或制作标准。", + "configFields": [ + { + "key": "standards", + "binding": "trust.config.standards", + "label": "资质与卫生小卡", + "input": "list", + "itemFields": [ + { + "key": "title", + "label": "小卡标题", + "required": true + }, + { + "key": "detail", + "label": "小卡说明", + "required": true + } + ] + } + ] }, { - type: "case", - label: "客户案例与反馈", - adminFields: { - title: "案例标题", - summary: "案例摘要", - content: "案例与客户反馈", + "type": "case", + "label": "客户案例与反馈", + "adminFields": { + "title": "案例标题", + "summary": "案例摘要", + "content": "案例与客户反馈" }, - pages: ["home", "profile"], - help: "填写代表性订单、活动案例或客户评价。", - configFields: [ - { - key: "entries", - binding: "trust.config.entries", - label: "合作案例条目", - input: "list", - itemFields: [ - { - key: "badge", - label: "左侧简称", - required: true, - }, - { - key: "title", - label: "案例名称", - required: true, - }, - { - key: "detail", - label: "交付说明", - }, - { - key: "result", - label: "右侧结果标签", - }, - ], - }, + "pages": [ + "home", + "profile" ], + "help": "填写代表性订单、活动案例或客户评价。", + "configFields": [ + { + "key": "entries", + "binding": "trust.config.entries", + "label": "合作案例条目", + "input": "list", + "itemFields": [ + { + "key": "badge", + "label": "左侧简称", + "required": true + }, + { + "key": "title", + "label": "案例名称", + "required": true + }, + { + "key": "detail", + "label": "交付说明" + }, + { + "key": "result", + "label": "右侧结果标签" + } + ] + } + ] }, { - type: "promise", - label: "回复与服务承诺", - adminFields: { - title: "承诺标题", - summary: "承诺摘要", - content: "服务承诺详情", + "type": "promise", + "label": "回复与服务承诺", + "adminFields": { + "title": "承诺标题", + "summary": "承诺摘要", + "content": "服务承诺详情" }, - pages: ["home", "profile"], - help: "说明回复时间、退改规则或服务承诺。", - configFields: [ - { - key: "commitments", - binding: "trust.config.commitments", - label: "回复承诺条目", - input: "list", - itemFields: [ - { - key: "label", - label: "情境或时段", - required: true, - }, - { - key: "detail", - label: "承诺说明", - required: true, - }, - { - key: "highlight", - label: "强调文字", - }, - ], - }, + "pages": [ + "home", + "profile" ], - }, + "help": "说明回复时间、退改规则或服务承诺。", + "configFields": [ + { + "key": "commitments", + "binding": "trust.config.commitments", + "label": "回复承诺条目", + "input": "list", + "itemFields": [ + { + "key": "label", + "label": "情境或时段", + "required": true + }, + { + "key": "detail", + "label": "承诺说明", + "required": true + }, + { + "key": "highlight", + "label": "强调文字" + } + ] + } + ] + } ], - sampleContent: { - food: { - templateKey: "food", - inquiryFormName: "餐品预订与定制表单", - offerings: [ + "sampleContent": { + "food": { + "templateKey": "food", + "inquiryFormName": "餐品预订与定制表单", + "offerings": [ { - kind: "package", - name: "示例·今日套餐", - summary: "现做家常套餐示例内容。", - categoryKey: "set-meal", - coverUrl: "/assets/content/package-01.jpg", - priceText: "¥28 起 / 份", - priceAmount: 2800, - config: { - media: [ + "kind": "package", + "name": "示例·今日套餐", + "summary": "现做家常套餐示例内容。", + "categoryKey": "set-meal", + "coverUrl": "/assets/content/package-01.jpg", + "priceText": "¥28 起 / 份", + "priceAmount": 2800, + "config": { + "media": [ { - url: "/assets/content/package-01.jpg", - alt: "", - type: "image", - }, - ], - }, + "url": "/assets/content/package-01.jpg", + "alt": "", + "type": "image" + } + ] + } }, { - kind: "service", - name: "示例·聚餐定制", - summary: "按人数和口味沟通定制餐品。", - categoryKey: "private-chef", - coverUrl: "/assets/content/private-chef.jpg", - priceText: "按人数和菜单确认", - priceAmount: 3200, - config: { - media: [ + "kind": "service", + "name": "示例·聚餐定制", + "summary": "按人数和口味沟通定制餐品。", + "categoryKey": "private-chef", + "coverUrl": "/assets/content/private-chef.jpg", + "priceText": "按人数和菜单确认", + "priceAmount": 3200, + "config": { + "media": [ { - url: "/assets/content/private-chef.jpg", - alt: "", - type: "image", - }, - ], - }, + "url": "/assets/content/private-chef.jpg", + "alt": "", + "type": "image" + } + ] + } }, { - kind: "service", - name: "示例·团体餐定制", - summary: "为社团、活动和小型聚会提供批量餐品定制。", - categoryKey: "group-meal", - coverUrl: "/assets/content/private-chef.jpg", - priceText: "按人数和菜单确认", - config: { - media: [ + "kind": "service", + "name": "示例·团体餐定制", + "summary": "为社团、活动和小型聚会提供批量餐品定制。", + "categoryKey": "group-meal", + "coverUrl": "/assets/content/private-chef.jpg", + "priceText": "按人数和菜单确认", + "config": { + "media": [ { - url: "/assets/content/private-chef.jpg", - alt: "", - type: "image", - }, - ], - }, - }, + "url": "/assets/content/private-chef.jpg", + "alt": "", + "type": "image" + } + ] + } + } ], - trustContent: [ + "trustContent": [ { - type: "schedule", - title: "每周出摊固定日程", - content: "", - config: { - status: "准时出摊", - weekdayLabel: "周一至周五(晚餐 + 夜宵档)", - weekdayTag: "常规固定点", - weekdayDetail: "地点:二号校门外小吃商业街 #07 号铺位", - weekdayHours: "营业:17:00 - 22:30(下雨搭防雨防风棚正常营业)", - weekendLabel: "周六、周日(全天接团体单 + 夜市流动)", - weekendTag: "活动专车", - weekendDetail: "白天专供:球赛、班级春游、社团集训、答辩餐", - weekendHours: "晚间:18:00 - 23:00 体育馆南侧流动出摊", - }, + "type": "schedule", + "title": "每周出摊固定日程", + "content": "", + "config": { + "status": "准时出摊", + "weekdayLabel": "周一至周五(晚餐 + 夜宵档)", + "weekdayTag": "常规固定点", + "weekdayDetail": "地点:二号校门外小吃商业街 #07 号铺位", + "weekdayHours": "营业:17:00 - 22:30(下雨搭防雨防风棚正常营业)", + "weekendLabel": "周六、周日(全天接团体单 + 夜市流动)", + "weekendTag": "活动专车", + "weekendDetail": "白天专供:球赛、班级春游、社团集训、答辩餐", + "weekendHours": "晚间:18:00 - 23:00 体育馆南侧流动出摊" + } }, { - type: "coverage", - title: "取餐与配送范围", - content: "", - config: { - pickupTitle: "摊位现场自取", - pickupDetail: "小程序提前留餐,报手机尾号即拿,附赠特制加厚保温袋,不用排长龙。", - deliveryTitle: "校内楼下配送", - deliveryDetail: - "满 3 份即可送至宿舍楼栋或实验楼门前,阿成骑专用恒温保温箱电动车直送。", - }, + "type": "coverage", + "title": "取餐与配送范围", + "content": "", + "config": { + "pickupTitle": "摊位现场自取", + "pickupDetail": "小程序提前留餐,报手机尾号即拿,附赠特制加厚保温袋,不用排长龙。", + "deliveryTitle": "校内楼下配送", + "deliveryDetail": "满 3 份即可送至宿舍楼栋或实验楼门前,阿成骑专用恒温保温箱电动车直送。" + } }, { - type: "process", - title: "定制餐品 4 步流程", - content: "", - config: { - intro: "专为班长、社长、活动干事设计的极简排菜流程", - steps: [ + "type": "process", + "title": "定制餐品 4 步流程", + "content": "", + "config": { + "intro": "专为班长、社长、活动干事设计的极简排菜流程", + "steps": [ { - title: "提交基本需求", - detail: "选择活动类型(如生日会、社团换届、答辩加餐)、预估人数与预算。", + "title": "提交基本需求", + "detail": "选择活动类型(如生日会、社团换届、答辩加餐)、预估人数与预算。" }, { - title: "15 分钟内核算菜单", - detail: "阿成微信直接联系,提供荤素搭配明细与个性化需求(免辣、清真配料等)。", + "title": "15 分钟内核算菜单", + "detail": "阿成微信直接联系,提供荤素搭配明细与个性化需求(免辣、清真配料等)。" }, { - title: "当日新鲜烹饪打包", - detail: "提前 2 小时生鲜采买,铁锅现炒,独立封盒并标注姓名 / 楼栋。", + "title": "当日新鲜烹饪打包", + "detail": "提前 2 小时生鲜采买,铁锅现炒,独立封盒并标注姓名 / 楼栋。" }, { - title: "保温直达交付", - detail: "约定时间准时送抵指定场地,确认菜品温度与数量无误后结算。", - }, + "title": "保温直达交付", + "detail": "约定时间准时送抵指定场地,确认菜品温度与数量无误后结算。" + } ], - minimumNote: "起订门槛:6 份起", - refundNote: "退改:出餐前 2 小时全退", - }, + "minimumNote": "起订门槛:6 份起", + "refundNote": "退改:出餐前 2 小时全退" + } }, { - type: "credential", - title: "食品安全与制作标准", - content: "示例内容,请根据实际资质和制作标准完善。", - config: { - standards: [ + "type": "credential", + "title": "食品安全与制作标准", + "content": "示例内容,请根据实际资质和制作标准完善。", + "config": { + "standards": [ { - title: "当天采购", - detail: "按当天需求采买", + "title": "当天采购", + "detail": "按当天需求采买" }, { - title: "现做现出餐", - detail: "按约定时间制作", + "title": "现做现出餐", + "detail": "按约定时间制作" }, { - title: "食具清洁消毒", - detail: "每日清洁与消毒", - }, - ], - }, + "title": "食具清洁消毒", + "detail": "每日清洁与消毒" + } + ] + } }, { - type: "case", - title: "他们都在阿成这订过餐", - summary: "感谢大学城各学院与社团伙伴的信任", - content: - "校街舞社年度专场 · 52 人份\n信息学院科创竞赛 · 连签 5 天\n7 号楼庆功宴 · 8 人定制", - config: { - entries: [ + "type": "case", + "title": "他们都在阿成这订过餐", + "summary": "感谢大学城各学院与社团伙伴的信任", + "content": "校街舞社年度专场 · 52 人份\n信息学院科创竞赛 · 连签 5 天\n7 号楼庆功宴 · 8 人定制", + "config": { + "entries": [ { - badge: "舞", - title: "校街舞社年度专场(52 人份)", - detail: "保温箱直达大礼堂后台,贴名分装", - result: "零延误签收", + "badge": "舞", + "title": "校街舞社年度专场(52 人份)", + "detail": "保温箱直达大礼堂后台,贴名分装", + "result": "零延误签收" }, { - badge: "科", - title: "信息学院科创竞赛封闭备赛", - detail: "每日荤素轮换,附赠每日滋补老汤", - result: "连签 5 天", + "badge": "科", + "title": "信息学院科创竞赛封闭备赛", + "detail": "每日荤素轮换,附赠每日滋补老汤", + "result": "连签 5 天" }, { - badge: "寝", - title: "7 号楼庆功宴(8 人定制)", - detail: "定制双拼厚肉饭", - result: "定制餐品", - }, - ], - }, + "badge": "寝", + "title": "7 号楼庆功宴(8 人定制)", + "detail": "定制双拼厚肉饭", + "result": "定制餐品" + } + ] + } }, { - type: "promise", - title: "阿成的真实回复承诺", - content: "备料期 15 分钟内联系,出摊高峰 1 小时内回复。", - config: { - commitments: [ + "type": "promise", + "title": "阿成的真实回复承诺", + "content": "备料期 15 分钟内联系,出摊高峰 1 小时内回复。", + "config": { + "commitments": [ { - label: "非出摊备料期", - detail: "提交咨询后通过微信或电话沟通。", - highlight: "15 分钟内", + "label": "非出摊备料期", + "detail": "提交咨询后通过微信或电话沟通。", + "highlight": "15 分钟内" }, { - label: "出摊晚高峰", - detail: "正在出餐,稍有延迟,会抽空回复。", - highlight: "1 小时内", - }, - ], - }, - }, + "label": "出摊晚高峰", + "detail": "正在出餐,稍有延迟,会抽空回复。", + "highlight": "1 小时内" + } + ] + } + } ], - fields: [ + "fields": [ { - key: "type", - label: "咨询类型", - type: "select", - required: true, - options: [ + "key": "type", + "label": "咨询类型", + "type": "select", + "required": true, + "options": [ { - label: "日常留餐", - value: "日常留餐", + "label": "日常留餐", + "value": "日常留餐" }, { - label: "宿舍开黑餐", - value: "宿舍开黑餐", + "label": "宿舍开黑餐", + "value": "宿舍开黑餐" }, { - label: "社团 / 班级活动", - value: "社团 / 班级活动", + "label": "社团 / 班级活动", + "value": "社团 / 班级活动" }, { - label: "生日聚会", - value: "生日聚会", + "label": "生日聚会", + "value": "生日聚会" }, { - label: "考试周加餐", - value: "考试周加餐", + "label": "考试周加餐", + "value": "考试周加餐" }, { - label: "其他需求", - value: "其他需求", - }, - ], + "label": "其他需求", + "value": "其他需求" + } + ] }, { - key: "people", - label: "用餐人数", - type: "select", - required: true, - options: [ + "key": "people", + "label": "用餐人数", + "type": "select", + "required": true, + "options": [ { - label: "1 人(单点)", - value: "1 人(单点)", + "label": "1 人(单点)", + "value": "1 人(单点)" }, { - label: "2-4 人(寝室小聚)", - value: "2-4 人(寝室小聚)", + "label": "2-4 人(寝室小聚)", + "value": "2-4 人(寝室小聚)" }, { - label: "5-10 人(部门小聚)", - value: "5-10 人(部门小聚)", + "label": "5-10 人(部门小聚)", + "value": "5-10 人(部门小聚)" }, { - label: "10-30 人(社团活动)", - value: "10-30 人(社团活动)", + "label": "10-30 人(社团活动)", + "value": "10-30 人(社团活动)" }, { - label: "30 人以上(大型活动)", - value: "30 人以上(大型活动)", - }, - ], + "label": "30 人以上(大型活动)", + "value": "30 人以上(大型活动)" + } + ] }, { - key: "date", - label: "用餐日期", - type: "date", - required: true, + "key": "date", + "label": "用餐日期", + "type": "date", + "required": true }, { - key: "budget", - label: "人均预算", - type: "select", - required: false, - options: [ + "key": "budget", + "label": "人均预算", + "type": "select", + "required": false, + "options": [ { - label: "15 元左右 / 人(实惠)", - value: "15 元左右 / 人(实惠)", + "label": "15 元左右 / 人(实惠)", + "value": "15 元左右 / 人(实惠)" }, { - label: "18-22 元 / 人(荤素双拼)", - value: "18-22 元 / 人(荤素双拼)", + "label": "18-22 元 / 人(荤素双拼)", + "value": "18-22 元 / 人(荤素双拼)" }, { - label: "25 元以上 / 人(高规格定制)", - value: "25 元以上 / 人(高规格定制)", - }, - ], + "label": "25 元以上 / 人(高规格定制)", + "value": "25 元以上 / 人(高规格定制)" + } + ] }, { - key: "delivery", - label: "取餐 / 配送方式", - type: "select", - required: false, - options: [ + "key": "delivery", + "label": "取餐 / 配送方式", + "type": "select", + "required": false, + "options": [ { - label: "摊位自取(报手机尾号即拿)", - value: "摊位自取(报手机尾号即拿)", + "label": "摊位自取(报手机尾号即拿)", + "value": "摊位自取(报手机尾号即拿)" }, { - label: "送至宿舍楼下(满 3 份)", - value: "送至宿舍楼下(满 3 份)", + "label": "送至宿舍楼下(满 3 份)", + "value": "送至宿舍楼下(满 3 份)" }, { - label: "送至指定教室 / 场地", - value: "送至指定教室 / 场地", - }, - ], + "label": "送至指定教室 / 场地", + "value": "送至指定教室 / 场地" + } + ] }, { - key: "remark", - label: "餐品 / 口味 / 忌口备注", - type: "textarea", - required: false, - placeholder: "例:现炒牛肉饭 1 份,微辣多浇卤汁,不要香菜", + "key": "remark", + "label": "餐品 / 口味 / 忌口备注", + "type": "textarea", + "required": false, + "placeholder": "例:现炒牛肉饭 1 份,微辣多浇卤汁,不要香菜" }, { - key: "phone", - label: "联系手机", - type: "phone", - required: true, - }, + "key": "phone", + "label": "联系手机", + "type": "phone", + "required": true + } ], - capabilityKey: "booking", - brandConfig: { - visualTemplateKey: "acheng-campus-food", - founder: "阿成", - title: "私房菜主理人", - slogan: "认真做好每一顿家常饭。", - phone: "", - wechat: "", - studioAddress: "大学城生活区东门附近", - avatarUrl: "/assets/owner/portrait.jpg", - heroImage: "/assets/content/package-01.jpg", - visualPresentation: { - home: { - stallTitle: "服务地点", - primaryAction: "咨询 / 预订", - secondaryAction: "查看菜单", - worksEyebrow: "今日推荐", - worksTitle: "热门套餐", - worksAction: "查看全部 →", - manifestoTitle: "我们的服务承诺", + "capabilityKey": "booking", + "brandConfig": { + "founder": "阿成", + "title": "私房菜主理人", + "slogan": "认真做好每一顿家常饭。", + "phone": "", + "wechat": "", + "studioAddress": "大学城生活区东门附近", + "avatarUrl": "/assets/owner/portrait.jpg", + "heroImage": "/assets/content/package-01.jpg", + "visualPresentation": { + "home": { + "stallTitle": "服务地点", + "primaryAction": "咨询 / 预订", + "secondaryAction": "查看菜单", + "worksEyebrow": "今日推荐", + "worksTitle": "热门套餐", + "worksAction": "查看全部 →", + "manifestoTitle": "我们的服务承诺" }, - offerings: { - title: "餐品与定制", - subtitle: "现做家常餐、团体餐和活动定制", - materialLabel: "包含:", - hardwareLabel: "定制说明:", - detailAction: "查看详情 →", - inquiryAction: "预订 / 咨询", + "offerings": { + "title": "餐品与定制", + "subtitle": "现做家常餐、团体餐和活动定制", + "materialLabel": "包含:", + "hardwareLabel": "定制说明:", + "detailAction": "查看详情 →", + "inquiryAction": "预订 / 咨询" }, - detail: { - priceLabel: "价格参考", - spaceLabel: "适合场景", - backgroundTitle: "餐品说明", - conceptTitle: "备餐方式", - craftsTitle: "服务内容", - materialsTitle: "交付说明", - inquiryAction: "预订 / 咨询", - inquiryHint: "提交后会由主理人与你确认时间、数量和地点。", + "detail": { + "priceLabel": "价格参考", + "spaceLabel": "适合场景", + "backgroundTitle": "餐品说明", + "conceptTitle": "备餐方式", + "craftsTitle": "服务内容", + "materialsTitle": "交付说明", + "inquiryAction": "预订 / 咨询", + "inquiryHint": "提交后会由主理人与你确认时间、数量和地点。" }, - profile: { - phoneLabel: "联系电话", - wechatLabel: "微信", - addressLabel: "服务地点", - callAction: "呼叫", - copyAction: "复制", - recordsTitle: "我的订单与咨询", - recordsCountUnit: "条记录", + "profile": { + "phoneLabel": "联系电话", + "wechatLabel": "微信", + "addressLabel": "服务地点", + "callAction": "呼叫", + "copyAction": "复制", + "recordsTitle": "我的订单与咨询", + "recordsCountUnit": "条记录" }, - inquiry: { - eyebrow: "ORDER", - title: "餐品预订", - subtitle: "留下用餐时间和人数,我会尽快确认。", - submitLabel: "提交预订需求", + "inquiry": { + "eyebrow": "ORDER", + "title": "餐品预订", + "subtitle": "留下用餐时间和人数,我会尽快确认。", + "submitLabel": "提交预订需求" }, - success: { - eyebrow: "ORDER", - title: "已收到你的需求", - intro: "确认备餐时间和数量后,我会尽快回复。", - recordsAction: "查看咨询记录", - homeAction: "返回首页", + "success": { + "eyebrow": "ORDER", + "title": "已收到你的需求", + "intro": "确认备餐时间和数量后,我会尽快回复。", + "recordsAction": "查看咨询记录", + "homeAction": "返回首页" }, - records: { - title: "我的咨询记录", - createAction: "新增咨询", - emptyTitle: "还没有咨询记录", - emptyDescription: "提交一次需求,开始与主理人沟通。", - emptyAction: "开始咨询", - }, - }, - }, - }, + "records": { + "title": "我的咨询记录", + "createAction": "新增咨询", + "emptyTitle": "还没有咨询记录", + "emptyDescription": "提交一次需求,开始与主理人沟通。", + "emptyAction": "开始咨询" + } + } + } + } }, - pages: [ + "pages": [ "pages/index/index", "pages/services/index", "pages/stall-service/index", - "pages/bookings/index", + "pages/bookings/index" ], - overrides: ["pages/inquiry", "pages/inquiry-success", "pages/offering", "pages/records"], - visualTemplateKey: "acheng-campus-food", + "overrides": [ + "pages/inquiry", + "pages/inquiry-success", + "pages/offering", + "pages/records" + ], + "visualTemplateKey": "acheng-campus-food", + "previewFixture": { + "food": { + "schemaVersion": "1", + "brand": { + "name": "阿成校园餐 · 预览", + "tagline": "用于独立预览的模板演示内容", + "description": "此内容仅用于平台模板预览,不代表真实品牌或客户案例。", + "deliveryNote": "演示预览已禁用真实咨询和联系操作。" + }, + "content": { + "templateKey": "food", + "inquiryFormName": "餐品预订与定制表单", + "offerings": [ + { + "kind": "package", + "name": "示例·今日套餐", + "summary": "现做家常套餐示例内容。", + "categoryKey": "set-meal", + "coverUrl": "/assets/content/package-01.jpg", + "priceText": "¥28 起 / 份", + "config": { + "media": [ + { + "url": "/assets/content/package-01.jpg", + "alt": "", + "type": "image" + } + ] + } + }, + { + "kind": "service", + "name": "示例·聚餐定制", + "summary": "按人数和口味沟通定制餐品。", + "categoryKey": "private-chef", + "coverUrl": "/assets/content/private-chef.jpg", + "priceText": "按人数和菜单确认", + "config": { + "media": [ + { + "url": "/assets/content/private-chef.jpg", + "alt": "", + "type": "image" + } + ] + } + }, + { + "kind": "service", + "name": "示例·团体餐定制", + "summary": "为社团、活动和小型聚会提供批量餐品定制。", + "categoryKey": "group-meal", + "coverUrl": "/assets/content/private-chef.jpg", + "priceText": "按人数和菜单确认", + "config": { + "media": [ + { + "url": "/assets/content/private-chef.jpg", + "alt": "", + "type": "image" + } + ] + } + } + ], + "trustContent": [ + { + "type": "schedule", + "title": "每周出摊固定日程", + "content": "", + "config": { + "status": "准时出摊", + "weekdayLabel": "周一至周五(晚餐 + 夜宵档)", + "weekdayTag": "常规固定点", + "weekdayDetail": "地点:二号校门外小吃商业街 #07 号铺位", + "weekdayHours": "营业:17:00 - 22:30(下雨搭防雨防风棚正常营业)", + "weekendLabel": "周六、周日(全天接团体单 + 夜市流动)", + "weekendTag": "活动专车", + "weekendDetail": "白天专供:球赛、班级春游、社团集训、答辩餐", + "weekendHours": "晚间:18:00 - 23:00 体育馆南侧流动出摊" + } + }, + { + "type": "coverage", + "title": "取餐与配送范围", + "content": "", + "config": { + "pickupTitle": "摊位现场自取", + "pickupDetail": "小程序提前留餐,报手机尾号即拿,附赠特制加厚保温袋,不用排长龙。", + "deliveryTitle": "校内楼下配送", + "deliveryDetail": "满 3 份即可送至宿舍楼栋或实验楼门前,阿成骑专用恒温保温箱电动车直送。" + } + }, + { + "type": "process", + "title": "定制餐品 4 步流程", + "content": "", + "config": { + "intro": "专为班长、社长、活动干事设计的极简排菜流程", + "steps": [ + { + "title": "提交基本需求", + "detail": "选择活动类型(如生日会、社团换届、答辩加餐)、预估人数与预算。" + }, + { + "title": "15 分钟内核算菜单", + "detail": "阿成微信直接联系,提供荤素搭配明细与个性化需求(免辣、清真配料等)。" + }, + { + "title": "当日新鲜烹饪打包", + "detail": "提前 2 小时生鲜采买,铁锅现炒,独立封盒并标注姓名 / 楼栋。" + }, + { + "title": "保温直达交付", + "detail": "约定时间准时送抵指定场地,确认菜品温度与数量无误后结算。" + } + ], + "minimumNote": "起订门槛:6 份起", + "refundNote": "退改:出餐前 2 小时全退" + } + }, + { + "type": "credential", + "title": "食品安全与制作标准", + "content": "示例内容,请根据实际资质和制作标准完善。", + "config": { + "standards": [ + { + "title": "当天采购", + "detail": "按当天需求采买" + }, + { + "title": "现做现出餐", + "detail": "按约定时间制作" + }, + { + "title": "食具清洁消毒", + "detail": "每日清洁与消毒" + } + ] + } + }, + { + "type": "case", + "title": "他们都在阿成这订过餐", + "summary": "感谢大学城各学院与社团伙伴的信任", + "content": "校街舞社年度专场 · 52 人份\n信息学院科创竞赛 · 连签 5 天\n7 号楼庆功宴 · 8 人定制", + "config": { + "entries": [ + { + "badge": "舞", + "title": "校街舞社年度专场(52 人份)", + "detail": "保温箱直达大礼堂后台,贴名分装", + "result": "零延误签收" + }, + { + "badge": "科", + "title": "信息学院科创竞赛封闭备赛", + "detail": "每日荤素轮换,附赠每日滋补老汤", + "result": "连签 5 天" + }, + { + "badge": "寝", + "title": "7 号楼庆功宴(8 人定制)", + "detail": "定制双拼厚肉饭", + "result": "定制餐品" + } + ] + } + }, + { + "type": "promise", + "title": "阿成的真实回复承诺", + "content": "备料期 15 分钟内联系,出摊高峰 1 小时内回复。", + "config": { + "commitments": [ + { + "label": "非出摊备料期", + "detail": "提交咨询后通过微信或电话沟通。", + "highlight": "15 分钟内" + }, + { + "label": "出摊晚高峰", + "detail": "正在出餐,稍有延迟,会抽空回复。", + "highlight": "1 小时内" + } + ] + } + } + ], + "fields": [ + { + "key": "type", + "label": "咨询类型", + "type": "select", + "required": true, + "options": [ + { + "label": "日常留餐", + "value": "日常留餐" + }, + { + "label": "宿舍开黑餐", + "value": "宿舍开黑餐" + }, + { + "label": "社团 / 班级活动", + "value": "社团 / 班级活动" + }, + { + "label": "生日聚会", + "value": "生日聚会" + }, + { + "label": "考试周加餐", + "value": "考试周加餐" + }, + { + "label": "其他需求", + "value": "其他需求" + } + ] + }, + { + "key": "people", + "label": "用餐人数", + "type": "select", + "required": true, + "options": [ + { + "label": "1 人(单点)", + "value": "1 人(单点)" + }, + { + "label": "2-4 人(寝室小聚)", + "value": "2-4 人(寝室小聚)" + }, + { + "label": "5-10 人(部门小聚)", + "value": "5-10 人(部门小聚)" + }, + { + "label": "10-30 人(社团活动)", + "value": "10-30 人(社团活动)" + }, + { + "label": "30 人以上(大型活动)", + "value": "30 人以上(大型活动)" + } + ] + }, + { + "key": "date", + "label": "用餐日期", + "type": "date", + "required": true + }, + { + "key": "budget", + "label": "人均预算", + "type": "select", + "required": false, + "options": [ + { + "label": "15 元左右 / 人(实惠)", + "value": "15 元左右 / 人(实惠)" + }, + { + "label": "18-22 元 / 人(荤素双拼)", + "value": "18-22 元 / 人(荤素双拼)" + }, + { + "label": "25 元以上 / 人(高规格定制)", + "value": "25 元以上 / 人(高规格定制)" + } + ] + }, + { + "key": "delivery", + "label": "取餐 / 配送方式", + "type": "select", + "required": false, + "options": [ + { + "label": "摊位自取(报手机尾号即拿)", + "value": "摊位自取(报手机尾号即拿)" + }, + { + "label": "送至宿舍楼下(满 3 份)", + "value": "送至宿舍楼下(满 3 份)" + }, + { + "label": "送至指定教室 / 场地", + "value": "送至指定教室 / 场地" + } + ] + }, + { + "key": "remark", + "label": "餐品 / 口味 / 忌口备注", + "type": "textarea", + "required": false, + "placeholder": "例:现炒牛肉饭 1 份,微辣多浇卤汁,不要香菜" + }, + { + "key": "phone", + "label": "联系手机", + "type": "phone", + "required": true + } + ], + "capabilityKey": "booking", + "brandConfig": { + "founder": "阿成", + "title": "私房菜主理人", + "slogan": "认真做好每一顿家常饭。", + "phone": "", + "wechat": "", + "studioAddress": "大学城生活区东门附近", + "avatarUrl": "/assets/owner/portrait.jpg", + "heroImage": "/assets/content/package-01.jpg", + "visualPresentation": { + "home": { + "stallTitle": "服务地点", + "primaryAction": "咨询 / 预订", + "secondaryAction": "查看菜单", + "worksEyebrow": "今日推荐", + "worksTitle": "热门套餐", + "worksAction": "查看全部 →", + "manifestoTitle": "我们的服务承诺" + }, + "offerings": { + "title": "餐品与定制", + "subtitle": "现做家常餐、团体餐和活动定制", + "materialLabel": "包含:", + "hardwareLabel": "定制说明:", + "detailAction": "查看详情 →", + "inquiryAction": "预订 / 咨询" + }, + "detail": { + "priceLabel": "价格参考", + "spaceLabel": "适合场景", + "backgroundTitle": "餐品说明", + "conceptTitle": "备餐方式", + "craftsTitle": "服务内容", + "materialsTitle": "交付说明", + "inquiryAction": "预订 / 咨询", + "inquiryHint": "提交后会由主理人与你确认时间、数量和地点。" + }, + "profile": { + "phoneLabel": "联系电话", + "wechatLabel": "微信", + "addressLabel": "服务地点", + "callAction": "呼叫", + "copyAction": "复制", + "recordsTitle": "我的订单与咨询", + "recordsCountUnit": "条记录" + }, + "inquiry": { + "eyebrow": "ORDER", + "title": "餐品预订", + "subtitle": "留下用餐时间和人数,我会尽快确认。", + "submitLabel": "提交预订需求" + }, + "success": { + "eyebrow": "ORDER", + "title": "已收到你的需求", + "intro": "确认备餐时间和数量后,我会尽快回复。", + "recordsAction": "查看咨询记录", + "homeAction": "返回首页" + }, + "records": { + "title": "我的咨询记录", + "createAction": "新增咨询", + "emptyTitle": "还没有咨询记录", + "emptyDescription": "提交一次需求,开始与主理人沟通。", + "emptyAction": "开始咨询" + } + } + } + }, + "safety": { + "submissions": "disabled", + "customerRecords": "disabled", + "contactActions": "disabled" + } + } + } }, { - packageKey: "atelier-solopreneur", - version: "1.3.1", - displayName: "独立工坊 · 品牌小程序", - defaultBrandSlug: "atelier-studio", - runtimeContract: "1.0", - supportedIndustryTemplates: ["personal"], - entrypoints: { - home: "pages/index/index", - offerings: "pages/services/index", - detail: "pages/offering/detail", - inquiry: "pages/inquiry/index", - success: "pages/inquiry-success/index", - records: "pages/records/index", - profile: "pages/bookings/index", + "packageKey": "atelier-solopreneur", + "version": "1.3.1", + "displayName": "独立工坊 · 品牌小程序", + "defaultBrandSlug": "atelier-studio", + "runtimeContract": "1.0", + "supportedIndustryTemplates": [ + "personal" + ], + "entrypoints": { + "home": "pages/index/index", + "offerings": "pages/services/index", + "detail": "pages/offering/detail", + "inquiry": "pages/inquiry/index", + "success": "pages/inquiry-success/index", + "records": "pages/records/index", + "profile": "pages/bookings/index" }, - navigation: [ + "navigation": [ { - key: "home", - label: "首页", - page: "home", - iconPath: "assets/tab/home.png", - selectedIconPath: "assets/tab/home-selected.png", + "key": "home", + "label": "首页", + "page": "home", + "iconPath": "assets/tab/home.png", + "selectedIconPath": "assets/tab/home-selected.png" }, { - key: "offerings", - label: "服务", - page: "offerings", - iconPath: "assets/tab/works.png", - selectedIconPath: "assets/tab/works-selected.png", + "key": "offerings", + "label": "服务", + "page": "offerings", + "iconPath": "assets/tab/works.png", + "selectedIconPath": "assets/tab/works-selected.png" }, { - key: "profile", - label: "我的", - page: "profile", - iconPath: "assets/tab/profile.png", - selectedIconPath: "assets/tab/profile-selected.png", - }, + "key": "profile", + "label": "我的", + "page": "profile", + "iconPath": "assets/tab/profile.png", + "selectedIconPath": "assets/tab/profile-selected.png" + } ], - requiredCapabilities: ["offerings", "inquiry"], - dataSlots: [ - { - key: "brand.identity", - source: "brand", - required: true, - description: "品牌定位与联系渠道", - }, - { - key: "offerings.list", - source: "offering", - required: true, - description: "试点模板与服务案例", - }, - { - key: "inquiry.form", - source: "inquiry", - required: true, - description: "品牌需求意向表单", - }, - { - key: "records.items", - source: "records", - required: true, - description: "访客咨询跟进记录", - }, + "requiredCapabilities": [ + "offerings", + "inquiry" ], - templateFields: [], - assetSlots: [ + "dataSlots": [ { - key: "brand.portrait", - binding: "brand.avatarUrl", - target: "brand", - label: "主理人头像", - help: "请上传本人真实头像,留空时不展示。", - required: false, - kind: "portrait", - aspectRatio: "1:1", + "key": "brand.identity", + "source": "brand", + "required": true, + "description": "品牌定位与联系渠道" }, { - key: "offering.cover", - binding: "offering.coverUrl", - target: "offering", - label: "试点模板封面", - help: "用于说明案例或模板场景,可上传真实页面截图。", - required: false, - kind: "image", - aspectRatio: "4:3", + "key": "offerings.list", + "source": "offering", + "required": true, + "description": "试点模板与服务案例" }, + { + "key": "inquiry.form", + "source": "inquiry", + "required": true, + "description": "品牌需求意向表单" + }, + { + "key": "records.items", + "source": "records", + "required": true, + "description": "访客咨询跟进记录" + } ], - admin: { - sections: [ + "templateFields": [], + "assetSlots": [ + { + "key": "brand.portrait", + "binding": "brand.avatarUrl", + "target": "brand", + "label": "主理人头像", + "help": "请上传本人真实头像,留空时不展示。", + "required": false, + "kind": "portrait", + "aspectRatio": "1:1" + }, + { + "key": "offering.cover", + "binding": "offering.coverUrl", + "target": "offering", + "label": "试点模板封面", + "help": "用于说明案例或模板场景,可上传真实页面截图。", + "required": false, + "kind": "image", + "aspectRatio": "4:3" + } + ], + "admin": { + "sections": [ { - key: "home_identity", - title: "首页主理人卡", - description: "展示主理人身份、经验和当前状态;头像复用品牌头像。", - page: "home", - target: "brand", - previewTargets: [ + "key": "home_identity", + "title": "首页主理人卡", + "description": "展示主理人身份、经验和当前状态;头像复用品牌头像。", + "page": "home", + "target": "brand", + "previewTargets": [ { - key: "atelier.home.identity", - label: "首页主理人卡", - }, + "key": "atelier.home.identity", + "label": "首页主理人卡" + } ], - fields: [ + "fields": [ { - key: "founder", - binding: "brand.config.founder", - label: "主理人姓名", - input: "text", - previewTarget: "atelier.home.identity", + "key": "founder", + "binding": "brand.config.founder", + "label": "主理人姓名", + "input": "text", + "previewTarget": "atelier.home.identity" }, { - key: "title", - binding: "brand.config.title", - label: "身份与专长", - input: "text", - previewTarget: "atelier.home.identity", + "key": "title", + "binding": "brand.config.title", + "label": "身份与专长", + "input": "text", + "previewTarget": "atelier.home.identity" }, { - key: "avatarUrl", - binding: "brand.avatarUrl", - label: "主理人头像", - input: "image", - previewTarget: "atelier.home.identity", + "key": "avatarUrl", + "binding": "brand.avatarUrl", + "label": "主理人头像", + "input": "image", + "previewTarget": "atelier.home.identity" }, { - key: "experience", - binding: "brand.config.atelier.identity.experience", - label: "经验年限", - input: "text", - previewTarget: "atelier.home.identity", + "key": "experience", + "binding": "brand.config.atelier.identity.experience", + "label": "经验年限", + "input": "text", + "previewTarget": "atelier.home.identity" }, { - key: "status", - binding: "brand.config.atelier.identity.status", - label: "当前状态", - input: "text", - previewTarget: "atelier.home.identity", + "key": "status", + "binding": "brand.config.atelier.identity.status", + "label": "当前状态", + "input": "text", + "previewTarget": "atelier.home.identity" }, { - key: "tags", - binding: "brand.config.atelier.identity.tags", - label: "身份标签", - input: "list", - previewTarget: "atelier.home.identity", - itemFields: [ + "key": "tags", + "binding": "brand.config.atelier.identity.tags", + "label": "身份标签", + "input": "list", + "previewTarget": "atelier.home.identity", + "itemFields": [ { - key: "title", - label: "标签", + "key": "title", + "label": "标签" + } + ] + } + ] + }, + { + "key": "home_intro", + "title": "首页价值定位", + "description": "修改后保存为草稿,发布后对访客生效。", + "page": "home", + "target": "brand", + "previewTargets": [ + { + "key": "atelier.home.intro", + "label": "首页价值定位" + } + ], + "fields": [ + { + "key": "eyebrow", + "binding": "brand.config.visualPresentation.home.eyebrow", + "label": "定位标签", + "input": "text", + "previewTarget": "atelier.home.intro" + }, + { + "key": "title", + "binding": "brand.config.visualPresentation.home.title", + "label": "首页标题", + "input": "text", + "previewTarget": "atelier.home.intro" + }, + { + "key": "subtitle", + "binding": "brand.config.visualPresentation.home.subtitle", + "label": "价值说明", + "input": "textarea", + "previewTarget": "atelier.home.intro" + }, + { + "key": "primaryAction", + "binding": "brand.config.visualPresentation.home.primaryAction", + "label": "咨询按钮", + "input": "text", + "previewTarget": "atelier.home.intro" + }, + { + "key": "secondaryAction", + "binding": "brand.config.visualPresentation.home.secondaryAction", + "label": "服务按钮", + "input": "text", + "previewTarget": "atelier.home.intro" + } + ] + }, + { + "key": "home_featuresHeading", + "title": "差异化标题", + "description": "修改后保存为草稿,发布后对访客生效。", + "page": "home", + "target": "brand", + "previewTargets": [ + { + "key": "atelier.home.featuresHeading", + "label": "差异化标题" + } + ], + "fields": [ + { + "key": "featuresTitle", + "binding": "brand.config.visualPresentation.home.featuresTitle", + "label": "区块标题", + "input": "text", + "previewTarget": "atelier.home.featuresHeading" + }, + { + "key": "featuresEnglish", + "binding": "brand.config.visualPresentation.home.featuresEnglish", + "label": "英文说明", + "input": "text", + "previewTarget": "atelier.home.featuresHeading" + } + ] + }, + { + "key": "home_casesHeading", + "title": "试点模板标题", + "description": "修改后保存为草稿,发布后对访客生效。", + "page": "home", + "target": "brand", + "previewTargets": [ + { + "key": "atelier.home.casesHeading", + "label": "试点模板标题" + } + ], + "fields": [ + { + "key": "casesTitle", + "binding": "brand.config.visualPresentation.home.casesTitle", + "label": "案例标题", + "input": "text", + "previewTarget": "atelier.home.casesHeading" + }, + { + "key": "casesSubtitle", + "binding": "brand.config.visualPresentation.home.casesSubtitle", + "label": "案例说明", + "input": "text", + "previewTarget": "atelier.home.casesHeading" + }, + { + "key": "caseAction", + "binding": "brand.config.visualPresentation.home.caseAction", + "label": "案例按钮", + "input": "text", + "previewTarget": "atelier.home.casesHeading" + } + ] + }, + { + "key": "home_audienceHeading", + "title": "服务群体标题", + "description": "修改后保存为草稿,发布后对访客生效。", + "page": "home", + "target": "brand", + "previewTargets": [ + { + "key": "atelier.home.audienceHeading", + "label": "服务群体标题" + } + ], + "fields": [ + { + "key": "audienceTitle", + "binding": "brand.config.visualPresentation.home.audienceTitle", + "label": "群体标题", + "input": "text", + "previewTarget": "atelier.home.audienceHeading" + }, + { + "key": "audienceEnglish", + "binding": "brand.config.visualPresentation.home.audienceEnglish", + "label": "英文说明", + "input": "text", + "previewTarget": "atelier.home.audienceHeading" + } + ] + }, + { + "key": "home_cta", + "title": "首页行动入口", + "description": "修改后保存为草稿,发布后对访客生效。", + "page": "home", + "target": "brand", + "previewTargets": [ + { + "key": "atelier.home.cta", + "label": "首页行动入口" + } + ], + "fields": [ + { + "key": "ctaTitle", + "binding": "brand.config.visualPresentation.home.ctaTitle", + "label": "行动标题", + "input": "text", + "previewTarget": "atelier.home.cta" + }, + { + "key": "ctaSubtitle", + "binding": "brand.config.visualPresentation.home.ctaSubtitle", + "label": "行动说明", + "input": "text", + "previewTarget": "atelier.home.cta" + }, + { + "key": "ctaAction", + "binding": "brand.config.visualPresentation.home.ctaAction", + "label": "行动按钮", + "input": "text", + "previewTarget": "atelier.home.cta" + } + ] + }, + { + "key": "offerings_intro", + "title": "服务页介绍", + "description": "修改后保存为草稿,发布后对访客生效。", + "page": "offerings", + "target": "brand", + "previewTargets": [ + { + "key": "atelier.offerings.intro", + "label": "服务页介绍" + } + ], + "fields": [ + { + "key": "eyebrow", + "binding": "brand.config.visualPresentation.offerings.eyebrow", + "label": "服务标签", + "input": "text", + "previewTarget": "atelier.offerings.intro" + }, + { + "key": "title", + "binding": "brand.config.visualPresentation.offerings.title", + "label": "服务标题", + "input": "text", + "previewTarget": "atelier.offerings.intro" + }, + { + "key": "subtitle", + "binding": "brand.config.visualPresentation.offerings.subtitle", + "label": "服务说明", + "input": "text", + "previewTarget": "atelier.offerings.intro" + } + ] + }, + { + "key": "offerings_deliverablesHeading", + "title": "交付体系标题", + "description": "修改后保存为草稿,发布后对访客生效。", + "page": "offerings", + "target": "brand", + "previewTargets": [ + { + "key": "atelier.offerings.deliverablesHeading", + "label": "交付体系标题" + } + ], + "fields": [ + { + "key": "deliverablesTitle", + "binding": "brand.config.visualPresentation.offerings.deliverablesTitle", + "label": "标题", + "input": "text", + "previewTarget": "atelier.offerings.deliverablesHeading" + }, + { + "key": "deliverablesEnglish", + "binding": "brand.config.visualPresentation.offerings.deliverablesEnglish", + "label": "说明", + "input": "text", + "previewTarget": "atelier.offerings.deliverablesHeading" + } + ] + }, + { + "key": "offerings_processHeading", + "title": "协作流程标题", + "description": "修改后保存为草稿,发布后对访客生效。", + "page": "offerings", + "target": "brand", + "previewTargets": [ + { + "key": "atelier.offerings.processHeading", + "label": "协作流程标题" + } + ], + "fields": [ + { + "key": "processTitle", + "binding": "brand.config.visualPresentation.offerings.processTitle", + "label": "标题", + "input": "text", + "previewTarget": "atelier.offerings.processHeading" + }, + { + "key": "processEnglish", + "binding": "brand.config.visualPresentation.offerings.processEnglish", + "label": "说明", + "input": "text", + "previewTarget": "atelier.offerings.processHeading" + } + ] + }, + { + "key": "offerings_proofHeading", + "title": "信任基石标题", + "description": "修改后保存为草稿,发布后对访客生效。", + "page": "offerings", + "target": "brand", + "previewTargets": [ + { + "key": "atelier.offerings.proofHeading", + "label": "信任基石标题" + } + ], + "fields": [ + { + "key": "proofTitle", + "binding": "brand.config.visualPresentation.offerings.proofTitle", + "label": "标题", + "input": "text", + "previewTarget": "atelier.offerings.proofHeading" + }, + { + "key": "proofEnglish", + "binding": "brand.config.visualPresentation.offerings.proofEnglish", + "label": "说明", + "input": "text", + "previewTarget": "atelier.offerings.proofHeading" + } + ] + }, + { + "key": "offerings_cta", + "title": "服务页行动入口", + "description": "修改后保存为草稿,发布后对访客生效。", + "page": "offerings", + "target": "brand", + "previewTargets": [ + { + "key": "atelier.offerings.cta", + "label": "服务页行动入口" + } + ], + "fields": [ + { + "key": "ctaTitle", + "binding": "brand.config.visualPresentation.offerings.ctaTitle", + "label": "行动标题", + "input": "text", + "previewTarget": "atelier.offerings.cta" + }, + { + "key": "ctaSubtitle", + "binding": "brand.config.visualPresentation.offerings.ctaSubtitle", + "label": "行动说明", + "input": "text", + "previewTarget": "atelier.offerings.cta" + }, + { + "key": "ctaAction", + "binding": "brand.config.visualPresentation.offerings.ctaAction", + "label": "行动按钮", + "input": "text", + "previewTarget": "atelier.offerings.cta" + } + ] + }, + { + "key": "profile_intro", + "title": "我的页介绍", + "description": "修改后保存为草稿,发布后对访客生效。", + "page": "profile", + "target": "brand", + "previewTargets": [ + { + "key": "atelier.profile.intro", + "label": "咨询页介绍" + } + ], + "fields": [ + { + "key": "eyebrow", + "binding": "brand.config.visualPresentation.profile.eyebrow", + "label": "排期说明", + "input": "text", + "previewTarget": "atelier.profile.intro" + }, + { + "key": "title", + "binding": "brand.config.visualPresentation.profile.title", + "label": "咨询标题", + "input": "text", + "previewTarget": "atelier.profile.intro" + }, + { + "key": "subtitle", + "binding": "brand.config.visualPresentation.profile.subtitle", + "label": "咨询说明", + "input": "text", + "previewTarget": "atelier.profile.intro" + } + ] + }, + { + "key": "profile_contact", + "title": "我的页联系入口", + "description": "修改后保存为草稿,发布后对访客生效。", + "page": "profile", + "target": "brand", + "previewTargets": [ + { + "key": "atelier.profile.contact", + "label": "联系与响应说明" + } + ], + "fields": [ + { + "key": "inquiryAction", + "binding": "brand.config.visualPresentation.profile.inquiryAction", + "label": "意向入口", + "input": "text", + "previewTarget": "atelier.profile.contact" + }, + { + "key": "timeHint", + "binding": "brand.config.visualPresentation.profile.timeHint", + "label": "填写时间", + "input": "text", + "previewTarget": "atelier.profile.contact" + }, + { + "key": "wechatLabel", + "binding": "brand.config.visualPresentation.profile.wechatLabel", + "label": "微信标签", + "input": "text", + "previewTarget": "atelier.profile.contact" + }, + { + "key": "copyAction", + "binding": "brand.config.visualPresentation.profile.copyAction", + "label": "复制按钮", + "input": "text", + "previewTarget": "atelier.profile.contact" + }, + { + "key": "contactHint", + "binding": "brand.config.visualPresentation.profile.contactHint", + "label": "联系提示", + "input": "text", + "previewTarget": "atelier.profile.contact" + }, + { + "key": "promise", + "binding": "brand.config.visualPresentation.profile.promise", + "label": "合作说明", + "input": "text", + "previewTarget": "atelier.profile.contact" + }, + { + "key": "contactWechat", + "binding": "brand.contactWechat", + "label": "微信号(与主理人介绍同步)", + "input": "text", + "previewTarget": "atelier.profile.contact" + } + ] + }, + { + "key": "profile_faqHeading", + "title": "常见问题标题", + "description": "修改后保存为草稿,发布后对访客生效。", + "page": "profile", + "target": "brand", + "previewTargets": [ + { + "key": "atelier.profile.faqHeading", + "label": "常见问题标题" + } + ], + "fields": [ + { + "key": "faqTitle", + "binding": "brand.config.visualPresentation.profile.faqTitle", + "label": "标题", + "input": "text", + "previewTarget": "atelier.profile.faqHeading" + }, + { + "key": "faqSubtitle", + "binding": "brand.config.visualPresentation.profile.faqSubtitle", + "label": "说明", + "input": "text", + "previewTarget": "atelier.profile.faqHeading" + } + ] + }, + { + "key": "profile_footer", + "title": "页尾寄语", + "description": "修改后保存为草稿,发布后对访客生效。", + "page": "profile", + "target": "brand", + "previewTargets": [ + { + "key": "atelier.profile.footer", + "label": "页尾寄语" + } + ], + "fields": [ + { + "key": "footerQuote", + "binding": "brand.config.visualPresentation.profile.footerQuote", + "label": "英文寄语", + "input": "textarea", + "previewTarget": "atelier.profile.footer" + }, + { + "key": "footerNote", + "binding": "brand.config.visualPresentation.profile.footerNote", + "label": "中文寄语", + "input": "text", + "previewTarget": "atelier.profile.footer" + } + ] + }, + { + "key": "profile_records", + "title": "我的页记录入口", + "description": "修改后保存为草稿,发布后对访客生效。", + "page": "profile", + "target": "brand", + "previewTargets": [ + { + "key": "atelier.profile.records", + "label": "我的咨询记录卡片" + } + ], + "fields": [ + { + "key": "recordsTitle", + "binding": "brand.config.visualPresentation.profile.recordsTitle", + "label": "记录标题", + "input": "text", + "previewTarget": "atelier.profile.records" + }, + { + "key": "recordsDescription", + "binding": "brand.config.visualPresentation.profile.recordsDescription", + "label": "记录说明", + "input": "textarea", + "previewTarget": "atelier.profile.records" + }, + { + "key": "recordsAction", + "binding": "brand.config.visualPresentation.profile.recordsAction", + "label": "记录按钮", + "input": "text", + "previewTarget": "atelier.profile.records" + } + ] + }, + { + "key": "inquiry_intro", + "title": "意向单说明", + "description": "修改后保存为草稿,发布后对访客生效。", + "page": "inquiry", + "target": "brand", + "previewTargets": [ + { + "key": "atelier.inquiry.intro", + "label": "意向单说明" + } + ], + "fields": [ + { + "key": "eyebrow", + "binding": "brand.config.visualPresentation.inquiry.eyebrow", + "label": "阶段标签", + "input": "text", + "previewTarget": "atelier.inquiry.intro" + }, + { + "key": "title", + "binding": "brand.config.visualPresentation.inquiry.title", + "label": "表单标题", + "input": "text", + "previewTarget": "atelier.inquiry.intro" + }, + { + "key": "subtitle", + "binding": "brand.config.visualPresentation.inquiry.subtitle", + "label": "表单说明", + "input": "text", + "previewTarget": "atelier.inquiry.intro" + }, + { + "key": "submitLabel", + "binding": "brand.config.visualPresentation.inquiry.submitLabel", + "label": "提交按钮", + "input": "text", + "previewTarget": "atelier.inquiry.intro" + }, + { + "key": "note", + "binding": "brand.config.visualPresentation.inquiry.note", + "label": "表单补充说明", + "input": "textarea", + "previewTarget": "atelier.inquiry.intro" + } + ] + }, + { + "key": "inquiry_privacy", + "title": "表单隐私说明", + "description": "修改后保存为草稿,发布后对访客生效。", + "page": "inquiry", + "target": "brand", + "previewTargets": [ + { + "key": "atelier.inquiry.privacy", + "label": "表单隐私说明" + } + ], + "fields": [ + { + "key": "privacyTitle", + "binding": "brand.config.visualPresentation.inquiry.privacyTitle", + "label": "隐私标题", + "input": "text", + "previewTarget": "atelier.inquiry.privacy" + }, + { + "key": "privacyNote", + "binding": "brand.config.visualPresentation.inquiry.privacyNote", + "label": "隐私说明", + "input": "textarea", + "previewTarget": "atelier.inquiry.privacy" + }, + { + "key": "followupHint", + "binding": "brand.config.visualPresentation.inquiry.followupHint", + "label": "跟进预期", + "input": "text", + "previewTarget": "atelier.inquiry.privacy" + } + ] + }, + { + "key": "success_copy", + "title": "提交成功说明", + "description": "修改后保存为草稿,发布后对访客生效。", + "page": "success", + "target": "brand", + "previewTargets": [ + { + "key": "atelier.success.copy", + "label": "提交成功说明" + } + ], + "fields": [ + { + "key": "eyebrow", + "binding": "brand.config.visualPresentation.success.eyebrow", + "label": "成功标签", + "input": "text", + "previewTarget": "atelier.success.copy" + }, + { + "key": "title", + "binding": "brand.config.visualPresentation.success.title", + "label": "成功标题", + "input": "text", + "previewTarget": "atelier.success.copy" + }, + { + "key": "intro", + "binding": "brand.config.visualPresentation.success.intro", + "label": "后续说明", + "input": "textarea", + "previewTarget": "atelier.success.copy" + }, + { + "key": "recordsAction", + "binding": "brand.config.visualPresentation.success.recordsAction", + "label": "记录按钮", + "input": "text", + "previewTarget": "atelier.success.copy" + }, + { + "key": "homeAction", + "binding": "brand.config.visualPresentation.success.homeAction", + "label": "首页按钮", + "input": "text", + "previewTarget": "atelier.success.copy" + } + ] + }, + { + "key": "records_copy", + "title": "咨询记录文案", + "description": "修改后保存为草稿,发布后对访客生效。", + "page": "records", + "target": "brand", + "previewTargets": [ + { + "key": "atelier.records.copy", + "label": "咨询记录文案" + } + ], + "fields": [ + { + "key": "title", + "binding": "brand.config.visualPresentation.records.title", + "label": "记录标题", + "input": "text", + "previewTarget": "atelier.records.copy" + }, + { + "key": "createAction", + "binding": "brand.config.visualPresentation.records.createAction", + "label": "新增按钮", + "input": "text", + "previewTarget": "atelier.records.copy" + }, + { + "key": "emptyTitle", + "binding": "brand.config.visualPresentation.records.emptyTitle", + "label": "空状态标题", + "input": "text", + "previewTarget": "atelier.records.copy" + }, + { + "key": "emptyDescription", + "binding": "brand.config.visualPresentation.records.emptyDescription", + "label": "空状态说明", + "input": "text", + "previewTarget": "atelier.records.copy" + }, + { + "key": "emptyAction", + "binding": "brand.config.visualPresentation.records.emptyAction", + "label": "空状态按钮", + "input": "text", + "previewTarget": "atelier.records.copy" + } + ] + }, + { + "key": "projectDetail", + "title": "案例详情", + "description": "以下内容分别填写在每个案例中,空白内容不会展示。", + "page": "detail", + "target": "offering", + "fields": [ + { + "key": "name", + "binding": "offering.name", + "label": "案例名称", + "input": "text", + "previewTarget": "atelier-solopreneur.detail.projectDetail" + }, + { + "key": "summary", + "binding": "offering.summary", + "label": "案例简介", + "input": "textarea", + "previewTarget": "atelier-solopreneur.detail.projectDetail" + }, + { + "key": "priceText", + "binding": "offering.priceText", + "label": "合作方式 / 报价说明", + "input": "text", + "previewTarget": "atelier-solopreneur.detail.projectDetail" + }, + { + "key": "coverUrl", + "binding": "offering.coverUrl", + "label": "案例封面", + "input": "image", + "previewTarget": "atelier-solopreneur.detail.projectDetail" + }, + { + "key": "categoryLabel", + "binding": "offering.config.categoryKey", + "label": "案例类别", + "input": "select", + "options": [ + { + "value": "portfolio", + "label": "案例展示" }, + { + "value": "consulting", + "label": "需求咨询" + }, + { + "value": "advisory", + "label": "长期支持" + }, + { + "value": "custom", + "label": "其他服务" + } ], + "previewTarget": "atelier-solopreneur.detail.projectDetail" }, - ], - }, - { - key: "home_intro", - title: "首页价值定位", - description: "修改后保存为草稿,发布后对访客生效。", - page: "home", - target: "brand", - previewTargets: [ { - key: "atelier.home.intro", - label: "首页价值定位", + "key": "detailHero", + "binding": "offering.config.detailHero", + "label": "详情主图", + "input": "image", + "previewTarget": "atelier-solopreneur.detail.projectDetail" }, - ], - fields: [ { - key: "eyebrow", - binding: "brand.config.visualPresentation.home.eyebrow", - label: "定位标签", - input: "text", - previewTarget: "atelier.home.intro", + "key": "area", + "binding": "offering.config.area", + "label": "项目地点", + "input": "text", + "previewTarget": "atelier-solopreneur.detail.projectDetail" }, { - key: "title", - binding: "brand.config.visualPresentation.home.title", - label: "首页标题", - input: "text", - previewTarget: "atelier.home.intro", + "key": "series", + "binding": "offering.config.series", + "label": "方案名称", + "input": "text", + "previewTarget": "atelier-solopreneur.detail.projectDetail" }, { - key: "subtitle", - binding: "brand.config.visualPresentation.home.subtitle", - label: "价值说明", - input: "textarea", - previewTarget: "atelier.home.intro", + "key": "spaceType", + "binding": "offering.config.spaceType", + "label": "适用场景", + "input": "text", + "previewTarget": "atelier-solopreneur.detail.projectDetail" }, { - key: "primaryAction", - binding: "brand.config.visualPresentation.home.primaryAction", - label: "咨询按钮", - input: "text", - previewTarget: "atelier.home.intro", + "key": "background", + "binding": "offering.config.details.background", + "label": "项目背景", + "input": "textarea", + "previewTarget": "atelier-solopreneur.detail.projectDetail" }, { - key: "secondaryAction", - binding: "brand.config.visualPresentation.home.secondaryAction", - label: "服务按钮", - input: "text", - previewTarget: "atelier.home.intro", + "key": "designConcept", + "binding": "offering.config.details.designConcept", + "label": "设计理念", + "input": "textarea", + "previewTarget": "atelier-solopreneur.detail.projectDetail" }, - ], - }, - { - key: "home_featuresHeading", - title: "差异化标题", - description: "修改后保存为草稿,发布后对访客生效。", - page: "home", - target: "brand", - previewTargets: [ { - key: "atelier.home.featuresHeading", - label: "差异化标题", - }, - ], - fields: [ - { - key: "featuresTitle", - binding: "brand.config.visualPresentation.home.featuresTitle", - label: "区块标题", - input: "text", - previewTarget: "atelier.home.featuresHeading", - }, - { - key: "featuresEnglish", - binding: "brand.config.visualPresentation.home.featuresEnglish", - label: "英文说明", - input: "text", - previewTarget: "atelier.home.featuresHeading", - }, - ], - }, - { - key: "home_casesHeading", - title: "试点模板标题", - description: "修改后保存为草稿,发布后对访客生效。", - page: "home", - target: "brand", - previewTargets: [ - { - key: "atelier.home.casesHeading", - label: "试点模板标题", - }, - ], - fields: [ - { - key: "casesTitle", - binding: "brand.config.visualPresentation.home.casesTitle", - label: "案例标题", - input: "text", - previewTarget: "atelier.home.casesHeading", - }, - { - key: "casesSubtitle", - binding: "brand.config.visualPresentation.home.casesSubtitle", - label: "案例说明", - input: "text", - previewTarget: "atelier.home.casesHeading", - }, - { - key: "caseAction", - binding: "brand.config.visualPresentation.home.caseAction", - label: "案例按钮", - input: "text", - previewTarget: "atelier.home.casesHeading", - }, - ], - }, - { - key: "home_audienceHeading", - title: "服务群体标题", - description: "修改后保存为草稿,发布后对访客生效。", - page: "home", - target: "brand", - previewTargets: [ - { - key: "atelier.home.audienceHeading", - label: "服务群体标题", - }, - ], - fields: [ - { - key: "audienceTitle", - binding: "brand.config.visualPresentation.home.audienceTitle", - label: "群体标题", - input: "text", - previewTarget: "atelier.home.audienceHeading", - }, - { - key: "audienceEnglish", - binding: "brand.config.visualPresentation.home.audienceEnglish", - label: "英文说明", - input: "text", - previewTarget: "atelier.home.audienceHeading", - }, - ], - }, - { - key: "home_cta", - title: "首页行动入口", - description: "修改后保存为草稿,发布后对访客生效。", - page: "home", - target: "brand", - previewTargets: [ - { - key: "atelier.home.cta", - label: "首页行动入口", - }, - ], - fields: [ - { - key: "ctaTitle", - binding: "brand.config.visualPresentation.home.ctaTitle", - label: "行动标题", - input: "text", - previewTarget: "atelier.home.cta", - }, - { - key: "ctaSubtitle", - binding: "brand.config.visualPresentation.home.ctaSubtitle", - label: "行动说明", - input: "text", - previewTarget: "atelier.home.cta", - }, - { - key: "ctaAction", - binding: "brand.config.visualPresentation.home.ctaAction", - label: "行动按钮", - input: "text", - previewTarget: "atelier.home.cta", - }, - ], - }, - { - key: "offerings_intro", - title: "服务页介绍", - description: "修改后保存为草稿,发布后对访客生效。", - page: "offerings", - target: "brand", - previewTargets: [ - { - key: "atelier.offerings.intro", - label: "服务页介绍", - }, - ], - fields: [ - { - key: "eyebrow", - binding: "brand.config.visualPresentation.offerings.eyebrow", - label: "服务标签", - input: "text", - previewTarget: "atelier.offerings.intro", - }, - { - key: "title", - binding: "brand.config.visualPresentation.offerings.title", - label: "服务标题", - input: "text", - previewTarget: "atelier.offerings.intro", - }, - { - key: "subtitle", - binding: "brand.config.visualPresentation.offerings.subtitle", - label: "服务说明", - input: "text", - previewTarget: "atelier.offerings.intro", - }, - ], - }, - { - key: "offerings_deliverablesHeading", - title: "交付体系标题", - description: "修改后保存为草稿,发布后对访客生效。", - page: "offerings", - target: "brand", - previewTargets: [ - { - key: "atelier.offerings.deliverablesHeading", - label: "交付体系标题", - }, - ], - fields: [ - { - key: "deliverablesTitle", - binding: "brand.config.visualPresentation.offerings.deliverablesTitle", - label: "标题", - input: "text", - previewTarget: "atelier.offerings.deliverablesHeading", - }, - { - key: "deliverablesEnglish", - binding: "brand.config.visualPresentation.offerings.deliverablesEnglish", - label: "说明", - input: "text", - previewTarget: "atelier.offerings.deliverablesHeading", - }, - ], - }, - { - key: "offerings_processHeading", - title: "协作流程标题", - description: "修改后保存为草稿,发布后对访客生效。", - page: "offerings", - target: "brand", - previewTargets: [ - { - key: "atelier.offerings.processHeading", - label: "协作流程标题", - }, - ], - fields: [ - { - key: "processTitle", - binding: "brand.config.visualPresentation.offerings.processTitle", - label: "标题", - input: "text", - previewTarget: "atelier.offerings.processHeading", - }, - { - key: "processEnglish", - binding: "brand.config.visualPresentation.offerings.processEnglish", - label: "说明", - input: "text", - previewTarget: "atelier.offerings.processHeading", - }, - ], - }, - { - key: "offerings_proofHeading", - title: "信任基石标题", - description: "修改后保存为草稿,发布后对访客生效。", - page: "offerings", - target: "brand", - previewTargets: [ - { - key: "atelier.offerings.proofHeading", - label: "信任基石标题", - }, - ], - fields: [ - { - key: "proofTitle", - binding: "brand.config.visualPresentation.offerings.proofTitle", - label: "标题", - input: "text", - previewTarget: "atelier.offerings.proofHeading", - }, - { - key: "proofEnglish", - binding: "brand.config.visualPresentation.offerings.proofEnglish", - label: "说明", - input: "text", - previewTarget: "atelier.offerings.proofHeading", - }, - ], - }, - { - key: "offerings_cta", - title: "服务页行动入口", - description: "修改后保存为草稿,发布后对访客生效。", - page: "offerings", - target: "brand", - previewTargets: [ - { - key: "atelier.offerings.cta", - label: "服务页行动入口", - }, - ], - fields: [ - { - key: "ctaTitle", - binding: "brand.config.visualPresentation.offerings.ctaTitle", - label: "行动标题", - input: "text", - previewTarget: "atelier.offerings.cta", - }, - { - key: "ctaSubtitle", - binding: "brand.config.visualPresentation.offerings.ctaSubtitle", - label: "行动说明", - input: "text", - previewTarget: "atelier.offerings.cta", - }, - { - key: "ctaAction", - binding: "brand.config.visualPresentation.offerings.ctaAction", - label: "行动按钮", - input: "text", - previewTarget: "atelier.offerings.cta", - }, - ], - }, - { - key: "profile_intro", - title: "我的页介绍", - description: "修改后保存为草稿,发布后对访客生效。", - page: "profile", - target: "brand", - previewTargets: [ - { - key: "atelier.profile.intro", - label: "咨询页介绍", - }, - ], - fields: [ - { - key: "eyebrow", - binding: "brand.config.visualPresentation.profile.eyebrow", - label: "排期说明", - input: "text", - previewTarget: "atelier.profile.intro", - }, - { - key: "title", - binding: "brand.config.visualPresentation.profile.title", - label: "咨询标题", - input: "text", - previewTarget: "atelier.profile.intro", - }, - { - key: "subtitle", - binding: "brand.config.visualPresentation.profile.subtitle", - label: "咨询说明", - input: "text", - previewTarget: "atelier.profile.intro", - }, - ], - }, - { - key: "profile_contact", - title: "我的页联系入口", - description: "修改后保存为草稿,发布后对访客生效。", - page: "profile", - target: "brand", - previewTargets: [ - { - key: "atelier.profile.contact", - label: "联系与响应说明", - }, - ], - fields: [ - { - key: "inquiryAction", - binding: "brand.config.visualPresentation.profile.inquiryAction", - label: "意向入口", - input: "text", - previewTarget: "atelier.profile.contact", - }, - { - key: "timeHint", - binding: "brand.config.visualPresentation.profile.timeHint", - label: "填写时间", - input: "text", - previewTarget: "atelier.profile.contact", - }, - { - key: "wechatLabel", - binding: "brand.config.visualPresentation.profile.wechatLabel", - label: "微信标签", - input: "text", - previewTarget: "atelier.profile.contact", - }, - { - key: "copyAction", - binding: "brand.config.visualPresentation.profile.copyAction", - label: "复制按钮", - input: "text", - previewTarget: "atelier.profile.contact", - }, - { - key: "contactHint", - binding: "brand.config.visualPresentation.profile.contactHint", - label: "联系提示", - input: "text", - previewTarget: "atelier.profile.contact", - }, - { - key: "promise", - binding: "brand.config.visualPresentation.profile.promise", - label: "合作说明", - input: "text", - previewTarget: "atelier.profile.contact", - }, - { - key: "contactWechat", - binding: "brand.contactWechat", - label: "微信号(与主理人介绍同步)", - input: "text", - previewTarget: "atelier.profile.contact", - }, - ], - }, - { - key: "profile_faqHeading", - title: "常见问题标题", - description: "修改后保存为草稿,发布后对访客生效。", - page: "profile", - target: "brand", - previewTargets: [ - { - key: "atelier.profile.faqHeading", - label: "常见问题标题", - }, - ], - fields: [ - { - key: "faqTitle", - binding: "brand.config.visualPresentation.profile.faqTitle", - label: "标题", - input: "text", - previewTarget: "atelier.profile.faqHeading", - }, - { - key: "faqSubtitle", - binding: "brand.config.visualPresentation.profile.faqSubtitle", - label: "说明", - input: "text", - previewTarget: "atelier.profile.faqHeading", - }, - ], - }, - { - key: "profile_footer", - title: "页尾寄语", - description: "修改后保存为草稿,发布后对访客生效。", - page: "profile", - target: "brand", - previewTargets: [ - { - key: "atelier.profile.footer", - label: "页尾寄语", - }, - ], - fields: [ - { - key: "footerQuote", - binding: "brand.config.visualPresentation.profile.footerQuote", - label: "英文寄语", - input: "textarea", - previewTarget: "atelier.profile.footer", - }, - { - key: "footerNote", - binding: "brand.config.visualPresentation.profile.footerNote", - label: "中文寄语", - input: "text", - previewTarget: "atelier.profile.footer", - }, - ], - }, - { - key: "profile_records", - title: "我的页记录入口", - description: "修改后保存为草稿,发布后对访客生效。", - page: "profile", - target: "brand", - previewTargets: [ - { - key: "atelier.profile.records", - label: "我的咨询记录卡片", - }, - ], - fields: [ - { - key: "recordsTitle", - binding: "brand.config.visualPresentation.profile.recordsTitle", - label: "记录标题", - input: "text", - previewTarget: "atelier.profile.records", - }, - { - key: "recordsDescription", - binding: "brand.config.visualPresentation.profile.recordsDescription", - label: "记录说明", - input: "textarea", - previewTarget: "atelier.profile.records", - }, - { - key: "recordsAction", - binding: "brand.config.visualPresentation.profile.recordsAction", - label: "记录按钮", - input: "text", - previewTarget: "atelier.profile.records", - }, - ], - }, - { - key: "inquiry_intro", - title: "意向单说明", - description: "修改后保存为草稿,发布后对访客生效。", - page: "inquiry", - target: "brand", - previewTargets: [ - { - key: "atelier.inquiry.intro", - label: "意向单说明", - }, - ], - fields: [ - { - key: "eyebrow", - binding: "brand.config.visualPresentation.inquiry.eyebrow", - label: "阶段标签", - input: "text", - previewTarget: "atelier.inquiry.intro", - }, - { - key: "title", - binding: "brand.config.visualPresentation.inquiry.title", - label: "表单标题", - input: "text", - previewTarget: "atelier.inquiry.intro", - }, - { - key: "subtitle", - binding: "brand.config.visualPresentation.inquiry.subtitle", - label: "表单说明", - input: "text", - previewTarget: "atelier.inquiry.intro", - }, - { - key: "submitLabel", - binding: "brand.config.visualPresentation.inquiry.submitLabel", - label: "提交按钮", - input: "text", - previewTarget: "atelier.inquiry.intro", - }, - { - key: "note", - binding: "brand.config.visualPresentation.inquiry.note", - label: "表单补充说明", - input: "textarea", - previewTarget: "atelier.inquiry.intro", - }, - ], - }, - { - key: "inquiry_privacy", - title: "表单隐私说明", - description: "修改后保存为草稿,发布后对访客生效。", - page: "inquiry", - target: "brand", - previewTargets: [ - { - key: "atelier.inquiry.privacy", - label: "表单隐私说明", - }, - ], - fields: [ - { - key: "privacyTitle", - binding: "brand.config.visualPresentation.inquiry.privacyTitle", - label: "隐私标题", - input: "text", - previewTarget: "atelier.inquiry.privacy", - }, - { - key: "privacyNote", - binding: "brand.config.visualPresentation.inquiry.privacyNote", - label: "隐私说明", - input: "textarea", - previewTarget: "atelier.inquiry.privacy", - }, - { - key: "followupHint", - binding: "brand.config.visualPresentation.inquiry.followupHint", - label: "跟进预期", - input: "text", - previewTarget: "atelier.inquiry.privacy", - }, - ], - }, - { - key: "success_copy", - title: "提交成功说明", - description: "修改后保存为草稿,发布后对访客生效。", - page: "success", - target: "brand", - previewTargets: [ - { - key: "atelier.success.copy", - label: "提交成功说明", - }, - ], - fields: [ - { - key: "eyebrow", - binding: "brand.config.visualPresentation.success.eyebrow", - label: "成功标签", - input: "text", - previewTarget: "atelier.success.copy", - }, - { - key: "title", - binding: "brand.config.visualPresentation.success.title", - label: "成功标题", - input: "text", - previewTarget: "atelier.success.copy", - }, - { - key: "intro", - binding: "brand.config.visualPresentation.success.intro", - label: "后续说明", - input: "textarea", - previewTarget: "atelier.success.copy", - }, - { - key: "recordsAction", - binding: "brand.config.visualPresentation.success.recordsAction", - label: "记录按钮", - input: "text", - previewTarget: "atelier.success.copy", - }, - { - key: "homeAction", - binding: "brand.config.visualPresentation.success.homeAction", - label: "首页按钮", - input: "text", - previewTarget: "atelier.success.copy", - }, - ], - }, - { - key: "records_copy", - title: "咨询记录文案", - description: "修改后保存为草稿,发布后对访客生效。", - page: "records", - target: "brand", - previewTargets: [ - { - key: "atelier.records.copy", - label: "咨询记录文案", - }, - ], - fields: [ - { - key: "title", - binding: "brand.config.visualPresentation.records.title", - label: "记录标题", - input: "text", - previewTarget: "atelier.records.copy", - }, - { - key: "createAction", - binding: "brand.config.visualPresentation.records.createAction", - label: "新增按钮", - input: "text", - previewTarget: "atelier.records.copy", - }, - { - key: "emptyTitle", - binding: "brand.config.visualPresentation.records.emptyTitle", - label: "空状态标题", - input: "text", - previewTarget: "atelier.records.copy", - }, - { - key: "emptyDescription", - binding: "brand.config.visualPresentation.records.emptyDescription", - label: "空状态说明", - input: "text", - previewTarget: "atelier.records.copy", - }, - { - key: "emptyAction", - binding: "brand.config.visualPresentation.records.emptyAction", - label: "空状态按钮", - input: "text", - previewTarget: "atelier.records.copy", - }, - ], - }, - { - key: "projectDetail", - title: "案例详情", - description: "以下内容分别填写在每个案例中,空白内容不会展示。", - page: "detail", - target: "offering", - fields: [ - { - key: "name", - binding: "offering.name", - label: "案例名称", - input: "text", - previewTarget: "atelier-solopreneur.detail.projectDetail", - }, - { - key: "summary", - binding: "offering.summary", - label: "案例简介", - input: "textarea", - previewTarget: "atelier-solopreneur.detail.projectDetail", - }, - { - key: "priceText", - binding: "offering.priceText", - label: "合作方式 / 报价说明", - input: "text", - previewTarget: "atelier-solopreneur.detail.projectDetail", - }, - { - key: "coverUrl", - binding: "offering.coverUrl", - label: "案例封面", - input: "image", - previewTarget: "atelier-solopreneur.detail.projectDetail", - }, - { - key: "categoryLabel", - binding: "offering.config.categoryKey", - label: "案例类别", - input: "select", - options: [ + "key": "keywords", + "binding": "offering.config.keywords", + "label": "项目关键词", + "input": "list", + "itemValueKey": "value", + "itemFields": [ { - value: "portfolio", - label: "案例展示", - }, - { - value: "consulting", - label: "需求咨询", - }, - { - value: "advisory", - label: "长期支持", - }, - { - value: "custom", - label: "其他服务", - }, + "key": "value", + "label": "关键词" + } ], - previewTarget: "atelier-solopreneur.detail.projectDetail", + "previewTarget": "atelier-solopreneur.detail.projectDetail" }, { - key: "detailHero", - binding: "offering.config.detailHero", - label: "详情主图", - input: "image", - previewTarget: "atelier-solopreneur.detail.projectDetail", - }, - { - key: "area", - binding: "offering.config.area", - label: "项目地点", - input: "text", - previewTarget: "atelier-solopreneur.detail.projectDetail", - }, - { - key: "series", - binding: "offering.config.series", - label: "方案名称", - input: "text", - previewTarget: "atelier-solopreneur.detail.projectDetail", - }, - { - key: "spaceType", - binding: "offering.config.spaceType", - label: "适用场景", - input: "text", - previewTarget: "atelier-solopreneur.detail.projectDetail", - }, - { - key: "background", - binding: "offering.config.details.background", - label: "项目背景", - input: "textarea", - previewTarget: "atelier-solopreneur.detail.projectDetail", - }, - { - key: "designConcept", - binding: "offering.config.details.designConcept", - label: "设计理念", - input: "textarea", - previewTarget: "atelier-solopreneur.detail.projectDetail", - }, - { - key: "keywords", - binding: "offering.config.keywords", - label: "项目关键词", - input: "list", - itemValueKey: "value", - itemFields: [ + "key": "crafts", + "binding": "offering.config.details.crafts", + "label": "交付要点", + "input": "list", + "itemValueKey": "value", + "itemFields": [ { - key: "value", - label: "关键词", - }, + "key": "value", + "label": "交付内容" + } ], - previewTarget: "atelier-solopreneur.detail.projectDetail", + "previewTarget": "atelier-solopreneur.detail.projectDetail" }, { - key: "crafts", - binding: "offering.config.details.crafts", - label: "交付要点", - input: "list", - itemValueKey: "value", - itemFields: [ + "key": "materialsList", + "binding": "offering.config.details.materialsList", + "label": "能力构成", + "input": "list", + "itemFields": [ { - key: "value", - label: "交付内容", + "key": "name", + "label": "能力名称" }, + { + "key": "spec", + "label": "能力说明" + } ], - previewTarget: "atelier-solopreneur.detail.projectDetail", - }, - { - key: "materialsList", - binding: "offering.config.details.materialsList", - label: "能力构成", - input: "list", - itemFields: [ - { - key: "name", - label: "能力名称", - }, - { - key: "spec", - label: "能力说明", - }, - ], - previewTarget: "atelier-solopreneur.detail.projectDetail", - }, + "previewTarget": "atelier-solopreneur.detail.projectDetail" + } ], - previewTargets: [ + "previewTargets": [ { - key: "atelier-solopreneur.detail.projectDetail", - label: "案例详情", - }, - ], + "key": "atelier-solopreneur.detail.projectDetail", + "label": "案例详情" + } + ] }, { - key: "detailCopy", - title: "详情页说明", - description: "说明案例内容、价格与咨询后的真实处理方式。", - page: "detail", - target: "brand", - fields: [ + "key": "detailCopy", + "title": "详情页说明", + "description": "说明案例内容、价格与咨询后的真实处理方式。", + "page": "detail", + "target": "brand", + "fields": [ { - key: "priceLabel", - binding: "brand.config.visualPresentation.detail.priceLabel", - label: "价格说明标题", - input: "text", - previewTarget: "atelier-solopreneur.detail.detailCopy", + "key": "priceLabel", + "binding": "brand.config.visualPresentation.detail.priceLabel", + "label": "价格说明标题", + "input": "text", + "previewTarget": "atelier-solopreneur.detail.detailCopy" }, { - key: "spaceLabel", - binding: "brand.config.visualPresentation.detail.spaceLabel", - label: "适用空间标题", - input: "text", - previewTarget: "atelier-solopreneur.detail.detailCopy", + "key": "spaceLabel", + "binding": "brand.config.visualPresentation.detail.spaceLabel", + "label": "适用空间标题", + "input": "text", + "previewTarget": "atelier-solopreneur.detail.detailCopy" }, { - key: "backgroundTitle", - binding: "brand.config.visualPresentation.detail.backgroundTitle", - label: "项目背景标题", - input: "text", - previewTarget: "atelier-solopreneur.detail.detailCopy", + "key": "backgroundTitle", + "binding": "brand.config.visualPresentation.detail.backgroundTitle", + "label": "项目背景标题", + "input": "text", + "previewTarget": "atelier-solopreneur.detail.detailCopy" }, { - key: "conceptTitle", - binding: "brand.config.visualPresentation.detail.conceptTitle", - label: "设计理念标题", - input: "text", - previewTarget: "atelier-solopreneur.detail.detailCopy", + "key": "conceptTitle", + "binding": "brand.config.visualPresentation.detail.conceptTitle", + "label": "设计理念标题", + "input": "text", + "previewTarget": "atelier-solopreneur.detail.detailCopy" }, { - key: "craftsTitle", - binding: "brand.config.visualPresentation.detail.craftsTitle", - label: "工艺要点标题", - input: "text", - previewTarget: "atelier-solopreneur.detail.detailCopy", + "key": "craftsTitle", + "binding": "brand.config.visualPresentation.detail.craftsTitle", + "label": "工艺要点标题", + "input": "text", + "previewTarget": "atelier-solopreneur.detail.detailCopy" }, { - key: "materialsTitle", - binding: "brand.config.visualPresentation.detail.materialsTitle", - label: "材料说明标题", - input: "text", - previewTarget: "atelier-solopreneur.detail.detailCopy", - }, + "key": "materialsTitle", + "binding": "brand.config.visualPresentation.detail.materialsTitle", + "label": "材料说明标题", + "input": "text", + "previewTarget": "atelier-solopreneur.detail.detailCopy" + } ], - previewTargets: [ + "previewTargets": [ { - key: "atelier-solopreneur.detail.detailCopy", - label: "详情页说明", - }, - ], + "key": "atelier-solopreneur.detail.detailCopy", + "label": "详情页说明" + } + ] }, { - key: "detailAction", - title: "详情页咨询入口", - description: "公共按钮与提示,对所有业务详情生效。", - page: "detail", - target: "brand", - fields: [ + "key": "detailAction", + "title": "详情页咨询入口", + "description": "公共按钮与提示,对所有业务详情生效。", + "page": "detail", + "target": "brand", + "fields": [ { - key: "inquiryAction", - binding: "brand.config.visualPresentation.detail.inquiryAction", - label: "咨询按钮文字", - input: "text", - previewTarget: "atelier-solopreneur.detail.action", + "key": "inquiryAction", + "binding": "brand.config.visualPresentation.detail.inquiryAction", + "label": "咨询按钮文字", + "input": "text", + "previewTarget": "atelier-solopreneur.detail.action" }, { - key: "inquiryHint", - binding: "brand.config.visualPresentation.detail.inquiryHint", - label: "咨询后的处理说明", - help: "只填写能兑现的服务安排。", - input: "textarea", - previewTarget: "atelier-solopreneur.detail.action", - }, + "key": "inquiryHint", + "binding": "brand.config.visualPresentation.detail.inquiryHint", + "label": "咨询后的处理说明", + "help": "只填写能兑现的服务安排。", + "input": "textarea", + "previewTarget": "atelier-solopreneur.detail.action" + } ], - previewTargets: [ + "previewTargets": [ { - key: "atelier-solopreneur.detail.action", - label: "详情页咨询入口", - }, - ], + "key": "atelier-solopreneur.detail.action", + "label": "详情页咨询入口" + } + ] }, { - key: "home_case", - title: "试点案例卡片", - description: "修改后保存为草稿,发布后对访客生效。", - page: "home", - target: "offering", - previewTargets: [ + "key": "home_case", + "title": "试点案例卡片", + "description": "修改后保存为草稿,发布后对访客生效。", + "page": "home", + "target": "offering", + "previewTargets": [ { - key: "atelier.home.case", - label: "试点案例卡片", - }, + "key": "atelier.home.case", + "label": "试点案例卡片" + } ], - fields: [ + "fields": [ { - key: "name", - binding: "offering.name", - label: "案例名称", - input: "text", - previewTarget: "atelier.home.case", + "key": "name", + "binding": "offering.name", + "label": "案例名称", + "input": "text", + "previewTarget": "atelier.home.case" }, { - key: "summary", - binding: "offering.summary", - label: "案例说明", - input: "textarea", - previewTarget: "atelier.home.case", + "key": "summary", + "binding": "offering.summary", + "label": "案例说明", + "input": "textarea", + "previewTarget": "atelier.home.case" }, { - key: "coverUrl", - binding: "offering.coverUrl", - label: "案例封面", - input: "image", - previewTarget: "atelier.home.case", - }, - ], + "key": "coverUrl", + "binding": "offering.coverUrl", + "label": "案例封面", + "input": "image", + "previewTarget": "atelier.home.case" + } + ] }, { - key: "home_badges", - title: "交付标签", - description: "修改后保存为草稿,发布后对访客生效。", - page: "home", - target: "brand", - previewTargets: [ + "key": "home_badges", + "title": "交付标签", + "description": "修改后保存为草稿,发布后对访客生效。", + "page": "home", + "target": "brand", + "previewTargets": [ { - key: "atelier.home.badges", - label: "交付标签", - }, + "key": "atelier.home.badges", + "label": "交付标签" + } ], - fields: [ + "fields": [ { - key: "badges", - binding: "brand.config.atelier.badges", - label: "交付标签", - input: "list", - previewTarget: "atelier.home.badges", - itemFields: [ + "key": "badges", + "binding": "brand.config.atelier.badges", + "label": "交付标签", + "input": "list", + "previewTarget": "atelier.home.badges", + "itemFields": [ { - key: "title", - label: "标题", - }, - ], - }, - ], + "key": "title", + "label": "标题" + } + ] + } + ] }, { - key: "home_features", - title: "差异化构建卡片", - description: "修改后保存为草稿,发布后对访客生效。", - page: "home", - target: "brand", - previewTargets: [ + "key": "home_features", + "title": "差异化构建卡片", + "description": "修改后保存为草稿,发布后对访客生效。", + "page": "home", + "target": "brand", + "previewTargets": [ { - key: "atelier.home.features", - label: "差异化构建卡片", - }, + "key": "atelier.home.features", + "label": "差异化构建卡片" + } ], - fields: [ + "fields": [ { - key: "features", - binding: "brand.config.atelier.features", - label: "差异化构建卡片", - input: "list", - previewTarget: "atelier.home.features", - itemFields: [ + "key": "features", + "binding": "brand.config.atelier.features", + "label": "差异化构建卡片", + "input": "list", + "previewTarget": "atelier.home.features", + "itemFields": [ { - key: "tag", - label: "标签", + "key": "tag", + "label": "标签" }, { - key: "title", - label: "标题", + "key": "title", + "label": "标题" }, { - key: "description", - label: "说明", - }, - ], - }, - ], + "key": "description", + "label": "说明" + } + ] + } + ] }, { - key: "home_audiences", - title: "服务群体", - description: "修改后保存为草稿,发布后对访客生效。", - page: "home", - target: "brand", - previewTargets: [ + "key": "home_audiences", + "title": "服务群体", + "description": "修改后保存为草稿,发布后对访客生效。", + "page": "home", + "target": "brand", + "previewTargets": [ { - key: "atelier.home.audiences", - label: "服务群体", - }, + "key": "atelier.home.audiences", + "label": "服务群体" + } ], - fields: [ + "fields": [ { - key: "audiences", - binding: "brand.config.atelier.audiences", - label: "服务群体", - input: "list", - previewTarget: "atelier.home.audiences", - itemFields: [ + "key": "audiences", + "binding": "brand.config.atelier.audiences", + "label": "服务群体", + "input": "list", + "previewTarget": "atelier.home.audiences", + "itemFields": [ { - key: "symbol", - label: "符号", + "key": "symbol", + "label": "符号" }, { - key: "title", - label: "标题", + "key": "title", + "label": "标题" }, { - key: "description", - label: "说明", - }, - ], - }, - ], + "key": "description", + "label": "说明" + } + ] + } + ] }, { - key: "offerings_deliverables", - title: "交付体系", - description: "修改后保存为草稿,发布后对访客生效。", - page: "offerings", - target: "brand", - previewTargets: [ + "key": "offerings_deliverables", + "title": "交付体系", + "description": "修改后保存为草稿,发布后对访客生效。", + "page": "offerings", + "target": "brand", + "previewTargets": [ { - key: "atelier.offerings.deliverables", - label: "交付体系", - }, + "key": "atelier.offerings.deliverables", + "label": "交付体系" + } ], - fields: [ + "fields": [ { - key: "deliverables", - binding: "brand.config.atelier.deliverables", - label: "交付体系", - input: "list", - previewTarget: "atelier.offerings.deliverables", - itemFields: [ + "key": "deliverables", + "binding": "brand.config.atelier.deliverables", + "label": "交付体系", + "input": "list", + "previewTarget": "atelier.offerings.deliverables", + "itemFields": [ { - key: "title", - label: "标题", + "key": "title", + "label": "标题" }, { - key: "tag", - label: "标签", + "key": "tag", + "label": "标签" }, { - key: "description", - label: "说明", - }, - ], - }, - ], + "key": "description", + "label": "说明" + } + ] + } + ] }, { - key: "offerings_process", - title: "协作步骤", - description: "修改后保存为草稿,发布后对访客生效。", - page: "offerings", - target: "brand", - previewTargets: [ + "key": "offerings_process", + "title": "协作步骤", + "description": "修改后保存为草稿,发布后对访客生效。", + "page": "offerings", + "target": "brand", + "previewTargets": [ { - key: "atelier.offerings.process", - label: "协作步骤", - }, + "key": "atelier.offerings.process", + "label": "协作步骤" + } ], - fields: [ + "fields": [ { - key: "process", - binding: "brand.config.atelier.process", - label: "协作步骤", - input: "list", - previewTarget: "atelier.offerings.process", - itemFields: [ + "key": "process", + "binding": "brand.config.atelier.process", + "label": "协作步骤", + "input": "list", + "previewTarget": "atelier.offerings.process", + "itemFields": [ { - key: "title", - label: "标题", + "key": "title", + "label": "标题" }, { - key: "description", - label: "说明", - }, - ], - }, - ], + "key": "description", + "label": "说明" + } + ] + } + ] }, { - key: "offerings_proofs", - title: "信任基石", - description: "修改后保存为草稿,发布后对访客生效。", - page: "offerings", - target: "brand", - previewTargets: [ + "key": "offerings_proofs", + "title": "信任基石", + "description": "修改后保存为草稿,发布后对访客生效。", + "page": "offerings", + "target": "brand", + "previewTargets": [ { - key: "atelier.offerings.proofs", - label: "信任基石", - }, + "key": "atelier.offerings.proofs", + "label": "信任基石" + } ], - fields: [ + "fields": [ { - key: "proofs", - binding: "brand.config.atelier.proofs", - label: "信任基石", - input: "list", - previewTarget: "atelier.offerings.proofs", - itemFields: [ + "key": "proofs", + "binding": "brand.config.atelier.proofs", + "label": "信任基石", + "input": "list", + "previewTarget": "atelier.offerings.proofs", + "itemFields": [ { - key: "title", - label: "标题", + "key": "title", + "label": "标题" }, { - key: "description", - label: "说明", - }, - ], - }, - ], + "key": "description", + "label": "说明" + } + ] + } + ] }, { - key: "profile_faqs", - title: "常见问题", - description: "修改后保存为草稿,发布后对访客生效。", - page: "profile", - target: "brand", - previewTargets: [ + "key": "profile_faqs", + "title": "常见问题", + "description": "修改后保存为草稿,发布后对访客生效。", + "page": "profile", + "target": "brand", + "previewTargets": [ { - key: "atelier.profile.faqs", - label: "常见问题", - }, + "key": "atelier.profile.faqs", + "label": "常见问题" + } ], - fields: [ + "fields": [ { - key: "faqs", - binding: "brand.config.atelier.faqs", - label: "常见问题", - input: "list", - previewTarget: "atelier.profile.faqs", - itemFields: [ + "key": "faqs", + "binding": "brand.config.atelier.faqs", + "label": "常见问题", + "input": "list", + "previewTarget": "atelier.profile.faqs", + "itemFields": [ { - key: "title", - label: "标题", + "key": "title", + "label": "标题" }, { - key: "description", - label: "说明", - }, - ], - }, - ], - }, - ], + "key": "description", + "label": "说明" + } + ] + } + ] + } + ] }, - trustContentTypes: [ + "trustContentTypes": [ { - type: "credential", - label: "系统基础与合作边界", - adminFields: { - title: "说明标题", - summary: "说明摘要", - content: "系统基础与合作说明", + "type": "credential", + "label": "系统基础与合作边界", + "adminFields": { + "title": "说明标题", + "summary": "说明摘要", + "content": "系统基础与合作说明" }, - pages: ["offerings"], - required: true, - }, + "pages": [ + "offerings" + ], + "required": true + } ], - sampleContent: { - personal: { - templateKey: "personal", - inquiryFormName: "品牌小程序需求意向单", - offerings: [ + "sampleContent": { + "personal": { + "templateKey": "personal", + "inquiryFormName": "品牌小程序需求意向单", + "offerings": [ { - kind: "service", - name: "校园餐饮品牌", - summary: "敏捷菜单 + 品牌展示 + 咨询承接", - categoryKey: "portfolio", - coverUrl: "/assets/cases/campus.jpg", - priceText: "按需求确认范围与报价", - config: { - spaceType: "餐饮品牌展示与咨询承接", - series: "试点架构原型", - keywords: ["模板演示", "可持续运营", "后台配置"], - details: { - background: - "校园餐饮品牌需要让访客快速了解餐品、营业安排与预订方式。本案例是用于验证系统结构的试点模板,不代表真实客户项目。", - designConcept: - "以品牌介绍建立第一印象,通过菜单与服务说明帮助访客了解供给,再通过咨询表单承接具体需求。", - crafts: [ + "kind": "service", + "name": "校园餐饮品牌", + "summary": "敏捷菜单 + 品牌展示 + 咨询承接", + "categoryKey": "portfolio", + "coverUrl": "/assets/cases/campus.jpg", + "priceText": "按需求确认范围与报价", + "config": { + "spaceType": "餐饮品牌展示与咨询承接", + "series": "试点架构原型", + "keywords": [ + "模板演示", + "可持续运营", + "后台配置" + ], + "details": { + "background": "校园餐饮品牌需要让访客快速了解餐品、营业安排与预订方式。本案例是用于验证系统结构的试点模板,不代表真实客户项目。", + "designConcept": "以品牌介绍建立第一印象,通过菜单与服务说明帮助访客了解供给,再通过咨询表单承接具体需求。", + "crafts": [ "品牌介绍与餐品内容由后台维护", "草稿预览与发布分离,确认后更新公开内容", - "咨询表单收集需求,支持后续人工跟进", + "咨询表单收集需求,支持后续人工跟进" ], - materialsList: [ + "materialsList": [ { - name: "品牌展示", - spec: "首页、主理人介绍与信任内容", + "name": "品牌展示", + "spec": "首页、主理人介绍与信任内容" }, { - name: "餐品管理", - spec: "列表、详情与封面配置", + "name": "餐品管理", + "spec": "列表、详情与封面配置" }, { - name: "需求承接", - spec: "咨询表单与跟进记录", - }, - ], - }, - }, + "name": "需求承接", + "spec": "咨询表单与跟进记录" + } + ] + } + } }, { - kind: "service", - name: "个人编辑型品牌", - summary: "案例沉淀 + 专业表达 + 合作咨询", - categoryKey: "portfolio", - coverUrl: "/assets/cases/editorial.jpg", - priceText: "按需求确认范围与报价", - config: { - spaceType: "个人品牌作品展示与合作咨询", - series: "试点架构原型", - keywords: ["模板演示", "可持续运营", "后台配置"], - details: { - background: - "个人品牌需要将定位、代表作品与合作方式组织成清晰的了解路径。本案例展示编辑型模板的结构,不构成客户合作背书。", - designConcept: - "围绕专业表达与作品沉淀组织页面,让访客先了解品牌与工作方式,再浏览案例细节并提出合作需求。", - crafts: [ + "kind": "service", + "name": "个人编辑型品牌", + "summary": "案例沉淀 + 专业表达 + 合作咨询", + "categoryKey": "portfolio", + "coverUrl": "/assets/cases/editorial.jpg", + "priceText": "按需求确认范围与报价", + "config": { + "spaceType": "个人品牌作品展示与合作咨询", + "series": "试点架构原型", + "keywords": [ + "模板演示", + "可持续运营", + "后台配置" + ], + "details": { + "background": "个人品牌需要将定位、代表作品与合作方式组织成清晰的了解路径。本案例展示编辑型模板的结构,不构成客户合作背书。", + "designConcept": "围绕专业表达与作品沉淀组织页面,让访客先了解品牌与工作方式,再浏览案例细节并提出合作需求。", + "crafts": [ "个人定位、作品与流程可持续更新", "案例详情展示背景、构建思路与交付要点", - "通过咨询入口衔接后续需求沟通", + "通过咨询入口衔接后续需求沟通" ], - materialsList: [ + "materialsList": [ { - name: "专业表达", - spec: "定位、简介与品牌理念", + "name": "专业表达", + "spec": "定位、简介与品牌理念" }, { - name: "作品沉淀", - spec: "案例列表、详情与图片", + "name": "作品沉淀", + "spec": "案例列表、详情与图片" }, { - name: "合作沟通", - spec: "合作说明、咨询表单与跟进记录", - }, - ], - }, - }, - }, + "name": "合作沟通", + "spec": "合作说明、咨询表单与跟进记录" + } + ] + } + } + } ], - trustContent: [ + "trustContent": [ { - type: "credential", - title: "系统基础与合作边界", - content: - "当前已实现两套试点模板、网页内容管理、草稿预览与发布、咨询承接能力。具体交付页面、上线材料、费用、排期与后续支持范围,需要在需求沟通后确认。", - }, + "type": "credential", + "title": "系统基础与合作边界", + "content": "当前已实现两套试点模板、网页内容管理、草稿预览与发布、咨询承接能力。具体交付页面、上线材料、费用、排期与后续支持范围,需要在需求沟通后确认。" + } ], - fields: [ + "fields": [ { - key: "name", - label: "称呼 / 品牌名称", - type: "text", - required: true, + "key": "name", + "label": "称呼 / 品牌名称", + "type": "text", + "required": true }, { - key: "industry", - label: "你的主营领域", - type: "radio", - required: true, - options: [ + "key": "industry", + "label": "你的主营领域", + "type": "radio", + "required": true, + "options": [ { - label: "独立设计 / 建筑", - value: "独立设计 / 建筑", + "label": "独立设计 / 建筑", + "value": "独立设计 / 建筑" }, { - label: "摄影 / 视觉艺术", - value: "摄影 / 视觉艺术", + "label": "摄影 / 视觉艺术", + "value": "摄影 / 视觉艺术" }, { - label: "独立商业咨询", - value: "独立商业咨询", + "label": "独立商业咨询", + "value": "独立商业咨询" }, { - label: "教练 / 身心疗愈", - value: "教练 / 身心疗愈", + "label": "教练 / 身心疗愈", + "value": "教练 / 身心疗愈" }, { - label: "个人 IP / 创作者", - value: "个人 IP / 创作者", + "label": "个人 IP / 创作者", + "value": "个人 IP / 创作者" }, { - label: "精品品牌 / 实体", - value: "精品品牌 / 实体", + "label": "精品品牌 / 实体", + "value": "精品品牌 / 实体" }, { - label: "其他", - value: "其他", - }, - ], + "label": "其他", + "value": "其他" + } + ] }, { - key: "needs", - label: "目前主要诉求与现状", - type: "textarea", - required: true, + "key": "needs", + "label": "目前主要诉求与现状", + "type": "textarea", + "required": true }, { - key: "timeline", - label: "预期启动排期", - type: "radio", - required: false, - options: [ + "key": "timeline", + "label": "预期启动排期", + "type": "radio", + "required": false, + "options": [ { - label: "本月内", - value: "本月内", + "label": "本月内", + "value": "本月内" }, { - label: "下月起", - value: "下月起", + "label": "下月起", + "value": "下月起" }, { - label: "先期评估", - value: "先期评估", - }, - ], + "label": "先期评估", + "value": "先期评估" + } + ] }, { - key: "contact", - label: "联系方式(微信 / 电话)", - type: "text", - required: true, - }, + "key": "contact", + "label": "联系方式(微信 / 电话)", + "type": "text", + "required": true + } ], - capabilityKey: "inquiry", - brandConfig: { - visualPresentation: { - home: { - eyebrow: "独立开发者 · 品牌小程序构建", - title: "把个人品牌做成\n可持续运营的小程序", - subtitle: - "不只是做一个展示页面,而是为你搭建专业展示、内容运营与长期承接咨询的小程序系统。", - primaryAction: "预约咨询 / 聊聊需求", - secondaryAction: "查看服务架构", - featuresTitle: "差异化构建逻辑", - featuresEnglish: "Bespoke System", - casesTitle: "试点架构原型", - casesSubtitle: "验证模板 · 点击进入结构解析", - caseAction: "查看详情架构 →", - audienceTitle: "专属服务群体", - audienceEnglish: "Target Creators", - ctaTitle: "开启你的品牌小程序", - ctaSubtitle: "从策略梳理到上线的一站式交付", - ctaAction: "立即沟通", + "capabilityKey": "inquiry", + "brandConfig": { + "visualPresentation": { + "home": { + "eyebrow": "独立开发者 · 品牌小程序构建", + "title": "把个人品牌做成\n可持续运营的小程序", + "subtitle": "不只是做一个展示页面,而是为你搭建专业展示、内容运营与长期承接咨询的小程序系统。", + "primaryAction": "预约咨询 / 聊聊需求", + "secondaryAction": "查看服务架构", + "featuresTitle": "差异化构建逻辑", + "featuresEnglish": "Bespoke System", + "casesTitle": "试点架构原型", + "casesSubtitle": "验证模板 · 点击进入结构解析", + "caseAction": "查看详情架构 →", + "audienceTitle": "专属服务群体", + "audienceEnglish": "Target Creators", + "ctaTitle": "开启你的品牌小程序", + "ctaSubtitle": "从策略梳理到上线的一站式交付", + "ctaAction": "立即沟通" }, - offerings: { - eyebrow: "完整独立交付 · 匠心构建", - title: "全链路服务与透明协作", - subtitle: "站在产品与长期运营的角度设计,专注交付可持续更新的个人品牌数字资产。", - deliverablesTitle: "交付体系", - deliverablesEnglish: "7 Deliverables", - processTitle: "协作流程", - processEnglish: "5 Phases · 节点透明可溯", - proofTitle: "信任基石", - proofEnglish: "Why bespoke", - ctaTitle: "对流程有疑问?直接聊聊", - ctaSubtitle: "一起梳理当前的品牌数字化需求,评估适合的结构与启动时间。", - ctaAction: "预约需求沟通", + "offerings": { + "eyebrow": "完整独立交付 · 匠心构建", + "title": "全链路服务与透明协作", + "subtitle": "站在产品与长期运营的角度设计,专注交付可持续更新的个人品牌数字资产。", + "deliverablesTitle": "交付体系", + "deliverablesEnglish": "7 Deliverables", + "processTitle": "协作流程", + "processEnglish": "5 Phases · 节点透明可溯", + "proofTitle": "信任基石", + "proofEnglish": "Why bespoke", + "ctaTitle": "对流程有疑问?直接聊聊", + "ctaSubtitle": "一起梳理当前的品牌数字化需求,评估适合的结构与启动时间。", + "ctaAction": "预约需求沟通" }, - profile: { - eyebrow: "个人中心 · 状态与沟通", - title: "我的", - subtitle: "查看咨询记录、发起新咨询,或直接联系主理人。", - inquiryAction: "新增咨询", - timeHint: "约 3 分钟", - wechatLabel: "微信直聊", - copyAction: "复制微信", - contactHint: "尚未配置微信号,可先填写意向单", - promise: "先梳理可行性与时间节点,再确认合作范围", - recordsAction: "查看咨询记录 →", - faqTitle: "常见疑问解答", - faqSubtitle: "把透明与确定性放在第一位,说明合作的常见顾虑与流程。", - footerQuote: "Bespoke digital architecture for clear minds.", - footerNote: "用心打磨每一处体验 · 期待与你的灵感交汇", - recordsTitle: "我的咨询记录", - recordsDescription: "查看提交过的意向和主理人回复状态。", + "profile": { + "eyebrow": "个人中心 · 状态与沟通", + "title": "我的", + "subtitle": "查看咨询记录、发起新咨询,或直接联系主理人。", + "inquiryAction": "新增咨询", + "timeHint": "约 3 分钟", + "wechatLabel": "微信直聊", + "copyAction": "复制微信", + "contactHint": "尚未配置微信号,可先填写意向单", + "promise": "先梳理可行性与时间节点,再确认合作范围", + "recordsAction": "查看咨询记录 →", + "faqTitle": "常见疑问解答", + "faqSubtitle": "把透明与确定性放在第一位,说明合作的常见顾虑与流程。", + "footerQuote": "Bespoke digital architecture for clear minds.", + "footerNote": "用心打磨每一处体验 · 期待与你的灵感交汇", + "recordsTitle": "我的咨询记录", + "recordsDescription": "查看提交过的意向和主理人回复状态。" }, - inquiry: { - eyebrow: "Atelier Note · 品牌意向梳理", - title: "品牌意向梳理 · 3 分钟完成", - subtitle: "用于需求梳理与排期评估,请填写当前业务、目标用户与主要诉求。", - submitLabel: "提交意向 · 预约沟通", - privacyTitle: "信息使用说明", - privacyNote: - "你提交的信息仅用于本次需求评估与后续联系。请勿填写密码、证件号码等敏感信息。", - followupHint: "提交后可在咨询记录中查看状态,具体响应时间以主理人确认为准。", - note: "填写的信息仅用于需求沟通与排期评估。", + "inquiry": { + "eyebrow": "Atelier Note · 品牌意向梳理", + "title": "品牌意向梳理 · 3 分钟完成", + "subtitle": "用于需求梳理与排期评估,请填写当前业务、目标用户与主要诉求。", + "submitLabel": "提交意向 · 预约沟通", + "privacyTitle": "信息使用说明", + "privacyNote": "你提交的信息仅用于本次需求评估与后续联系。请勿填写密码、证件号码等敏感信息。", + "followupHint": "提交后可在咨询记录中查看状态,具体响应时间以主理人确认为准。", + "note": "填写的信息仅用于需求沟通与排期评估。" }, - success: { - eyebrow: "已提交", - title: "意向已送达工坊", - intro: "已收到你的需求清单,将结合业务情况评估可行性,并通过你留下的联系方式沟通。", - recordsAction: "查看咨询记录", - homeAction: "返回首页", + "success": { + "eyebrow": "已提交", + "title": "意向已送达工坊", + "intro": "已收到你的需求清单,将结合业务情况评估可行性,并通过你留下的联系方式沟通。", + "recordsAction": "查看咨询记录", + "homeAction": "返回首页" }, - records: { - title: "我的品牌咨询", - createAction: "填写新需求", - emptyTitle: "还没有咨询记录", - emptyDescription: "提交品牌需求后,可以在这里查看后续跟进状态。", - emptyAction: "填写品牌需求", - }, - detail: { - priceLabel: "合作方式", - spaceLabel: "适用场景", - backgroundTitle: "案例与业务背景", - conceptTitle: "构建思路", - craftsTitle: "交付要点", - materialsTitle: "能力构成", - inquiryAction: "聊聊类似需求", - inquiryHint: "具体范围与报价在需求确认后提供。", + "records": { + "title": "我的品牌咨询", + "createAction": "填写新需求", + "emptyTitle": "还没有咨询记录", + "emptyDescription": "提交品牌需求后,可以在这里查看后续跟进状态。", + "emptyAction": "填写品牌需求" }, + "detail": { + "priceLabel": "合作方式", + "spaceLabel": "适用场景", + "backgroundTitle": "案例与业务背景", + "conceptTitle": "构建思路", + "craftsTitle": "交付要点", + "materialsTitle": "能力构成", + "inquiryAction": "聊聊类似需求", + "inquiryHint": "具体范围与报价在需求确认后提供。" + } }, - atelier: { - badges: [ + "atelier": { + "badges": [ { - title: "完整可交付小程序", + "title": "完整可交付小程序" }, { - title: "支持后台随时更新", + "title": "支持后台随时更新" }, { - title: "支持长期演进", - }, + "title": "支持长期演进" + } ], - features: [ + "features": [ { - tag: "敏捷控制台", - title: "不是静态页面,而是可持续更新的系统", - description: - "拥有独立管理后台,案例作品、核心业务与介绍随时增删修改,让日常更新回归内容本身。", + "tag": "敏捷控制台", + "title": "不是静态页面,而是可持续更新的系统", + "description": "拥有独立管理后台,案例作品、核心业务与介绍随时增删修改,让日常更新回归内容本身。" }, { - tag: "信任转化", - title: "先梳理定位与信任结构", - description: - "优先厘清客户的了解路径与业务背书,从第一屏价值表达,到高意向咨询的承接。", + "tag": "信任转化", + "title": "先梳理定位与信任结构", + "description": "优先厘清客户的了解路径与业务背书,从第一屏价值表达,到高意向咨询的承接。" }, { - tag: "陪伴演进", - title: "交付之后,支持长期迭代", - description: "从上线协助到阶段性功能扩展,让品牌载体伴随业务持续成长。", - }, + "tag": "陪伴演进", + "title": "交付之后,支持长期迭代", + "description": "从上线协助到阶段性功能扩展,让品牌载体伴随业务持续成长。" + } ], - audiences: [ + "audiences": [ { - symbol: "◎", - title: "摄影师", - description: "样片沉淀", + "symbol": "◎", + "title": "摄影师", + "description": "样片沉淀" }, { - symbol: "◇", - title: "咨询顾问", - description: "信任转化", + "symbol": "◇", + "title": "咨询顾问", + "description": "信任转化" }, { - symbol: "✎", - title: "独立设计", - description: "作品展呈", + "symbol": "✎", + "title": "独立设计", + "description": "作品展呈" }, { - symbol: "↗", - title: "教练疗愈", - description: "需求预约", + "symbol": "↗", + "title": "教练疗愈", + "description": "需求预约" }, { - symbol: "▤", - title: "IP 创作者", - description: "私域载体", + "symbol": "▤", + "title": "IP 创作者", + "description": "私域载体" }, { - symbol: "⌂", - title: "小微实体", - description: "产品看板", - }, + "symbol": "⌂", + "title": "小微实体", + "description": "产品看板" + } ], - deliverables: [ + "deliverables": [ { - title: "品牌定位梳理", - tag: "清晰聚焦", - description: "提炼核心专长与目标客户画像,明确小程序核心诉求与转化路径。", + "title": "品牌定位梳理", + "tag": "清晰聚焦", + "description": "提炼核心专长与目标客户画像,明确小程序核心诉求与转化路径。" }, { - title: "页面结构设计", - tag: "信任动线", - description: "梳理信息架构与信任动线,建立递进式了解路径。", + "title": "页面结构设计", + "tag": "信任动线", + "description": "梳理信息架构与信任动线,建立递进式了解路径。" }, { - title: "小程序视觉设计", - tag: "克制美学", - description: "结合微信使用习惯设计界面,用精致排版强化专业辨识度。", + "title": "小程序视觉设计", + "tag": "克制美学", + "description": "结合微信使用习惯设计界面,用精致排版强化专业辨识度。" }, { - title: "内容字段规划", - tag: "结构资产", - description: "规范案例、服务与常见问题字段,让内容持续沉淀。", + "title": "内容字段规划", + "tag": "结构资产", + "description": "规范案例、服务与常见问题字段,让内容持续沉淀。" }, { - title: "后台管理配置", - tag: "自主维护", - description: "通过网页后台修改内容、上传图片,保存为草稿,确认后发布。", + "title": "后台管理配置", + "tag": "自主维护", + "description": "通过网页后台修改内容、上传图片,保存为草稿,确认后发布。" }, { - title: "发布上线协助", - tag: "上线协作", - description: "协助准备微信主体与类目材料、配置和提审,审核结果以微信平台为准。", + "title": "发布上线协助", + "tag": "上线协作", + "description": "协助准备微信主体与类目材料、配置和提审,审核结果以微信平台为准。" }, { - title: "后续运营支持", - tag: "长期支持", - description: "提供操作说明与迭代建议,具体支持范围在合作时确认。", - }, + "title": "后续运营支持", + "tag": "长期支持", + "description": "提供操作说明与迭代建议,具体支持范围在合作时确认。" + } ], - process: [ + "process": [ { - title: "需求沟通", - description: "交流专业背景、获客渠道与核心需求,评估可行性与排期。", + "title": "需求沟通", + "description": "交流专业背景、获客渠道与核心需求,评估可行性与排期。" }, { - title: "品牌结构梳理", - description: "提炼品牌关键词与信息架构,统一页面目标。", + "title": "品牌结构梳理", + "description": "提炼品牌关键词与信息架构,统一页面目标。" }, { - title: "界面设计确认", - description: "确认原型、视觉、排版与交互细节。", + "title": "界面设计确认", + "description": "确认原型、视觉、排版与交互细节。" }, { - title: "内容配置与上线", - description: "录入案例与服务资料,联调、提审并协助发布。", + "title": "内容配置与上线", + "description": "录入案例与服务资料,联调、提审并协助发布。" }, { - title: "长期演进迭代", - description: "根据反馈完善内容,按约定范围迭代功能。", - }, + "title": "长期演进迭代", + "description": "根据反馈完善内容,按约定范围迭代功能。" + } ], - proofs: [ + "proofs": [ { - title: "已有系统基础", - description: "两套试点模板验证展示、配置与咨询链路。", + "title": "已有系统基础", + "description": "两套试点模板验证展示、配置与咨询链路。" }, { - title: "支持后台管理", - description: "内容由品牌自行维护,草稿确认后再发布。", + "title": "支持后台管理", + "description": "内容由品牌自行维护,草稿确认后再发布。" }, { - title: "模块化扩展", - description: "复用稳定的系统能力,按需求扩展页面与服务。", + "title": "模块化扩展", + "description": "复用稳定的系统能力,按需求扩展页面与服务。" }, { - title: "定位先于视觉", - description: "先说明你是谁、为谁服务、为什么值得信任。", + "title": "定位先于视觉", + "description": "先说明你是谁、为谁服务、为什么值得信任。" }, { - title: "直接沟通与持续支持", - description: "独立主理人直接对接,合作边界与后续支持提前确认。", - }, + "title": "直接沟通与持续支持", + "description": "独立主理人直接对接,合作边界与后续支持提前确认。" + } ], - faqs: [ + "faqs": [ { - title: "还没整理好品牌文案,可以开始吗?", - description: - "可以先沟通。第一阶段一起梳理定位、核心业务与已有素材,再确定需要补齐的内容。", + "title": "还没整理好品牌文案,可以开始吗?", + "description": "可以先沟通。第一阶段一起梳理定位、核心业务与已有素材,再确定需要补齐的内容。" }, { - title: "后续内容可以自己修改吗?", - description: - "可以通过网页管理后台维护简介、案例、服务与表单。保存先形成草稿,确认并发布后,公开小程序才更新。", + "title": "后续内容可以自己修改吗?", + "description": "可以通过网页管理后台维护简介、案例、服务与表单。保存先形成草稿,确认并发布后,公开小程序才更新。" }, { - title: "可以先做轻量版本验证吗?", - description: - "可以。优先用展示、服务介绍与意向咨询等核心页面验证需求,再依据反馈扩展。", + "title": "可以先做轻量版本验证吗?", + "description": "可以。优先用展示、服务介绍与意向咨询等核心页面验证需求,再依据反馈扩展。" }, { - title: "设计和上线怎么配合?", - description: - "需求对齐、结构梳理、视觉确认、内容配置与上线分阶段推进。微信认证与审核由平台决定,所需材料和分工提前确认。", - }, + "title": "设计和上线怎么配合?", + "description": "需求对齐、结构梳理、视觉确认、内容配置与上线分阶段推进。微信认证与审核由平台决定,所需材料和分工提前确认。" + } ], - identity: { - status: "当前可接新项目", - experience: "10 年", - tags: [ + "identity": { + "status": "当前可接新项目", + "experience": "10 年", + "tags": [ { - title: "大屏可视化", + "title": "大屏可视化" }, { - title: "小程序", - }, - ], - }, + "title": "小程序" + } + ] + } }, - founder: "验收主理人", - title: "产品设计 / 全栈开发", - }, - }, + "founder": "验收主理人", + "title": "产品设计 / 全栈开发" + } + } }, - pages: ["pages/index/index", "pages/services/index", "pages/bookings/index"], - previewFixture: { - personal: { - schemaVersion: "1", - brand: { - name: "独立工坊 · 演示品牌", - tagline: "把专业经验变成值得信任的个人品牌", - description: - "为独立主理人提供品牌定位、产品设计与小程序开发支持。这些内容仅用于演示模板。", - hours: "工作日 10:00–18:00", - address: "远程协作 · 全国", - deliveryNote: "演示内容不接受真实咨询。", - avatarUrl: "/assets/avatar.jpg", + "pages": [ + "pages/index/index", + "pages/services/index", + "pages/bookings/index" + ], + "previewFixture": { + "personal": { + "schemaVersion": "1", + "brand": { + "name": "独立工坊 · 演示品牌", + "tagline": "把专业经验变成值得信任的个人品牌", + "description": "为独立主理人提供品牌定位、产品设计与小程序开发支持。这些内容仅用于演示模板。", + "hours": "工作日 10:00–18:00", + "address": "远程协作 · 全国", + "deliveryNote": "演示内容不接受真实咨询。", + "avatarUrl": "/assets/avatar.jpg" }, - content: { - templateKey: "personal", - inquiryFormName: "品牌小程序需求意向单", - offerings: [ + "content": { + "templateKey": "personal", + "inquiryFormName": "品牌小程序需求意向单", + "offerings": [ { - kind: "service", - name: "校园餐饮品牌", - summary: "敏捷菜单 + 品牌展示 + 咨询承接", - categoryKey: "portfolio", - coverUrl: "/assets/cases/campus.jpg", - priceText: "按需求确认范围与报价", - config: { - spaceType: "餐饮品牌展示与咨询承接", - series: "试点架构原型", - keywords: ["模板演示", "可持续运营", "后台配置"], - details: { - background: - "校园餐饮品牌需要让访客快速了解餐品、营业安排与预订方式。本案例是用于验证系统结构的试点模板,不代表真实客户项目。", - designConcept: - "以品牌介绍建立第一印象,通过菜单与服务说明帮助访客了解供给,再通过咨询表单承接具体需求。", - crafts: [ + "kind": "service", + "name": "校园餐饮品牌", + "summary": "敏捷菜单 + 品牌展示 + 咨询承接", + "categoryKey": "portfolio", + "coverUrl": "/assets/cases/campus.jpg", + "priceText": "按需求确认范围与报价", + "config": { + "spaceType": "餐饮品牌展示与咨询承接", + "series": "试点架构原型", + "keywords": [ + "模板演示", + "可持续运营", + "后台配置" + ], + "details": { + "background": "校园餐饮品牌需要让访客快速了解餐品、营业安排与预订方式。本案例是用于验证系统结构的试点模板,不代表真实客户项目。", + "designConcept": "以品牌介绍建立第一印象,通过菜单与服务说明帮助访客了解供给,再通过咨询表单承接具体需求。", + "crafts": [ "品牌介绍与餐品内容由后台维护", "草稿预览与发布分离,确认后更新公开内容", - "咨询表单收集需求,支持后续人工跟进", + "咨询表单收集需求,支持后续人工跟进" ], - materialsList: [ + "materialsList": [ { - name: "品牌展示", - spec: "首页、主理人介绍与信任内容", + "name": "品牌展示", + "spec": "首页、主理人介绍与信任内容" }, { - name: "餐品管理", - spec: "列表、详情与封面配置", + "name": "餐品管理", + "spec": "列表、详情与封面配置" }, { - name: "需求承接", - spec: "咨询表单与跟进记录", - }, - ], - }, - }, + "name": "需求承接", + "spec": "咨询表单与跟进记录" + } + ] + } + } }, { - kind: "service", - name: "个人编辑型品牌", - summary: "案例沉淀 + 专业表达 + 合作咨询", - categoryKey: "portfolio", - coverUrl: "/assets/cases/editorial.jpg", - priceText: "按需求确认范围与报价", - config: { - spaceType: "个人品牌作品展示与合作咨询", - series: "试点架构原型", - keywords: ["模板演示", "可持续运营", "后台配置"], - details: { - background: - "个人品牌需要将定位、代表作品与合作方式组织成清晰的了解路径。本案例展示编辑型模板的结构,不构成客户合作背书。", - designConcept: - "围绕专业表达与作品沉淀组织页面,让访客先了解品牌与工作方式,再浏览案例细节并提出合作需求。", - crafts: [ + "kind": "service", + "name": "个人编辑型品牌", + "summary": "案例沉淀 + 专业表达 + 合作咨询", + "categoryKey": "portfolio", + "coverUrl": "/assets/cases/editorial.jpg", + "priceText": "按需求确认范围与报价", + "config": { + "spaceType": "个人品牌作品展示与合作咨询", + "series": "试点架构原型", + "keywords": [ + "模板演示", + "可持续运营", + "后台配置" + ], + "details": { + "background": "个人品牌需要将定位、代表作品与合作方式组织成清晰的了解路径。本案例展示编辑型模板的结构,不构成客户合作背书。", + "designConcept": "围绕专业表达与作品沉淀组织页面,让访客先了解品牌与工作方式,再浏览案例细节并提出合作需求。", + "crafts": [ "个人定位、作品与流程可持续更新", "案例详情展示背景、构建思路与交付要点", - "通过咨询入口衔接后续需求沟通", + "通过咨询入口衔接后续需求沟通" ], - materialsList: [ + "materialsList": [ { - name: "专业表达", - spec: "定位、简介与品牌理念", + "name": "专业表达", + "spec": "定位、简介与品牌理念" }, { - name: "作品沉淀", - spec: "案例列表、详情与图片", + "name": "作品沉淀", + "spec": "案例列表、详情与图片" }, { - name: "合作沟通", - spec: "合作说明、咨询表单与跟进记录", - }, - ], - }, - }, - }, + "name": "合作沟通", + "spec": "合作说明、咨询表单与跟进记录" + } + ] + } + } + } ], - trustContent: [ + "trustContent": [ { - type: "credential", - title: "系统基础与合作边界", - content: - "当前已实现两套试点模板、网页内容管理、草稿预览与发布、咨询承接能力。具体交付页面、上线材料、费用、排期与后续支持范围,需要在需求沟通后确认。", - }, + "type": "credential", + "title": "系统基础与合作边界", + "content": "当前已实现两套试点模板、网页内容管理、草稿预览与发布、咨询承接能力。具体交付页面、上线材料、费用、排期与后续支持范围,需要在需求沟通后确认。" + } ], - fields: [ + "fields": [ { - key: "name", - label: "称呼 / 品牌名称", - type: "text", - required: true, + "key": "name", + "label": "称呼 / 品牌名称", + "type": "text", + "required": true }, { - key: "industry", - label: "你的主营领域", - type: "radio", - required: true, - options: [ + "key": "industry", + "label": "你的主营领域", + "type": "radio", + "required": true, + "options": [ { - label: "独立设计 / 建筑", - value: "独立设计 / 建筑", + "label": "独立设计 / 建筑", + "value": "独立设计 / 建筑" }, { - label: "摄影 / 视觉艺术", - value: "摄影 / 视觉艺术", + "label": "摄影 / 视觉艺术", + "value": "摄影 / 视觉艺术" }, { - label: "独立商业咨询", - value: "独立商业咨询", + "label": "独立商业咨询", + "value": "独立商业咨询" }, { - label: "教练 / 身心疗愈", - value: "教练 / 身心疗愈", + "label": "教练 / 身心疗愈", + "value": "教练 / 身心疗愈" }, { - label: "个人 IP / 创作者", - value: "个人 IP / 创作者", + "label": "个人 IP / 创作者", + "value": "个人 IP / 创作者" }, { - label: "精品品牌 / 实体", - value: "精品品牌 / 实体", + "label": "精品品牌 / 实体", + "value": "精品品牌 / 实体" }, { - label: "其他", - value: "其他", - }, - ], + "label": "其他", + "value": "其他" + } + ] }, { - key: "needs", - label: "目前主要诉求与现状", - type: "textarea", - required: true, + "key": "needs", + "label": "目前主要诉求与现状", + "type": "textarea", + "required": true }, { - key: "timeline", - label: "预期启动排期", - type: "radio", - required: false, - options: [ + "key": "timeline", + "label": "预期启动排期", + "type": "radio", + "required": false, + "options": [ { - label: "本月内", - value: "本月内", + "label": "本月内", + "value": "本月内" }, { - label: "下月起", - value: "下月起", + "label": "下月起", + "value": "下月起" }, { - label: "先期评估", - value: "先期评估", - }, - ], + "label": "先期评估", + "value": "先期评估" + } + ] }, { - key: "contact", - label: "联系方式(微信 / 电话)", - type: "text", - required: true, - }, + "key": "contact", + "label": "联系方式(微信 / 电话)", + "type": "text", + "required": true + } ], - capabilityKey: "inquiry", - brandConfig: { - visualPresentation: { - home: { - eyebrow: "独立开发者 · 品牌小程序构建", - title: "把个人品牌做成\n可持续运营的小程序", - subtitle: - "不只是做一个展示页面,而是为你搭建专业展示、内容运营与长期承接咨询的小程序系统。", - primaryAction: "预约咨询 / 聊聊需求", - secondaryAction: "查看服务架构", - featuresTitle: "差异化构建逻辑", - featuresEnglish: "Bespoke System", - casesTitle: "试点架构原型", - casesSubtitle: "验证模板 · 点击进入结构解析", - caseAction: "查看详情架构 →", - audienceTitle: "专属服务群体", - audienceEnglish: "Target Creators", - ctaTitle: "开启你的品牌小程序", - ctaSubtitle: "从策略梳理到上线的一站式交付", - ctaAction: "立即沟通", + "capabilityKey": "inquiry", + "brandConfig": { + "visualPresentation": { + "home": { + "eyebrow": "独立开发者 · 品牌小程序构建", + "title": "把个人品牌做成\n可持续运营的小程序", + "subtitle": "不只是做一个展示页面,而是为你搭建专业展示、内容运营与长期承接咨询的小程序系统。", + "primaryAction": "预约咨询 / 聊聊需求", + "secondaryAction": "查看服务架构", + "featuresTitle": "差异化构建逻辑", + "featuresEnglish": "Bespoke System", + "casesTitle": "试点架构原型", + "casesSubtitle": "验证模板 · 点击进入结构解析", + "caseAction": "查看详情架构 →", + "audienceTitle": "专属服务群体", + "audienceEnglish": "Target Creators", + "ctaTitle": "开启你的品牌小程序", + "ctaSubtitle": "从策略梳理到上线的一站式交付", + "ctaAction": "立即沟通" }, - offerings: { - eyebrow: "完整独立交付 · 匠心构建", - title: "全链路服务与透明协作", - subtitle: "站在产品与长期运营的角度设计,专注交付可持续更新的个人品牌数字资产。", - deliverablesTitle: "交付体系", - deliverablesEnglish: "7 Deliverables", - processTitle: "协作流程", - processEnglish: "5 Phases · 节点透明可溯", - proofTitle: "信任基石", - proofEnglish: "Why bespoke", - ctaTitle: "对流程有疑问?直接聊聊", - ctaSubtitle: "一起梳理当前的品牌数字化需求,评估适合的结构与启动时间。", - ctaAction: "预约需求沟通", + "offerings": { + "eyebrow": "完整独立交付 · 匠心构建", + "title": "全链路服务与透明协作", + "subtitle": "站在产品与长期运营的角度设计,专注交付可持续更新的个人品牌数字资产。", + "deliverablesTitle": "交付体系", + "deliverablesEnglish": "7 Deliverables", + "processTitle": "协作流程", + "processEnglish": "5 Phases · 节点透明可溯", + "proofTitle": "信任基石", + "proofEnglish": "Why bespoke", + "ctaTitle": "对流程有疑问?直接聊聊", + "ctaSubtitle": "一起梳理当前的品牌数字化需求,评估适合的结构与启动时间。", + "ctaAction": "预约需求沟通" }, - profile: { - eyebrow: "个人中心 · 状态与沟通", - title: "我的", - subtitle: "查看咨询记录、发起新咨询,或直接联系主理人。", - inquiryAction: "新增咨询", - timeHint: "约 3 分钟", - wechatLabel: "微信直聊", - copyAction: "复制微信", - contactHint: "尚未配置微信号,可先填写意向单", - promise: "先梳理可行性与时间节点,再确认合作范围", - recordsAction: "查看咨询记录 →", - faqTitle: "常见疑问解答", - faqSubtitle: "把透明与确定性放在第一位,说明合作的常见顾虑与流程。", - footerQuote: "Bespoke digital architecture for clear minds.", - footerNote: "用心打磨每一处体验 · 期待与你的灵感交汇", - recordsTitle: "我的咨询记录", - recordsDescription: "查看提交过的意向和主理人回复状态。", + "profile": { + "eyebrow": "个人中心 · 状态与沟通", + "title": "我的", + "subtitle": "查看咨询记录、发起新咨询,或直接联系主理人。", + "inquiryAction": "新增咨询", + "timeHint": "约 3 分钟", + "wechatLabel": "微信直聊", + "copyAction": "复制微信", + "contactHint": "尚未配置微信号,可先填写意向单", + "promise": "先梳理可行性与时间节点,再确认合作范围", + "recordsAction": "查看咨询记录 →", + "faqTitle": "常见疑问解答", + "faqSubtitle": "把透明与确定性放在第一位,说明合作的常见顾虑与流程。", + "footerQuote": "Bespoke digital architecture for clear minds.", + "footerNote": "用心打磨每一处体验 · 期待与你的灵感交汇", + "recordsTitle": "我的咨询记录", + "recordsDescription": "查看提交过的意向和主理人回复状态。" }, - inquiry: { - eyebrow: "Atelier Note · 品牌意向梳理", - title: "品牌意向梳理 · 3 分钟完成", - subtitle: "用于需求梳理与排期评估,请填写当前业务、目标用户与主要诉求。", - submitLabel: "提交意向 · 预约沟通", - privacyTitle: "信息使用说明", - privacyNote: - "你提交的信息仅用于本次需求评估与后续联系。请勿填写密码、证件号码等敏感信息。", - followupHint: "提交后可在咨询记录中查看状态,具体响应时间以主理人确认为准。", - note: "填写的信息仅用于需求沟通与排期评估。", + "inquiry": { + "eyebrow": "Atelier Note · 品牌意向梳理", + "title": "品牌意向梳理 · 3 分钟完成", + "subtitle": "用于需求梳理与排期评估,请填写当前业务、目标用户与主要诉求。", + "submitLabel": "提交意向 · 预约沟通", + "privacyTitle": "信息使用说明", + "privacyNote": "你提交的信息仅用于本次需求评估与后续联系。请勿填写密码、证件号码等敏感信息。", + "followupHint": "提交后可在咨询记录中查看状态,具体响应时间以主理人确认为准。", + "note": "填写的信息仅用于需求沟通与排期评估。" }, - success: { - eyebrow: "已提交", - title: "意向已送达工坊", - intro: "已收到你的需求清单,将结合业务情况评估可行性,并通过你留下的联系方式沟通。", - recordsAction: "查看咨询记录", - homeAction: "返回首页", + "success": { + "eyebrow": "已提交", + "title": "意向已送达工坊", + "intro": "已收到你的需求清单,将结合业务情况评估可行性,并通过你留下的联系方式沟通。", + "recordsAction": "查看咨询记录", + "homeAction": "返回首页" }, - records: { - title: "我的品牌咨询", - createAction: "填写新需求", - emptyTitle: "还没有咨询记录", - emptyDescription: "提交品牌需求后,可以在这里查看后续跟进状态。", - emptyAction: "填写品牌需求", - }, - detail: { - priceLabel: "合作方式", - spaceLabel: "适用场景", - backgroundTitle: "案例与业务背景", - conceptTitle: "构建思路", - craftsTitle: "交付要点", - materialsTitle: "能力构成", - inquiryAction: "聊聊类似需求", - inquiryHint: "具体范围与报价在需求确认后提供。", + "records": { + "title": "我的品牌咨询", + "createAction": "填写新需求", + "emptyTitle": "还没有咨询记录", + "emptyDescription": "提交品牌需求后,可以在这里查看后续跟进状态。", + "emptyAction": "填写品牌需求" }, + "detail": { + "priceLabel": "合作方式", + "spaceLabel": "适用场景", + "backgroundTitle": "案例与业务背景", + "conceptTitle": "构建思路", + "craftsTitle": "交付要点", + "materialsTitle": "能力构成", + "inquiryAction": "聊聊类似需求", + "inquiryHint": "具体范围与报价在需求确认后提供。" + } }, - atelier: { - badges: [ + "atelier": { + "badges": [ { - title: "完整可交付小程序", + "title": "完整可交付小程序" }, { - title: "支持后台随时更新", + "title": "支持后台随时更新" }, { - title: "支持长期演进", - }, + "title": "支持长期演进" + } ], - features: [ + "features": [ { - tag: "敏捷控制台", - title: "不是静态页面,而是可持续更新的系统", - description: - "拥有独立管理后台,案例作品、核心业务与介绍随时增删修改,让日常更新回归内容本身。", + "tag": "敏捷控制台", + "title": "不是静态页面,而是可持续更新的系统", + "description": "拥有独立管理后台,案例作品、核心业务与介绍随时增删修改,让日常更新回归内容本身。" }, { - tag: "信任转化", - title: "先梳理定位与信任结构", - description: - "优先厘清客户的了解路径与业务背书,从第一屏价值表达,到高意向咨询的承接。", + "tag": "信任转化", + "title": "先梳理定位与信任结构", + "description": "优先厘清客户的了解路径与业务背书,从第一屏价值表达,到高意向咨询的承接。" }, { - tag: "陪伴演进", - title: "交付之后,支持长期迭代", - description: "从上线协助到阶段性功能扩展,让品牌载体伴随业务持续成长。", - }, + "tag": "陪伴演进", + "title": "交付之后,支持长期迭代", + "description": "从上线协助到阶段性功能扩展,让品牌载体伴随业务持续成长。" + } ], - audiences: [ + "audiences": [ { - symbol: "◎", - title: "摄影师", - description: "样片沉淀", + "symbol": "◎", + "title": "摄影师", + "description": "样片沉淀" }, { - symbol: "◇", - title: "咨询顾问", - description: "信任转化", + "symbol": "◇", + "title": "咨询顾问", + "description": "信任转化" }, { - symbol: "✎", - title: "独立设计", - description: "作品展呈", + "symbol": "✎", + "title": "独立设计", + "description": "作品展呈" }, { - symbol: "↗", - title: "教练疗愈", - description: "需求预约", + "symbol": "↗", + "title": "教练疗愈", + "description": "需求预约" }, { - symbol: "▤", - title: "IP 创作者", - description: "私域载体", + "symbol": "▤", + "title": "IP 创作者", + "description": "私域载体" }, { - symbol: "⌂", - title: "小微实体", - description: "产品看板", - }, + "symbol": "⌂", + "title": "小微实体", + "description": "产品看板" + } ], - deliverables: [ + "deliverables": [ { - title: "品牌定位梳理", - tag: "清晰聚焦", - description: "提炼核心专长与目标客户画像,明确小程序核心诉求与转化路径。", + "title": "品牌定位梳理", + "tag": "清晰聚焦", + "description": "提炼核心专长与目标客户画像,明确小程序核心诉求与转化路径。" }, { - title: "页面结构设计", - tag: "信任动线", - description: "梳理信息架构与信任动线,建立递进式了解路径。", + "title": "页面结构设计", + "tag": "信任动线", + "description": "梳理信息架构与信任动线,建立递进式了解路径。" }, { - title: "小程序视觉设计", - tag: "克制美学", - description: "结合微信使用习惯设计界面,用精致排版强化专业辨识度。", + "title": "小程序视觉设计", + "tag": "克制美学", + "description": "结合微信使用习惯设计界面,用精致排版强化专业辨识度。" }, { - title: "内容字段规划", - tag: "结构资产", - description: "规范案例、服务与常见问题字段,让内容持续沉淀。", + "title": "内容字段规划", + "tag": "结构资产", + "description": "规范案例、服务与常见问题字段,让内容持续沉淀。" }, { - title: "后台管理配置", - tag: "自主维护", - description: "通过网页后台修改内容、上传图片,保存为草稿,确认后发布。", + "title": "后台管理配置", + "tag": "自主维护", + "description": "通过网页后台修改内容、上传图片,保存为草稿,确认后发布。" }, { - title: "发布上线协助", - tag: "上线协作", - description: "协助准备微信主体与类目材料、配置和提审,审核结果以微信平台为准。", + "title": "发布上线协助", + "tag": "上线协作", + "description": "协助准备微信主体与类目材料、配置和提审,审核结果以微信平台为准。" }, { - title: "后续运营支持", - tag: "长期支持", - description: "提供操作说明与迭代建议,具体支持范围在合作时确认。", - }, + "title": "后续运营支持", + "tag": "长期支持", + "description": "提供操作说明与迭代建议,具体支持范围在合作时确认。" + } ], - process: [ + "process": [ { - title: "需求沟通", - description: "交流专业背景、获客渠道与核心需求,评估可行性与排期。", + "title": "需求沟通", + "description": "交流专业背景、获客渠道与核心需求,评估可行性与排期。" }, { - title: "品牌结构梳理", - description: "提炼品牌关键词与信息架构,统一页面目标。", + "title": "品牌结构梳理", + "description": "提炼品牌关键词与信息架构,统一页面目标。" }, { - title: "界面设计确认", - description: "确认原型、视觉、排版与交互细节。", + "title": "界面设计确认", + "description": "确认原型、视觉、排版与交互细节。" }, { - title: "内容配置与上线", - description: "录入案例与服务资料,联调、提审并协助发布。", + "title": "内容配置与上线", + "description": "录入案例与服务资料,联调、提审并协助发布。" }, { - title: "长期演进迭代", - description: "根据反馈完善内容,按约定范围迭代功能。", - }, + "title": "长期演进迭代", + "description": "根据反馈完善内容,按约定范围迭代功能。" + } ], - proofs: [ + "proofs": [ { - title: "已有系统基础", - description: "两套试点模板验证展示、配置与咨询链路。", + "title": "已有系统基础", + "description": "两套试点模板验证展示、配置与咨询链路。" }, { - title: "支持后台管理", - description: "内容由品牌自行维护,草稿确认后再发布。", + "title": "支持后台管理", + "description": "内容由品牌自行维护,草稿确认后再发布。" }, { - title: "模块化扩展", - description: "复用稳定的系统能力,按需求扩展页面与服务。", + "title": "模块化扩展", + "description": "复用稳定的系统能力,按需求扩展页面与服务。" }, { - title: "定位先于视觉", - description: "先说明你是谁、为谁服务、为什么值得信任。", + "title": "定位先于视觉", + "description": "先说明你是谁、为谁服务、为什么值得信任。" }, { - title: "直接沟通与持续支持", - description: "独立主理人直接对接,合作边界与后续支持提前确认。", - }, + "title": "直接沟通与持续支持", + "description": "独立主理人直接对接,合作边界与后续支持提前确认。" + } ], - faqs: [ + "faqs": [ { - title: "还没整理好品牌文案,可以开始吗?", - description: - "可以先沟通。第一阶段一起梳理定位、核心业务与已有素材,再确定需要补齐的内容。", + "title": "还没整理好品牌文案,可以开始吗?", + "description": "可以先沟通。第一阶段一起梳理定位、核心业务与已有素材,再确定需要补齐的内容。" }, { - title: "后续内容可以自己修改吗?", - description: - "可以通过网页管理后台维护简介、案例、服务与表单。保存先形成草稿,确认并发布后,公开小程序才更新。", + "title": "后续内容可以自己修改吗?", + "description": "可以通过网页管理后台维护简介、案例、服务与表单。保存先形成草稿,确认并发布后,公开小程序才更新。" }, { - title: "可以先做轻量版本验证吗?", - description: - "可以。优先用展示、服务介绍与意向咨询等核心页面验证需求,再依据反馈扩展。", + "title": "可以先做轻量版本验证吗?", + "description": "可以。优先用展示、服务介绍与意向咨询等核心页面验证需求,再依据反馈扩展。" }, { - title: "设计和上线怎么配合?", - description: - "需求对齐、结构梳理、视觉确认、内容配置与上线分阶段推进。微信认证与审核由平台决定,所需材料和分工提前确认。", - }, + "title": "设计和上线怎么配合?", + "description": "需求对齐、结构梳理、视觉确认、内容配置与上线分阶段推进。微信认证与审核由平台决定,所需材料和分工提前确认。" + } ], - identity: { - status: "当前可接新项目", - experience: "10 年", - tags: [ + "identity": { + "status": "当前可接新项目", + "experience": "10 年", + "tags": [ { - title: "大屏可视化", + "title": "大屏可视化" }, { - title: "小程序", - }, - ], - }, + "title": "小程序" + } + ] + } }, - founder: "林予 · 示例主理人", - title: "产品设计 / 全栈开发", - }, + "founder": "林予 · 示例主理人", + "title": "产品设计 / 全栈开发" + } }, - safety: { - submissions: "disabled", - customerRecords: "disabled", - contactActions: "disabled", - }, - }, + "safety": { + "submissions": "disabled", + "customerRecords": "disabled", + "contactActions": "disabled" + } + } }, - visualTemplateKey: "atelier-solopreneur", + "visualTemplateKey": "atelier-solopreneur" }, { - packageKey: "linjing-editorial", - version: "1.0.4", - displayName: "林境建筑画册", - defaultBrandSlug: "linjing-doors", - runtimeContract: "1.0", - supportedIndustryTemplates: ["personal", "doors"], - entrypoints: { - home: "pages/index/index", - offerings: "pages/services/index", - detail: "pages/offering/detail", - inquiry: "pages/inquiry/index", - success: "pages/inquiry-success/index", - records: "pages/records/index", - profile: "pages/bookings/index", + "packageKey": "linjing-editorial", + "version": "1.0.5", + "displayName": "林境建筑画册", + "defaultBrandSlug": "linjing-doors", + "runtimeContract": "1.0", + "supportedIndustryTemplates": [ + "personal", + "doors" + ], + "entrypoints": { + "home": "pages/index/index", + "offerings": "pages/services/index", + "detail": "pages/offering/detail", + "inquiry": "pages/inquiry/index", + "success": "pages/inquiry-success/index", + "records": "pages/records/index", + "profile": "pages/bookings/index" }, - navigation: [ + "navigation": [ { - key: "home", - label: "首页", - page: "home", - iconPath: "assets/tab/home.png", - selectedIconPath: "assets/tab/home-selected.png", + "key": "home", + "label": "首页", + "page": "home", + "iconPath": "assets/tab/home.png", + "selectedIconPath": "assets/tab/home-selected.png" }, { - key: "offerings", - label: "案例与体系", - page: "offerings", - iconPath: "assets/tab/works.png", - selectedIconPath: "assets/tab/works-selected.png", + "key": "offerings", + "label": "案例与体系", + "page": "offerings", + "iconPath": "assets/tab/works.png", + "selectedIconPath": "assets/tab/works-selected.png" }, { - key: "profile", - label: "主理人与我", - page: "profile", - iconPath: "assets/tab/profile.png", - selectedIconPath: "assets/tab/profile-selected.png", - }, + "key": "profile", + "label": "主理人与我", + "page": "profile", + "iconPath": "assets/tab/profile.png", + "selectedIconPath": "assets/tab/profile-selected.png" + } ], - requiredCapabilities: ["offerings", "inquiry"], - dataSlots: [ - { - key: "brand.identity", - source: "brand", - required: true, - description: "品牌名称、主理人和公开联系方式", - }, - { - key: "brand.hero", - source: "brand", - required: true, - description: "建筑项目或产品系统的首页表达", - }, - { - key: "trust.proof", - source: "trust", - required: true, - description: "资质、方法、项目经验和履约说明", - }, - { - key: "offerings.list", - source: "offering", - required: true, - description: "门系统案例和服务体系", - }, - { - key: "offering.detail", - source: "offering", - required: true, - description: "单个项目案例的完整介绍", - }, - { - key: "inquiry.form", - source: "inquiry", - required: true, - description: "私宅门系统咨询问题", - }, - { - key: "records.items", - source: "records", - required: true, - description: "访客自己的咨询记录", - }, + "requiredCapabilities": [ + "offerings", + "inquiry" ], - templateFields: [ + "dataSlots": [ { - key: "designPhilosophy", - page: "home", - binding: "brand.config.templateData.designPhilosophy", - previewTarget: "editorial.home.hero", - label: "设计理念", - help: "用一两句话说明你的设计方法。", - input: "textarea", - maxLength: 160, - placeholder: "例如:克制、自然、长期主义", + "key": "brand.identity", + "source": "brand", + "required": true, + "description": "品牌名称、主理人和公开联系方式" }, + { + "key": "brand.hero", + "source": "brand", + "required": true, + "description": "建筑项目或产品系统的首页表达" + }, + { + "key": "trust.proof", + "source": "trust", + "required": true, + "description": "资质、方法、项目经验和履约说明" + }, + { + "key": "offerings.list", + "source": "offering", + "required": true, + "description": "门系统案例和服务体系" + }, + { + "key": "offering.detail", + "source": "offering", + "required": true, + "description": "单个项目案例的完整介绍" + }, + { + "key": "inquiry.form", + "source": "inquiry", + "required": true, + "description": "私宅门系统咨询问题" + }, + { + "key": "records.items", + "source": "records", + "required": true, + "description": "访客自己的咨询记录" + } ], - assetSlots: [ + "templateFields": [ { - key: "brand.portrait", - binding: "brand.avatarUrl", - target: "brand", - label: "主理人肖像", - help: "用于主理人与我页面,建议使用正式、清晰的照片。", - required: false, - kind: "portrait", - aspectRatio: "1:1", - }, - { - key: "brand.projectHero", - binding: "brand.config.heroImage", - target: "brand", - label: "首页项目主图", - help: "展示真实别墅、入户门或空间细节,体现品牌审美和项目能力。", - required: true, - kind: "image", - aspectRatio: "16:9", - }, - { - key: "offering.cover", - binding: "offering.coverUrl", - target: "offering", - label: "案例封面", - help: "每个案例使用一张项目实拍或可信效果图。", - required: true, - kind: "image", - aspectRatio: "4:3", - }, + "key": "designPhilosophy", + "page": "home", + "binding": "brand.config.templateData.designPhilosophy", + "previewTarget": "editorial.home.hero", + "label": "设计理念", + "help": "用一两句话说明你的设计方法。", + "input": "textarea", + "maxLength": 160, + "placeholder": "例如:克制、自然、长期主义" + } ], - admin: { - sections: [ + "assetSlots": [ + { + "key": "brand.portrait", + "binding": "brand.avatarUrl", + "target": "brand", + "label": "主理人肖像", + "help": "用于主理人与我页面,建议使用正式、清晰的照片。", + "required": false, + "kind": "portrait", + "aspectRatio": "1:1" + }, + { + "key": "brand.projectHero", + "binding": "brand.config.heroImage", + "target": "brand", + "label": "首页项目主图", + "help": "展示真实别墅、入户门或空间细节,体现品牌审美和项目能力。", + "required": true, + "kind": "image", + "aspectRatio": "16:9" + }, + { + "key": "offering.cover", + "binding": "offering.coverUrl", + "target": "offering", + "label": "案例封面", + "help": "每个案例使用一张项目实拍或可信效果图。", + "required": true, + "kind": "image", + "aspectRatio": "4:3" + } + ], + "admin": { + "sections": [ { - key: "identity", - title: "主理人与联系方式", - description: "让业主清楚谁负责项目,以及如何联系你。", - page: "profile", - target: "brand", - fields: [ + "key": "identity", + "title": "主理人与联系方式", + "description": "让业主清楚谁负责项目,以及如何联系你。", + "page": "profile", + "target": "brand", + "fields": [ { - key: "founder", - binding: "brand.config.founder", - label: "主理人姓名", - input: "text", - required: true, - previewTarget: "linjing-editorial.profile.identity", + "key": "founder", + "binding": "brand.config.founder", + "label": "主理人姓名", + "input": "text", + "required": true, + "previewTarget": "linjing-editorial.profile.identity" }, { - key: "title", - binding: "brand.config.title", - label: "身份或职位", - input: "text", - required: true, - placeholder: "例如:别墅门系统主理人", - previewTarget: "linjing-editorial.profile.identity", + "key": "title", + "binding": "brand.config.title", + "label": "身份或职位", + "input": "text", + "required": true, + "placeholder": "例如:别墅门系统主理人", + "previewTarget": "linjing-editorial.profile.identity" }, { - key: "avatarUrl", - binding: "brand.avatarUrl", - label: "主理人头像", - input: "image", - previewTarget: "linjing-editorial.profile.identity", - help: "共享品牌资料,修改后同步影响其他展示位置。", + "key": "avatarUrl", + "binding": "brand.avatarUrl", + "label": "主理人头像", + "input": "image", + "previewTarget": "linjing-editorial.profile.identity", + "help": "共享品牌资料,修改后同步影响其他展示位置。" }, { - key: "contactPhone", - binding: "brand.contactPhone", - label: "联系电话", - input: "phone", - previewTarget: "linjing-editorial.profile.identity", - help: "共享品牌资料,修改后同步影响其他展示位置。", + "key": "contactPhone", + "binding": "brand.contactPhone", + "label": "联系电话", + "input": "phone", + "previewTarget": "linjing-editorial.profile.identity", + "help": "共享品牌资料,修改后同步影响其他展示位置。" }, { - key: "contactWechat", - binding: "brand.contactWechat", - label: "联系微信", - input: "text", - previewTarget: "linjing-editorial.profile.identity", - help: "共享品牌资料,修改后同步影响其他展示位置。", + "key": "contactWechat", + "binding": "brand.contactWechat", + "label": "联系微信", + "input": "text", + "previewTarget": "linjing-editorial.profile.identity", + "help": "共享品牌资料,修改后同步影响其他展示位置。" }, { - key: "address", - binding: "brand.address", - label: "联系地址", - input: "text", - previewTarget: "linjing-editorial.profile.identity", - help: "共享品牌资料,修改后同步影响其他展示位置。", - }, + "key": "address", + "binding": "brand.address", + "label": "联系地址", + "input": "text", + "previewTarget": "linjing-editorial.profile.identity", + "help": "共享品牌资料,修改后同步影响其他展示位置。" + } ], - previewTargets: [ + "previewTargets": [ { - key: "linjing-editorial.profile.identity", - label: "主理人与联系方式", - }, - ], + "key": "linjing-editorial.profile.identity", + "label": "主理人与联系方式" + } + ] }, { - key: "homeOffering", - title: "首页业务卡片", - description: "点选预览中的单条内容,修改对应业务记录。", - page: "home", - target: "offering", - fields: [ + "key": "homeOffering", + "title": "首页业务卡片", + "description": "点选预览中的单条内容,修改对应业务记录。", + "page": "home", + "target": "offering", + "fields": [ { - key: "name", - binding: "offering.name", - label: "名称", - input: "text", - previewTarget: "linjing-editorial.home.offering", + "key": "name", + "binding": "offering.name", + "label": "名称", + "input": "text", + "previewTarget": "linjing-editorial.home.offering" }, { - key: "coverUrl", - binding: "offering.coverUrl", - label: "封面图片", - input: "image", - previewTarget: "linjing-editorial.home.offering", + "key": "coverUrl", + "binding": "offering.coverUrl", + "label": "封面图片", + "input": "image", + "previewTarget": "linjing-editorial.home.offering" }, { - key: "detailHero", - binding: "offering.config.detailHero", - label: "详情主图", - input: "image", - previewTarget: "linjing-editorial.home.offering", - help: "此图优先用于卡片和详情;未填写时使用封面图片。", + "key": "detailHero", + "binding": "offering.config.detailHero", + "label": "详情主图", + "input": "image", + "previewTarget": "linjing-editorial.home.offering", + "help": "此图优先用于卡片和详情;未填写时使用封面图片。" }, { - key: "categoryLabel", - binding: "offering.config.categoryKey", - label: "案例类别", - input: "select", - options: [ + "key": "categoryLabel", + "binding": "offering.config.categoryKey", + "label": "案例类别", + "input": "select", + "options": [ { - value: "entrance-door", - label: "入户大门", + "value": "entrance-door", + "label": "入户大门" }, { - value: "garden-door", - label: "庭院围墙门", + "value": "garden-door", + "label": "庭院围墙门" }, { - value: "interior-door", - label: "室内户内门", + "value": "interior-door", + "label": "室内户内门" }, { - value: "stealth-door", - label: "装饰隐形门", + "value": "stealth-door", + "label": "装饰隐形门" }, { - value: "custom", - label: "设计咨询", - }, + "value": "custom", + "label": "设计咨询" + } ], - previewTarget: "linjing-editorial.home.offering", + "previewTarget": "linjing-editorial.home.offering" }, { - key: "area", - binding: "offering.config.area", - label: "项目地点", - input: "text", - previewTarget: "linjing-editorial.home.offering", + "key": "area", + "binding": "offering.config.area", + "label": "项目地点", + "input": "text", + "previewTarget": "linjing-editorial.home.offering" }, { - key: "series", - binding: "offering.config.series", - label: "产品系列", - input: "text", - previewTarget: "linjing-editorial.home.offering", + "key": "series", + "binding": "offering.config.series", + "label": "产品系列", + "input": "text", + "previewTarget": "linjing-editorial.home.offering" }, { - key: "keywords", - binding: "offering.config.keywords", - label: "项目关键词", - input: "list", - itemValueKey: "value", - itemFields: [ + "key": "keywords", + "binding": "offering.config.keywords", + "label": "项目关键词", + "input": "list", + "itemValueKey": "value", + "itemFields": [ { - key: "value", - label: "关键词", - }, + "key": "value", + "label": "关键词" + } ], - previewTarget: "linjing-editorial.home.offering", - }, + "previewTarget": "linjing-editorial.home.offering" + } ], - previewTargets: [ + "previewTargets": [ { - key: "linjing-editorial.home.offering", - label: "首页业务卡片", - }, - ], + "key": "linjing-editorial.home.offering", + "label": "首页业务卡片" + } + ] }, { - key: "home", - title: "首页品牌表达", - description: "用简洁的语言解释你的项目方法、代表作品和合作流程。", - page: "home", - target: "brand", - previewTargets: [ + "key": "home", + "title": "首页品牌表达", + "description": "用简洁的语言解释你的项目方法、代表作品和合作流程。", + "page": "home", + "target": "brand", + "previewTargets": [ { - key: "editorial.home.identity", - label: "主理人介绍", + "key": "editorial.home.identity", + "label": "主理人介绍" }, { - key: "editorial.home.hero", - label: "首页主视觉", + "key": "editorial.home.hero", + "label": "首页主视觉" }, { - key: "editorial.home.proof", - label: "信任介绍", + "key": "editorial.home.proof", + "label": "信任介绍" }, { - key: "editorial.home.manifesto", - label: "品牌主张", + "key": "editorial.home.manifesto", + "label": "品牌主张" }, { - key: "editorial.home.works", - label: "代表案例标题", + "key": "editorial.home.works", + "label": "代表案例标题" }, { - key: "linjing-editorial.home.home", - label: "首页品牌表达", - composite: true, - children: [ + "key": "linjing-editorial.home.home", + "label": "首页品牌表达", + "composite": true, + "children": [ "editorial.home.identity", "editorial.home.hero", "editorial.home.proof", "editorial.home.manifesto", "editorial.home.works", "editorial.home.flow", - "linjing-editorial.home.offering", - ], + "linjing-editorial.home.offering" + ] }, { - key: "editorial.home.flow", - label: "合作流程标题", - }, + "key": "editorial.home.flow", + "label": "合作流程标题" + } ], - fields: [ + "fields": [ { - key: "founderBadge", - previewTarget: "editorial.home.identity", - binding: "brand.config.visualPresentation.home.founderBadge", - label: "主理人标签", - input: "text", - placeholder: "例如:亲自主理 / 10 年经验", + "key": "founderBadge", + "previewTarget": "editorial.home.identity", + "binding": "brand.config.visualPresentation.home.founderBadge", + "label": "主理人标签", + "input": "text", + "placeholder": "例如:亲自主理 / 10 年经验" }, { - key: "heroImage", - previewTarget: "editorial.home.hero", - binding: "brand.config.heroImage", - label: "首页项目主图", - help: "展示真实别墅、入户门或空间细节,体现项目能力。", - input: "image", - required: true, + "key": "heroImage", + "previewTarget": "editorial.home.hero", + "binding": "brand.config.heroImage", + "label": "首页项目主图", + "help": "展示真实别墅、入户门或空间细节,体现项目能力。", + "input": "image", + "required": true }, { - key: "proofTitle", - previewTarget: "editorial.home.proof", - binding: "brand.config.visualPresentation.home.proofTitle", - label: "信任介绍标题", - input: "text", + "key": "proofTitle", + "previewTarget": "editorial.home.proof", + "binding": "brand.config.visualPresentation.home.proofTitle", + "label": "信任介绍标题", + "input": "text" }, { - key: "proofEyebrow", - previewTarget: "editorial.home.proof", - binding: "brand.config.visualPresentation.home.proofEyebrow", - label: "信任介绍小标题", - input: "text", + "key": "proofEyebrow", + "previewTarget": "editorial.home.proof", + "binding": "brand.config.visualPresentation.home.proofEyebrow", + "label": "信任介绍小标题", + "input": "text" }, { - key: "manifestoEyebrow", - previewTarget: "editorial.home.manifesto", - binding: "brand.config.visualPresentation.home.manifestoEyebrow", - label: "品牌主张小标题", - input: "text", + "key": "manifestoEyebrow", + "previewTarget": "editorial.home.manifesto", + "binding": "brand.config.visualPresentation.home.manifestoEyebrow", + "label": "品牌主张小标题", + "input": "text" }, { - key: "manifestoTitle", - previewTarget: "editorial.home.manifesto", - binding: "brand.config.visualPresentation.home.manifestoTitle", - label: "品牌主张", - input: "text", + "key": "manifestoTitle", + "previewTarget": "editorial.home.manifesto", + "binding": "brand.config.visualPresentation.home.manifestoTitle", + "label": "品牌主张", + "input": "text" }, { - key: "worksEyebrow", - previewTarget: "editorial.home.works", - binding: "brand.config.visualPresentation.home.worksEyebrow", - label: "代表案例小标题", - input: "text", + "key": "worksEyebrow", + "previewTarget": "editorial.home.works", + "binding": "brand.config.visualPresentation.home.worksEyebrow", + "label": "代表案例小标题", + "input": "text" }, { - key: "worksTitle", - previewTarget: "editorial.home.works", - binding: "brand.config.visualPresentation.home.worksTitle", - label: "代表案例标题", - input: "text", + "key": "worksTitle", + "previewTarget": "editorial.home.works", + "binding": "brand.config.visualPresentation.home.worksTitle", + "label": "代表案例标题", + "input": "text" }, { - key: "worksAction", - binding: "brand.config.visualPresentation.home.worksAction", - label: "查看案例入口", - input: "text", - previewTarget: "editorial.home.works", + "key": "worksAction", + "binding": "brand.config.visualPresentation.home.worksAction", + "label": "查看案例入口", + "input": "text", + "previewTarget": "editorial.home.works" }, { - key: "flowEyebrow", - binding: "brand.config.visualPresentation.home.flowEyebrow", - label: "合作流程小标题", - input: "text", - previewTarget: "editorial.home.flow", + "key": "flowEyebrow", + "binding": "brand.config.visualPresentation.home.flowEyebrow", + "label": "合作流程小标题", + "input": "text", + "previewTarget": "editorial.home.flow" }, { - key: "flowTitle", - binding: "brand.config.visualPresentation.home.flowTitle", - label: "项目流程标题", - input: "text", - previewTarget: "editorial.home.flow", + "key": "flowTitle", + "binding": "brand.config.visualPresentation.home.flowTitle", + "label": "项目流程标题", + "input": "text", + "previewTarget": "editorial.home.flow" }, { - key: "heroTitle", - binding: "brand.config.homeHero.title", - label: "首页主标题", - input: "text", - previewTarget: "editorial.home.hero", + "key": "heroTitle", + "binding": "brand.config.homeHero.title", + "label": "首页主标题", + "input": "text", + "previewTarget": "editorial.home.hero" }, { - key: "heroEyebrow", - binding: "brand.config.homeHero.eyebrow", - label: "主图项目标注", - input: "text", - previewTarget: "editorial.home.hero", + "key": "heroEyebrow", + "binding": "brand.config.homeHero.eyebrow", + "label": "主图项目标注", + "input": "text", + "previewTarget": "editorial.home.hero" }, { - key: "heroDescription", - binding: "brand.config.homeHero.slogan", - label: "首页主图说明", - input: "textarea", - previewTarget: "editorial.home.hero", + "key": "heroDescription", + "binding": "brand.config.homeHero.slogan", + "label": "首页主图说明", + "input": "textarea", + "previewTarget": "editorial.home.hero" }, { - key: "heroAction", - binding: "brand.config.homeHero.cta", - label: "主图行动文字", - input: "text", - previewTarget: "editorial.home.hero", + "key": "heroAction", + "binding": "brand.config.homeHero.cta", + "label": "主图行动文字", + "input": "text", + "previewTarget": "editorial.home.hero" }, { - key: "avatarUrl", - binding: "brand.avatarUrl", - label: "主理人头像", - input: "image", - previewTarget: "editorial.home.identity", - help: "共享品牌资料,修改后同步影响其他展示位置。", + "key": "avatarUrl", + "binding": "brand.avatarUrl", + "label": "主理人头像", + "input": "image", + "previewTarget": "editorial.home.identity", + "help": "共享品牌资料,修改后同步影响其他展示位置。" }, { - key: "founder", - binding: "brand.config.founder", - label: "主理人姓名", - input: "text", - previewTarget: "editorial.home.identity", - help: "共享品牌资料,修改后同步影响其他展示位置。", + "key": "founder", + "binding": "brand.config.founder", + "label": "主理人姓名", + "input": "text", + "previewTarget": "editorial.home.identity", + "help": "共享品牌资料,修改后同步影响其他展示位置。" }, { - key: "title", - binding: "brand.config.title", - label: "身份或职位", - input: "text", - previewTarget: "editorial.home.identity", - help: "共享品牌资料,修改后同步影响其他展示位置。", + "key": "title", + "binding": "brand.config.title", + "label": "身份或职位", + "input": "text", + "previewTarget": "editorial.home.identity", + "help": "共享品牌资料,修改后同步影响其他展示位置。" }, { - key: "description", - binding: "brand.description", - label: "主理人简介", - input: "textarea", - previewTarget: "editorial.home.identity", - help: "共享品牌资料,修改后同步影响其他展示位置。", + "key": "description", + "binding": "brand.description", + "label": "主理人简介", + "input": "textarea", + "previewTarget": "editorial.home.identity", + "help": "共享品牌资料,修改后同步影响其他展示位置。" }, { - key: "heroFallback_name", - binding: "brand.name", - label: "备用主标题(品牌名称)", - input: "text", - previewTarget: "editorial.home.hero", - help: "共享品牌值;对应主图文案为空时使用。", + "key": "heroFallback_name", + "binding": "brand.name", + "label": "备用主标题(品牌名称)", + "input": "text", + "previewTarget": "editorial.home.hero", + "help": "共享品牌值;对应主图文案为空时使用。" }, { - key: "heroFallback_tagline", - binding: "brand.tagline", - label: "备用标注(品牌标语)", - input: "text", - previewTarget: "editorial.home.hero", - help: "共享品牌值;对应主图文案为空时使用。", + "key": "heroFallback_tagline", + "binding": "brand.tagline", + "label": "备用标注(品牌标语)", + "input": "text", + "previewTarget": "editorial.home.hero", + "help": "共享品牌值;对应主图文案为空时使用。" }, { - key: "heroFallback_description", - binding: "brand.description", - label: "备用说明(品牌简介)", - input: "text", - previewTarget: "editorial.home.hero", - help: "共享品牌值;对应主图文案为空时使用。", - }, - ], + "key": "heroFallback_description", + "binding": "brand.description", + "label": "备用说明(品牌简介)", + "input": "text", + "previewTarget": "editorial.home.hero", + "help": "共享品牌值;对应主图文案为空时使用。" + } + ] }, { - key: "profileDetails", - title: "服务区域与履约说明", - description: "在主理人与我页面说明可服务的地区和真实履约承诺。", - page: "profile", - target: "brand", - fields: [ + "key": "profileDetails", + "title": "服务区域与履约说明", + "description": "在主理人与我页面说明可服务的地区和真实履约承诺。", + "page": "profile", + "target": "brand", + "fields": [ { - key: "coverage", - binding: "brand.config.profilePresentation.coverage", - label: "服务区域", - input: "list", - itemFields: [ + "key": "coverage", + "binding": "brand.config.profilePresentation.coverage", + "label": "服务区域", + "input": "list", + "itemFields": [ { - key: "title", - label: "区域名称", + "key": "title", + "label": "区域名称" }, { - key: "content", - label: "服务说明", - input: "textarea", - }, + "key": "content", + "label": "服务说明", + "input": "textarea" + } ], - previewTarget: "linjing-editorial.profile.coverage", + "previewTarget": "linjing-editorial.profile.coverage" }, { - key: "warranty", - binding: "brand.config.profilePresentation.warranty", - label: "履约与维护说明", - input: "list", - itemValueKey: "value", - itemFields: [ + "key": "warranty", + "binding": "brand.config.profilePresentation.warranty", + "label": "履约与维护说明", + "input": "list", + "itemValueKey": "value", + "itemFields": [ { - key: "value", - label: "承诺内容", - input: "textarea", - }, + "key": "value", + "label": "承诺内容", + "input": "textarea" + } ], - previewTarget: "linjing-editorial.profile.warranty", + "previewTarget": "linjing-editorial.profile.warranty" }, { - key: "recordsTitle", - binding: "brand.config.visualPresentation.profile.recordsTitle", - label: "咨询记录入口标题", - input: "text", - previewTarget: "linjing-editorial.profile.records", + "key": "recordsTitle", + "binding": "brand.config.visualPresentation.profile.recordsTitle", + "label": "咨询记录入口标题", + "input": "text", + "previewTarget": "linjing-editorial.profile.records" }, { - key: "recordsSubtitle", - binding: "brand.config.visualPresentation.profile.recordsSubtitle", - label: "咨询记录入口说明", - input: "textarea", - previewTarget: "linjing-editorial.profile.records", + "key": "recordsSubtitle", + "binding": "brand.config.visualPresentation.profile.recordsSubtitle", + "label": "咨询记录入口说明", + "input": "textarea", + "previewTarget": "linjing-editorial.profile.records" }, { - key: "coverageTitle", - binding: "brand.config.visualPresentation.profile.coverageTitle", - label: "服务区域标题", - input: "text", - previewTarget: "linjing-editorial.profile.coverage", + "key": "coverageTitle", + "binding": "brand.config.visualPresentation.profile.coverageTitle", + "label": "服务区域标题", + "input": "text", + "previewTarget": "linjing-editorial.profile.coverage" }, { - key: "warrantyTitle", - binding: "brand.config.visualPresentation.profile.warrantyTitle", - label: "履约说明标题", - input: "text", - previewTarget: "linjing-editorial.profile.warranty", + "key": "warrantyTitle", + "binding": "brand.config.visualPresentation.profile.warrantyTitle", + "label": "履约说明标题", + "input": "text", + "previewTarget": "linjing-editorial.profile.warranty" }, { - key: "phoneLabel", - binding: "brand.config.visualPresentation.profile.phoneLabel", - label: "电话标签", - input: "text", - previewTarget: "linjing-editorial.profile.identity", + "key": "phoneLabel", + "binding": "brand.config.visualPresentation.profile.phoneLabel", + "label": "电话标签", + "input": "text", + "previewTarget": "linjing-editorial.profile.identity" }, { - key: "wechatLabel", - binding: "brand.config.visualPresentation.profile.wechatLabel", - label: "微信标签", - input: "text", - previewTarget: "linjing-editorial.profile.identity", + "key": "wechatLabel", + "binding": "brand.config.visualPresentation.profile.wechatLabel", + "label": "微信标签", + "input": "text", + "previewTarget": "linjing-editorial.profile.identity" }, { - key: "addressLabel", - binding: "brand.config.visualPresentation.profile.addressLabel", - label: "地址标签", - input: "text", - previewTarget: "linjing-editorial.profile.identity", + "key": "addressLabel", + "binding": "brand.config.visualPresentation.profile.addressLabel", + "label": "地址标签", + "input": "text", + "previewTarget": "linjing-editorial.profile.identity" }, { - key: "callAction", - binding: "brand.config.visualPresentation.profile.callAction", - label: "拨打电话按钮", - input: "text", - previewTarget: "linjing-editorial.profile.identity", + "key": "callAction", + "binding": "brand.config.visualPresentation.profile.callAction", + "label": "拨打电话按钮", + "input": "text", + "previewTarget": "linjing-editorial.profile.identity" }, { - key: "copyAction", - binding: "brand.config.visualPresentation.profile.copyAction", - label: "复制微信按钮", - input: "text", - previewTarget: "linjing-editorial.profile.identity", + "key": "copyAction", + "binding": "brand.config.visualPresentation.profile.copyAction", + "label": "复制微信按钮", + "input": "text", + "previewTarget": "linjing-editorial.profile.identity" }, { - key: "recordsCountUnit", - binding: "brand.config.visualPresentation.profile.recordsCountUnit", - label: "记录数量单位", - input: "text", - previewTarget: "linjing-editorial.profile.identity", - }, + "key": "recordsCountUnit", + "binding": "brand.config.visualPresentation.profile.recordsCountUnit", + "label": "记录数量单位", + "input": "text", + "previewTarget": "linjing-editorial.profile.identity" + } ], - previewTargets: [ + "previewTargets": [ { - key: "linjing-editorial.profile.profileDetails", - label: "主理人页面", - composite: true, - children: [ + "key": "linjing-editorial.profile.profileDetails", + "label": "主理人页面", + "composite": true, + "children": [ "linjing-editorial.profile.identity", "linjing-editorial.profile.records", "linjing-editorial.profile.coverage", - "linjing-editorial.profile.warranty", + "linjing-editorial.profile.warranty" + ] + }, + { + "key": "linjing-editorial.profile.records", + "label": "咨询记录入口" + }, + { + "key": "linjing-editorial.profile.coverage", + "label": "服务区域" + }, + { + "key": "linjing-editorial.profile.warranty", + "label": "履约说明" + } + ] + }, + { + "key": "offeringsOffering", + "title": "业务卡片", + "description": "点选预览中的单条内容,修改对应业务记录。", + "page": "offerings", + "target": "offering", + "fields": [ + { + "key": "name", + "binding": "offering.name", + "label": "名称", + "input": "text", + "previewTarget": "linjing-editorial.offerings.item" + }, + { + "key": "summary", + "binding": "offering.summary", + "label": "简介", + "input": "textarea", + "previewTarget": "linjing-editorial.offerings.item" + }, + { + "key": "priceText", + "binding": "offering.priceText", + "label": "价格说明", + "input": "text", + "previewTarget": "linjing-editorial.offerings.item" + }, + { + "key": "coverUrl", + "binding": "offering.coverUrl", + "label": "封面图片", + "input": "image", + "previewTarget": "linjing-editorial.offerings.item" + }, + { + "key": "detailHero", + "binding": "offering.config.detailHero", + "label": "详情主图", + "input": "image", + "previewTarget": "linjing-editorial.offerings.item", + "help": "此图优先用于卡片和详情;未填写时使用封面图片。" + }, + { + "key": "categoryLabel", + "binding": "offering.config.categoryKey", + "label": "案例类别", + "input": "select", + "options": [ + { + "value": "entrance-door", + "label": "入户大门" + }, + { + "value": "garden-door", + "label": "庭院围墙门" + }, + { + "value": "interior-door", + "label": "室内户内门" + }, + { + "value": "stealth-door", + "label": "装饰隐形门" + }, + { + "value": "custom", + "label": "设计咨询" + } ], + "previewTarget": "linjing-editorial.offerings.item" }, { - key: "linjing-editorial.profile.records", - label: "咨询记录入口", - }, - { - key: "linjing-editorial.profile.coverage", - label: "服务区域", - }, - { - key: "linjing-editorial.profile.warranty", - label: "履约说明", - }, + "key": "area", + "binding": "offering.config.area", + "label": "项目地点", + "input": "text", + "previewTarget": "linjing-editorial.offerings.item" + } ], + "previewTargets": [ + { + "key": "linjing-editorial.offerings.item", + "label": "业务卡片" + } + ] }, { - key: "offeringsOffering", - title: "业务卡片", - description: "点选预览中的单条内容,修改对应业务记录。", - page: "offerings", - target: "offering", - fields: [ + "key": "cases", + "title": "案例与体系", + "description": "说明案例页展示的内容,让业主能快速找到相近项目。", + "page": "offerings", + "target": "offering", + "fields": [ { - key: "name", - binding: "offering.name", - label: "名称", - input: "text", - previewTarget: "linjing-editorial.offerings.item", + "key": "worksEyebrow", + "binding": "brand.config.visualPresentation.offerings.worksEyebrow", + "label": "案例页辅助标题", + "input": "text", + "previewTarget": "linjing-editorial.offerings.cases" }, { - key: "summary", - binding: "offering.summary", - label: "简介", - input: "textarea", - previewTarget: "linjing-editorial.offerings.item", + "key": "worksTitle", + "binding": "brand.config.visualPresentation.offerings.worksTitle", + "label": "案例页主标题", + "input": "text", + "previewTarget": "linjing-editorial.offerings.cases" }, { - key: "priceText", - binding: "offering.priceText", - label: "价格说明", - input: "text", - previewTarget: "linjing-editorial.offerings.item", + "key": "subtitle", + "binding": "brand.config.visualPresentation.offerings.subtitle", + "label": "案例页说明", + "input": "textarea", + "maxLength": 140, + "previewTarget": "linjing-editorial.offerings.cases" }, { - key: "coverUrl", - binding: "offering.coverUrl", - label: "封面图片", - input: "image", - previewTarget: "linjing-editorial.offerings.item", + "key": "closingText", + "binding": "brand.config.visualPresentation.offerings.closingText", + "label": "案例页结语", + "input": "textarea", + "previewTarget": "linjing-editorial.offerings.cases" }, { - key: "detailHero", - binding: "offering.config.detailHero", - label: "详情主图", - input: "image", - previewTarget: "linjing-editorial.offerings.item", - help: "此图优先用于卡片和详情;未填写时使用封面图片。", + "key": "closingAction", + "binding": "brand.config.visualPresentation.offerings.closingAction", + "label": "案例页咨询入口", + "input": "text", + "previewTarget": "linjing-editorial.offerings.cases" + } + ], + "previewTargets": [ + { + "key": "linjing-editorial.offerings.cases", + "label": "案例与体系" + } + ] + }, + { + "key": "consultation", + "title": "咨询说明", + "description": "明确访客提交后会得到怎样的回应,减少无效咨询。", + "page": "inquiry", + "target": "inquiry", + "fields": [ + { + "key": "title", + "binding": "brand.config.visualPresentation.inquiry.title", + "label": "咨询页面标题", + "input": "text", + "previewTarget": "linjing-editorial.inquiry.consultation" }, { - key: "categoryLabel", - binding: "offering.config.categoryKey", - label: "案例类别", - input: "select", - options: [ + "key": "subtitle", + "binding": "brand.config.visualPresentation.inquiry.subtitle", + "label": "咨询说明", + "input": "textarea", + "maxLength": 140, + "previewTarget": "linjing-editorial.inquiry.consultation" + }, + { + "key": "submitLabel", + "binding": "brand.config.visualPresentation.inquiry.submitLabel", + "label": "提交按钮文字", + "input": "text", + "previewTarget": "linjing-editorial.inquiry.consultation" + }, + { + "key": "eyebrow", + "binding": "brand.config.visualPresentation.inquiry.eyebrow", + "label": "咨询页小标题", + "input": "text", + "previewTarget": "linjing-editorial.inquiry.consultation" + }, + { + "key": "note", + "binding": "brand.config.visualPresentation.inquiry.note", + "label": "咨询前提示", + "input": "textarea", + "previewTarget": "linjing-editorial.inquiry.consultation" + } + ], + "previewTargets": [ + { + "key": "linjing-editorial.inquiry.consultation", + "label": "咨询说明" + } + ] + }, + { + "key": "projectDetail", + "title": "案例详情", + "description": "以下内容分别填写在每个案例中,空白内容不会展示。", + "page": "detail", + "target": "offering", + "fields": [ + { + "key": "categoryLabel", + "binding": "offering.config.categoryKey", + "label": "案例类别", + "input": "select", + "options": [ { - value: "entrance-door", - label: "入户大门", + "value": "entrance-door", + "label": "入户大门" }, { - value: "garden-door", - label: "庭院围墙门", + "value": "garden-door", + "label": "庭院围墙门" }, { - value: "interior-door", - label: "室内户内门", + "value": "interior-door", + "label": "室内户内门" }, { - value: "stealth-door", - label: "装饰隐形门", + "value": "stealth-door", + "label": "装饰隐形门" }, { - value: "custom", - label: "设计咨询", - }, + "value": "custom", + "label": "设计咨询" + } ], - previewTarget: "linjing-editorial.offerings.item", + "previewTarget": "linjing-editorial.detail.projectDetail" }, { - key: "area", - binding: "offering.config.area", - label: "项目地点", - input: "text", - previewTarget: "linjing-editorial.offerings.item", - }, - ], - previewTargets: [ - { - key: "linjing-editorial.offerings.item", - label: "业务卡片", - }, - ], - }, - { - key: "cases", - title: "案例与体系", - description: "说明案例页展示的内容,让业主能快速找到相近项目。", - page: "offerings", - target: "offering", - fields: [ - { - key: "worksEyebrow", - binding: "brand.config.visualPresentation.offerings.worksEyebrow", - label: "案例页辅助标题", - input: "text", - previewTarget: "linjing-editorial.offerings.cases", + "key": "detailHero", + "binding": "offering.config.detailHero", + "label": "详情主图", + "input": "image", + "previewTarget": "linjing-editorial.detail.projectDetail" }, { - key: "worksTitle", - binding: "brand.config.visualPresentation.offerings.worksTitle", - label: "案例页主标题", - input: "text", - previewTarget: "linjing-editorial.offerings.cases", + "key": "area", + "binding": "offering.config.area", + "label": "项目地点", + "input": "text", + "previewTarget": "linjing-editorial.detail.projectDetail" }, { - key: "subtitle", - binding: "brand.config.visualPresentation.offerings.subtitle", - label: "案例页说明", - input: "textarea", - maxLength: 140, - previewTarget: "linjing-editorial.offerings.cases", + "key": "series", + "binding": "offering.config.series", + "label": "产品系列", + "input": "text", + "previewTarget": "linjing-editorial.detail.projectDetail" }, { - key: "closingText", - binding: "brand.config.visualPresentation.offerings.closingText", - label: "案例页结语", - input: "textarea", - previewTarget: "linjing-editorial.offerings.cases", + "key": "spaceType", + "binding": "offering.config.spaceType", + "label": "适用空间", + "input": "text", + "previewTarget": "linjing-editorial.detail.projectDetail" }, { - key: "closingAction", - binding: "brand.config.visualPresentation.offerings.closingAction", - label: "案例页咨询入口", - input: "text", - previewTarget: "linjing-editorial.offerings.cases", - }, - ], - previewTargets: [ - { - key: "linjing-editorial.offerings.cases", - label: "案例与体系", - }, - ], - }, - { - key: "consultation", - title: "咨询说明", - description: "明确访客提交后会得到怎样的回应,减少无效咨询。", - page: "inquiry", - target: "inquiry", - fields: [ - { - key: "title", - binding: "brand.config.visualPresentation.inquiry.title", - label: "咨询页面标题", - input: "text", - previewTarget: "linjing-editorial.inquiry.consultation", + "key": "background", + "binding": "offering.config.details.background", + "label": "项目背景", + "input": "textarea", + "previewTarget": "linjing-editorial.detail.projectDetail" }, { - key: "subtitle", - binding: "brand.config.visualPresentation.inquiry.subtitle", - label: "咨询说明", - input: "textarea", - maxLength: 140, - previewTarget: "linjing-editorial.inquiry.consultation", + "key": "designConcept", + "binding": "offering.config.details.designConcept", + "label": "设计理念", + "input": "textarea", + "previewTarget": "linjing-editorial.detail.projectDetail" }, { - key: "submitLabel", - binding: "brand.config.visualPresentation.inquiry.submitLabel", - label: "提交按钮文字", - input: "text", - previewTarget: "linjing-editorial.inquiry.consultation", - }, - { - key: "eyebrow", - binding: "brand.config.visualPresentation.inquiry.eyebrow", - label: "咨询页小标题", - input: "text", - previewTarget: "linjing-editorial.inquiry.consultation", - }, - { - key: "note", - binding: "brand.config.visualPresentation.inquiry.note", - label: "咨询前提示", - input: "textarea", - previewTarget: "linjing-editorial.inquiry.consultation", - }, - ], - previewTargets: [ - { - key: "linjing-editorial.inquiry.consultation", - label: "咨询说明", - }, - ], - }, - { - key: "projectDetail", - title: "案例详情", - description: "以下内容分别填写在每个案例中,空白内容不会展示。", - page: "detail", - target: "offering", - fields: [ - { - key: "categoryLabel", - binding: "offering.config.categoryKey", - label: "案例类别", - input: "select", - options: [ + "key": "keywords", + "binding": "offering.config.keywords", + "label": "项目关键词", + "input": "list", + "itemValueKey": "value", + "itemFields": [ { - value: "entrance-door", - label: "入户大门", - }, - { - value: "garden-door", - label: "庭院围墙门", - }, - { - value: "interior-door", - label: "室内户内门", - }, - { - value: "stealth-door", - label: "装饰隐形门", - }, - { - value: "custom", - label: "设计咨询", - }, + "key": "value", + "label": "关键词" + } ], - previewTarget: "linjing-editorial.detail.projectDetail", + "previewTarget": "linjing-editorial.detail.projectDetail" }, { - key: "detailHero", - binding: "offering.config.detailHero", - label: "详情主图", - input: "image", - previewTarget: "linjing-editorial.detail.projectDetail", - }, - { - key: "area", - binding: "offering.config.area", - label: "项目地点", - input: "text", - previewTarget: "linjing-editorial.detail.projectDetail", - }, - { - key: "series", - binding: "offering.config.series", - label: "产品系列", - input: "text", - previewTarget: "linjing-editorial.detail.projectDetail", - }, - { - key: "spaceType", - binding: "offering.config.spaceType", - label: "适用空间", - input: "text", - previewTarget: "linjing-editorial.detail.projectDetail", - }, - { - key: "background", - binding: "offering.config.details.background", - label: "项目背景", - input: "textarea", - previewTarget: "linjing-editorial.detail.projectDetail", - }, - { - key: "designConcept", - binding: "offering.config.details.designConcept", - label: "设计理念", - input: "textarea", - previewTarget: "linjing-editorial.detail.projectDetail", - }, - { - key: "keywords", - binding: "offering.config.keywords", - label: "项目关键词", - input: "list", - itemValueKey: "value", - itemFields: [ + "key": "crafts", + "binding": "offering.config.details.crafts", + "label": "工艺要点", + "input": "list", + "itemValueKey": "value", + "itemFields": [ { - key: "value", - label: "关键词", - }, + "key": "value", + "label": "工艺说明" + } ], - previewTarget: "linjing-editorial.detail.projectDetail", + "previewTarget": "linjing-editorial.detail.projectDetail" }, { - key: "crafts", - binding: "offering.config.details.crafts", - label: "工艺要点", - input: "list", - itemValueKey: "value", - itemFields: [ + "key": "materialsList", + "binding": "offering.config.details.materialsList", + "label": "材料说明", + "input": "list", + "itemFields": [ { - key: "value", - label: "工艺说明", + "key": "name", + "label": "材料名称" }, + { + "key": "spec", + "label": "规格说明" + } ], - previewTarget: "linjing-editorial.detail.projectDetail", - }, - { - key: "materialsList", - binding: "offering.config.details.materialsList", - label: "材料说明", - input: "list", - itemFields: [ - { - key: "name", - label: "材料名称", - }, - { - key: "spec", - label: "规格说明", - }, - ], - previewTarget: "linjing-editorial.detail.projectDetail", - }, + "previewTarget": "linjing-editorial.detail.projectDetail" + } ], - previewTargets: [ + "previewTargets": [ { - key: "linjing-editorial.detail.projectDetail", - label: "案例详情", - }, - ], + "key": "linjing-editorial.detail.projectDetail", + "label": "案例详情" + } + ] }, { - key: "detailCopy", - title: "详情页说明", - description: "说明案例内容、价格与咨询后的真实处理方式。", - page: "detail", - target: "brand", - fields: [ + "key": "detailCopy", + "title": "详情页说明", + "description": "说明案例内容、价格与咨询后的真实处理方式。", + "page": "detail", + "target": "brand", + "fields": [ { - key: "priceLabel", - binding: "brand.config.visualPresentation.detail.priceLabel", - label: "价格说明标题", - input: "text", - previewTarget: "linjing-editorial.detail.detailCopy", + "key": "priceLabel", + "binding": "brand.config.visualPresentation.detail.priceLabel", + "label": "价格说明标题", + "input": "text", + "previewTarget": "linjing-editorial.detail.detailCopy" }, { - key: "spaceLabel", - binding: "brand.config.visualPresentation.detail.spaceLabel", - label: "适用空间标题", - input: "text", - previewTarget: "linjing-editorial.detail.detailCopy", + "key": "spaceLabel", + "binding": "brand.config.visualPresentation.detail.spaceLabel", + "label": "适用空间标题", + "input": "text", + "previewTarget": "linjing-editorial.detail.detailCopy" }, { - key: "backgroundTitle", - binding: "brand.config.visualPresentation.detail.backgroundTitle", - label: "项目背景标题", - input: "text", - previewTarget: "linjing-editorial.detail.detailCopy", + "key": "backgroundTitle", + "binding": "brand.config.visualPresentation.detail.backgroundTitle", + "label": "项目背景标题", + "input": "text", + "previewTarget": "linjing-editorial.detail.detailCopy" }, { - key: "conceptTitle", - binding: "brand.config.visualPresentation.detail.conceptTitle", - label: "设计理念标题", - input: "text", - previewTarget: "linjing-editorial.detail.detailCopy", + "key": "conceptTitle", + "binding": "brand.config.visualPresentation.detail.conceptTitle", + "label": "设计理念标题", + "input": "text", + "previewTarget": "linjing-editorial.detail.detailCopy" }, { - key: "craftsTitle", - binding: "brand.config.visualPresentation.detail.craftsTitle", - label: "工艺要点标题", - input: "text", - previewTarget: "linjing-editorial.detail.detailCopy", + "key": "craftsTitle", + "binding": "brand.config.visualPresentation.detail.craftsTitle", + "label": "工艺要点标题", + "input": "text", + "previewTarget": "linjing-editorial.detail.detailCopy" }, { - key: "materialsTitle", - binding: "brand.config.visualPresentation.detail.materialsTitle", - label: "材料说明标题", - input: "text", - previewTarget: "linjing-editorial.detail.detailCopy", - }, + "key": "materialsTitle", + "binding": "brand.config.visualPresentation.detail.materialsTitle", + "label": "材料说明标题", + "input": "text", + "previewTarget": "linjing-editorial.detail.detailCopy" + } ], - previewTargets: [ + "previewTargets": [ { - key: "linjing-editorial.detail.detailCopy", - label: "详情页说明", - }, - ], + "key": "linjing-editorial.detail.detailCopy", + "label": "详情页说明" + } + ] }, { - key: "successCopy", - title: "提交成功页", - description: "访客提交后看到的确认信息与后续预期。", - page: "success", - target: "brand", - fields: [ + "key": "successCopy", + "title": "提交成功页", + "description": "访客提交后看到的确认信息与后续预期。", + "page": "success", + "target": "brand", + "fields": [ { - key: "eyebrow", - binding: "brand.config.visualPresentation.success.eyebrow", - label: "页面小标题", - input: "text", - previewTarget: "linjing-editorial.success.successCopy", + "key": "eyebrow", + "binding": "brand.config.visualPresentation.success.eyebrow", + "label": "页面小标题", + "input": "text", + "previewTarget": "linjing-editorial.success.successCopy" }, { - key: "title", - binding: "brand.config.visualPresentation.success.title", - label: "确认标题", - input: "text", - previewTarget: "linjing-editorial.success.successCopy", + "key": "title", + "binding": "brand.config.visualPresentation.success.title", + "label": "确认标题", + "input": "text", + "previewTarget": "linjing-editorial.success.successCopy" }, { - key: "intro", - binding: "brand.config.visualPresentation.success.intro", - label: "后续联系说明", - help: "回复时间必须与实际承诺一致。", - input: "textarea", - previewTarget: "linjing-editorial.success.successCopy", + "key": "intro", + "binding": "brand.config.visualPresentation.success.intro", + "label": "后续联系说明", + "help": "回复时间必须与实际承诺一致。", + "input": "textarea", + "previewTarget": "linjing-editorial.success.successCopy" }, { - key: "recordsAction", - binding: "brand.config.visualPresentation.success.recordsAction", - label: "查看记录按钮", - input: "text", - previewTarget: "linjing-editorial.success.successCopy", + "key": "recordsAction", + "binding": "brand.config.visualPresentation.success.recordsAction", + "label": "查看记录按钮", + "input": "text", + "previewTarget": "linjing-editorial.success.successCopy" }, { - key: "homeAction", - binding: "brand.config.visualPresentation.success.homeAction", - label: "返回首页按钮", - input: "text", - previewTarget: "linjing-editorial.success.successCopy", - }, + "key": "homeAction", + "binding": "brand.config.visualPresentation.success.homeAction", + "label": "返回首页按钮", + "input": "text", + "previewTarget": "linjing-editorial.success.successCopy" + } ], - previewTargets: [ + "previewTargets": [ { - key: "linjing-editorial.success.successCopy", - label: "提交成功页", - }, - ], + "key": "linjing-editorial.success.successCopy", + "label": "提交成功页" + } + ] }, { - key: "recordsCopy", - title: "咨询记录页", - description: "访客查看咨询状态时看到的内容。", - page: "records", - target: "brand", - fields: [ + "key": "recordsCopy", + "title": "咨询记录页", + "description": "访客查看咨询状态时看到的内容。", + "page": "records", + "target": "brand", + "fields": [ { - key: "title", - binding: "brand.config.visualPresentation.records.title", - label: "记录页标题", - input: "text", - previewTarget: "linjing-editorial.records.recordsCopy", + "key": "title", + "binding": "brand.config.visualPresentation.records.title", + "label": "记录页标题", + "input": "text", + "previewTarget": "linjing-editorial.records.recordsCopy" }, { - key: "createAction", - binding: "brand.config.visualPresentation.records.createAction", - label: "新增咨询按钮", - input: "text", - previewTarget: "linjing-editorial.records.recordsCopy", + "key": "createAction", + "binding": "brand.config.visualPresentation.records.createAction", + "label": "新增咨询按钮", + "input": "text", + "previewTarget": "linjing-editorial.records.recordsCopy" }, { - key: "emptyTitle", - binding: "brand.config.visualPresentation.records.emptyTitle", - label: "暂无记录标题", - input: "text", - previewTarget: "linjing-editorial.records.recordsCopy", + "key": "emptyTitle", + "binding": "brand.config.visualPresentation.records.emptyTitle", + "label": "暂无记录标题", + "input": "text", + "previewTarget": "linjing-editorial.records.recordsCopy" }, { - key: "emptyDescription", - binding: "brand.config.visualPresentation.records.emptyDescription", - label: "暂无记录说明", - input: "textarea", - previewTarget: "linjing-editorial.records.recordsCopy", + "key": "emptyDescription", + "binding": "brand.config.visualPresentation.records.emptyDescription", + "label": "暂无记录说明", + "input": "textarea", + "previewTarget": "linjing-editorial.records.recordsCopy" }, { - key: "emptyAction", - binding: "brand.config.visualPresentation.records.emptyAction", - label: "空状态按钮", - input: "text", - previewTarget: "linjing-editorial.records.recordsCopy", - }, + "key": "emptyAction", + "binding": "brand.config.visualPresentation.records.emptyAction", + "label": "空状态按钮", + "input": "text", + "previewTarget": "linjing-editorial.records.recordsCopy" + } ], - previewTargets: [ + "previewTargets": [ { - key: "linjing-editorial.records.recordsCopy", - label: "咨询记录页", - }, - ], + "key": "linjing-editorial.records.recordsCopy", + "label": "咨询记录页" + } + ] }, { - key: "offerings_detailAction", - title: "详情按钮文字", - description: "此页同类按钮共用此文案。", - page: "offerings", - target: "brand", - previewTargets: [ + "key": "offerings_detailAction", + "title": "详情按钮文字", + "description": "此页同类按钮共用此文案。", + "page": "offerings", + "target": "brand", + "previewTargets": [ { - key: "linjing-editorial.offerings.action", - label: "详情按钮文字", - }, + "key": "linjing-editorial.offerings.action", + "label": "详情按钮文字" + } ], - fields: [ + "fields": [ { - key: "detailAction", - binding: "brand.config.visualPresentation.offerings.detailAction", - label: "详情按钮文字", - input: "text", - previewTarget: "linjing-editorial.offerings.action", - }, - ], + "key": "detailAction", + "binding": "brand.config.visualPresentation.offerings.detailAction", + "label": "详情按钮文字", + "input": "text", + "previewTarget": "linjing-editorial.offerings.action" + } + ] }, { - key: "detailAction", - title: "详情页咨询入口", - description: "公共按钮与提示,对所有业务详情生效。", - page: "detail", - target: "brand", - fields: [ + "key": "detailAction", + "title": "详情页咨询入口", + "description": "公共按钮与提示,对所有业务详情生效。", + "page": "detail", + "target": "brand", + "fields": [ { - key: "inquiryAction", - binding: "brand.config.visualPresentation.detail.inquiryAction", - label: "咨询按钮文字", - input: "text", - previewTarget: "linjing-editorial.detail.action", + "key": "inquiryAction", + "binding": "brand.config.visualPresentation.detail.inquiryAction", + "label": "咨询按钮文字", + "input": "text", + "previewTarget": "linjing-editorial.detail.action" }, { - key: "inquiryHint", - binding: "brand.config.visualPresentation.detail.inquiryHint", - label: "咨询后的处理说明", - help: "只填写能兑现的服务安排。", - input: "textarea", - previewTarget: "linjing-editorial.detail.action", - }, + "key": "inquiryHint", + "binding": "brand.config.visualPresentation.detail.inquiryHint", + "label": "咨询后的处理说明", + "help": "只填写能兑现的服务安排。", + "input": "textarea", + "previewTarget": "linjing-editorial.detail.action" + } ], - previewTargets: [ + "previewTargets": [ { - key: "linjing-editorial.detail.action", - label: "详情页咨询入口", - }, - ], - }, - ], + "key": "linjing-editorial.detail.action", + "label": "详情页咨询入口" + } + ] + } + ] }, - trustContentTypes: [ + "trustContentTypes": [ { - type: "schedule", - label: "服务与合作安排", - adminFields: { - title: "安排标题", - summary: "安排摘要", - content: "时间与排期详情", + "type": "schedule", + "label": "服务与合作安排", + "adminFields": { + "title": "安排标题", + "summary": "安排摘要", + "content": "时间与排期详情" }, - pages: ["profile"], - help: "说明可预约时间、服务周期或项目排期。", - }, - { - type: "coverage", - label: "服务范围与适用对象", - adminFields: { - title: "范围标题", - summary: "范围摘要", - content: "服务范围说明", - }, - pages: ["profile"], - help: "说明服务地区、项目类型或合作边界。", - }, - { - type: "process", - label: "合作流程", - adminFields: { - title: "流程标题", - summary: "流程摘要", - content: "流程步骤", - }, - pages: ["profile"], - help: "每行写一步,从初次沟通到交付完成。", - placeholder: "例如:需求沟通\n方案确认\n落地交付", - required: true, - }, - { - type: "credential", - label: "专业资历与方法", - adminFields: { - title: "证明标题", - summary: "专业摘要", - content: "资历与方法说明", - }, - pages: ["home", "profile"], - help: "填写经验、资质、专业标准或工作方法。", - previewTargets: [ - { - key: "editorial.home.proof.stats", - label: "信任数据", - page: "home", - }, - { - key: "editorial.home.manifesto.pillars", - label: "专业方法", - page: "home", - }, - { - key: "editorial.home.flow.steps", - label: "合作流程步骤", - page: "home", - }, + "pages": [ + "profile" ], - configFields: [ - { - key: "stats", - binding: "trust.config.stats", - label: "信任数据", - input: "list", - previewTarget: "editorial.home.proof.stats", - itemFields: [ - { - key: "value", - label: "数字或成果", - }, - { - key: "label", - label: "说明", - }, - { - key: "sub", - label: "补充说明", - required: false, - }, - ], - }, - { - key: "pillars", - binding: "trust.config.pillars", - label: "专业方法", - input: "list", - previewTarget: "editorial.home.manifesto.pillars", - itemFields: [ - { - key: "title", - label: "方法名称", - }, - { - key: "desc", - label: "方法说明", - }, - ], - }, - { - key: "serviceFlow", - binding: "trust.config.serviceFlow", - label: "合作流程", - input: "list", - previewTarget: "editorial.home.flow.steps", - itemFields: [ - { - key: "step", - label: "步骤编号", - }, - { - key: "name", - label: "步骤名称", - }, - { - key: "desc", - label: "步骤说明", - }, - ], - }, + "help": "说明可预约时间、服务周期或项目排期。" + }, + { + "type": "coverage", + "label": "服务范围与适用对象", + "adminFields": { + "title": "范围标题", + "summary": "范围摘要", + "content": "服务范围说明" + }, + "pages": [ + "profile" ], - required: true, + "help": "说明服务地区、项目类型或合作边界。" }, { - type: "case", - label: "项目案例与客户反馈", - adminFields: { - title: "案例标题", - summary: "案例摘要", - content: "项目成果与客户反馈", + "type": "process", + "label": "合作流程", + "adminFields": { + "title": "流程标题", + "summary": "流程摘要", + "content": "流程步骤" }, - pages: ["profile"], - help: "填写代表性项目、成果或客户评价。", + "pages": [ + "profile" + ], + "help": "每行写一步,从初次沟通到交付完成。", + "placeholder": "例如:需求沟通\n方案确认\n落地交付", + "required": true }, { - type: "promise", - label: "合作预期与响应承诺", - adminFields: { - title: "承诺标题", - summary: "承诺摘要", - content: "合作与响应说明", + "type": "credential", + "label": "专业资历与方法", + "adminFields": { + "title": "证明标题", + "summary": "专业摘要", + "content": "资历与方法说明" }, - pages: ["profile"], - help: "说明回复时间、合作边界和后续跟进方式。", + "pages": [ + "home", + "profile" + ], + "help": "填写经验、资质、专业标准或工作方法。", + "previewTargets": [ + { + "key": "editorial.home.proof.stats", + "label": "信任数据", + "page": "home" + }, + { + "key": "editorial.home.manifesto.pillars", + "label": "专业方法", + "page": "home" + }, + { + "key": "editorial.home.flow.steps", + "label": "合作流程步骤", + "page": "home" + } + ], + "configFields": [ + { + "key": "stats", + "binding": "trust.config.stats", + "label": "信任数据", + "input": "list", + "previewTarget": "editorial.home.proof.stats", + "itemFields": [ + { + "key": "value", + "label": "数字或成果" + }, + { + "key": "label", + "label": "说明" + }, + { + "key": "sub", + "label": "补充说明", + "required": false + } + ] + }, + { + "key": "pillars", + "binding": "trust.config.pillars", + "label": "专业方法", + "input": "list", + "previewTarget": "editorial.home.manifesto.pillars", + "itemFields": [ + { + "key": "title", + "label": "方法名称" + }, + { + "key": "desc", + "label": "方法说明" + } + ] + }, + { + "key": "serviceFlow", + "binding": "trust.config.serviceFlow", + "label": "合作流程", + "input": "list", + "previewTarget": "editorial.home.flow.steps", + "itemFields": [ + { + "key": "step", + "label": "步骤编号" + }, + { + "key": "name", + "label": "步骤名称" + }, + { + "key": "desc", + "label": "步骤说明" + } + ] + } + ], + "required": true }, + { + "type": "case", + "label": "项目案例与客户反馈", + "adminFields": { + "title": "案例标题", + "summary": "案例摘要", + "content": "项目成果与客户反馈" + }, + "pages": [ + "profile" + ], + "help": "填写代表性项目、成果或客户评价。" + }, + { + "type": "promise", + "label": "合作预期与响应承诺", + "adminFields": { + "title": "承诺标题", + "summary": "承诺摘要", + "content": "合作与响应说明" + }, + "pages": [ + "profile" + ], + "help": "说明回复时间、合作边界和后续跟进方式。" + } ], - sampleContent: { - doors: { - templateKey: "doors", - inquiryFormName: "门系统咨询表单", - offerings: [ + "sampleContent": { + "doors": { + "templateKey": "doors", + "inquiryFormName": "门系统咨询表单", + "offerings": [ { - kind: "product", - name: "序章·入户门", - summary: "为别墅入口定制的整樘门系统", - categoryKey: "entrance-door", - coverUrl: "/assets/content/doors-hero.jpg", - priceText: "按项目确认", - config: { - series: "「万籁」重型天地轴入户系统", - hardware: "德国 dormakaba 重型地弹簧 + 定制实心锻铜一体式长执手", - details: { - materialsList: [ + "kind": "product", + "name": "序章·入户门", + "summary": "为别墅入口定制的整樘门系统", + "categoryKey": "entrance-door", + "coverUrl": "/assets/content/doors-hero.jpg", + "priceText": "按项目确认", + "config": { + "series": "「万籁」重型天地轴入户系统", + "hardware": "德国 dormakaba 重型地弹簧 + 定制实心锻铜一体式长执手", + "details": { + "materialsList": [ { - name: "门扇主体", - spec: "航空铝蜂窝 + 防暴钢板 + 黑胡桃", + "name": "门扇主体", + "spec": "航空铝蜂窝 + 防暴钢板 + 黑胡桃" }, { - name: "承重结构", - spec: "不锈钢重型天地偏心轴", - }, - ], + "name": "承重结构", + "spec": "不锈钢重型天地偏心轴" + } + ] }, - media: [ + "media": [ { - url: "/assets/content/doors-hero.jpg", - alt: "", - type: "image", - }, - ], - }, + "url": "/assets/content/doors-hero.jpg", + "alt": "", + "type": "image" + } + ] + } }, { - kind: "product", - name: "庭院·边界门", - summary: "连接建筑与庭院的定制门", - categoryKey: "garden-door", - coverUrl: "/assets/content/doors-yard-gate.jpg", - priceText: "按项目确认", - config: { - series: "「虚实」透光私家庭院门", - hardware: "意大利全隐形地埋式液压自闭器 + 静音电控锁", - details: { - materialsList: [ + "kind": "product", + "name": "庭院·边界门", + "summary": "连接建筑与庭院的定制门", + "categoryKey": "garden-door", + "coverUrl": "/assets/content/doors-yard-gate.jpg", + "priceText": "按项目确认", + "config": { + "series": "「虚实」透光私家庭院门", + "hardware": "意大利全隐形地埋式液压自闭器 + 静音电控锁", + "details": { + "materialsList": [ { - name: "户外木种", - spec: "高油脂老料缅甸柚木", + "name": "户外木种", + "spec": "高油脂老料缅甸柚木" }, { - name: "骨架型材", - spec: "高强度航空铝镁合金", - }, - ], + "name": "骨架型材", + "spec": "高强度航空铝镁合金" + } + ] }, - media: [ + "media": [ { - url: "/assets/content/doors-yard-gate.jpg", - alt: "", - type: "image", - }, - ], - }, + "url": "/assets/content/doors-yard-gate.jpg", + "alt": "", + "type": "image" + } + ] + } }, { - kind: "product", - name: "室内·静谧门", - summary: "统一室内空间秩序的户内门", - categoryKey: "interior-door", - coverUrl: "/assets/content/doors-room-door.jpg", - priceText: "按项目确认", - config: { - series: "「空灵」2.8m - 3.2m 满高通顶系统", - hardware: "意大利 AGB 磁吸静音门锁 + 隐藏式暗铰链", - details: { - materialsList: [ + "kind": "product", + "name": "室内·静谧门", + "summary": "统一室内空间秩序的户内门", + "categoryKey": "interior-door", + "coverUrl": "/assets/content/doors-room-door.jpg", + "priceText": "按项目确认", + "config": { + "series": "「空灵」2.8m - 3.2m 满高通顶系统", + "hardware": "意大利 AGB 磁吸静音门锁 + 隐藏式暗铰链", + "details": { + "materialsList": [ { - name: "抗弯核心", - spec: "双组份碳纤维预应力防变形拉力杆", + "name": "抗弯核心", + "spec": "双组份碳纤维预应力防变形拉力杆" }, { - name: "吸音内衬", - spec: "德国均质空心桥洞力学板", - }, - ], + "name": "吸音内衬", + "spec": "德国均质空心桥洞力学板" + } + ] }, - media: [ + "media": [ { - url: "/assets/content/doors-room-door.jpg", - alt: "", - type: "image", - }, - ], - }, + "url": "/assets/content/doors-room-door.jpg", + "alt": "", + "type": "image" + } + ] + } }, { - kind: "service", - name: "一对一门系统设计咨询", - summary: "从现场到方案的完整设计沟通", - categoryKey: "custom", - coverUrl: "/assets/content/personal-consulting.jpg", - priceText: "按项目确认", - config: { - series: "「无垠」密室及背景墙融合门", - hardware: "感应式电动自开闭装置或碰珠反弹器", - details: { - materialsList: [ + "kind": "service", + "name": "一对一门系统设计咨询", + "summary": "从现场到方案的完整设计沟通", + "categoryKey": "custom", + "coverUrl": "/assets/content/personal-consulting.jpg", + "priceText": "按项目确认", + "config": { + "series": "「无垠」密室及背景墙融合门", + "hardware": "感应式电动自开闭装置或碰珠反弹器", + "details": { + "materialsList": [ { - name: "表面饰材", - spec: "意大利雪山银狐超薄天然大理石", + "name": "表面饰材", + "spec": "意大利雪山银狐超薄天然大理石" }, { - name: "驱动系统", - spec: "低噪步进电机伺服闭门器", - }, - ], + "name": "驱动系统", + "spec": "低噪步进电机伺服闭门器" + } + ] }, - media: [ + "media": [ { - url: "/assets/content/personal-consulting.jpg", - alt: "", - type: "image", - }, - ], - }, - }, + "url": "/assets/content/personal-consulting.jpg", + "alt": "", + "type": "image" + } + ] + } + } ], - trustContent: [ + "trustContent": [ { - type: "credential", - title: "主理人的门作观", - content: "国家注册高级室内建筑师,专注高定大门及私宅空间门类系统研发 14 年。", - config: { - stats: [ + "type": "credential", + "title": "主理人的门作观", + "content": "国家注册高级室内建筑师,专注高定大门及私宅空间门类系统研发 14 年。", + "config": { + "stats": [ { - value: "14年", - label: "高端门系深化经验", - sub: "历经百项严苛私宅考验", + "value": "14年", + "label": "高端门系深化经验", + "sub": "历经百项严苛私宅考验" }, { - value: "260+", - label: "落地庄园实景案例", - sub: "全实景图库,可预约探访", + "value": "260+", + "label": "落地庄园实景案例", + "sub": "全实景图库,可预约探访" }, { - value: "100%", - label: "主理人全案跟进", - sub: "量房 / 出图 / 选料 / 试装", + "value": "100%", + "label": "主理人全案跟进", + "sub": "量房 / 出图 / 选料 / 试装" }, { - value: "10年", - label: "结构主轴质保承诺", - sub: "终生五金润滑维保机制", - }, + "value": "10年", + "label": "结构主轴质保承诺", + "sub": "终生五金润滑维保机制" + } ], - pillars: [ + "pillars": [ { - title: "天然厚板与古铜锻打", - desc: "精选天然木材与手工冷锻紫铜,构建长期耐用的门体结构。", + "title": "天然厚板与古铜锻打", + "desc": "精选天然木材与手工冷锻紫铜,构建长期耐用的门体结构。" }, { - title: "微米级红外高精量房", - desc: "通过 3D 空间激光扫描复核门洞公差与建筑墙体垂直度。", + "title": "微米级红外高精量房", + "desc": "通过 3D 空间激光扫描复核门洞公差与建筑墙体垂直度。" }, { - title: "隐匿式重型五金系统", - desc: "使用可调静音承重铰链,让重型门体开合轻盈安静。", - }, + "title": "隐匿式重型五金系统", + "desc": "使用可调静音承重铰链,让重型门体开合轻盈安静。" + } ], - serviceFlow: [ + "serviceFlow": [ { - step: "01", - name: "私享沟通", - desc: "厘清生活动线与风候环境", + "step": "01", + "name": "私享沟通", + "desc": "厘清生活动线与风候环境" }, { - step: "02", - name: "上门实测", - desc: "复核门洞公差与地平基准", + "step": "02", + "name": "上门实测", + "desc": "复核门洞公差与地平基准" }, { - step: "03", - name: "构造出图", - desc: "输出结构图与材质节点方案", + "step": "03", + "name": "构造出图", + "desc": "输出结构图与材质节点方案" }, { - step: "04", - name: "实样工坊确认", - desc: "确认木样、锻铜样与密封节点", + "step": "04", + "name": "实样工坊确认", + "desc": "确认木样、锻铜样与密封节点" }, { - step: "05", - name: "工坊试装交付", - desc: "试装调试后专车直运现场", + "step": "05", + "name": "工坊试装交付", + "desc": "试装调试后专车直运现场" }, { - step: "06", - name: "终生私属维护", - desc: "建立一门一档数字化档案", - }, - ], - }, + "step": "06", + "name": "终生私属维护", + "desc": "建立一门一档数字化档案" + } + ] + } }, { - type: "case", - title: "别墅门系统案例", - content: "示例内容,待品牌主理人完善。", + "type": "case", + "title": "别墅门系统案例", + "content": "示例内容,待品牌主理人完善。" }, { - type: "process", - title: "从测量到交付", - content: "示例内容,待品牌主理人完善。", - }, + "type": "process", + "title": "从测量到交付", + "content": "示例内容,待品牌主理人完善。" + } ], - fields: [ + "fields": [ { - key: "doorType", - label: "期望定制的门类型", - type: "select", - required: true, - options: [ + "key": "doorType", + "label": "期望定制的门类型", + "type": "select", + "required": true, + "options": [ { - label: "入户大门(防暴铸铜 / 实木)", - value: "entry", + "label": "入户大门(防暴铸铜 / 实木)", + "value": "entry" }, { - label: "庭院围墙门(耐候格栅 / 对开)", - value: "yard", + "label": "庭院围墙门(耐候格栅 / 对开)", + "value": "yard" }, { - label: "全屋室内门系统(通顶隐形)", - value: "interior", + "label": "全屋室内门系统(通顶隐形)", + "value": "interior" }, { - label: "背景墙一体门 / 密室门", - value: "wall", + "label": "背景墙一体门 / 密室门", + "value": "wall" }, { - label: "整栋别墅门系统全案一体化", - value: "whole-home", - }, - ], + "label": "整栋别墅门系统全案一体化", + "value": "whole-home" + } + ] }, { - key: "cityArea", - label: "房屋 / 别墅所在城市与楼盘", - type: "text", - required: true, + "key": "cityArea", + "label": "房屋 / 别墅所在城市与楼盘", + "type": "text", + "required": true }, { - key: "projectStage", - label: "项目阶段", - type: "select", - required: true, - options: [ + "key": "projectStage", + "label": "项目阶段", + "type": "select", + "required": true, + "options": [ { - label: "土建结构阶段(适合预埋加固)", - value: "structure", + "label": "土建结构阶段(适合预埋加固)", + "value": "structure" }, { - label: "水电木工阶段(适合精确测距)", - value: "rough-in", + "label": "水电木工阶段(适合精确测距)", + "value": "rough-in" }, { - label: "硬装收尾阶段", - value: "finishing", + "label": "硬装收尾阶段", + "value": "finishing" }, { - label: "旧宅门体翻新改造", - value: "renovation", - }, - ], + "label": "旧宅门体翻新改造", + "value": "renovation" + } + ] }, { - key: "budgetRange", - label: "预估门系统投资预算", - type: "select", - required: false, - options: [ + "key": "budgetRange", + "label": "预估门系统投资预算", + "type": "select", + "required": false, + "options": [ { - label: "5 万 - 10 万", - value: "50k-100k", + "label": "5 万 - 10 万", + "value": "50k-100k" }, { - label: "10 万 - 20 万", - value: "100k-200k", + "label": "10 万 - 20 万", + "value": "100k-200k" }, { - label: "20 万 - 50 万(全宅全案)", - value: "200k-500k", + "label": "20 万 - 50 万(全宅全案)", + "value": "200k-500k" }, { - label: "50 万以上(顶级孤品定制)", - value: "500k-plus", - }, - ], + "label": "50 万以上(顶级孤品定制)", + "value": "500k-plus" + } + ] }, { - key: "needMeasure", - label: "是否需要主理人上门现场量房", - type: "radio", - required: true, - options: [ + "key": "needMeasure", + "label": "是否需要主理人上门现场量房", + "type": "radio", + "required": true, + "options": [ { - label: "需要(预约排期现场勘测)", - value: "需要(预约排期现场勘测)", + "label": "需要(预约排期现场勘测)", + "value": "需要(预约排期现场勘测)" }, { - label: "暂不需要(先发图纸在线深化评估)", - value: "暂不需要(先发图纸在线深化评估)", - }, - ], + "label": "暂不需要(先发图纸在线深化评估)", + "value": "暂不需要(先发图纸在线深化评估)" + } + ] }, { - key: "contactName", - label: "贵姓称谓", - type: "text", - required: true, + "key": "contactName", + "label": "贵姓称谓", + "type": "text", + "required": true }, { - key: "contactPhone", - label: "联系手机号(微信同号)", - type: "tel", - required: true, + "key": "contactPhone", + "label": "联系手机号(微信同号)", + "type": "tel", + "required": true }, { - key: "specialNote", - label: "空间想法或特殊需求描述", - type: "textarea", - required: false, - }, + "key": "specialNote", + "label": "空间想法或特殊需求描述", + "type": "textarea", + "required": false + } ], - capabilityKey: "inquiry", - brandConfig: { - visualTemplateKey: "linjing-editorial", - templateData: { - designPhilosophy: "先厘清问题,再设计表达", + "capabilityKey": "inquiry", + "brandConfig": { + "templateData": { + "designPhilosophy": "先厘清问题,再设计表达" }, - title: "高端门系统建筑研造主理人", - slogan: "为当代别墅空间,定制有秩序感与呼吸感的门", - phone: "186-0218-9908", - wechat: "LIN-ATELIER-2024", - studioAddress: "上海市静安区威海路设计中心 A 座 / 杭州良渚研造工坊", - avatarUrl: "/assets/content/personal-avatar.jpg", - heroImage: "/assets/content/doors-hero.jpg", - visualPresentation: { - home: { - founderBadge: "接受项目沟通", - proofEyebrow: "专业经验与合作成果", - proofTitle: "14 年,只做门与空间的关系", - manifestoEyebrow: "工作原则", - manifestoTitle: "先厘清问题,再设计表达", - worksEyebrow: "项目案例", - worksTitle: "门系统项目", - worksAction: "查看全部 →", + "title": "高端门系统建筑研造主理人", + "slogan": "为当代别墅空间,定制有秩序感与呼吸感的门", + "phone": "186-0218-9908", + "wechat": "LIN-ATELIER-2024", + "studioAddress": "上海市静安区威海路设计中心 A 座 / 杭州良渚研造工坊", + "avatarUrl": "/assets/content/personal-avatar.jpg", + "heroImage": "/assets/content/doors-hero.jpg", + "visualPresentation": { + "home": { + "founderBadge": "接受项目沟通", + "proofEyebrow": "专业经验与合作成果", + "proofTitle": "14 年,只做门与空间的关系", + "manifestoEyebrow": "工作原则", + "manifestoTitle": "先厘清问题,再设计表达", + "worksEyebrow": "项目案例", + "worksTitle": "门系统项目", + "worksAction": "查看全部 →" }, - offerings: { - title: "门系统项目", - subtitle: "从入户门到室内门的一体化设计", - materialLabel: "包含:", - hardwareLabel: "定制说明:", - detailAction: "查看详情 →", - inquiryAction: "发起咨询", + "offerings": { + "title": "门系统项目", + "subtitle": "从入户门到室内门的一体化设计", + "materialLabel": "包含:", + "hardwareLabel": "定制说明:", + "detailAction": "查看详情 →", + "inquiryAction": "发起咨询" }, - detail: { - priceLabel: "价格参考", - spaceLabel: "适合场景", - backgroundTitle: "项目背景", - conceptTitle: "设计思路", - craftsTitle: "交付要点", - materialsTitle: "材料与说明", - inquiryAction: "发起咨询", - inquiryHint: "提交信息后由主理人与您沟通。", + "detail": { + "priceLabel": "价格参考", + "spaceLabel": "适合场景", + "backgroundTitle": "项目背景", + "conceptTitle": "设计思路", + "craftsTitle": "交付要点", + "materialsTitle": "材料与说明", + "inquiryAction": "发起咨询", + "inquiryHint": "提交信息后由主理人与您沟通。" }, - profile: { - phoneLabel: "联系电话", - wechatLabel: "微信", - addressLabel: "工作地点", - callAction: "呼叫", - copyAction: "复制", - recordsTitle: "我的咨询记录", - recordsCountUnit: "条记录", + "profile": { + "phoneLabel": "联系电话", + "wechatLabel": "微信", + "addressLabel": "工作地点", + "callAction": "呼叫", + "copyAction": "复制", + "recordsTitle": "我的咨询记录", + "recordsCountUnit": "条记录" }, - inquiry: { - eyebrow: "COLLABORATION", - title: "合作咨询", - subtitle: "留下你的需求与目标,主理人会尽快联系。", - submitLabel: "提交量房与定制评估需求", + "inquiry": { + "eyebrow": "COLLABORATION", + "title": "合作咨询", + "subtitle": "留下你的需求与目标,主理人会尽快联系。", + "submitLabel": "提交量房与定制评估需求" }, - success: { - eyebrow: "COLLABORATION", - title: "已收到你的咨询", - intro: "主理人会尽快与你联系。", - recordsAction: "查看咨询记录", - homeAction: "返回首页", - }, - records: { - title: "我的咨询记录", - createAction: "新增咨询", - emptyTitle: "还没有咨询记录", - emptyDescription: "提交一次咨询,开始与你的主理人沟通。", - emptyAction: "开始咨询", + "success": { + "eyebrow": "COLLABORATION", + "title": "已收到你的咨询", + "intro": "主理人会尽快与你联系。", + "recordsAction": "查看咨询记录", + "homeAction": "返回首页" }, + "records": { + "title": "我的咨询记录", + "createAction": "新增咨询", + "emptyTitle": "还没有咨询记录", + "emptyDescription": "提交一次咨询,开始与你的主理人沟通。", + "emptyAction": "开始咨询" + } }, - founder: "林叙安 (Lin XUAN)", - profilePresentation: { - coverage: [ + "founder": "林叙安 (Lin XUAN)", + "profilePresentation": { + "coverage": [ { - title: "直派核心圈", - content: - "上海、杭州、宁波、苏州、无锡、南京及深圳、广州。主理人及资深装配总工亲赴现场。", + "title": "直派核心圈", + "content": "上海、杭州、宁波、苏州、无锡、南京及深圳、广州。主理人及资深装配总工亲赴现场。" }, { - title: "全国其他城市私邸", - content: "接受建筑设计师联合委托,安排远程 3D 激光测绘支持与专用物流直运安装。", - }, + "title": "全国其他城市私邸", + "content": "接受建筑设计师联合委托,安排远程 3D 激光测绘支持与专用物流直运安装。" + } ], - warranty: [ + "warranty": [ "门体内部防变形航空合金骨架承诺 10 年结构质保;", "重型天地轴、进口地弹簧及磁吸五金 5 年免费维护;", "每樘门出厂前进行 5000 次启闭校正;", - "原木天然肌理享有首年 2 次木蜡油保养服务。", - ], - }, - }, + "原木天然肌理享有首年 2 次木蜡油保养服务。" + ] + } + } }, - personal: { - templateKey: "personal", - inquiryFormName: "合作咨询表单", - offerings: [ + "personal": { + "templateKey": "personal", + "inquiryFormName": "合作咨询表单", + "offerings": [ { - kind: "service", - name: "示例·品牌定位咨询", - summary: "梳理品牌定位与下一步行动。", - categoryKey: "consulting", - coverUrl: "/assets/content/personal-consulting.jpg", - priceText: "按需求确认", - config: { - media: [ + "kind": "service", + "name": "示例·品牌定位咨询", + "summary": "梳理品牌定位与下一步行动。", + "categoryKey": "consulting", + "coverUrl": "/assets/content/personal-consulting.jpg", + "priceText": "按需求确认", + "config": { + "media": [ { - url: "/assets/content/personal-consulting.jpg", - alt: "", - type: "image", - }, - ], - }, + "url": "/assets/content/personal-consulting.jpg", + "alt": "", + "type": "image" + } + ] + } }, { - kind: "service", - name: "示例·长期顾问支持", - summary: "围绕表达和转化提供持续支持。", - categoryKey: "advisory", - coverUrl: "/assets/content/personal-advisory.jpg", - priceText: "按服务周期确认", - config: { - media: [ + "kind": "service", + "name": "示例·长期顾问支持", + "summary": "围绕表达和转化提供持续支持。", + "categoryKey": "advisory", + "coverUrl": "/assets/content/personal-advisory.jpg", + "priceText": "按服务周期确认", + "config": { + "media": [ { - url: "/assets/content/personal-advisory.jpg", - alt: "", - type: "image", - }, - ], - }, - }, + "url": "/assets/content/personal-advisory.jpg", + "alt": "", + "type": "image" + } + ] + } + } ], - trustContent: [ + "trustContent": [ { - type: "credential", - title: "关于主理人", - content: "示例内容,待品牌主理人完善。", + "type": "credential", + "title": "关于主理人", + "content": "示例内容,待品牌主理人完善。" }, { - type: "process", - title: "合作方法", - content: "示例内容,待品牌主理人完善。", - }, + "type": "process", + "title": "合作方法", + "content": "示例内容,待品牌主理人完善。" + } ], - fields: [ + "fields": [ { - key: "name", - label: "您的称呼", - type: "text", - required: true, + "key": "name", + "label": "您的称呼", + "type": "text", + "required": true }, { - key: "phone", - label: "联系方式", - type: "phone", - required: true, + "key": "phone", + "label": "联系方式", + "type": "phone", + "required": true }, { - key: "remark", - label: "合作需求", - type: "textarea", - required: true, - }, + "key": "remark", + "label": "合作需求", + "type": "textarea", + "required": true + } ], - capabilityKey: "inquiry", - brandConfig: { - visualTemplateKey: "linjing-editorial", - templateData: { - designPhilosophy: "先厘清问题,再设计表达", + "capabilityKey": "inquiry", + "brandConfig": { + "templateData": { + "designPhilosophy": "先厘清问题,再设计表达" }, - title: "品牌策略顾问", - slogan: "用清晰的定位与可执行的表达,让专业被看见。", - phone: "", - wechat: "", - studioAddress: "上海市徐汇区创意园区", - avatarUrl: "/assets/content/personal-avatar.jpg", - heroImage: "/assets/content/personal-consulting.jpg", - visualPresentation: { - home: { - founderBadge: "接受项目沟通", - proofEyebrow: "专业经验与合作成果", - proofTitle: "经验与方法", - manifestoEyebrow: "工作原则", - manifestoTitle: "先厘清问题,再设计表达", - worksEyebrow: "合作方式", - worksTitle: "品牌策略与顾问服务", - worksAction: "查看全部 →", + "title": "品牌策略顾问", + "slogan": "用清晰的定位与可执行的表达,让专业被看见。", + "phone": "", + "wechat": "", + "studioAddress": "上海市徐汇区创意园区", + "avatarUrl": "/assets/content/personal-avatar.jpg", + "heroImage": "/assets/content/personal-consulting.jpg", + "visualPresentation": { + "home": { + "founderBadge": "接受项目沟通", + "proofEyebrow": "专业经验与合作成果", + "proofTitle": "经验与方法", + "manifestoEyebrow": "工作原则", + "manifestoTitle": "先厘清问题,再设计表达", + "worksEyebrow": "合作方式", + "worksTitle": "品牌策略与顾问服务", + "worksAction": "查看全部 →" }, - offerings: { - title: "合作方式", - subtitle: "围绕定位、表达与业务转化,选择适合当前阶段的支持。", - materialLabel: "包含:", - hardwareLabel: "定制说明:", - detailAction: "查看详情 →", - inquiryAction: "发起咨询", + "offerings": { + "title": "合作方式", + "subtitle": "围绕定位、表达与业务转化,选择适合当前阶段的支持。", + "materialLabel": "包含:", + "hardwareLabel": "定制说明:", + "detailAction": "查看详情 →", + "inquiryAction": "发起咨询" }, - detail: { - priceLabel: "价格参考", - spaceLabel: "适合场景", - backgroundTitle: "项目背景", - conceptTitle: "设计思路", - craftsTitle: "交付要点", - materialsTitle: "材料与说明", - inquiryAction: "发起咨询", - inquiryHint: "提交信息后由主理人与您沟通。", + "detail": { + "priceLabel": "价格参考", + "spaceLabel": "适合场景", + "backgroundTitle": "项目背景", + "conceptTitle": "设计思路", + "craftsTitle": "交付要点", + "materialsTitle": "材料与说明", + "inquiryAction": "发起咨询", + "inquiryHint": "提交信息后由主理人与您沟通。" }, - profile: { - phoneLabel: "联系电话", - wechatLabel: "微信", - addressLabel: "工作地点", - callAction: "呼叫", - copyAction: "复制", - recordsTitle: "我的咨询记录", - recordsCountUnit: "条记录", + "profile": { + "phoneLabel": "联系电话", + "wechatLabel": "微信", + "addressLabel": "工作地点", + "callAction": "呼叫", + "copyAction": "复制", + "recordsTitle": "我的咨询记录", + "recordsCountUnit": "条记录" }, - inquiry: { - eyebrow: "COLLABORATION", - title: "合作咨询", - subtitle: "留下你的需求与目标,主理人会尽快联系。", - submitLabel: "提交咨询", + "inquiry": { + "eyebrow": "COLLABORATION", + "title": "合作咨询", + "subtitle": "留下你的需求与目标,主理人会尽快联系。", + "submitLabel": "提交咨询" }, - success: { - eyebrow: "COLLABORATION", - title: "已收到你的咨询", - intro: "主理人会尽快与你联系。", - recordsAction: "查看咨询记录", - homeAction: "返回首页", - }, - records: { - title: "我的咨询记录", - createAction: "新增咨询", - emptyTitle: "还没有咨询记录", - emptyDescription: "提交一次咨询,开始与你的主理人沟通。", - emptyAction: "开始咨询", + "success": { + "eyebrow": "COLLABORATION", + "title": "已收到你的咨询", + "intro": "主理人会尽快与你联系。", + "recordsAction": "查看咨询记录", + "homeAction": "返回首页" }, + "records": { + "title": "我的咨询记录", + "createAction": "新增咨询", + "emptyTitle": "还没有咨询记录", + "emptyDescription": "提交一次咨询,开始与你的主理人沟通。", + "emptyAction": "开始咨询" + } }, - founder: "示例主理人", - }, - }, + "founder": "示例主理人" + } + } }, - pages: ["pages/index/index", "pages/services/index", "pages/bookings/index"], - visualTemplateKey: "linjing-editorial", - }, + "pages": [ + "pages/index/index", + "pages/services/index", + "pages/bookings/index" + ], + "visualTemplateKey": "linjing-editorial", + "previewFixture": { + "doors": { + "schemaVersion": "1", + "brand": { + "name": "林境建筑画册 · 预览", + "tagline": "用于独立预览的模板演示内容", + "description": "此内容仅用于平台模板预览,不代表真实品牌或客户案例。", + "deliveryNote": "演示预览已禁用真实咨询和联系操作。" + }, + "content": { + "templateKey": "doors", + "inquiryFormName": "门系统咨询表单", + "offerings": [ + { + "kind": "product", + "name": "序章·入户门", + "summary": "为别墅入口定制的整樘门系统", + "categoryKey": "entrance-door", + "coverUrl": "/assets/content/doors-hero.jpg", + "priceText": "按项目确认", + "config": { + "series": "「万籁」重型天地轴入户系统", + "hardware": "德国 dormakaba 重型地弹簧 + 定制实心锻铜一体式长执手", + "details": { + "materialsList": [ + { + "name": "门扇主体", + "spec": "航空铝蜂窝 + 防暴钢板 + 黑胡桃" + }, + { + "name": "承重结构", + "spec": "不锈钢重型天地偏心轴" + } + ] + }, + "media": [ + { + "url": "/assets/content/doors-hero.jpg", + "alt": "", + "type": "image" + } + ] + } + }, + { + "kind": "product", + "name": "庭院·边界门", + "summary": "连接建筑与庭院的定制门", + "categoryKey": "garden-door", + "coverUrl": "/assets/content/doors-yard-gate.jpg", + "priceText": "按项目确认", + "config": { + "series": "「虚实」透光私家庭院门", + "hardware": "意大利全隐形地埋式液压自闭器 + 静音电控锁", + "details": { + "materialsList": [ + { + "name": "户外木种", + "spec": "高油脂老料缅甸柚木" + }, + { + "name": "骨架型材", + "spec": "高强度航空铝镁合金" + } + ] + }, + "media": [ + { + "url": "/assets/content/doors-yard-gate.jpg", + "alt": "", + "type": "image" + } + ] + } + }, + { + "kind": "product", + "name": "室内·静谧门", + "summary": "统一室内空间秩序的户内门", + "categoryKey": "interior-door", + "coverUrl": "/assets/content/doors-room-door.jpg", + "priceText": "按项目确认", + "config": { + "series": "「空灵」2.8m - 3.2m 满高通顶系统", + "hardware": "意大利 AGB 磁吸静音门锁 + 隐藏式暗铰链", + "details": { + "materialsList": [ + { + "name": "抗弯核心", + "spec": "双组份碳纤维预应力防变形拉力杆" + }, + { + "name": "吸音内衬", + "spec": "德国均质空心桥洞力学板" + } + ] + }, + "media": [ + { + "url": "/assets/content/doors-room-door.jpg", + "alt": "", + "type": "image" + } + ] + } + }, + { + "kind": "service", + "name": "一对一门系统设计咨询", + "summary": "从现场到方案的完整设计沟通", + "categoryKey": "custom", + "coverUrl": "/assets/content/personal-consulting.jpg", + "priceText": "按项目确认", + "config": { + "series": "「无垠」密室及背景墙融合门", + "hardware": "感应式电动自开闭装置或碰珠反弹器", + "details": { + "materialsList": [ + { + "name": "表面饰材", + "spec": "意大利雪山银狐超薄天然大理石" + }, + { + "name": "驱动系统", + "spec": "低噪步进电机伺服闭门器" + } + ] + }, + "media": [ + { + "url": "/assets/content/personal-consulting.jpg", + "alt": "", + "type": "image" + } + ] + } + } + ], + "trustContent": [ + { + "type": "credential", + "title": "主理人的门作观", + "content": "国家注册高级室内建筑师,专注高定大门及私宅空间门类系统研发 14 年。", + "config": { + "stats": [ + { + "value": "14年", + "label": "高端门系深化经验", + "sub": "历经百项严苛私宅考验" + }, + { + "value": "260+", + "label": "落地庄园实景案例", + "sub": "全实景图库,可预约探访" + }, + { + "value": "100%", + "label": "主理人全案跟进", + "sub": "量房 / 出图 / 选料 / 试装" + }, + { + "value": "10年", + "label": "结构主轴质保承诺", + "sub": "终生五金润滑维保机制" + } + ], + "pillars": [ + { + "title": "天然厚板与古铜锻打", + "desc": "精选天然木材与手工冷锻紫铜,构建长期耐用的门体结构。" + }, + { + "title": "微米级红外高精量房", + "desc": "通过 3D 空间激光扫描复核门洞公差与建筑墙体垂直度。" + }, + { + "title": "隐匿式重型五金系统", + "desc": "使用可调静音承重铰链,让重型门体开合轻盈安静。" + } + ], + "serviceFlow": [ + { + "step": "01", + "name": "私享沟通", + "desc": "厘清生活动线与风候环境" + }, + { + "step": "02", + "name": "上门实测", + "desc": "复核门洞公差与地平基准" + }, + { + "step": "03", + "name": "构造出图", + "desc": "输出结构图与材质节点方案" + }, + { + "step": "04", + "name": "实样工坊确认", + "desc": "确认木样、锻铜样与密封节点" + }, + { + "step": "05", + "name": "工坊试装交付", + "desc": "试装调试后专车直运现场" + }, + { + "step": "06", + "name": "终生私属维护", + "desc": "建立一门一档数字化档案" + } + ] + } + }, + { + "type": "case", + "title": "别墅门系统案例", + "content": "示例内容,待品牌主理人完善。" + }, + { + "type": "process", + "title": "从测量到交付", + "content": "示例内容,待品牌主理人完善。" + } + ], + "fields": [ + { + "key": "doorType", + "label": "期望定制的门类型", + "type": "select", + "required": true, + "options": [ + { + "label": "入户大门(防暴铸铜 / 实木)", + "value": "entry" + }, + { + "label": "庭院围墙门(耐候格栅 / 对开)", + "value": "yard" + }, + { + "label": "全屋室内门系统(通顶隐形)", + "value": "interior" + }, + { + "label": "背景墙一体门 / 密室门", + "value": "wall" + }, + { + "label": "整栋别墅门系统全案一体化", + "value": "whole-home" + } + ] + }, + { + "key": "cityArea", + "label": "房屋 / 别墅所在城市与楼盘", + "type": "text", + "required": true + }, + { + "key": "projectStage", + "label": "项目阶段", + "type": "select", + "required": true, + "options": [ + { + "label": "土建结构阶段(适合预埋加固)", + "value": "structure" + }, + { + "label": "水电木工阶段(适合精确测距)", + "value": "rough-in" + }, + { + "label": "硬装收尾阶段", + "value": "finishing" + }, + { + "label": "旧宅门体翻新改造", + "value": "renovation" + } + ] + }, + { + "key": "budgetRange", + "label": "预估门系统投资预算", + "type": "select", + "required": false, + "options": [ + { + "label": "5 万 - 10 万", + "value": "50k-100k" + }, + { + "label": "10 万 - 20 万", + "value": "100k-200k" + }, + { + "label": "20 万 - 50 万(全宅全案)", + "value": "200k-500k" + }, + { + "label": "50 万以上(顶级孤品定制)", + "value": "500k-plus" + } + ] + }, + { + "key": "needMeasure", + "label": "是否需要主理人上门现场量房", + "type": "radio", + "required": true, + "options": [ + { + "label": "需要(预约排期现场勘测)", + "value": "需要(预约排期现场勘测)" + }, + { + "label": "暂不需要(先发图纸在线深化评估)", + "value": "暂不需要(先发图纸在线深化评估)" + } + ] + }, + { + "key": "contactName", + "label": "贵姓称谓", + "type": "text", + "required": true + }, + { + "key": "contactPhone", + "label": "联系手机号(微信同号)", + "type": "tel", + "required": true + }, + { + "key": "specialNote", + "label": "空间想法或特殊需求描述", + "type": "textarea", + "required": false + } + ], + "capabilityKey": "inquiry", + "brandConfig": { + "templateData": { + "designPhilosophy": "先厘清问题,再设计表达" + }, + "title": "高端门系统建筑研造主理人", + "slogan": "为当代别墅空间,定制有秩序感与呼吸感的门", + "phone": "186-0218-9908", + "wechat": "LIN-ATELIER-2024", + "studioAddress": "上海市静安区威海路设计中心 A 座 / 杭州良渚研造工坊", + "avatarUrl": "/assets/content/personal-avatar.jpg", + "heroImage": "/assets/content/doors-hero.jpg", + "visualPresentation": { + "home": { + "founderBadge": "接受项目沟通", + "proofEyebrow": "专业经验与合作成果", + "proofTitle": "14 年,只做门与空间的关系", + "manifestoEyebrow": "工作原则", + "manifestoTitle": "先厘清问题,再设计表达", + "worksEyebrow": "项目案例", + "worksTitle": "门系统项目", + "worksAction": "查看全部 →" + }, + "offerings": { + "title": "门系统项目", + "subtitle": "从入户门到室内门的一体化设计", + "materialLabel": "包含:", + "hardwareLabel": "定制说明:", + "detailAction": "查看详情 →", + "inquiryAction": "发起咨询" + }, + "detail": { + "priceLabel": "价格参考", + "spaceLabel": "适合场景", + "backgroundTitle": "项目背景", + "conceptTitle": "设计思路", + "craftsTitle": "交付要点", + "materialsTitle": "材料与说明", + "inquiryAction": "发起咨询", + "inquiryHint": "提交信息后由主理人与您沟通。" + }, + "profile": { + "phoneLabel": "联系电话", + "wechatLabel": "微信", + "addressLabel": "工作地点", + "callAction": "呼叫", + "copyAction": "复制", + "recordsTitle": "我的咨询记录", + "recordsCountUnit": "条记录" + }, + "inquiry": { + "eyebrow": "COLLABORATION", + "title": "合作咨询", + "subtitle": "留下你的需求与目标,主理人会尽快联系。", + "submitLabel": "提交量房与定制评估需求" + }, + "success": { + "eyebrow": "COLLABORATION", + "title": "已收到你的咨询", + "intro": "主理人会尽快与你联系。", + "recordsAction": "查看咨询记录", + "homeAction": "返回首页" + }, + "records": { + "title": "我的咨询记录", + "createAction": "新增咨询", + "emptyTitle": "还没有咨询记录", + "emptyDescription": "提交一次咨询,开始与你的主理人沟通。", + "emptyAction": "开始咨询" + } + }, + "founder": "林叙安 (Lin XUAN)", + "profilePresentation": { + "coverage": [ + { + "title": "直派核心圈", + "content": "上海、杭州、宁波、苏州、无锡、南京及深圳、广州。主理人及资深装配总工亲赴现场。" + }, + { + "title": "全国其他城市私邸", + "content": "接受建筑设计师联合委托,安排远程 3D 激光测绘支持与专用物流直运安装。" + } + ], + "warranty": [ + "门体内部防变形航空合金骨架承诺 10 年结构质保;", + "重型天地轴、进口地弹簧及磁吸五金 5 年免费维护;", + "每樘门出厂前进行 5000 次启闭校正;", + "原木天然肌理享有首年 2 次木蜡油保养服务。" + ] + } + } + }, + "safety": { + "submissions": "disabled", + "customerRecords": "disabled", + "contactActions": "disabled" + } + }, + "personal": { + "schemaVersion": "1", + "brand": { + "name": "林境建筑画册 · 预览", + "tagline": "用于独立预览的模板演示内容", + "description": "此内容仅用于平台模板预览,不代表真实品牌或客户案例。", + "deliveryNote": "演示预览已禁用真实咨询和联系操作。" + }, + "content": { + "templateKey": "personal", + "inquiryFormName": "合作咨询表单", + "offerings": [ + { + "kind": "service", + "name": "示例·品牌定位咨询", + "summary": "梳理品牌定位与下一步行动。", + "categoryKey": "consulting", + "coverUrl": "/assets/content/personal-consulting.jpg", + "priceText": "按需求确认", + "config": { + "media": [ + { + "url": "/assets/content/personal-consulting.jpg", + "alt": "", + "type": "image" + } + ] + } + }, + { + "kind": "service", + "name": "示例·长期顾问支持", + "summary": "围绕表达和转化提供持续支持。", + "categoryKey": "advisory", + "coverUrl": "/assets/content/personal-advisory.jpg", + "priceText": "按服务周期确认", + "config": { + "media": [ + { + "url": "/assets/content/personal-advisory.jpg", + "alt": "", + "type": "image" + } + ] + } + } + ], + "trustContent": [ + { + "type": "credential", + "title": "关于主理人", + "content": "示例内容,待品牌主理人完善。" + }, + { + "type": "process", + "title": "合作方法", + "content": "示例内容,待品牌主理人完善。" + } + ], + "fields": [ + { + "key": "name", + "label": "您的称呼", + "type": "text", + "required": true + }, + { + "key": "phone", + "label": "联系方式", + "type": "phone", + "required": true + }, + { + "key": "remark", + "label": "合作需求", + "type": "textarea", + "required": true + } + ], + "capabilityKey": "inquiry", + "brandConfig": { + "templateData": { + "designPhilosophy": "先厘清问题,再设计表达" + }, + "title": "品牌策略顾问", + "slogan": "用清晰的定位与可执行的表达,让专业被看见。", + "phone": "", + "wechat": "", + "studioAddress": "上海市徐汇区创意园区", + "avatarUrl": "/assets/content/personal-avatar.jpg", + "heroImage": "/assets/content/personal-consulting.jpg", + "visualPresentation": { + "home": { + "founderBadge": "接受项目沟通", + "proofEyebrow": "专业经验与合作成果", + "proofTitle": "经验与方法", + "manifestoEyebrow": "工作原则", + "manifestoTitle": "先厘清问题,再设计表达", + "worksEyebrow": "合作方式", + "worksTitle": "品牌策略与顾问服务", + "worksAction": "查看全部 →" + }, + "offerings": { + "title": "合作方式", + "subtitle": "围绕定位、表达与业务转化,选择适合当前阶段的支持。", + "materialLabel": "包含:", + "hardwareLabel": "定制说明:", + "detailAction": "查看详情 →", + "inquiryAction": "发起咨询" + }, + "detail": { + "priceLabel": "价格参考", + "spaceLabel": "适合场景", + "backgroundTitle": "项目背景", + "conceptTitle": "设计思路", + "craftsTitle": "交付要点", + "materialsTitle": "材料与说明", + "inquiryAction": "发起咨询", + "inquiryHint": "提交信息后由主理人与您沟通。" + }, + "profile": { + "phoneLabel": "联系电话", + "wechatLabel": "微信", + "addressLabel": "工作地点", + "callAction": "呼叫", + "copyAction": "复制", + "recordsTitle": "我的咨询记录", + "recordsCountUnit": "条记录" + }, + "inquiry": { + "eyebrow": "COLLABORATION", + "title": "合作咨询", + "subtitle": "留下你的需求与目标,主理人会尽快联系。", + "submitLabel": "提交咨询" + }, + "success": { + "eyebrow": "COLLABORATION", + "title": "已收到你的咨询", + "intro": "主理人会尽快与你联系。", + "recordsAction": "查看咨询记录", + "homeAction": "返回首页" + }, + "records": { + "title": "我的咨询记录", + "createAction": "新增咨询", + "emptyTitle": "还没有咨询记录", + "emptyDescription": "提交一次咨询,开始与你的主理人沟通。", + "emptyAction": "开始咨询" + } + }, + "founder": "示例主理人" + } + }, + "safety": { + "submissions": "disabled", + "customerRecords": "disabled", + "contactActions": "disabled" + } + } + } + } ]; export const generatedTemplatePackageRegistryHash = - "9331ccd265c062ede2ac010e45e2fb20a38bfa176ca81869e0a54250f2619aa0"; + "dc82c85917f137a0f2a3a473147f32426ea0f46bf107adf709afd34cd5699db8"; diff --git a/packages/config/src/template-package-manifest.ts b/packages/config/src/template-package-manifest.ts index 77f65cc..2c69a9a 100644 --- a/packages/config/src/template-package-manifest.ts +++ b/packages/config/src/template-package-manifest.ts @@ -147,5 +147,5 @@ export interface TemplatePackageManifest { }[]; overrides?: readonly string[]; sampleContent?: Partial>; - previewFixture?: Partial>; + previewFixture: Readonly>>; } diff --git a/packages/config/src/template-packages.ts b/packages/config/src/template-packages.ts index bfd52ae..b232510 100644 --- a/packages/config/src/template-packages.ts +++ b/packages/config/src/template-packages.ts @@ -1,5 +1,6 @@ import { generatedTemplatePackageRegistry } from "./generated-template-packages.js"; import type { TemplatePackageManifest } from "./template-package-manifest.js"; +export { validateTemplatePackageManifest } from "@personal-brand/template-contract"; export const templatePackageRegistry: readonly TemplatePackageManifest[] = generatedTemplatePackageRegistry; @@ -13,24 +14,3 @@ export function getTemplatePackageManifestForVisualKey( ): TemplatePackageManifest | undefined { return templatePackageRegistry.find((item) => item.visualTemplateKey === visualTemplateKey); } - -export function validateTemplatePackageManifest(manifest: TemplatePackageManifest): string[] { - const errors: string[] = []; - if (!manifest.packageKey.trim()) errors.push("packageKey is required"); - if (!manifest.version.trim()) errors.push("version is required"); - if (manifest.runtimeContract !== "1.0") errors.push("unsupported runtimeContract"); - if (!manifest.supportedIndustryTemplates.length) - errors.push("supportedIndustryTemplates must not be empty"); - for (const page of [ - "home", - "offerings", - "detail", - "inquiry", - "success", - "records", - "profile", - ] as const) { - if (!manifest.entrypoints[page]?.trim()) errors.push(`entrypoints.${page} is required`); - } - return errors; -} diff --git a/packages/config/src/template-sample-content.ts b/packages/config/src/template-sample-content.ts index 412ecb2..c62def1 100644 --- a/packages/config/src/template-sample-content.ts +++ b/packages/config/src/template-sample-content.ts @@ -1,6 +1,4 @@ import type { BrandTemplateKey } from "./template-keys.js"; -import { getDefaultVisualTemplateKey } from "./visual-templates.js"; -import { templatePackageRegistry } from "./template-packages.js"; export interface TemplateSampleContent { templateKey: BrandTemplateKey; @@ -33,132 +31,3 @@ export interface TemplateSampleContent { }>; capabilityKey: string; } - -const doorsSampleContent: TemplateSampleContent = { - templateKey: "doors", - inquiryFormName: "门系统咨询表单", - offerings: [ - { - kind: "product", - name: "序章·入户门", - summary: "为别墅入口定制的整樘门系统", - categoryKey: "entrance-door", - }, - { - kind: "product", - name: "庭院·边界门", - summary: "连接建筑与庭院的定制门", - categoryKey: "garden-door", - }, - { - kind: "product", - name: "室内·静谧门", - summary: "统一室内空间秩序的户内门", - categoryKey: "interior-door", - }, - { - kind: "service", - name: "一对一门系统设计咨询", - summary: "从现场到方案的完整设计沟通", - categoryKey: "custom", - }, - ], - trustContent: [ - { type: "credential", title: "主理人的门作观", content: "示例内容,待品牌主理人完善。" }, - { type: "case", title: "别墅门系统案例", content: "示例内容,待品牌主理人完善。" }, - { type: "process", title: "从测量到交付", content: "示例内容,待品牌主理人完善。" }, - { type: "credential", title: "材料与工艺标准", content: "示例内容,待品牌主理人完善。" }, - ], - fields: [ - { key: "projectType", label: "项目类型", type: "select", required: false }, - { key: "projectStage", label: "项目阶段", type: "select", required: false }, - { key: "siteDescription", label: "项目概况", type: "textarea", required: false }, - { key: "phone", label: "联系方式", type: "phone", required: true }, - ], - capabilityKey: "doors", -}; - -const foodSampleContent: TemplateSampleContent = { - templateKey: "food", - inquiryFormName: "餐品预订与定制表单", - offerings: [ - { - kind: "package", - name: "示例·今日套餐", - summary: "现做家常套餐示例内容。", - categoryKey: "set-meal", - priceAmount: 2800, - }, - { - kind: "service", - name: "示例·聚餐定制", - summary: "按人数和口味沟通定制餐品。", - categoryKey: "private-chef", - }, - ], - trustContent: [ - { type: "credential", title: "关于主理人", content: "示例内容,待品牌主理人完善。" }, - { type: "process", title: "从预订到取餐", content: "示例内容,待品牌主理人完善。" }, - ], - fields: [ - { key: "date", label: "用餐日期", type: "date", required: true }, - { key: "number", label: "用餐人数", type: "number", required: true }, - { key: "phone", label: "联系方式", type: "phone", required: true }, - ], - capabilityKey: "booking", -}; - -const personalSampleContent: TemplateSampleContent = { - templateKey: "personal", - inquiryFormName: "合作咨询表单", - offerings: [ - { - kind: "service", - name: "示例·品牌定位咨询", - summary: "梳理品牌定位与下一步行动。", - categoryKey: "consulting", - }, - { - kind: "service", - name: "示例·长期顾问支持", - summary: "围绕表达和转化提供持续支持。", - categoryKey: "advisory", - }, - ], - trustContent: [ - { type: "credential", title: "关于主理人", content: "示例内容,待品牌主理人完善。" }, - { type: "process", title: "合作方法", content: "示例内容,待品牌主理人完善。" }, - ], - fields: [ - { key: "name", label: "您的称呼", type: "text", required: true }, - { key: "phone", label: "联系方式", type: "phone", required: true }, - { key: "remark", label: "合作需求", type: "textarea", required: true }, - ], - capabilityKey: "inquiry", -}; - -export const templateSampleContent = { - personal: personalSampleContent, - food: foodSampleContent, - doors: doorsSampleContent, -} as const; - -export function getTemplateSampleContent( - templateKey: string, - visualTemplateKey?: string, -): TemplateSampleContent | undefined { - const selected = visualTemplateKey - ? templatePackageRegistry.find( - (item) => - item.packageKey === visualTemplateKey && - item.supportedIndustryTemplates.includes(templateKey), - ) - : undefined; - if (selected) return selected.sampleContent?.[templateKey]; - const packageSample = templatePackageRegistry.find( - (item) => - item.packageKey === getDefaultVisualTemplateKey(templateKey) && - item.supportedIndustryTemplates.includes(templateKey), - )?.sampleContent?.[templateKey]; - return packageSample ?? templateSampleContent[templateKey as keyof typeof templateSampleContent]; -} diff --git a/packages/config/src/visual-templates.ts b/packages/config/src/visual-templates.ts index 7ef1805..dff51b2 100644 --- a/packages/config/src/visual-templates.ts +++ b/packages/config/src/visual-templates.ts @@ -67,13 +67,3 @@ export const visualTemplateKeys = listVisualTemplateKeys(); export function getVisualTemplate(key: string): VisualTemplateDefinition | undefined { return visualTemplates[key]; } - -export function getDefaultVisualTemplateKey(industryTemplateKey: string): VisualTemplateKey { - return ( - listVisualTemplateKeys().find((key) => - getVisualTemplate(key)?.supportedIndustryTemplates.includes(industryTemplateKey), - ) ?? defaultVisualTemplateKey - ); -} - -export const defaultVisualTemplateKey = "linjing-editorial" satisfies VisualTemplateKey; diff --git a/packages/template-acheng-campus-food/template.json b/packages/template-acheng-campus-food/template.json index fec1910..1e928d3 100644 --- a/packages/template-acheng-campus-food/template.json +++ b/packages/template-acheng-campus-food/template.json @@ -1539,7 +1539,6 @@ ], "capabilityKey": "booking", "brandConfig": { - "visualTemplateKey": "acheng-campus-food", "founder": "阿成", "title": "私房菜主理人", "slogan": "认真做好每一顿家常饭。", @@ -1615,5 +1614,394 @@ "pages/stall-service/index", "pages/bookings/index" ], - "overrides": ["pages/inquiry", "pages/inquiry-success", "pages/offering", "pages/records"] + "overrides": ["pages/inquiry", "pages/inquiry-success", "pages/offering", "pages/records"], + "visualTemplateKey": "acheng-campus-food", + "previewFixture": { + "food": { + "schemaVersion": "1", + "brand": { + "name": "阿成校园餐 · 预览", + "tagline": "用于独立预览的模板演示内容", + "description": "此内容仅用于平台模板预览,不代表真实品牌或客户案例。", + "deliveryNote": "演示预览已禁用真实咨询和联系操作。" + }, + "content": { + "templateKey": "food", + "inquiryFormName": "餐品预订与定制表单", + "offerings": [ + { + "kind": "package", + "name": "示例·今日套餐", + "summary": "现做家常套餐示例内容。", + "categoryKey": "set-meal", + "coverUrl": "/assets/content/package-01.jpg", + "priceText": "¥28 起 / 份", + "config": { + "media": [ + { + "url": "/assets/content/package-01.jpg", + "alt": "", + "type": "image" + } + ] + } + }, + { + "kind": "service", + "name": "示例·聚餐定制", + "summary": "按人数和口味沟通定制餐品。", + "categoryKey": "private-chef", + "coverUrl": "/assets/content/private-chef.jpg", + "priceText": "按人数和菜单确认", + "config": { + "media": [ + { + "url": "/assets/content/private-chef.jpg", + "alt": "", + "type": "image" + } + ] + } + }, + { + "kind": "service", + "name": "示例·团体餐定制", + "summary": "为社团、活动和小型聚会提供批量餐品定制。", + "categoryKey": "group-meal", + "coverUrl": "/assets/content/private-chef.jpg", + "priceText": "按人数和菜单确认", + "config": { + "media": [ + { + "url": "/assets/content/private-chef.jpg", + "alt": "", + "type": "image" + } + ] + } + } + ], + "trustContent": [ + { + "type": "schedule", + "title": "每周出摊固定日程", + "content": "", + "config": { + "status": "准时出摊", + "weekdayLabel": "周一至周五(晚餐 + 夜宵档)", + "weekdayTag": "常规固定点", + "weekdayDetail": "地点:二号校门外小吃商业街 #07 号铺位", + "weekdayHours": "营业:17:00 - 22:30(下雨搭防雨防风棚正常营业)", + "weekendLabel": "周六、周日(全天接团体单 + 夜市流动)", + "weekendTag": "活动专车", + "weekendDetail": "白天专供:球赛、班级春游、社团集训、答辩餐", + "weekendHours": "晚间:18:00 - 23:00 体育馆南侧流动出摊" + } + }, + { + "type": "coverage", + "title": "取餐与配送范围", + "content": "", + "config": { + "pickupTitle": "摊位现场自取", + "pickupDetail": "小程序提前留餐,报手机尾号即拿,附赠特制加厚保温袋,不用排长龙。", + "deliveryTitle": "校内楼下配送", + "deliveryDetail": "满 3 份即可送至宿舍楼栋或实验楼门前,阿成骑专用恒温保温箱电动车直送。" + } + }, + { + "type": "process", + "title": "定制餐品 4 步流程", + "content": "", + "config": { + "intro": "专为班长、社长、活动干事设计的极简排菜流程", + "steps": [ + { + "title": "提交基本需求", + "detail": "选择活动类型(如生日会、社团换届、答辩加餐)、预估人数与预算。" + }, + { + "title": "15 分钟内核算菜单", + "detail": "阿成微信直接联系,提供荤素搭配明细与个性化需求(免辣、清真配料等)。" + }, + { + "title": "当日新鲜烹饪打包", + "detail": "提前 2 小时生鲜采买,铁锅现炒,独立封盒并标注姓名 / 楼栋。" + }, + { + "title": "保温直达交付", + "detail": "约定时间准时送抵指定场地,确认菜品温度与数量无误后结算。" + } + ], + "minimumNote": "起订门槛:6 份起", + "refundNote": "退改:出餐前 2 小时全退" + } + }, + { + "type": "credential", + "title": "食品安全与制作标准", + "content": "示例内容,请根据实际资质和制作标准完善。", + "config": { + "standards": [ + { + "title": "当天采购", + "detail": "按当天需求采买" + }, + { + "title": "现做现出餐", + "detail": "按约定时间制作" + }, + { + "title": "食具清洁消毒", + "detail": "每日清洁与消毒" + } + ] + } + }, + { + "type": "case", + "title": "他们都在阿成这订过餐", + "summary": "感谢大学城各学院与社团伙伴的信任", + "content": "校街舞社年度专场 · 52 人份\n信息学院科创竞赛 · 连签 5 天\n7 号楼庆功宴 · 8 人定制", + "config": { + "entries": [ + { + "badge": "舞", + "title": "校街舞社年度专场(52 人份)", + "detail": "保温箱直达大礼堂后台,贴名分装", + "result": "零延误签收" + }, + { + "badge": "科", + "title": "信息学院科创竞赛封闭备赛", + "detail": "每日荤素轮换,附赠每日滋补老汤", + "result": "连签 5 天" + }, + { + "badge": "寝", + "title": "7 号楼庆功宴(8 人定制)", + "detail": "定制双拼厚肉饭", + "result": "定制餐品" + } + ] + } + }, + { + "type": "promise", + "title": "阿成的真实回复承诺", + "content": "备料期 15 分钟内联系,出摊高峰 1 小时内回复。", + "config": { + "commitments": [ + { + "label": "非出摊备料期", + "detail": "提交咨询后通过微信或电话沟通。", + "highlight": "15 分钟内" + }, + { + "label": "出摊晚高峰", + "detail": "正在出餐,稍有延迟,会抽空回复。", + "highlight": "1 小时内" + } + ] + } + } + ], + "fields": [ + { + "key": "type", + "label": "咨询类型", + "type": "select", + "required": true, + "options": [ + { + "label": "日常留餐", + "value": "日常留餐" + }, + { + "label": "宿舍开黑餐", + "value": "宿舍开黑餐" + }, + { + "label": "社团 / 班级活动", + "value": "社团 / 班级活动" + }, + { + "label": "生日聚会", + "value": "生日聚会" + }, + { + "label": "考试周加餐", + "value": "考试周加餐" + }, + { + "label": "其他需求", + "value": "其他需求" + } + ] + }, + { + "key": "people", + "label": "用餐人数", + "type": "select", + "required": true, + "options": [ + { + "label": "1 人(单点)", + "value": "1 人(单点)" + }, + { + "label": "2-4 人(寝室小聚)", + "value": "2-4 人(寝室小聚)" + }, + { + "label": "5-10 人(部门小聚)", + "value": "5-10 人(部门小聚)" + }, + { + "label": "10-30 人(社团活动)", + "value": "10-30 人(社团活动)" + }, + { + "label": "30 人以上(大型活动)", + "value": "30 人以上(大型活动)" + } + ] + }, + { + "key": "date", + "label": "用餐日期", + "type": "date", + "required": true + }, + { + "key": "budget", + "label": "人均预算", + "type": "select", + "required": false, + "options": [ + { + "label": "15 元左右 / 人(实惠)", + "value": "15 元左右 / 人(实惠)" + }, + { + "label": "18-22 元 / 人(荤素双拼)", + "value": "18-22 元 / 人(荤素双拼)" + }, + { + "label": "25 元以上 / 人(高规格定制)", + "value": "25 元以上 / 人(高规格定制)" + } + ] + }, + { + "key": "delivery", + "label": "取餐 / 配送方式", + "type": "select", + "required": false, + "options": [ + { + "label": "摊位自取(报手机尾号即拿)", + "value": "摊位自取(报手机尾号即拿)" + }, + { + "label": "送至宿舍楼下(满 3 份)", + "value": "送至宿舍楼下(满 3 份)" + }, + { + "label": "送至指定教室 / 场地", + "value": "送至指定教室 / 场地" + } + ] + }, + { + "key": "remark", + "label": "餐品 / 口味 / 忌口备注", + "type": "textarea", + "required": false, + "placeholder": "例:现炒牛肉饭 1 份,微辣多浇卤汁,不要香菜" + }, + { + "key": "phone", + "label": "联系手机", + "type": "phone", + "required": true + } + ], + "capabilityKey": "booking", + "brandConfig": { + "founder": "阿成", + "title": "私房菜主理人", + "slogan": "认真做好每一顿家常饭。", + "phone": "", + "wechat": "", + "studioAddress": "大学城生活区东门附近", + "avatarUrl": "/assets/owner/portrait.jpg", + "heroImage": "/assets/content/package-01.jpg", + "visualPresentation": { + "home": { + "stallTitle": "服务地点", + "primaryAction": "咨询 / 预订", + "secondaryAction": "查看菜单", + "worksEyebrow": "今日推荐", + "worksTitle": "热门套餐", + "worksAction": "查看全部 →", + "manifestoTitle": "我们的服务承诺" + }, + "offerings": { + "title": "餐品与定制", + "subtitle": "现做家常餐、团体餐和活动定制", + "materialLabel": "包含:", + "hardwareLabel": "定制说明:", + "detailAction": "查看详情 →", + "inquiryAction": "预订 / 咨询" + }, + "detail": { + "priceLabel": "价格参考", + "spaceLabel": "适合场景", + "backgroundTitle": "餐品说明", + "conceptTitle": "备餐方式", + "craftsTitle": "服务内容", + "materialsTitle": "交付说明", + "inquiryAction": "预订 / 咨询", + "inquiryHint": "提交后会由主理人与你确认时间、数量和地点。" + }, + "profile": { + "phoneLabel": "联系电话", + "wechatLabel": "微信", + "addressLabel": "服务地点", + "callAction": "呼叫", + "copyAction": "复制", + "recordsTitle": "我的订单与咨询", + "recordsCountUnit": "条记录" + }, + "inquiry": { + "eyebrow": "ORDER", + "title": "餐品预订", + "subtitle": "留下用餐时间和人数,我会尽快确认。", + "submitLabel": "提交预订需求" + }, + "success": { + "eyebrow": "ORDER", + "title": "已收到你的需求", + "intro": "确认备餐时间和数量后,我会尽快回复。", + "recordsAction": "查看咨询记录", + "homeAction": "返回首页" + }, + "records": { + "title": "我的咨询记录", + "createAction": "新增咨询", + "emptyTitle": "还没有咨询记录", + "emptyDescription": "提交一次需求,开始与主理人沟通。", + "emptyAction": "开始咨询" + } + } + } + }, + "safety": { + "submissions": "disabled", + "customerRecords": "disabled", + "contactActions": "disabled" + } + } + } } diff --git a/packages/template-compiler/test/fixtures/template-drill-consultant/template.json b/packages/template-compiler/test/fixtures/template-drill-consultant/template.json index 9f0e39e..ce3390b 100644 --- a/packages/template-compiler/test/fixtures/template-drill-consultant/template.json +++ b/packages/template-compiler/test/fixtures/template-drill-consultant/template.json @@ -2,6 +2,7 @@ "packageKey": "drill-consultant", "version": "0.1.0", "displayName": "咨询师演练模板", + "visualTemplateKey": "drill-consultant", "defaultBrandSlug": "drill-consultant", "runtimeContract": "1.0", "supportedIndustryTemplates": ["consulting"], @@ -54,5 +55,28 @@ ] } ] + }, + "previewFixture": { + "consulting": { + "schemaVersion": "1", + "brand": { + "name": "咨询师演练", + "tagline": "用于编译器测试的虚构品牌", + "description": "此内容仅用于模板编译器测试。" + }, + "content": { + "templateKey": "consulting", + "inquiryFormName": "演练咨询表单", + "capabilityKey": "inquiry", + "offerings": [], + "trustContent": [], + "fields": [] + }, + "safety": { + "submissions": "disabled", + "customerRecords": "disabled", + "contactActions": "disabled" + } + } } } diff --git a/packages/template-contract/src/index.ts b/packages/template-contract/src/index.ts index 3ebe4e4..fa449c1 100644 --- a/packages/template-contract/src/index.ts +++ b/packages/template-contract/src/index.ts @@ -137,6 +137,7 @@ export type TemplatePackageManifest = { packageKey: string; version: string; displayName: string; + visualTemplateKey: string; runtimeContract: typeof TEMPLATE_RUNTIME_CONTRACT; supportedIndustryTemplates: string[]; entrypoints: Record; @@ -160,22 +161,21 @@ export type TemplatePackageManifest = { admin: TemplateAdminManifest; trustContentTypes?: TemplateTrustContentType[]; sampleContent?: Record; - previewFixture?: Record; + previewFixture: Record; }; export function validateTemplatePackageManifest(value: unknown): string[] { const errors: string[] = []; if (!value || typeof value !== "object") return ["manifest must be an object"]; const manifest = value as Partial; - if (manifest.previewFixture !== undefined) { - for (const issue of validateTemplatePreviewFixtures( - manifest.previewFixture, - manifest.supportedIndustryTemplates ?? [], - )) - errors.push(`previewFixture.${issue.path}: ${issue.message}`); - } + for (const issue of validateTemplatePreviewFixtures( + manifest.previewFixture, + manifest.supportedIndustryTemplates ?? [], + )) + errors.push(`previewFixture.${issue.path}: ${issue.message}`); if (!manifest.packageKey?.trim()) errors.push("packageKey is required"); if (!manifest.version?.trim()) errors.push("version is required"); + if (!manifest.visualTemplateKey?.trim()) errors.push("visualTemplateKey is required"); if (manifest.runtimeContract !== TEMPLATE_RUNTIME_CONTRACT) errors.push(`runtimeContract must be ${TEMPLATE_RUNTIME_CONTRACT}`); if (!manifest.displayName?.trim()) errors.push("displayName is required"); diff --git a/packages/template-contract/test/manifest.test.mjs b/packages/template-contract/test/manifest.test.mjs index 48690bb..8c33971 100644 --- a/packages/template-contract/test/manifest.test.mjs +++ b/packages/template-contract/test/manifest.test.mjs @@ -58,6 +58,14 @@ for (const key of ["acheng-campus-food", "linjing-editorial"]) { test("template contract rejects technical or incomplete admin declarations", () => { const manifestPath = path.join(packageRoot, "template-acheng-campus-food/template.json"); const manifest = JSON.parse(fs.readFileSync(manifestPath, "utf8")); + const previewFixture = structuredClone(manifest.previewFixture); + delete manifest.previewFixture; + assert.ok( + validateTemplatePackageManifest(manifest).some((message) => + message.startsWith("previewFixture"), + ), + ); + manifest.previewFixture = previewFixture; manifest.admin.sections[0].fields[0].label = ""; manifest.assetSlots[0].help = ""; assert.deepEqual(validateTemplatePackageManifest(manifest), [ diff --git a/packages/template-linjing-editorial/package.json b/packages/template-linjing-editorial/package.json index b17e59e..19b2024 100644 --- a/packages/template-linjing-editorial/package.json +++ b/packages/template-linjing-editorial/package.json @@ -1,6 +1,6 @@ { "name": "@personal-brand/template-linjing-editorial", - "version": "1.0.4", + "version": "1.0.5", "private": true, "type": "module", "files": [ diff --git a/packages/template-linjing-editorial/template.json b/packages/template-linjing-editorial/template.json index 12a4732..edc3feb 100644 --- a/packages/template-linjing-editorial/template.json +++ b/packages/template-linjing-editorial/template.json @@ -1,6 +1,6 @@ { "packageKey": "linjing-editorial", - "version": "1.0.4", + "version": "1.0.5", "displayName": "林境建筑画册", "defaultBrandSlug": "linjing-doors", "runtimeContract": "1.0", @@ -1336,8 +1336,14 @@ "hardware": "德国 dormakaba 重型地弹簧 + 定制实心锻铜一体式长执手", "details": { "materialsList": [ - { "name": "门扇主体", "spec": "航空铝蜂窝 + 防暴钢板 + 黑胡桃" }, - { "name": "承重结构", "spec": "不锈钢重型天地偏心轴" } + { + "name": "门扇主体", + "spec": "航空铝蜂窝 + 防暴钢板 + 黑胡桃" + }, + { + "name": "承重结构", + "spec": "不锈钢重型天地偏心轴" + } ] }, "media": [ @@ -1361,8 +1367,14 @@ "hardware": "意大利全隐形地埋式液压自闭器 + 静音电控锁", "details": { "materialsList": [ - { "name": "户外木种", "spec": "高油脂老料缅甸柚木" }, - { "name": "骨架型材", "spec": "高强度航空铝镁合金" } + { + "name": "户外木种", + "spec": "高油脂老料缅甸柚木" + }, + { + "name": "骨架型材", + "spec": "高强度航空铝镁合金" + } ] }, "media": [ @@ -1386,8 +1398,14 @@ "hardware": "意大利 AGB 磁吸静音门锁 + 隐藏式暗铰链", "details": { "materialsList": [ - { "name": "抗弯核心", "spec": "双组份碳纤维预应力防变形拉力杆" }, - { "name": "吸音内衬", "spec": "德国均质空心桥洞力学板" } + { + "name": "抗弯核心", + "spec": "双组份碳纤维预应力防变形拉力杆" + }, + { + "name": "吸音内衬", + "spec": "德国均质空心桥洞力学板" + } ] }, "media": [ @@ -1411,8 +1429,14 @@ "hardware": "感应式电动自开闭装置或碰珠反弹器", "details": { "materialsList": [ - { "name": "表面饰材", "spec": "意大利雪山银狐超薄天然大理石" }, - { "name": "驱动系统", "spec": "低噪步进电机伺服闭门器" } + { + "name": "表面饰材", + "spec": "意大利雪山银狐超薄天然大理石" + }, + { + "name": "驱动系统", + "spec": "低噪步进电机伺服闭门器" + } ] }, "media": [ @@ -1432,10 +1456,26 @@ "content": "国家注册高级室内建筑师,专注高定大门及私宅空间门类系统研发 14 年。", "config": { "stats": [ - { "value": "14年", "label": "高端门系深化经验", "sub": "历经百项严苛私宅考验" }, - { "value": "260+", "label": "落地庄园实景案例", "sub": "全实景图库,可预约探访" }, - { "value": "100%", "label": "主理人全案跟进", "sub": "量房 / 出图 / 选料 / 试装" }, - { "value": "10年", "label": "结构主轴质保承诺", "sub": "终生五金润滑维保机制" } + { + "value": "14年", + "label": "高端门系深化经验", + "sub": "历经百项严苛私宅考验" + }, + { + "value": "260+", + "label": "落地庄园实景案例", + "sub": "全实景图库,可预约探访" + }, + { + "value": "100%", + "label": "主理人全案跟进", + "sub": "量房 / 出图 / 选料 / 试装" + }, + { + "value": "10年", + "label": "结构主轴质保承诺", + "sub": "终生五金润滑维保机制" + } ], "pillars": [ { @@ -1452,12 +1492,36 @@ } ], "serviceFlow": [ - { "step": "01", "name": "私享沟通", "desc": "厘清生活动线与风候环境" }, - { "step": "02", "name": "上门实测", "desc": "复核门洞公差与地平基准" }, - { "step": "03", "name": "构造出图", "desc": "输出结构图与材质节点方案" }, - { "step": "04", "name": "实样工坊确认", "desc": "确认木样、锻铜样与密封节点" }, - { "step": "05", "name": "工坊试装交付", "desc": "试装调试后专车直运现场" }, - { "step": "06", "name": "终生私属维护", "desc": "建立一门一档数字化档案" } + { + "step": "01", + "name": "私享沟通", + "desc": "厘清生活动线与风候环境" + }, + { + "step": "02", + "name": "上门实测", + "desc": "复核门洞公差与地平基准" + }, + { + "step": "03", + "name": "构造出图", + "desc": "输出结构图与材质节点方案" + }, + { + "step": "04", + "name": "实样工坊确认", + "desc": "确认木样、锻铜样与密封节点" + }, + { + "step": "05", + "name": "工坊试装交付", + "desc": "试装调试后专车直运现场" + }, + { + "step": "06", + "name": "终生私属维护", + "desc": "建立一门一档数字化档案" + } ] } }, @@ -1592,7 +1656,6 @@ ], "capabilityKey": "inquiry", "brandConfig": { - "visualTemplateKey": "linjing-editorial", "templateData": { "designPhilosophy": "先厘清问题,再设计表达" }, @@ -1756,7 +1819,6 @@ ], "capabilityKey": "inquiry", "brandConfig": { - "visualTemplateKey": "linjing-editorial", "templateData": { "designPhilosophy": "先厘清问题,再设计表达" }, @@ -1830,5 +1892,607 @@ } } }, - "pages": ["pages/index/index", "pages/services/index", "pages/bookings/index"] + "pages": ["pages/index/index", "pages/services/index", "pages/bookings/index"], + "visualTemplateKey": "linjing-editorial", + "previewFixture": { + "doors": { + "schemaVersion": "1", + "brand": { + "name": "林境建筑画册 · 预览", + "tagline": "用于独立预览的模板演示内容", + "description": "此内容仅用于平台模板预览,不代表真实品牌或客户案例。", + "deliveryNote": "演示预览已禁用真实咨询和联系操作。" + }, + "content": { + "templateKey": "doors", + "inquiryFormName": "门系统咨询表单", + "offerings": [ + { + "kind": "product", + "name": "序章·入户门", + "summary": "为别墅入口定制的整樘门系统", + "categoryKey": "entrance-door", + "coverUrl": "/assets/content/doors-hero.jpg", + "priceText": "按项目确认", + "config": { + "series": "「万籁」重型天地轴入户系统", + "hardware": "德国 dormakaba 重型地弹簧 + 定制实心锻铜一体式长执手", + "details": { + "materialsList": [ + { + "name": "门扇主体", + "spec": "航空铝蜂窝 + 防暴钢板 + 黑胡桃" + }, + { + "name": "承重结构", + "spec": "不锈钢重型天地偏心轴" + } + ] + }, + "media": [ + { + "url": "/assets/content/doors-hero.jpg", + "alt": "", + "type": "image" + } + ] + } + }, + { + "kind": "product", + "name": "庭院·边界门", + "summary": "连接建筑与庭院的定制门", + "categoryKey": "garden-door", + "coverUrl": "/assets/content/doors-yard-gate.jpg", + "priceText": "按项目确认", + "config": { + "series": "「虚实」透光私家庭院门", + "hardware": "意大利全隐形地埋式液压自闭器 + 静音电控锁", + "details": { + "materialsList": [ + { + "name": "户外木种", + "spec": "高油脂老料缅甸柚木" + }, + { + "name": "骨架型材", + "spec": "高强度航空铝镁合金" + } + ] + }, + "media": [ + { + "url": "/assets/content/doors-yard-gate.jpg", + "alt": "", + "type": "image" + } + ] + } + }, + { + "kind": "product", + "name": "室内·静谧门", + "summary": "统一室内空间秩序的户内门", + "categoryKey": "interior-door", + "coverUrl": "/assets/content/doors-room-door.jpg", + "priceText": "按项目确认", + "config": { + "series": "「空灵」2.8m - 3.2m 满高通顶系统", + "hardware": "意大利 AGB 磁吸静音门锁 + 隐藏式暗铰链", + "details": { + "materialsList": [ + { + "name": "抗弯核心", + "spec": "双组份碳纤维预应力防变形拉力杆" + }, + { + "name": "吸音内衬", + "spec": "德国均质空心桥洞力学板" + } + ] + }, + "media": [ + { + "url": "/assets/content/doors-room-door.jpg", + "alt": "", + "type": "image" + } + ] + } + }, + { + "kind": "service", + "name": "一对一门系统设计咨询", + "summary": "从现场到方案的完整设计沟通", + "categoryKey": "custom", + "coverUrl": "/assets/content/personal-consulting.jpg", + "priceText": "按项目确认", + "config": { + "series": "「无垠」密室及背景墙融合门", + "hardware": "感应式电动自开闭装置或碰珠反弹器", + "details": { + "materialsList": [ + { + "name": "表面饰材", + "spec": "意大利雪山银狐超薄天然大理石" + }, + { + "name": "驱动系统", + "spec": "低噪步进电机伺服闭门器" + } + ] + }, + "media": [ + { + "url": "/assets/content/personal-consulting.jpg", + "alt": "", + "type": "image" + } + ] + } + } + ], + "trustContent": [ + { + "type": "credential", + "title": "主理人的门作观", + "content": "国家注册高级室内建筑师,专注高定大门及私宅空间门类系统研发 14 年。", + "config": { + "stats": [ + { + "value": "14年", + "label": "高端门系深化经验", + "sub": "历经百项严苛私宅考验" + }, + { + "value": "260+", + "label": "落地庄园实景案例", + "sub": "全实景图库,可预约探访" + }, + { + "value": "100%", + "label": "主理人全案跟进", + "sub": "量房 / 出图 / 选料 / 试装" + }, + { + "value": "10年", + "label": "结构主轴质保承诺", + "sub": "终生五金润滑维保机制" + } + ], + "pillars": [ + { + "title": "天然厚板与古铜锻打", + "desc": "精选天然木材与手工冷锻紫铜,构建长期耐用的门体结构。" + }, + { + "title": "微米级红外高精量房", + "desc": "通过 3D 空间激光扫描复核门洞公差与建筑墙体垂直度。" + }, + { + "title": "隐匿式重型五金系统", + "desc": "使用可调静音承重铰链,让重型门体开合轻盈安静。" + } + ], + "serviceFlow": [ + { + "step": "01", + "name": "私享沟通", + "desc": "厘清生活动线与风候环境" + }, + { + "step": "02", + "name": "上门实测", + "desc": "复核门洞公差与地平基准" + }, + { + "step": "03", + "name": "构造出图", + "desc": "输出结构图与材质节点方案" + }, + { + "step": "04", + "name": "实样工坊确认", + "desc": "确认木样、锻铜样与密封节点" + }, + { + "step": "05", + "name": "工坊试装交付", + "desc": "试装调试后专车直运现场" + }, + { + "step": "06", + "name": "终生私属维护", + "desc": "建立一门一档数字化档案" + } + ] + } + }, + { + "type": "case", + "title": "别墅门系统案例", + "content": "示例内容,待品牌主理人完善。" + }, + { + "type": "process", + "title": "从测量到交付", + "content": "示例内容,待品牌主理人完善。" + } + ], + "fields": [ + { + "key": "doorType", + "label": "期望定制的门类型", + "type": "select", + "required": true, + "options": [ + { + "label": "入户大门(防暴铸铜 / 实木)", + "value": "entry" + }, + { + "label": "庭院围墙门(耐候格栅 / 对开)", + "value": "yard" + }, + { + "label": "全屋室内门系统(通顶隐形)", + "value": "interior" + }, + { + "label": "背景墙一体门 / 密室门", + "value": "wall" + }, + { + "label": "整栋别墅门系统全案一体化", + "value": "whole-home" + } + ] + }, + { + "key": "cityArea", + "label": "房屋 / 别墅所在城市与楼盘", + "type": "text", + "required": true + }, + { + "key": "projectStage", + "label": "项目阶段", + "type": "select", + "required": true, + "options": [ + { + "label": "土建结构阶段(适合预埋加固)", + "value": "structure" + }, + { + "label": "水电木工阶段(适合精确测距)", + "value": "rough-in" + }, + { + "label": "硬装收尾阶段", + "value": "finishing" + }, + { + "label": "旧宅门体翻新改造", + "value": "renovation" + } + ] + }, + { + "key": "budgetRange", + "label": "预估门系统投资预算", + "type": "select", + "required": false, + "options": [ + { + "label": "5 万 - 10 万", + "value": "50k-100k" + }, + { + "label": "10 万 - 20 万", + "value": "100k-200k" + }, + { + "label": "20 万 - 50 万(全宅全案)", + "value": "200k-500k" + }, + { + "label": "50 万以上(顶级孤品定制)", + "value": "500k-plus" + } + ] + }, + { + "key": "needMeasure", + "label": "是否需要主理人上门现场量房", + "type": "radio", + "required": true, + "options": [ + { + "label": "需要(预约排期现场勘测)", + "value": "需要(预约排期现场勘测)" + }, + { + "label": "暂不需要(先发图纸在线深化评估)", + "value": "暂不需要(先发图纸在线深化评估)" + } + ] + }, + { + "key": "contactName", + "label": "贵姓称谓", + "type": "text", + "required": true + }, + { + "key": "contactPhone", + "label": "联系手机号(微信同号)", + "type": "tel", + "required": true + }, + { + "key": "specialNote", + "label": "空间想法或特殊需求描述", + "type": "textarea", + "required": false + } + ], + "capabilityKey": "inquiry", + "brandConfig": { + "templateData": { + "designPhilosophy": "先厘清问题,再设计表达" + }, + "title": "高端门系统建筑研造主理人", + "slogan": "为当代别墅空间,定制有秩序感与呼吸感的门", + "phone": "186-0218-9908", + "wechat": "LIN-ATELIER-2024", + "studioAddress": "上海市静安区威海路设计中心 A 座 / 杭州良渚研造工坊", + "avatarUrl": "/assets/content/personal-avatar.jpg", + "heroImage": "/assets/content/doors-hero.jpg", + "visualPresentation": { + "home": { + "founderBadge": "接受项目沟通", + "proofEyebrow": "专业经验与合作成果", + "proofTitle": "14 年,只做门与空间的关系", + "manifestoEyebrow": "工作原则", + "manifestoTitle": "先厘清问题,再设计表达", + "worksEyebrow": "项目案例", + "worksTitle": "门系统项目", + "worksAction": "查看全部 →" + }, + "offerings": { + "title": "门系统项目", + "subtitle": "从入户门到室内门的一体化设计", + "materialLabel": "包含:", + "hardwareLabel": "定制说明:", + "detailAction": "查看详情 →", + "inquiryAction": "发起咨询" + }, + "detail": { + "priceLabel": "价格参考", + "spaceLabel": "适合场景", + "backgroundTitle": "项目背景", + "conceptTitle": "设计思路", + "craftsTitle": "交付要点", + "materialsTitle": "材料与说明", + "inquiryAction": "发起咨询", + "inquiryHint": "提交信息后由主理人与您沟通。" + }, + "profile": { + "phoneLabel": "联系电话", + "wechatLabel": "微信", + "addressLabel": "工作地点", + "callAction": "呼叫", + "copyAction": "复制", + "recordsTitle": "我的咨询记录", + "recordsCountUnit": "条记录" + }, + "inquiry": { + "eyebrow": "COLLABORATION", + "title": "合作咨询", + "subtitle": "留下你的需求与目标,主理人会尽快联系。", + "submitLabel": "提交量房与定制评估需求" + }, + "success": { + "eyebrow": "COLLABORATION", + "title": "已收到你的咨询", + "intro": "主理人会尽快与你联系。", + "recordsAction": "查看咨询记录", + "homeAction": "返回首页" + }, + "records": { + "title": "我的咨询记录", + "createAction": "新增咨询", + "emptyTitle": "还没有咨询记录", + "emptyDescription": "提交一次咨询,开始与你的主理人沟通。", + "emptyAction": "开始咨询" + } + }, + "founder": "林叙安 (Lin XUAN)", + "profilePresentation": { + "coverage": [ + { + "title": "直派核心圈", + "content": "上海、杭州、宁波、苏州、无锡、南京及深圳、广州。主理人及资深装配总工亲赴现场。" + }, + { + "title": "全国其他城市私邸", + "content": "接受建筑设计师联合委托,安排远程 3D 激光测绘支持与专用物流直运安装。" + } + ], + "warranty": [ + "门体内部防变形航空合金骨架承诺 10 年结构质保;", + "重型天地轴、进口地弹簧及磁吸五金 5 年免费维护;", + "每樘门出厂前进行 5000 次启闭校正;", + "原木天然肌理享有首年 2 次木蜡油保养服务。" + ] + } + } + }, + "safety": { + "submissions": "disabled", + "customerRecords": "disabled", + "contactActions": "disabled" + } + }, + "personal": { + "schemaVersion": "1", + "brand": { + "name": "林境建筑画册 · 预览", + "tagline": "用于独立预览的模板演示内容", + "description": "此内容仅用于平台模板预览,不代表真实品牌或客户案例。", + "deliveryNote": "演示预览已禁用真实咨询和联系操作。" + }, + "content": { + "templateKey": "personal", + "inquiryFormName": "合作咨询表单", + "offerings": [ + { + "kind": "service", + "name": "示例·品牌定位咨询", + "summary": "梳理品牌定位与下一步行动。", + "categoryKey": "consulting", + "coverUrl": "/assets/content/personal-consulting.jpg", + "priceText": "按需求确认", + "config": { + "media": [ + { + "url": "/assets/content/personal-consulting.jpg", + "alt": "", + "type": "image" + } + ] + } + }, + { + "kind": "service", + "name": "示例·长期顾问支持", + "summary": "围绕表达和转化提供持续支持。", + "categoryKey": "advisory", + "coverUrl": "/assets/content/personal-advisory.jpg", + "priceText": "按服务周期确认", + "config": { + "media": [ + { + "url": "/assets/content/personal-advisory.jpg", + "alt": "", + "type": "image" + } + ] + } + } + ], + "trustContent": [ + { + "type": "credential", + "title": "关于主理人", + "content": "示例内容,待品牌主理人完善。" + }, + { + "type": "process", + "title": "合作方法", + "content": "示例内容,待品牌主理人完善。" + } + ], + "fields": [ + { + "key": "name", + "label": "您的称呼", + "type": "text", + "required": true + }, + { + "key": "phone", + "label": "联系方式", + "type": "phone", + "required": true + }, + { + "key": "remark", + "label": "合作需求", + "type": "textarea", + "required": true + } + ], + "capabilityKey": "inquiry", + "brandConfig": { + "templateData": { + "designPhilosophy": "先厘清问题,再设计表达" + }, + "title": "品牌策略顾问", + "slogan": "用清晰的定位与可执行的表达,让专业被看见。", + "phone": "", + "wechat": "", + "studioAddress": "上海市徐汇区创意园区", + "avatarUrl": "/assets/content/personal-avatar.jpg", + "heroImage": "/assets/content/personal-consulting.jpg", + "visualPresentation": { + "home": { + "founderBadge": "接受项目沟通", + "proofEyebrow": "专业经验与合作成果", + "proofTitle": "经验与方法", + "manifestoEyebrow": "工作原则", + "manifestoTitle": "先厘清问题,再设计表达", + "worksEyebrow": "合作方式", + "worksTitle": "品牌策略与顾问服务", + "worksAction": "查看全部 →" + }, + "offerings": { + "title": "合作方式", + "subtitle": "围绕定位、表达与业务转化,选择适合当前阶段的支持。", + "materialLabel": "包含:", + "hardwareLabel": "定制说明:", + "detailAction": "查看详情 →", + "inquiryAction": "发起咨询" + }, + "detail": { + "priceLabel": "价格参考", + "spaceLabel": "适合场景", + "backgroundTitle": "项目背景", + "conceptTitle": "设计思路", + "craftsTitle": "交付要点", + "materialsTitle": "材料与说明", + "inquiryAction": "发起咨询", + "inquiryHint": "提交信息后由主理人与您沟通。" + }, + "profile": { + "phoneLabel": "联系电话", + "wechatLabel": "微信", + "addressLabel": "工作地点", + "callAction": "呼叫", + "copyAction": "复制", + "recordsTitle": "我的咨询记录", + "recordsCountUnit": "条记录" + }, + "inquiry": { + "eyebrow": "COLLABORATION", + "title": "合作咨询", + "subtitle": "留下你的需求与目标,主理人会尽快联系。", + "submitLabel": "提交咨询" + }, + "success": { + "eyebrow": "COLLABORATION", + "title": "已收到你的咨询", + "intro": "主理人会尽快与你联系。", + "recordsAction": "查看咨询记录", + "homeAction": "返回首页" + }, + "records": { + "title": "我的咨询记录", + "createAction": "新增咨询", + "emptyTitle": "还没有咨询记录", + "emptyDescription": "提交一次咨询,开始与你的主理人沟通。", + "emptyAction": "开始咨询" + } + }, + "founder": "示例主理人" + } + }, + "safety": { + "submissions": "disabled", + "customerRecords": "disabled", + "contactActions": "disabled" + } + } + } } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 0f75031..ae6224a 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -224,7 +224,11 @@ importers: packages/capability-booking: {} - packages/config: {} + packages/config: + dependencies: + '@personal-brand/template-contract': + specifier: workspace:^ + version: link:../template-contract packages/template-acheng-campus-food: dependencies: diff --git a/scripts/generate-template-catalog.cjs b/scripts/generate-template-catalog.cjs index 8b48cc8..ff929e3 100644 --- a/scripts/generate-template-catalog.cjs +++ b/scripts/generate-template-catalog.cjs @@ -17,7 +17,7 @@ const templates = fs const manifest = JSON.parse( fs.readFileSync(path.join(packageRoot, entry.name, "template.json"), "utf8"), ); - return { ...manifest, visualTemplateKey: manifest.packageKey }; + return manifest; }) .sort((left, right) => left.packageKey.localeCompare(right.packageKey)); @@ -34,7 +34,7 @@ const fingerprint = crypto .createHash("sha256") .update(JSON.stringify(canonical(templates))) .digest("hex"); -const content = `// prettier-ignore\nimport type { TemplatePackageManifest } from "./index.js";\n\nexport const generatedTemplatePackageRegistry: readonly TemplatePackageManifest[] = ${JSON.stringify(templates, null, 2)};\nexport const generatedTemplatePackageRegistryHash =\n "${fingerprint}";\n`; +const content = `import type { TemplatePackageManifest } from "./index.js";\n\n// prettier-ignore\nexport const generatedTemplatePackageRegistry: readonly TemplatePackageManifest[] = ${JSON.stringify(templates, null, 2)};\nexport const generatedTemplatePackageRegistryHash =\n "${fingerprint}";\n`; const write = process.argv.includes("--write"); if (write) { fs.writeFileSync(outputPath, content); diff --git a/scripts/template-compatibility.cjs b/scripts/template-compatibility.cjs index f94bf76..6d6e2e6 100644 --- a/scripts/template-compatibility.cjs +++ b/scripts/template-compatibility.cjs @@ -109,8 +109,8 @@ for (const { directory, manifest, package: packageMetadata } of packages) { const packageIndustries = Array.isArray(manifest.supportedIndustryTemplates) ? manifest.supportedIndustryTemplates : []; - const visualKey = manifest.visualTemplateKey ?? key; - const visualRegistered = visualKeys.includes(visualKey); + const visualKey = manifest.visualTemplateKey; + const visualRegistered = typeof visualKey === "string" && visualKeys.includes(visualKey); const rendererPath = `${directory}/taro/index.tsx`; const rendererExists = fs.existsSync(path.join(packagesRoot, rendererPath)); const rendererExport = rendererExists @@ -141,6 +141,7 @@ for (const { directory, manifest, package: packageMetadata } of packages) { errors.push("No capability definitions found in capability-contracts.ts"); if (!rendererGlob) errors.push("Admin renderer package glob is not discoverable"); if (!packageIndustries.length) errors.push(`${key}: supportedIndustryTemplates is empty`); + if (!visualRegistered) errors.push(`${key}: visualTemplateKey is missing or unknown`); if (unknownCapabilities.length) errors.push(`${key}: unknown capabilities ${unknownCapabilities.join(", ")}`); if (!toolchainCompatible)