feat: 建立组件化模板预览基线并规划可视化编辑

This commit is contained in:
que01 committed 2026-10-09 12:32:24 +08:00
1 parent c5af790554
commit 0b14b5a814
46 files changed
+1880 -427

No files matched your search

+9 -1
View File
@@ -11,10 +11,15 @@ import type {
RuntimeTrustItem,
ThemeManifest,
} from "@personal-brand/types";
export { projectBrandAliases } from "@personal-brand/types";
export type { PublicOffering } from "@personal-brand/types";
export type { BookingStatus } from "@personal-brand/types";
export type { BrandTemplateKey } from "@personal-brand/types";
export type { EditorPreviewFrameMessage, EditorPreviewHostMessage } from "@personal-brand/types";
export type {
EditorPreviewFrameMessage,
EditorPreviewHostMessage,
RuntimeWorkspace,
} from "@personal-brand/types";
export interface BrandProfile {
id: string;
@@ -688,6 +693,9 @@ export class ApiClient {
}> {
return this.request("/admin/workspace");
}
getAdminPreviewWorkspace(): Promise<import("@personal-brand/types").RuntimeWorkspace> {
return this.request("/admin/workspace/preview");
}
listAdminReleases(): Promise<BrandReleaseSummary[]> {
return this.request("/admin/releases");
}
File diff suppressed because it is too large. Load diff
@@ -6,7 +6,8 @@ import { navigate } from "../../../apps/taro/src/runtime/navigation";
import { presentation, offering, slot, text, rows } from "../../../apps/taro/src/runtime/content";
import type { RuntimeWorkspace } from "@personal-brand/types";
import "./style.css";
const asset = (name: string) => `/assets/${name}`;
const asset = (name: string) =>
`/assets/${PREVIEW_ALL_TEMPLATES ? "acheng-campus-food/" : ""}${name}`;
function Home({ workspace }: { workspace: RuntimeWorkspace }) {
const brand = workspace.brand;
const p = presentation(workspace, "home");
@@ -115,7 +116,7 @@ function Service({ workspace }: { workspace: RuntimeWorkspace }) {
].filter((row) => row.title && row.detail);
const steps = rows(process?.config.steps).filter((step) => step.title && step.detail);
return (
<View className="food-service">
<View className="food-service" data-editor-target="acheng-campus-food.service.service">
<View className="page service-page">
{schedule && scheduleRows.length > 0 && (
<View className="service-card schedule-card">
@@ -220,7 +221,7 @@ function Profile({ workspace }: { workspace: RuntimeWorkspace }) {
const p = presentation(workspace, "profile");
const credentials = workspace.trustItems.filter((item) => item.type === "credential");
return (
<View className="food-profile">
<View className="food-profile" data-editor-target="acheng-campus-food.profile.identity">
<View className="page">
<View className="profile-card">
<View className="portrait">
@@ -340,13 +341,22 @@ function Profile({ workspace }: { workspace: RuntimeWorkspace }) {
</View>
);
}
const formTargets: Record<string, string> = {
inquiry: "acheng-campus-food.inquiry.booking",
success: "acheng-campus-food.success.successCopy",
records: "acheng-campus-food.records.recordsCopy",
};
export function TemplatePage({ workspace, page, children, offeringId }: TemplateProps) {
if (page === "home") return <Home workspace={workspace} />;
if (page === "service") return <Service workspace={workspace} />;
if (page === "profile") return <Profile workspace={workspace} />;
if (page === "offerings") return <OfferingList workspace={workspace} />;
if (page === "detail") return <Detail workspace={workspace} id={offeringId} />;
return <View className="food-forms">{children}</View>;
return (
<View className="food-forms" data-editor-target={formTargets[page]}>
{children}
</View>
);
}
function OfferingList({ workspace }: { workspace: RuntimeWorkspace }) {
const p = presentation(workspace, "offerings");
@@ -363,7 +373,7 @@ function OfferingList({ workspace }: { workspace: RuntimeWorkspace }) {
.includes(query.trim().toLowerCase()),
);
return (
<View className="food-list">
<View className="food-list" data-editor-target="acheng-campus-food.offerings.menu">
<View className="page">
<View className="filters">
<Button
@@ -437,7 +447,7 @@ function Detail({ workspace, id }: { workspace: RuntimeWorkspace; id?: string })
const item = offering(found);
const p = presentation(workspace, "detail");
return (
<View className="food-detail">
<View className="food-detail" data-editor-target="acheng-campus-food.detail.dishDetail">
<View className="detail">
<View className="hero-wrap">
<Image
@@ -454,7 +464,7 @@ function Detail({ workspace, id }: { workspace: RuntimeWorkspace; id?: string })
<Text>{item.series}</Text>
</View>
</View>
<View className="content">
<View className="content" data-editor-target="acheng-campus-food.detail.detailCopy">
<View className="price-card">
<View>
<Text>{p.priceLabel || "参考价格"}</Text>
@@ -144,7 +144,8 @@
"label": "主理人姓名",
"input": "text",
"required": true,
"placeholder": "例如:阿成"
"placeholder": "例如:阿成",
"previewTarget": "acheng-campus-food.profile.identity"
},
{
"key": "title",
@@ -152,33 +153,44 @@
"label": "你的身份",
"help": "例如:校园餐饮主理人。",
"input": "text",
"required": true
"required": true,
"previewTarget": "acheng-campus-food.profile.identity"
},
{
"key": "badge",
"binding": "brand.config.visualPresentation.profile.badge",
"label": "写真角标",
"input": "text",
"help": "显示在主理人写真上,可填写经验或服务定位。"
"help": "显示在主理人写真上,可填写经验或服务定位。",
"previewTarget": "acheng-campus-food.profile.identity"
},
{
"key": "storyLead",
"binding": "brand.config.visualPresentation.profile.storyLead",
"label": "故事引言",
"input": "textarea",
"help": "故事开头的强调段落,下面的正文使用品牌简介。"
"help": "故事开头的强调段落,下面的正文使用品牌简介。",
"previewTarget": "acheng-campus-food.profile.identity"
},
{
"key": "recordsTitle",
"binding": "brand.config.visualPresentation.profile.recordsTitle",
"label": "记录入口文案",
"input": "text"
"input": "text",
"previewTarget": "acheng-campus-food.profile.identity"
},
{
"key": "recordsCountUnit",
"binding": "brand.config.visualPresentation.profile.recordsCountUnit",
"label": "记录数量单位",
"input": "text"
"input": "text",
"previewTarget": "acheng-campus-food.profile.identity"
}
],
"previewTargets": [
{
"key": "acheng-campus-food.profile.identity",
"label": "摊位与主理人"
}
]
},
@@ -189,10 +201,22 @@
"page": "home",
"target": "brand",
"previewTargets": [
{ "key": "food.home.location", "label": "服务地点" },
{ "key": "food.home.hero", "label": "出摊现场图片" },
{ "key": "food.home.offerings-heading", "label": "餐品区域标题" },
{ "key": "food.home.promise-heading", "label": "出餐承诺标题" }
{
"key": "food.home.location",
"label": "服务地点"
},
{
"key": "food.home.hero",
"label": "出摊现场图片"
},
{
"key": "food.home.offerings-heading",
"label": "餐品区域标题"
},
{
"key": "food.home.promise-heading",
"label": "出餐承诺标题"
}
],
"fields": [
{
@@ -255,7 +279,14 @@
"binding": "brand.config.visualPresentation.service.processAction",
"label": "流程咨询按钮",
"input": "text",
"placeholder": "例如:立即预订"
"placeholder": "例如:立即预订",
"previewTarget": "acheng-campus-food.service.service"
}
],
"previewTargets": [
{
"key": "acheng-campus-food.service.service",
"label": "出摊服务页说明"
}
]
},
@@ -270,21 +301,30 @@
"key": "title",
"binding": "brand.config.visualPresentation.offerings.title",
"label": "菜单页标题",
"input": "text"
"input": "text",
"previewTarget": "acheng-campus-food.offerings.menu"
},
{
"key": "subtitle",
"binding": "brand.config.visualPresentation.offerings.subtitle",
"label": "菜单页说明",
"input": "textarea",
"maxLength": 120
"maxLength": 120,
"previewTarget": "acheng-campus-food.offerings.menu"
},
{
"key": "menuTip",
"binding": "brand.config.visualPresentation.offerings.menuTip",
"label": "菜单提示",
"help": "只填写当前实际提供的取餐、加菜或定制服务。",
"input": "textarea"
"input": "textarea",
"previewTarget": "acheng-campus-food.offerings.menu"
}
],
"previewTargets": [
{
"key": "acheng-campus-food.offerings.menu",
"label": "菜单页说明"
}
]
},
@@ -299,28 +339,38 @@
"key": "title",
"binding": "brand.config.visualPresentation.inquiry.title",
"label": "预订页面标题",
"input": "text"
"input": "text",
"previewTarget": "acheng-campus-food.inquiry.booking"
},
{
"key": "subtitle",
"binding": "brand.config.visualPresentation.inquiry.subtitle",
"label": "预订说明",
"input": "textarea",
"maxLength": 120
"maxLength": 120,
"previewTarget": "acheng-campus-food.inquiry.booking"
},
{
"key": "submitLabel",
"binding": "brand.config.visualPresentation.inquiry.submitLabel",
"label": "提交按钮文字",
"input": "text",
"placeholder": "例如:提交预订需求"
"placeholder": "例如:提交预订需求",
"previewTarget": "acheng-campus-food.inquiry.booking"
},
{
"key": "promise",
"binding": "brand.config.visualPresentation.inquiry.promise",
"label": "真实服务承诺",
"help": "仅填写能兑现的回复时间、订金和联系规则;留空则不显示。",
"input": "textarea"
"input": "textarea",
"previewTarget": "acheng-campus-food.inquiry.booking"
}
],
"previewTargets": [
{
"key": "acheng-campus-food.inquiry.booking",
"label": "预订与定制"
}
]
},
@@ -335,43 +385,50 @@
"key": "categoryLabel",
"binding": "offering.config.categoryLabel",
"label": "餐品类别",
"input": "text"
"input": "text",
"previewTarget": "acheng-campus-food.detail.dishDetail"
},
{
"key": "detailHero",
"binding": "offering.config.detailHero",
"label": "详情主图",
"input": "image"
"input": "image",
"previewTarget": "acheng-campus-food.detail.dishDetail"
},
{
"key": "area",
"binding": "offering.config.area",
"label": "供应地点",
"input": "text"
"input": "text",
"previewTarget": "acheng-campus-food.detail.dishDetail"
},
{
"key": "series",
"binding": "offering.config.series",
"label": "套餐或系列说明",
"input": "text"
"input": "text",
"previewTarget": "acheng-campus-food.detail.dishDetail"
},
{
"key": "spaceType",
"binding": "offering.config.spaceType",
"label": "适合场景",
"input": "text"
"input": "text",
"previewTarget": "acheng-campus-food.detail.dishDetail"
},
{
"key": "background",
"binding": "offering.config.details.background",
"label": "餐品介绍",
"input": "textarea"
"input": "textarea",
"previewTarget": "acheng-campus-food.detail.dishDetail"
},
{
"key": "designConcept",
"binding": "offering.config.details.designConcept",
"label": "口味与分量",
"input": "textarea"
"input": "textarea",
"previewTarget": "acheng-campus-food.detail.dishDetail"
},
{
"key": "keywords",
@@ -384,7 +441,8 @@
"key": "value",
"label": "特色"
}
]
],
"previewTarget": "acheng-campus-food.detail.dishDetail"
},
{
"key": "crafts",
@@ -397,7 +455,8 @@
"key": "value",
"label": "制作说明"
}
]
],
"previewTarget": "acheng-campus-food.detail.dishDetail"
},
{
"key": "materialsList",
@@ -413,7 +472,14 @@
"key": "spec",
"label": "说明"
}
]
],
"previewTarget": "acheng-campus-food.detail.dishDetail"
}
],
"previewTargets": [
{
"key": "acheng-campus-food.detail.dishDetail",
"label": "餐品与服务详情"
}
]
},
@@ -428,50 +494,64 @@
"key": "priceLabel",
"binding": "brand.config.visualPresentation.detail.priceLabel",
"label": "价格说明标题",
"input": "text"
"input": "text",
"previewTarget": "acheng-campus-food.detail.detailCopy"
},
{
"key": "spaceLabel",
"binding": "brand.config.visualPresentation.detail.spaceLabel",
"label": "适合场景标题",
"input": "text"
"input": "text",
"previewTarget": "acheng-campus-food.detail.detailCopy"
},
{
"key": "backgroundTitle",
"binding": "brand.config.visualPresentation.detail.backgroundTitle",
"label": "餐品介绍标题",
"input": "text"
"input": "text",
"previewTarget": "acheng-campus-food.detail.detailCopy"
},
{
"key": "conceptTitle",
"binding": "brand.config.visualPresentation.detail.conceptTitle",
"label": "口味与分量标题",
"input": "text"
"input": "text",
"previewTarget": "acheng-campus-food.detail.detailCopy"
},
{
"key": "craftsTitle",
"binding": "brand.config.visualPresentation.detail.craftsTitle",
"label": "制作方式标题",
"input": "text"
"input": "text",
"previewTarget": "acheng-campus-food.detail.detailCopy"
},
{
"key": "materialsTitle",
"binding": "brand.config.visualPresentation.detail.materialsTitle",
"label": "食材与搭配标题",
"input": "text"
"input": "text",
"previewTarget": "acheng-campus-food.detail.detailCopy"
},
{
"key": "inquiryAction",
"binding": "brand.config.visualPresentation.detail.inquiryAction",
"label": "咨询按钮文字",
"input": "text"
"input": "text",
"previewTarget": "acheng-campus-food.detail.detailCopy"
},
{
"key": "inquiryHint",
"binding": "brand.config.visualPresentation.detail.inquiryHint",
"label": "咨询后的处理说明",
"help": "只写能够兑现的联系和确认方式。",
"input": "textarea"
"input": "textarea",
"previewTarget": "acheng-campus-food.detail.detailCopy"
}
],
"previewTargets": [
{
"key": "acheng-campus-food.detail.detailCopy",
"label": "详情页说明"
}
]
},
@@ -486,32 +566,43 @@
"key": "eyebrow",
"binding": "brand.config.visualPresentation.success.eyebrow",
"label": "页面小标题",
"input": "text"
"input": "text",
"previewTarget": "acheng-campus-food.success.successCopy"
},
{
"key": "title",
"binding": "brand.config.visualPresentation.success.title",
"label": "确认标题",
"input": "text"
"input": "text",
"previewTarget": "acheng-campus-food.success.successCopy"
},
{
"key": "intro",
"binding": "brand.config.visualPresentation.success.intro",
"label": "后续联系说明",
"help": "若写回复时间,请确认日常能兑现。",
"input": "textarea"
"input": "textarea",
"previewTarget": "acheng-campus-food.success.successCopy"
},
{
"key": "recordsAction",
"binding": "brand.config.visualPresentation.success.recordsAction",
"label": "查看记录按钮",
"input": "text"
"input": "text",
"previewTarget": "acheng-campus-food.success.successCopy"
},
{
"key": "homeAction",
"binding": "brand.config.visualPresentation.success.homeAction",
"label": "返回首页按钮",
"input": "text"
"input": "text",
"previewTarget": "acheng-campus-food.success.successCopy"
}
],
"previewTargets": [
{
"key": "acheng-campus-food.success.successCopy",
"label": "提交成功页"
}
]
},
@@ -526,31 +617,42 @@
"key": "title",
"binding": "brand.config.visualPresentation.records.title",
"label": "记录页标题",
"input": "text"
"input": "text",
"previewTarget": "acheng-campus-food.records.recordsCopy"
},
{
"key": "createAction",
"binding": "brand.config.visualPresentation.records.createAction",
"label": "新增咨询按钮",
"input": "text"
"input": "text",
"previewTarget": "acheng-campus-food.records.recordsCopy"
},
{
"key": "emptyTitle",
"binding": "brand.config.visualPresentation.records.emptyTitle",
"label": "暂无记录标题",
"input": "text"
"input": "text",
"previewTarget": "acheng-campus-food.records.recordsCopy"
},
{
"key": "emptyDescription",
"binding": "brand.config.visualPresentation.records.emptyDescription",
"label": "暂无记录说明",
"input": "textarea"
"input": "textarea",
"previewTarget": "acheng-campus-food.records.recordsCopy"
},
{
"key": "emptyAction",
"binding": "brand.config.visualPresentation.records.emptyAction",
"label": "空状态按钮",
"input": "text"
"input": "text",
"previewTarget": "acheng-campus-food.records.recordsCopy"
}
],
"previewTargets": [
{
"key": "acheng-campus-food.records.recordsCopy",
"label": "咨询记录页"
}
]
}
@@ -27,15 +27,25 @@ for (const directory of templateDirectories) {
const keys = targets.map((target) => target.key);
assert.equal(new Set(keys).size, keys.length, "preview target keys must be unique");
for (const { section } of targets) {
for (const section of sections) {
for (const field of section.fields) {
if (field.previewTarget)
assert.ok(
section.previewTargets.some((target) => target.key === field.previewTarget),
`${section.key}.${field.key} references an undeclared previewTarget`,
);
assert.ok(field.binding, `${section.key}.${field.key} must have an editable binding`);
assert.ok(field.previewTarget, `${section.key}.${field.key} must map to a visual region`);
assert.ok(
section.previewTargets?.some((target) => target.key === field.previewTarget),
`${section.key}.${field.key} references an undeclared previewTarget`,
);
}
}
for (const field of manifest.templateFields ?? []) {
assert.ok(field.binding, `templateFields.${field.key} must have an editable binding`);
assert.ok(field.previewTarget, `templateFields.${field.key} must map to a visual region`);
assert.ok(
targets.some((target) => target.key === field.previewTarget),
`templateFields.${field.key} references an undeclared previewTarget`,
);
assert.ok(rendererPath && fs.existsSync(rendererPath));
}
for (const target of targets)
assert.ok(
@@ -48,8 +58,9 @@ for (const directory of templateDirectories) {
const renderer = fs.readFileSync(rendererPath, "utf8");
for (const target of targets)
assert.ok(
renderer.includes(`data-editor-target="${target.key}"`),
renderer.includes(target.key),
`renderer is missing data-editor-target ${target.key}`,
);
assert.ok(renderer.includes("data-editor-target"), "renderer must expose editor targets");
});
}
@@ -19,7 +19,7 @@ function Home({ workspace }: { workspace: RuntimeWorkspace }) {
const credential = slot(workspace, "credential");
const t = workspace.trustPresentation;
return (
<View className="editorial-home">
<View className="editorial-home" data-editor-target="linjing-editorial.home.home">
<View className="page">
<View className="founder-card" data-editor-target="editorial.home.identity">
{text(b.avatarUrl) && (
@@ -125,9 +125,12 @@ function Profile({ workspace }: { workspace: RuntimeWorkspace }) {
const p = presentation(workspace, "profile");
const config = object(b.profilePresentation);
return (
<View className="editorial-profile">
<View
className="editorial-profile"
data-editor-target="linjing-editorial.profile.profileDetails"
>
<View className="profile">
<View className="founder-card">
<View className="founder-card" data-editor-target="linjing-editorial.profile.identity">
<View className="identity">
{text(b.avatarUrl) && (
<Image className="avatar" src={text(b.avatarUrl)} mode="aspectFill" />
@@ -215,7 +218,7 @@ function Profile({ workspace }: { workspace: RuntimeWorkspace }) {
function List({ workspace }: { workspace: RuntimeWorkspace }) {
const p = presentation(workspace, "offerings");
return (
<View className="editorial-list">
<View className="editorial-list" data-editor-target="linjing-editorial.offerings.cases">
<View className="page">
<Text className="eyebrow">{p.eyebrow}</Text>
<Text className="section-title">{p.title || "作品与服务"}</Text>
@@ -255,7 +258,7 @@ function Detail({ workspace, id }: { workspace: RuntimeWorkspace; id?: string })
const item = offering(found);
const p = presentation(workspace, "detail");
return (
<View className="editorial-detail">
<View className="editorial-detail" data-editor-target="linjing-editorial.detail.projectDetail">
<View className="detail">
<View className="hero-wrap">
<Image
@@ -272,7 +275,7 @@ function Detail({ workspace, id }: { workspace: RuntimeWorkspace; id?: string })
<Text>{item.series}</Text>
</View>
</View>
<View className="content">
<View className="content" data-editor-target="linjing-editorial.detail.detailCopy">
<View className="price-card">
<View>
<Text>{p.priceLabel}</Text>
@@ -333,10 +336,19 @@ function Detail({ workspace, id }: { workspace: RuntimeWorkspace; id?: string })
</View>
);
}
const formTargets: Record<string, string> = {
inquiry: "linjing-editorial.inquiry.consultation",
success: "linjing-editorial.success.successCopy",
records: "linjing-editorial.records.recordsCopy",
};
export function TemplatePage({ workspace, page, children, offeringId }: TemplateProps) {
if (page === "home") return <Home workspace={workspace} />;
if (page === "offerings") return <List workspace={workspace} />;
if (page === "profile" || page === "service") return <Profile workspace={workspace} />;
if (page === "detail") return <Detail workspace={workspace} id={offeringId} />;
return <View className="editorial-forms">{children}</View>;
return (
<View className="editorial-forms" data-editor-target={formTargets[page]}>
{children}
</View>
);
}
+378 -102
View File
@@ -86,6 +86,8 @@
{
"key": "designPhilosophy",
"page": "home",
"binding": "brand.config.templateData.designPhilosophy",
"previewTarget": "linjing-editorial.home.home",
"label": "设计理念",
"help": "用一两句话说明你的设计方法。",
"input": "textarea",
@@ -139,7 +141,8 @@
"binding": "brand.config.founder",
"label": "主理人姓名",
"input": "text",
"required": true
"required": true,
"previewTarget": "linjing-editorial.profile.identity"
},
{
"key": "title",
@@ -147,7 +150,14 @@
"label": "身份或职位",
"input": "text",
"required": true,
"placeholder": "例如:别墅门系统主理人"
"placeholder": "例如:别墅门系统主理人",
"previewTarget": "linjing-editorial.profile.identity"
}
],
"previewTargets": [
{
"key": "linjing-editorial.profile.identity",
"label": "主理人与联系方式"
}
]
},
@@ -158,11 +168,30 @@
"page": "home",
"target": "brand",
"previewTargets": [
{ "key": "editorial.home.identity", "label": "主理人标签" },
{ "key": "editorial.home.hero", "label": "首页主视觉" },
{ "key": "editorial.home.proof", "label": "信任介绍" },
{ "key": "editorial.home.manifesto", "label": "品牌主张" },
{ "key": "editorial.home.works", "label": "代表案例标题" }
{
"key": "editorial.home.identity",
"label": "主理人标签"
},
{
"key": "editorial.home.hero",
"label": "首页主视觉"
},
{
"key": "editorial.home.proof",
"label": "信任介绍"
},
{
"key": "editorial.home.manifesto",
"label": "品牌主张"
},
{
"key": "editorial.home.works",
"label": "代表案例标题"
},
{
"key": "linjing-editorial.home.home",
"label": "首页品牌表达"
}
],
"fields": [
{
@@ -228,43 +257,50 @@
"key": "worksAction",
"binding": "brand.config.visualPresentation.home.worksAction",
"label": "查看案例入口",
"input": "text"
"input": "text",
"previewTarget": "linjing-editorial.home.home"
},
{
"key": "flowEyebrow",
"binding": "brand.config.visualPresentation.home.flowEyebrow",
"label": "合作流程小标题",
"input": "text"
"input": "text",
"previewTarget": "linjing-editorial.home.home"
},
{
"key": "flowTitle",
"binding": "brand.config.visualPresentation.home.flowTitle",
"label": "项目流程标题",
"input": "text"
"input": "text",
"previewTarget": "linjing-editorial.home.home"
},
{
"key": "heroTitle",
"binding": "brand.config.homeHero.title",
"label": "首页主标题",
"input": "text"
"input": "text",
"previewTarget": "linjing-editorial.home.home"
},
{
"key": "heroEyebrow",
"binding": "brand.config.homeHero.eyebrow",
"label": "主图项目标注",
"input": "text"
"input": "text",
"previewTarget": "linjing-editorial.home.home"
},
{
"key": "heroDescription",
"binding": "brand.config.homeHero.slogan",
"label": "首页主图说明",
"input": "textarea"
"input": "textarea",
"previewTarget": "linjing-editorial.home.home"
},
{
"key": "heroAction",
"binding": "brand.config.homeHero.cta",
"label": "主图行动文字",
"input": "text"
"input": "text",
"previewTarget": "linjing-editorial.home.home"
}
]
},
@@ -281,9 +317,17 @@
"label": "服务区域",
"input": "list",
"itemFields": [
{ "key": "title", "label": "区域名称" },
{ "key": "content", "label": "服务说明", "input": "textarea" }
]
{
"key": "title",
"label": "区域名称"
},
{
"key": "content",
"label": "服务说明",
"input": "textarea"
}
],
"previewTarget": "linjing-editorial.profile.profileDetails"
},
{
"key": "warranty",
@@ -291,67 +335,90 @@
"label": "履约与维护说明",
"input": "list",
"itemValueKey": "value",
"itemFields": [{ "key": "value", "label": "承诺内容", "input": "textarea" }]
"itemFields": [
{
"key": "value",
"label": "承诺内容",
"input": "textarea"
}
],
"previewTarget": "linjing-editorial.profile.profileDetails"
},
{
"key": "recordsTitle",
"binding": "brand.config.visualPresentation.profile.recordsTitle",
"label": "咨询记录入口标题",
"input": "text"
"input": "text",
"previewTarget": "linjing-editorial.profile.profileDetails"
},
{
"key": "recordsSubtitle",
"binding": "brand.config.visualPresentation.profile.recordsSubtitle",
"label": "咨询记录入口说明",
"input": "textarea"
"input": "textarea",
"previewTarget": "linjing-editorial.profile.profileDetails"
},
{
"key": "coverageTitle",
"binding": "brand.config.visualPresentation.profile.coverageTitle",
"label": "服务区域标题",
"input": "text"
"input": "text",
"previewTarget": "linjing-editorial.profile.profileDetails"
},
{
"key": "warrantyTitle",
"binding": "brand.config.visualPresentation.profile.warrantyTitle",
"label": "履约说明标题",
"input": "text"
"input": "text",
"previewTarget": "linjing-editorial.profile.profileDetails"
},
{
"key": "phoneLabel",
"binding": "brand.config.visualPresentation.profile.phoneLabel",
"label": "电话标签",
"input": "text"
"input": "text",
"previewTarget": "linjing-editorial.profile.profileDetails"
},
{
"key": "wechatLabel",
"binding": "brand.config.visualPresentation.profile.wechatLabel",
"label": "微信标签",
"input": "text"
"input": "text",
"previewTarget": "linjing-editorial.profile.profileDetails"
},
{
"key": "addressLabel",
"binding": "brand.config.visualPresentation.profile.addressLabel",
"label": "地址标签",
"input": "text"
"input": "text",
"previewTarget": "linjing-editorial.profile.profileDetails"
},
{
"key": "callAction",
"binding": "brand.config.visualPresentation.profile.callAction",
"label": "拨打电话按钮",
"input": "text"
"input": "text",
"previewTarget": "linjing-editorial.profile.profileDetails"
},
{
"key": "copyAction",
"binding": "brand.config.visualPresentation.profile.copyAction",
"label": "复制微信按钮",
"input": "text"
"input": "text",
"previewTarget": "linjing-editorial.profile.profileDetails"
},
{
"key": "recordsCountUnit",
"binding": "brand.config.visualPresentation.profile.recordsCountUnit",
"label": "记录数量单位",
"input": "text"
"input": "text",
"previewTarget": "linjing-editorial.profile.profileDetails"
}
],
"previewTargets": [
{
"key": "linjing-editorial.profile.profileDetails",
"label": "服务区域与履约说明"
}
]
},
@@ -366,32 +433,43 @@
"key": "worksEyebrow",
"binding": "brand.config.visualPresentation.offerings.worksEyebrow",
"label": "案例页辅助标题",
"input": "text"
"input": "text",
"previewTarget": "linjing-editorial.offerings.cases"
},
{
"key": "worksTitle",
"binding": "brand.config.visualPresentation.offerings.worksTitle",
"label": "案例页主标题",
"input": "text"
"input": "text",
"previewTarget": "linjing-editorial.offerings.cases"
},
{
"key": "subtitle",
"binding": "brand.config.visualPresentation.offerings.subtitle",
"label": "案例页说明",
"input": "textarea",
"maxLength": 140
"maxLength": 140,
"previewTarget": "linjing-editorial.offerings.cases"
},
{
"key": "closingText",
"binding": "brand.config.visualPresentation.offerings.closingText",
"label": "案例页结语",
"input": "textarea"
"input": "textarea",
"previewTarget": "linjing-editorial.offerings.cases"
},
{
"key": "closingAction",
"binding": "brand.config.visualPresentation.offerings.closingAction",
"label": "案例页咨询入口",
"input": "text"
"input": "text",
"previewTarget": "linjing-editorial.offerings.cases"
}
],
"previewTargets": [
{
"key": "linjing-editorial.offerings.cases",
"label": "案例与体系"
}
]
},
@@ -406,32 +484,43 @@
"key": "title",
"binding": "brand.config.visualPresentation.inquiry.title",
"label": "咨询页面标题",
"input": "text"
"input": "text",
"previewTarget": "linjing-editorial.inquiry.consultation"
},
{
"key": "subtitle",
"binding": "brand.config.visualPresentation.inquiry.subtitle",
"label": "咨询说明",
"input": "textarea",
"maxLength": 140
"maxLength": 140,
"previewTarget": "linjing-editorial.inquiry.consultation"
},
{
"key": "submitLabel",
"binding": "brand.config.visualPresentation.inquiry.submitLabel",
"label": "提交按钮文字",
"input": "text"
"input": "text",
"previewTarget": "linjing-editorial.inquiry.consultation"
},
{
"key": "eyebrow",
"binding": "brand.config.visualPresentation.inquiry.eyebrow",
"label": "咨询页小标题",
"input": "text"
"input": "text",
"previewTarget": "linjing-editorial.inquiry.consultation"
},
{
"key": "note",
"binding": "brand.config.visualPresentation.inquiry.note",
"label": "咨询前提示",
"input": "textarea"
"input": "textarea",
"previewTarget": "linjing-editorial.inquiry.consultation"
}
],
"previewTargets": [
{
"key": "linjing-editorial.inquiry.consultation",
"label": "咨询说明"
}
]
},
@@ -446,43 +535,50 @@
"key": "categoryLabel",
"binding": "offering.config.categoryLabel",
"label": "案例类别",
"input": "text"
"input": "text",
"previewTarget": "linjing-editorial.detail.projectDetail"
},
{
"key": "detailHero",
"binding": "offering.config.detailHero",
"label": "详情主图",
"input": "image"
"input": "image",
"previewTarget": "linjing-editorial.detail.projectDetail"
},
{
"key": "area",
"binding": "offering.config.area",
"label": "项目地点",
"input": "text"
"input": "text",
"previewTarget": "linjing-editorial.detail.projectDetail"
},
{
"key": "series",
"binding": "offering.config.series",
"label": "产品系列",
"input": "text"
"input": "text",
"previewTarget": "linjing-editorial.detail.projectDetail"
},
{
"key": "spaceType",
"binding": "offering.config.spaceType",
"label": "适用空间",
"input": "text"
"input": "text",
"previewTarget": "linjing-editorial.detail.projectDetail"
},
{
"key": "background",
"binding": "offering.config.details.background",
"label": "项目背景",
"input": "textarea"
"input": "textarea",
"previewTarget": "linjing-editorial.detail.projectDetail"
},
{
"key": "designConcept",
"binding": "offering.config.details.designConcept",
"label": "设计理念",
"input": "textarea"
"input": "textarea",
"previewTarget": "linjing-editorial.detail.projectDetail"
},
{
"key": "keywords",
@@ -490,7 +586,13 @@
"label": "项目关键词",
"input": "list",
"itemValueKey": "value",
"itemFields": [{ "key": "value", "label": "关键词" }]
"itemFields": [
{
"key": "value",
"label": "关键词"
}
],
"previewTarget": "linjing-editorial.detail.projectDetail"
},
{
"key": "crafts",
@@ -498,7 +600,13 @@
"label": "工艺要点",
"input": "list",
"itemValueKey": "value",
"itemFields": [{ "key": "value", "label": "工艺说明" }]
"itemFields": [
{
"key": "value",
"label": "工艺说明"
}
],
"previewTarget": "linjing-editorial.detail.projectDetail"
},
{
"key": "materialsList",
@@ -506,9 +614,22 @@
"label": "材料说明",
"input": "list",
"itemFields": [
{ "key": "name", "label": "材料名称" },
{ "key": "spec", "label": "规格说明" }
]
{
"key": "name",
"label": "材料名称"
},
{
"key": "spec",
"label": "规格说明"
}
],
"previewTarget": "linjing-editorial.detail.projectDetail"
}
],
"previewTargets": [
{
"key": "linjing-editorial.detail.projectDetail",
"label": "案例详情"
}
]
},
@@ -523,50 +644,64 @@
"key": "priceLabel",
"binding": "brand.config.visualPresentation.detail.priceLabel",
"label": "价格说明标题",
"input": "text"
"input": "text",
"previewTarget": "linjing-editorial.detail.detailCopy"
},
{
"key": "spaceLabel",
"binding": "brand.config.visualPresentation.detail.spaceLabel",
"label": "适用空间标题",
"input": "text"
"input": "text",
"previewTarget": "linjing-editorial.detail.detailCopy"
},
{
"key": "backgroundTitle",
"binding": "brand.config.visualPresentation.detail.backgroundTitle",
"label": "项目背景标题",
"input": "text"
"input": "text",
"previewTarget": "linjing-editorial.detail.detailCopy"
},
{
"key": "conceptTitle",
"binding": "brand.config.visualPresentation.detail.conceptTitle",
"label": "设计理念标题",
"input": "text"
"input": "text",
"previewTarget": "linjing-editorial.detail.detailCopy"
},
{
"key": "craftsTitle",
"binding": "brand.config.visualPresentation.detail.craftsTitle",
"label": "工艺要点标题",
"input": "text"
"input": "text",
"previewTarget": "linjing-editorial.detail.detailCopy"
},
{
"key": "materialsTitle",
"binding": "brand.config.visualPresentation.detail.materialsTitle",
"label": "材料说明标题",
"input": "text"
"input": "text",
"previewTarget": "linjing-editorial.detail.detailCopy"
},
{
"key": "inquiryAction",
"binding": "brand.config.visualPresentation.detail.inquiryAction",
"label": "咨询按钮文字",
"input": "text"
"input": "text",
"previewTarget": "linjing-editorial.detail.detailCopy"
},
{
"key": "inquiryHint",
"binding": "brand.config.visualPresentation.detail.inquiryHint",
"label": "咨询后的处理说明",
"help": "只填写能兑现的服务安排。",
"input": "textarea"
"input": "textarea",
"previewTarget": "linjing-editorial.detail.detailCopy"
}
],
"previewTargets": [
{
"key": "linjing-editorial.detail.detailCopy",
"label": "详情页说明"
}
]
},
@@ -581,32 +716,43 @@
"key": "eyebrow",
"binding": "brand.config.visualPresentation.success.eyebrow",
"label": "页面小标题",
"input": "text"
"input": "text",
"previewTarget": "linjing-editorial.success.successCopy"
},
{
"key": "title",
"binding": "brand.config.visualPresentation.success.title",
"label": "确认标题",
"input": "text"
"input": "text",
"previewTarget": "linjing-editorial.success.successCopy"
},
{
"key": "intro",
"binding": "brand.config.visualPresentation.success.intro",
"label": "后续联系说明",
"help": "回复时间必须与实际承诺一致。",
"input": "textarea"
"input": "textarea",
"previewTarget": "linjing-editorial.success.successCopy"
},
{
"key": "recordsAction",
"binding": "brand.config.visualPresentation.success.recordsAction",
"label": "查看记录按钮",
"input": "text"
"input": "text",
"previewTarget": "linjing-editorial.success.successCopy"
},
{
"key": "homeAction",
"binding": "brand.config.visualPresentation.success.homeAction",
"label": "返回首页按钮",
"input": "text"
"input": "text",
"previewTarget": "linjing-editorial.success.successCopy"
}
],
"previewTargets": [
{
"key": "linjing-editorial.success.successCopy",
"label": "提交成功页"
}
]
},
@@ -621,31 +767,42 @@
"key": "title",
"binding": "brand.config.visualPresentation.records.title",
"label": "记录页标题",
"input": "text"
"input": "text",
"previewTarget": "linjing-editorial.records.recordsCopy"
},
{
"key": "createAction",
"binding": "brand.config.visualPresentation.records.createAction",
"label": "新增咨询按钮",
"input": "text"
"input": "text",
"previewTarget": "linjing-editorial.records.recordsCopy"
},
{
"key": "emptyTitle",
"binding": "brand.config.visualPresentation.records.emptyTitle",
"label": "暂无记录标题",
"input": "text"
"input": "text",
"previewTarget": "linjing-editorial.records.recordsCopy"
},
{
"key": "emptyDescription",
"binding": "brand.config.visualPresentation.records.emptyDescription",
"label": "暂无记录说明",
"input": "textarea"
"input": "textarea",
"previewTarget": "linjing-editorial.records.recordsCopy"
},
{
"key": "emptyAction",
"binding": "brand.config.visualPresentation.records.emptyAction",
"label": "空状态按钮",
"input": "text"
"input": "text",
"previewTarget": "linjing-editorial.records.recordsCopy"
}
],
"previewTargets": [
{
"key": "linjing-editorial.records.recordsCopy",
"label": "咨询记录页"
}
]
}
@@ -655,21 +812,33 @@
{
"type": "schedule",
"label": "服务与合作安排",
"adminFields": { "title": "安排标题", "summary": "安排摘要", "content": "时间与排期详情" },
"adminFields": {
"title": "安排标题",
"summary": "安排摘要",
"content": "时间与排期详情"
},
"pages": ["profile"],
"help": "说明可预约时间、服务周期或项目排期。"
},
{
"type": "coverage",
"label": "服务范围与适用对象",
"adminFields": { "title": "范围标题", "summary": "范围摘要", "content": "服务范围说明" },
"adminFields": {
"title": "范围标题",
"summary": "范围摘要",
"content": "服务范围说明"
},
"pages": ["profile"],
"help": "说明服务地区、项目类型或合作边界。"
},
{
"type": "process",
"label": "合作流程",
"adminFields": { "title": "流程标题", "summary": "流程摘要", "content": "流程步骤" },
"adminFields": {
"title": "流程标题",
"summary": "流程摘要",
"content": "流程步骤"
},
"pages": ["profile"],
"help": "每行写一步,从初次沟通到交付完成。",
"placeholder": "例如:需求沟通\n方案确认\n落地交付",
@@ -678,7 +847,11 @@
{
"type": "credential",
"label": "专业资历与方法",
"adminFields": { "title": "证明标题", "summary": "专业摘要", "content": "资历与方法说明" },
"adminFields": {
"title": "证明标题",
"summary": "专业摘要",
"content": "资历与方法说明"
},
"pages": ["home", "profile"],
"help": "填写经验、资质、专业标准或工作方法。",
"configFields": [
@@ -688,9 +861,19 @@
"label": "信任数据",
"input": "list",
"itemFields": [
{ "key": "value", "label": "数字或成果" },
{ "key": "label", "label": "说明" },
{ "key": "sub", "label": "补充说明", "required": false }
{
"key": "value",
"label": "数字或成果"
},
{
"key": "label",
"label": "说明"
},
{
"key": "sub",
"label": "补充说明",
"required": false
}
]
},
{
@@ -699,8 +882,14 @@
"label": "专业方法",
"input": "list",
"itemFields": [
{ "key": "title", "label": "方法名称" },
{ "key": "desc", "label": "方法说明" }
{
"key": "title",
"label": "方法名称"
},
{
"key": "desc",
"label": "方法说明"
}
]
},
{
@@ -709,9 +898,18 @@
"label": "合作流程",
"input": "list",
"itemFields": [
{ "key": "step", "label": "步骤编号" },
{ "key": "name", "label": "步骤名称" },
{ "key": "desc", "label": "步骤说明" }
{
"key": "step",
"label": "步骤编号"
},
{
"key": "name",
"label": "步骤名称"
},
{
"key": "desc",
"label": "步骤说明"
}
]
}
],
@@ -731,7 +929,11 @@
{
"type": "promise",
"label": "合作预期与响应承诺",
"adminFields": { "title": "承诺标题", "summary": "承诺摘要", "content": "合作与响应说明" },
"adminFields": {
"title": "承诺标题",
"summary": "承诺摘要",
"content": "合作与响应说明"
},
"pages": ["profile"],
"help": "说明回复时间、合作边界和后续跟进方式。"
}
@@ -777,7 +979,11 @@
"title": "别墅门系统案例",
"content": "示例内容,待品牌主理人完善。"
},
{ "type": "process", "title": "从测量到交付", "content": "示例内容,待品牌主理人完善。" },
{
"type": "process",
"title": "从测量到交付",
"content": "示例内容,待品牌主理人完善。"
},
{
"type": "credential",
"title": "材料与工艺标准",
@@ -791,11 +997,26 @@
"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": "整栋别墅门系统全案一体化"
}
]
},
{
@@ -810,10 +1031,22 @@
"type": "select",
"required": true,
"options": [
{ "label": "土建结构阶段(适合预埋加固)", "value": "土建结构阶段(适合预埋加固)" },
{ "label": "水电木工阶段(适合精确测距)", "value": "水电木工阶段(适合精确测距)" },
{ "label": "硬装收尾阶段", "value": "硬装收尾阶段" },
{ "label": "旧宅门体翻新改造", "value": "旧宅门体翻新改造" }
{
"label": "土建结构阶段(适合预埋加固)",
"value": "土建结构阶段(适合预埋加固)"
},
{
"label": "水电木工阶段(适合精确测距)",
"value": "水电木工阶段(适合精确测距)"
},
{
"label": "硬装收尾阶段",
"value": "硬装收尾阶段"
},
{
"label": "旧宅门体翻新改造",
"value": "旧宅门体翻新改造"
}
]
},
{
@@ -822,10 +1055,22 @@
"type": "select",
"required": false,
"options": [
{ "label": "5 万 - 10 万", "value": "5 万 - 10 万" },
{ "label": "10 万 - 20 万", "value": "10 万 - 20 万" },
{ "label": "20 万 - 50 万(全宅全案)", "value": "20 万 - 50 万(全宅全案)" },
{ "label": "50 万以上(顶级孤品定制)", "value": "50 万以上(顶级孤品定制)" }
{
"label": "5 万 - 10 万",
"value": "5 万 - 10 万"
},
{
"label": "10 万 - 20 万",
"value": "10 万 - 20 万"
},
{
"label": "20 万 - 50 万(全宅全案)",
"value": "20 万 - 50 万(全宅全案)"
},
{
"label": "50 万以上(顶级孤品定制)",
"value": "50 万以上(顶级孤品定制)"
}
]
},
{
@@ -834,14 +1079,22 @@
"type": "radio",
"required": true,
"options": [
{ "label": "需要(预约排期现场勘测)", "value": "需要(预约排期现场勘测)" },
{
"label": "需要(预约排期现场勘测)",
"value": "需要(预约排期现场勘测)"
},
{
"label": "暂不需要(先发图纸在线深化评估)",
"value": "暂不需要(先发图纸在线深化评估)"
}
]
},
{ "key": "contactName", "label": "贵姓称谓", "type": "text", "required": true },
{
"key": "contactName",
"label": "贵姓称谓",
"type": "text",
"required": true
},
{
"key": "contactPhone",
"label": "联系手机号(微信同号)",
@@ -875,13 +1128,36 @@
}
],
"trustContent": [
{ "type": "credential", "title": "关于主理人", "content": "示例内容,待品牌主理人完善。" },
{ "type": "process", "title": "合作方法", "content": "示例内容,待品牌主理人完善。" }
{
"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 }
{
"key": "name",
"label": "您的称呼",
"type": "text",
"required": true
},
{
"key": "phone",
"label": "联系方式",
"type": "phone",
"required": true
},
{
"key": "remark",
"label": "合作需求",
"type": "textarea",
"required": true
}
],
"capabilityKey": "inquiry"
}
+6
View File
@@ -1,6 +1,12 @@
import type { RuntimeWorkspace } from "./runtime-workspace.js";
export type EditorPreviewHostMessage =
| {
protocol: "personal-brand-editor-preview";
version: 1;
type: "workspaceDraft";
workspace: RuntimeWorkspace;
}
| {
protocol: "personal-brand-editor-preview";
version: 1;