feat: 让模板声明驱动安装并保存快照

This commit is contained in:
que01 committed 2026-09-20 17:48:33 +08:00
1 parent a3434ce2b9
commit 388032000a
6 files changed
+65 -18

No files matched your search

+7
View File
@@ -114,6 +114,13 @@ export interface BrandTemplateDefinition {
title: string;
required: boolean;
}>;
fields: Array<{
scope: string;
key: string;
label: string;
type: string;
required: boolean;
}>;
capabilities: string[];
}
export interface OfferingSection {
+46
View File
@@ -10,6 +10,13 @@ export interface BrandTemplateModuleDefinition {
title: string;
required: boolean;
}
export interface BrandTemplateFieldDefinition {
scope: string;
key: string;
label: string;
type: string;
required: boolean;
}
export interface BrandTemplateDefinition {
key: BrandTemplateKey;
@@ -19,6 +26,7 @@ export interface BrandTemplateDefinition {
serviceCategories: string[];
trustContentTypes: string[];
modules: BrandTemplateModuleDefinition[];
fields: BrandTemplateFieldDefinition[];
capabilities: string[];
}
@@ -44,6 +52,25 @@ export const brandTemplates = {
{ key: "inquiry", type: "inquiry", title: "联系与咨询", required: true },
{ key: "contact", type: "contact", title: "品牌表达", required: true },
],
fields: [
{ scope: "profile", key: "name", label: "品牌名称", type: "text", required: true },
{ scope: "profile", key: "tagline", label: "一句话定位", type: "text", required: true },
{ scope: "profile", key: "audience", label: "服务对象", type: "textarea", required: true },
{
scope: "profile",
key: "valueProposition",
label: "提供的价值",
type: "textarea",
required: true,
},
{
scope: "profile",
key: "trustProof",
label: "信任证明入口",
type: "textarea",
required: true,
},
],
capabilities: ["offerings", "inquiry"],
},
food: {
@@ -67,6 +94,25 @@ export const brandTemplates = {
{ key: "inquiry", type: "inquiry", title: "预约与咨询", required: true },
{ key: "contact", type: "contact", title: "品牌表达", required: true },
],
fields: [
{ scope: "profile", key: "name", label: "品牌名称", type: "text", required: true },
{ scope: "profile", key: "tagline", label: "一句话定位", type: "text", required: true },
{ scope: "profile", key: "audience", label: "服务对象", type: "textarea", required: true },
{
scope: "profile",
key: "valueProposition",
label: "提供的价值",
type: "textarea",
required: true,
},
{
scope: "profile",
key: "trustProof",
label: "信任证明入口",
type: "textarea",
required: true,
},
],
capabilities: ["offerings", "inquiry", "booking"],
},
} satisfies Record<BrandTemplateKey, BrandTemplateDefinition>;