feat: 完善模板内容后台配置能力

This commit is contained in:
que01 committed 2026-09-28 17:30:34 +08:00
1 parent 2bc2193b44
commit 9266ec824a
37 files changed
+2273 -63

No files matched your search

+9 -1
View File
@@ -70,7 +70,14 @@ export interface TemplateAdminField {
binding: string;
label: string;
help?: string;
input: "text" | "textarea" | "phone" | "image" | "number";
input: "text" | "textarea" | "phone" | "image" | "number" | "list";
itemFields?: Array<{
key: string;
label: string;
input?: "text" | "textarea";
required?: boolean;
}>;
itemValueKey?: string;
required?: boolean;
maxLength?: number;
placeholder?: string;
@@ -93,6 +100,7 @@ export interface AdminTemplateContent {
help?: string;
placeholder?: string;
required?: boolean;
configFields?: TemplateAdminField[];
}>;
assetSlots: Array<{
key: string;
@@ -223,6 +223,24 @@ export const generatedTemplatePackageRegistry = [
"input": "text",
"placeholder": "例如:17:00 - 22:30 · 今日营业中"
},
{
"key": "coverageContent",
"binding": "brand.config.visualPresentation.profile.coverageContent",
"label": "取餐与配送说明",
"input": "textarea"
},
{
"key": "coverageTitle",
"binding": "brand.config.visualPresentation.profile.coverageTitle",
"label": "服务方式标题",
"input": "text"
},
{
"key": "worksEyebrow",
"binding": "brand.config.visualPresentation.home.worksEyebrow",
"label": "餐品区域小标题",
"input": "text"
},
{
"key": "worksTitle",
"binding": "brand.config.visualPresentation.home.worksTitle",
@@ -255,6 +273,13 @@ export const generatedTemplatePackageRegistry = [
"label": "菜单页说明",
"input": "textarea",
"maxLength": 120
},
{
"key": "menuTip",
"binding": "brand.config.visualPresentation.offerings.menuTip",
"label": "菜单提示",
"help": "只填写当前实际提供的取餐、加菜或定制服务。",
"input": "textarea"
}
]
},
@@ -283,6 +308,239 @@ export const generatedTemplatePackageRegistry = [
"label": "提交按钮文字",
"input": "text",
"placeholder": "例如:提交预订需求"
},
{
"key": "promise",
"binding": "brand.config.visualPresentation.inquiry.promise",
"label": "真实服务承诺",
"help": "仅填写能兑现的回复时间、订金和联系规则;留空则不显示。",
"input": "textarea"
}
]
},
{
"key": "dishDetail",
"title": "餐品与服务详情",
"description": "每项餐品或服务单独填写;没有内容的详情区块不会展示。",
"target": "offering",
"fields": [
{
"key": "categoryLabel",
"binding": "offering.config.categoryLabel",
"label": "餐品类别",
"input": "text"
},
{
"key": "detailHero",
"binding": "offering.config.detailHero",
"label": "详情主图",
"input": "image"
},
{
"key": "area",
"binding": "offering.config.area",
"label": "供应地点",
"input": "text"
},
{
"key": "series",
"binding": "offering.config.series",
"label": "套餐或系列说明",
"input": "text"
},
{
"key": "spaceType",
"binding": "offering.config.spaceType",
"label": "适合场景",
"input": "text"
},
{
"key": "background",
"binding": "offering.config.details.background",
"label": "餐品介绍",
"input": "textarea"
},
{
"key": "designConcept",
"binding": "offering.config.details.designConcept",
"label": "口味与分量",
"input": "textarea"
},
{
"key": "keywords",
"binding": "offering.config.keywords",
"label": "餐品特色",
"input": "list",
"itemValueKey": "value",
"itemFields": [
{
"key": "value",
"label": "特色"
}
]
},
{
"key": "crafts",
"binding": "offering.config.details.crafts",
"label": "制作方式",
"input": "list",
"itemValueKey": "value",
"itemFields": [
{
"key": "value",
"label": "制作说明"
}
]
},
{
"key": "materialsList",
"binding": "offering.config.details.materialsList",
"label": "食材与搭配",
"input": "list",
"itemFields": [
{
"key": "name",
"label": "食材或搭配"
},
{
"key": "spec",
"label": "说明"
}
]
}
]
},
{
"key": "detailCopy",
"title": "详情页说明",
"description": "解释价格、餐品内容和咨询后会怎样处理。",
"target": "brand",
"fields": [
{
"key": "priceLabel",
"binding": "brand.config.visualPresentation.detail.priceLabel",
"label": "价格说明标题",
"input": "text"
},
{
"key": "spaceLabel",
"binding": "brand.config.visualPresentation.detail.spaceLabel",
"label": "适合场景标题",
"input": "text"
},
{
"key": "backgroundTitle",
"binding": "brand.config.visualPresentation.detail.backgroundTitle",
"label": "餐品介绍标题",
"input": "text"
},
{
"key": "conceptTitle",
"binding": "brand.config.visualPresentation.detail.conceptTitle",
"label": "口味与分量标题",
"input": "text"
},
{
"key": "craftsTitle",
"binding": "brand.config.visualPresentation.detail.craftsTitle",
"label": "制作方式标题",
"input": "text"
},
{
"key": "materialsTitle",
"binding": "brand.config.visualPresentation.detail.materialsTitle",
"label": "食材与搭配标题",
"input": "text"
},
{
"key": "inquiryAction",
"binding": "brand.config.visualPresentation.detail.inquiryAction",
"label": "咨询按钮文字",
"input": "text"
},
{
"key": "inquiryHint",
"binding": "brand.config.visualPresentation.detail.inquiryHint",
"label": "咨询后的处理说明",
"help": "只写能够兑现的联系和确认方式。",
"input": "textarea"
}
]
},
{
"key": "successCopy",
"title": "提交成功页",
"description": "顾客提交后看到的确认信息与后续预期。",
"target": "brand",
"fields": [
{
"key": "eyebrow",
"binding": "brand.config.visualPresentation.success.eyebrow",
"label": "页面小标题",
"input": "text"
},
{
"key": "title",
"binding": "brand.config.visualPresentation.success.title",
"label": "确认标题",
"input": "text"
},
{
"key": "intro",
"binding": "brand.config.visualPresentation.success.intro",
"label": "后续联系说明",
"help": "若写回复时间,请确认日常能兑现。",
"input": "textarea"
},
{
"key": "recordsAction",
"binding": "brand.config.visualPresentation.success.recordsAction",
"label": "查看记录按钮",
"input": "text"
},
{
"key": "homeAction",
"binding": "brand.config.visualPresentation.success.homeAction",
"label": "返回首页按钮",
"input": "text"
}
]
},
{
"key": "recordsCopy",
"title": "咨询记录页",
"description": "顾客查看预订与咨询处理进度时看到的内容。",
"target": "brand",
"fields": [
{
"key": "title",
"binding": "brand.config.visualPresentation.records.title",
"label": "记录页标题",
"input": "text"
},
{
"key": "createAction",
"binding": "brand.config.visualPresentation.records.createAction",
"label": "新增咨询按钮",
"input": "text"
},
{
"key": "emptyTitle",
"binding": "brand.config.visualPresentation.records.emptyTitle",
"label": "暂无记录标题",
"input": "text"
},
{
"key": "emptyDescription",
"binding": "brand.config.visualPresentation.records.emptyDescription",
"label": "暂无记录说明",
"input": "textarea"
},
{
"key": "emptyAction",
"binding": "brand.config.visualPresentation.records.emptyAction",
"label": "空状态按钮",
"input": "text"
}
]
}
@@ -649,17 +907,176 @@ export const generatedTemplatePackageRegistry = [
"label": "信任介绍标题",
"input": "text"
},
{
"key": "proofEyebrow",
"binding": "brand.config.visualPresentation.home.proofEyebrow",
"label": "信任介绍小标题",
"input": "text"
},
{
"key": "manifestoEyebrow",
"binding": "brand.config.visualPresentation.home.manifestoEyebrow",
"label": "品牌主张小标题",
"input": "text"
},
{
"key": "manifestoTitle",
"binding": "brand.config.visualPresentation.home.manifestoTitle",
"label": "品牌主张",
"input": "text"
},
{
"key": "worksEyebrow",
"binding": "brand.config.visualPresentation.home.worksEyebrow",
"label": "代表案例小标题",
"input": "text"
},
{
"key": "worksTitle",
"binding": "brand.config.visualPresentation.home.worksTitle",
"label": "代表案例标题",
"input": "text"
},
{
"key": "worksAction",
"binding": "brand.config.visualPresentation.home.worksAction",
"label": "查看案例入口",
"input": "text"
},
{
"key": "flowEyebrow",
"binding": "brand.config.visualPresentation.home.flowEyebrow",
"label": "合作流程小标题",
"input": "text"
},
{
"key": "flowTitle",
"binding": "brand.config.visualPresentation.home.flowTitle",
"label": "项目流程标题",
"input": "text"
},
{
"key": "heroTitle",
"binding": "brand.config.homeHero.title",
"label": "首页主标题",
"input": "text"
},
{
"key": "heroEyebrow",
"binding": "brand.config.homeHero.eyebrow",
"label": "主图项目标注",
"input": "text"
},
{
"key": "heroDescription",
"binding": "brand.config.homeHero.slogan",
"label": "首页主图说明",
"input": "textarea"
},
{
"key": "heroAction",
"binding": "brand.config.homeHero.cta",
"label": "主图行动文字",
"input": "text"
}
]
},
{
"key": "profileDetails",
"title": "服务区域与履约说明",
"description": "在主理人与我页面说明可服务的地区和真实履约承诺。",
"target": "brand",
"fields": [
{
"key": "coverage",
"binding": "brand.config.profilePresentation.coverage",
"label": "服务区域",
"input": "list",
"itemFields": [
{
"key": "title",
"label": "区域名称"
},
{
"key": "content",
"label": "服务说明",
"input": "textarea"
}
]
},
{
"key": "warranty",
"binding": "brand.config.profilePresentation.warranty",
"label": "履约与维护说明",
"input": "list",
"itemValueKey": "value",
"itemFields": [
{
"key": "value",
"label": "承诺内容",
"input": "textarea"
}
]
},
{
"key": "recordsTitle",
"binding": "brand.config.visualPresentation.profile.recordsTitle",
"label": "咨询记录入口标题",
"input": "text"
},
{
"key": "recordsSubtitle",
"binding": "brand.config.visualPresentation.profile.recordsSubtitle",
"label": "咨询记录入口说明",
"input": "textarea"
},
{
"key": "coverageTitle",
"binding": "brand.config.visualPresentation.profile.coverageTitle",
"label": "服务区域标题",
"input": "text"
},
{
"key": "warrantyTitle",
"binding": "brand.config.visualPresentation.profile.warrantyTitle",
"label": "履约说明标题",
"input": "text"
},
{
"key": "phoneLabel",
"binding": "brand.config.visualPresentation.profile.phoneLabel",
"label": "电话标签",
"input": "text"
},
{
"key": "wechatLabel",
"binding": "brand.config.visualPresentation.profile.wechatLabel",
"label": "微信标签",
"input": "text"
},
{
"key": "addressLabel",
"binding": "brand.config.visualPresentation.profile.addressLabel",
"label": "地址标签",
"input": "text"
},
{
"key": "callAction",
"binding": "brand.config.visualPresentation.profile.callAction",
"label": "拨打电话按钮",
"input": "text"
},
{
"key": "copyAction",
"binding": "brand.config.visualPresentation.profile.copyAction",
"label": "复制微信按钮",
"input": "text"
},
{
"key": "recordsCountUnit",
"binding": "brand.config.visualPresentation.profile.recordsCountUnit",
"label": "记录数量单位",
"input": "text"
}
]
},
@@ -687,6 +1104,18 @@ export const generatedTemplatePackageRegistry = [
"label": "案例页说明",
"input": "textarea",
"maxLength": 140
},
{
"key": "closingText",
"binding": "brand.config.visualPresentation.offerings.closingText",
"label": "案例页结语",
"input": "textarea"
},
{
"key": "closingAction",
"binding": "brand.config.visualPresentation.offerings.closingAction",
"label": "案例页咨询入口",
"input": "text"
}
]
},
@@ -714,6 +1143,244 @@ export const generatedTemplatePackageRegistry = [
"binding": "brand.config.visualPresentation.inquiry.submitLabel",
"label": "提交按钮文字",
"input": "text"
},
{
"key": "eyebrow",
"binding": "brand.config.visualPresentation.inquiry.eyebrow",
"label": "咨询页小标题",
"input": "text"
},
{
"key": "note",
"binding": "brand.config.visualPresentation.inquiry.note",
"label": "咨询前提示",
"input": "textarea"
}
]
},
{
"key": "projectDetail",
"title": "案例详情",
"description": "以下内容分别填写在每个案例中,空白内容不会展示。",
"target": "offering",
"fields": [
{
"key": "categoryLabel",
"binding": "offering.config.categoryLabel",
"label": "案例类别",
"input": "text"
},
{
"key": "detailHero",
"binding": "offering.config.detailHero",
"label": "详情主图",
"input": "image"
},
{
"key": "area",
"binding": "offering.config.area",
"label": "项目地点",
"input": "text"
},
{
"key": "series",
"binding": "offering.config.series",
"label": "产品系列",
"input": "text"
},
{
"key": "spaceType",
"binding": "offering.config.spaceType",
"label": "适用空间",
"input": "text"
},
{
"key": "background",
"binding": "offering.config.details.background",
"label": "项目背景",
"input": "textarea"
},
{
"key": "designConcept",
"binding": "offering.config.details.designConcept",
"label": "设计理念",
"input": "textarea"
},
{
"key": "keywords",
"binding": "offering.config.keywords",
"label": "项目关键词",
"input": "list",
"itemValueKey": "value",
"itemFields": [
{
"key": "value",
"label": "关键词"
}
]
},
{
"key": "crafts",
"binding": "offering.config.details.crafts",
"label": "工艺要点",
"input": "list",
"itemValueKey": "value",
"itemFields": [
{
"key": "value",
"label": "工艺说明"
}
]
},
{
"key": "materialsList",
"binding": "offering.config.details.materialsList",
"label": "材料说明",
"input": "list",
"itemFields": [
{
"key": "name",
"label": "材料名称"
},
{
"key": "spec",
"label": "规格说明"
}
]
}
]
},
{
"key": "detailCopy",
"title": "详情页说明",
"description": "说明案例内容、价格与咨询后的真实处理方式。",
"target": "brand",
"fields": [
{
"key": "priceLabel",
"binding": "brand.config.visualPresentation.detail.priceLabel",
"label": "价格说明标题",
"input": "text"
},
{
"key": "spaceLabel",
"binding": "brand.config.visualPresentation.detail.spaceLabel",
"label": "适用空间标题",
"input": "text"
},
{
"key": "backgroundTitle",
"binding": "brand.config.visualPresentation.detail.backgroundTitle",
"label": "项目背景标题",
"input": "text"
},
{
"key": "conceptTitle",
"binding": "brand.config.visualPresentation.detail.conceptTitle",
"label": "设计理念标题",
"input": "text"
},
{
"key": "craftsTitle",
"binding": "brand.config.visualPresentation.detail.craftsTitle",
"label": "工艺要点标题",
"input": "text"
},
{
"key": "materialsTitle",
"binding": "brand.config.visualPresentation.detail.materialsTitle",
"label": "材料说明标题",
"input": "text"
},
{
"key": "inquiryAction",
"binding": "brand.config.visualPresentation.detail.inquiryAction",
"label": "咨询按钮文字",
"input": "text"
},
{
"key": "inquiryHint",
"binding": "brand.config.visualPresentation.detail.inquiryHint",
"label": "咨询后的处理说明",
"help": "只填写能兑现的服务安排。",
"input": "textarea"
}
]
},
{
"key": "successCopy",
"title": "提交成功页",
"description": "访客提交后看到的确认信息与后续预期。",
"target": "brand",
"fields": [
{
"key": "eyebrow",
"binding": "brand.config.visualPresentation.success.eyebrow",
"label": "页面小标题",
"input": "text"
},
{
"key": "title",
"binding": "brand.config.visualPresentation.success.title",
"label": "确认标题",
"input": "text"
},
{
"key": "intro",
"binding": "brand.config.visualPresentation.success.intro",
"label": "后续联系说明",
"help": "回复时间必须与实际承诺一致。",
"input": "textarea"
},
{
"key": "recordsAction",
"binding": "brand.config.visualPresentation.success.recordsAction",
"label": "查看记录按钮",
"input": "text"
},
{
"key": "homeAction",
"binding": "brand.config.visualPresentation.success.homeAction",
"label": "返回首页按钮",
"input": "text"
}
]
},
{
"key": "recordsCopy",
"title": "咨询记录页",
"description": "访客查看咨询状态时看到的内容。",
"target": "brand",
"fields": [
{
"key": "title",
"binding": "brand.config.visualPresentation.records.title",
"label": "记录页标题",
"input": "text"
},
{
"key": "createAction",
"binding": "brand.config.visualPresentation.records.createAction",
"label": "新增咨询按钮",
"input": "text"
},
{
"key": "emptyTitle",
"binding": "brand.config.visualPresentation.records.emptyTitle",
"label": "暂无记录标题",
"input": "text"
},
{
"key": "emptyDescription",
"binding": "brand.config.visualPresentation.records.emptyDescription",
"label": "暂无记录说明",
"input": "textarea"
},
{
"key": "emptyAction",
"binding": "brand.config.visualPresentation.records.emptyAction",
"label": "空状态按钮",
"input": "text"
}
]
}
@@ -741,6 +1408,65 @@ export const generatedTemplatePackageRegistry = [
"type": "credential",
"label": "专业资历与方法",
"help": "填写经验、资质、专业标准或工作方法。",
"configFields": [
{
"key": "stats",
"binding": "trust.config.stats",
"label": "信任数据",
"input": "list",
"itemFields": [
{
"key": "value",
"label": "数字或成果"
},
{
"key": "label",
"label": "说明"
},
{
"key": "sub",
"label": "补充说明",
"required": false
}
]
},
{
"key": "pillars",
"binding": "trust.config.pillars",
"label": "专业方法",
"input": "list",
"itemFields": [
{
"key": "title",
"label": "方法名称"
},
{
"key": "desc",
"label": "方法说明"
}
]
},
{
"key": "serviceFlow",
"binding": "trust.config.serviceFlow",
"label": "合作流程",
"input": "list",
"itemFields": [
{
"key": "step",
"label": "步骤编号"
},
{
"key": "name",
"label": "步骤名称"
},
{
"key": "desc",
"label": "步骤说明"
}
]
}
],
"required": true
},
{
@@ -985,4 +1711,4 @@ export const generatedTemplatePackageRegistry = [
}
];
export const generatedTemplatePackageRegistryHash =
"f7ba069156be4fdf8f21c6e600796082ff87d5c04b0ed2a07d3b7d4ca68817b5";
"2a4344e4bb932b06eb386cba64d407290fa125799bf16a204eddb945179e68fc";
+17 -1
View File
@@ -222,7 +222,15 @@ export interface TemplatePackageManifest {
title: string;
description: string;
target: "brand" | "offering" | "trust" | "inquiry";
fields: readonly { key: string; binding: string; label: string; required?: boolean }[];
fields: readonly {
key: string;
binding: string;
label: string;
input: string;
required?: boolean;
itemFields?: readonly { key: string; label: string; input?: string; required?: boolean }[];
itemValueKey?: string;
}[];
}[];
};
trustContentTypes?: readonly {
@@ -231,6 +239,14 @@ export interface TemplatePackageManifest {
help?: string;
placeholder?: string;
required?: boolean;
configFields?: readonly {
key: string;
binding: string;
label: string;
input: string;
itemFields?: readonly { key: string; label: string; input?: string; required?: boolean }[];
itemValueKey?: string;
}[];
}[];
sampleContent?: Partial<Record<BrandTemplateKey, TemplateSampleContent>>;
}
@@ -1,7 +1,7 @@
{
"pages": ["pages/index/index"],
"window": {
"navigationBarTitleText": "阿成校园餐",
"navigationBarTitleText": "品牌首页",
"navigationBarBackgroundColor": "#FFF8F0",
"navigationBarTextStyle": "black"
},
@@ -1 +1 @@
<view class="page"><view class="brand-card"><view class="identity"><image src="{{brand.avatarUrl}}" mode="aspectFill"/><view><text class="name">{{brand.founder}}</text><text class="title">{{brand.title}}</text><text class="slogan">“{{brand.slogan}}”</text></view></view><view class="notice"><text class="notice-title">{{presentation.stallTitle || '今日出摊点'}}</text><text>{{brand.studioAddress || brand.address}}</text><text class="notice-time">{{presentation.stallTime || '17:00 - 22:30 · 今日营业中'}}</text><text wx:for="{{trustItems}}" wx:if="{{item.type === 'schedule'}}" wx:key="title" class="notice-desc">{{item.content}}</text></view><view class="actions"><button bindtap="openInquiry">预约 / 定制</button><button class="muted" bindtap="openOfferings">今日菜单</button></view></view><view class="scene-wrap"><view class="section-head"><text class="eyebrow">真实出摊现场</text><text class="more">{{brand.name}}</text></view><image src="{{brand.heroImage}}" mode="aspectFill" bindtap="openService"/></view><view class="section-head"><view><text class="eyebrow">{{presentation.worksEyebrow || '今日餐品与预订'}}</text><text class="heading">{{presentation.worksTitle || '套餐、聚餐与定制餐'}}</text></view><text class="more" bindtap="openOfferings">全部餐品 ›</text></view><view class="dish-grid"><view wx:for="{{offerings}}" wx:key="id" class="dish" data-id="{{item.id}}" bindtap="openOffering"><image src="{{item.image}}" mode="aspectFill"/><view class="dish-copy"><text class="dish-name">{{item.name}}</text><text class="dish-sub">{{item.desc}}</text><text class="price">{{item.priceRange}}</text></view></view></view><view wx:for="{{trustItems}}" wx:if="{{item.type === 'promise' || item.type === 'case'}}" wx:key="title" class="promise"><text class="eyebrow light">{{item.title}}</text><text class="promise-title">{{item.summary}}</text><text class="quote">{{item.content}}</text></view></view>
<view class="page"><view class="brand-card"><view class="identity"><image src="{{brand.avatarUrl}}" mode="aspectFill"/><view><text class="name">{{brand.founder}}</text><text class="title">{{brand.title}}</text><text class="slogan">“{{brand.slogan}}”</text></view></view><view class="notice"><text class="notice-title">{{presentation.stallTitle || '服务地点'}}</text><text>{{brand.studioAddress || brand.address}}</text><text wx:if="{{presentation.stallTime}}" class="notice-time">{{presentation.stallTime}}</text><text wx:for="{{trustItems}}" wx:if="{{item.type === 'schedule'}}" wx:key="title" class="notice-desc">{{item.content}}</text></view><view class="actions"><button bindtap="openInquiry">咨询 / 预订</button><button class="muted" bindtap="openOfferings">查看餐品</button></view></view><view class="scene-wrap"><view class="section-head"><text class="eyebrow">{{brand.name}}</text></view><image src="{{brand.heroImage}}" mode="aspectFill" bindtap="openService"/></view><view class="section-head"><view><text class="eyebrow">{{presentation.worksEyebrow || '餐品与服务'}}</text><text class="heading">{{presentation.worksTitle || '可选餐品'}}</text></view><text class="more" bindtap="openOfferings">查看全部 ›</text></view><view class="dish-grid"><view wx:for="{{offerings}}" wx:key="id" class="dish" data-id="{{item.id}}" bindtap="openOffering"><image src="{{item.image}}" mode="aspectFill"/><view class="dish-copy"><text class="dish-name">{{item.name}}</text><text class="dish-sub">{{item.desc}}</text><text class="price">{{item.priceRange}}</text></view></view></view><view wx:for="{{trustItems}}" wx:if="{{item.type === 'promise' || item.type === 'case'}}" wx:key="title" class="promise"><text class="eyebrow light">{{item.title}}</text><text class="promise-title">{{item.summary}}</text><text class="quote">{{item.content}}</text></view></view>
@@ -1 +1 @@
<view class="page"><view class="head"><text class="eyebrow">{{brand.name}}</text><text class="title">{{presentation.title || '今日菜单'}}</text><text class="subtitle">{{presentation.subtitle || '现做现吃,支持提前预留和团体定制'}}</text></view><view wx:if="{{categories.length > 1}}" class="filters"><view wx:for="{{categories}}" wx:key="key" class="filter {{item.key === category ? 'active' : ''}}" data-key="{{item.key}}" bindtap="chooseCategory">{{item.label}}</view></view><view class="search"><text class="search-icon">⌕</text><input value="{{query}}" placeholder="搜索餐品、牛肉、卤肉、鸡腿" bindinput="search" /></view><view class="tip">米饭免费续,支持微辣、免葱姜蒜,团体餐可提前预留。</view><view class="list"><view wx:for="{{visibleOfferings}}" wx:key="id" class="dish" data-id="{{item.id}}" bindtap="open"><view class="dish-media"><image src="{{item.image}}" mode="aspectFill"/><text class="tag">{{item.category || '现做餐品'}}</text></view><view class="copy"><text class="name">{{item.name}}</text><text class="desc">{{item.desc}}</text><view class="chips"><text>现做</text><text>今日有售</text></view><view class="bottom"><text class="price">{{item.priceRange}}</text><text class="action">详情 / 预留 ›</text></view></view></view></view><button class="cta" bindtap="inquire">团体活动 / 定制餐咨询</button></view>
<view class="page"><view class="head"><text class="eyebrow">{{brand.name}}</text><text class="title">{{presentation.title || '餐品与服务'}}</text><text class="subtitle">{{presentation.subtitle}}</text></view><view wx:if="{{categories.length > 1}}" class="filters"><view wx:for="{{categories}}" wx:key="key" class="filter {{item.key === category ? 'active' : ''}}" data-key="{{item.key}}" bindtap="chooseCategory">{{item.label}}</view></view><view class="search"><text class="search-icon">⌕</text><input value="{{query}}" placeholder="搜索餐品" bindinput="search" /></view><view wx:if="{{presentation.menuTip}}" class="tip">{{presentation.menuTip}}</view><view class="list"><view wx:for="{{visibleOfferings}}" wx:key="id" class="dish" data-id="{{item.id}}" bindtap="open"><view class="dish-media"><image src="{{item.image}}" mode="aspectFill"/><text class="tag">{{item.category || '餐品'}}</text></view><view class="copy"><text class="name">{{item.name}}</text><text class="desc">{{item.desc}}</text><view class="bottom"><text class="price">{{item.priceRange}}</text><text class="action">查看详情 ›</text></view></view></view></view><button class="cta" bindtap="inquire">咨询 / 预订</button></view>
@@ -1 +1 @@
<view class="page"><view class="profile-card"><image src="{{brand.avatarUrl}}" mode="aspectFill"/><text class="name">{{brand.founder}}</text><text class="title">{{brand.title}}</text><text class="bio">{{brand.slogan}}</text><view class="contact"><button bindtap="call">电话联系</button><button bindtap="copy">复制微信</button></view></view><view class="card"><text class="card-title">{{presentation.coverageTitle || '出摊与配送'}}</text><text>{{brand.studioAddress || brand.address}}</text><text>{{presentation.coverageContent || '支持校园摊位自取、宿舍配送和班级活动定制。'}}</text></view><view class="card" bindtap="records"><text class="card-title">我的预约记录</text><text>{{recordsCount}} 条记录 ›</text></view></view>
<view class="page"><view class="profile-card"><image src="{{brand.avatarUrl}}" mode="aspectFill"/><text class="name">{{brand.founder}}</text><text class="title">{{brand.title}}</text><text class="bio">{{brand.slogan}}</text><view class="contact"><button bindtap="call">电话联系</button><button bindtap="copy">复制微信</button></view></view><view class="card"><text class="card-title">{{presentation.coverageTitle || '服务地点与方式'}}</text><text>{{brand.studioAddress || brand.address}}</text><text wx:if="{{presentation.coverageContent}}">{{presentation.coverageContent}}</text></view><view class="card" bindtap="records"><text class="card-title">我的预约记录</text><text>{{recordsCount}} 条记录 ›</text></view></view>
@@ -5,14 +5,15 @@ Page({
data: { brand: {}, presentation: {}, trustItems: [], offerings: [], error: "" },
onLoad() {
loadWorkspaceWithFallback()
.then((workspace) =>
.then((workspace) => {
this.setData({
brand: workspace.brand || {},
presentation: workspace.brand?.visualPresentation?.home || {},
trustItems: workspace.trustItems || [],
offerings: workspace.offerings || [],
}),
)
});
wx.setNavigationBarTitle({ title: workspace.brand?.name || "品牌首页" });
})
.catch((error) => this.setData({ error: error.message }));
},
selectOffering(event) {
@@ -1,5 +1,5 @@
{
"navigationBarTitleText": "阿成校园餐",
"navigationBarTitleText": "品牌首页",
"usingComponents": {
"acheng-home": "/components/templates/acheng-home/acheng-home"
}
@@ -34,12 +34,14 @@ Page({
formId: "",
submitting: false,
formError: "",
presentation: {},
},
onLoad(options) {
this.offeringId = options.offeringId || "";
loadWorkspaceWithFallback()
.then((workspace) => {
this.forms = workspace.inquiryForms || [];
this.setData({ presentation: workspace.brand?.visualPresentation?.inquiry || {} });
this.selectForm();
})
.catch((error) => this.setData({ formError: error.message }));
@@ -112,7 +114,7 @@ Page({
wx.setStorageSync("latestInquirySubmission", result);
this.setData({ submitting: false, subView: "history" });
this.loadRecords();
wx.showToast({ title: "已提交,阿成会尽快联系你", icon: "none" });
wx.showToast({ title: "咨询已提交", icon: "none" });
});
const fail = (error) =>
this.setData({ submitting: false, formError: error.message || "提交失败,请重试" });
@@ -2,8 +2,8 @@
<view class="sub-tabs"><view class="sub-tab {{subView === 'form' ? 'active' : ''}}" data-view="form" bindtap="switchView">▤ 新建咨询 / 预订</view><view class="sub-tab {{subView === 'history' ? 'active' : ''}}" data-view="history" bindtap="switchView">▣ 我的咨询记录 ({{records.length}})</view></view>
<block wx:if="{{subView === 'form'}}">
<view class="form-card">
<text class="form-title">定制 / 预留需求登记</text>
<text class="form-desc">告诉阿成时间与人数,阿成量身帮你们排菜(免收预约定金)</text>
<text class="form-title">{{presentation.title || '咨询 / 预订'}}</text>
<text wx:if="{{presentation.subtitle}}" class="form-desc">{{presentation.subtitle}}</text>
<view wx:for="{{fields}}" wx:key="key" class="field">
<text class="label">{{item.label}} <b wx:if="{{item.required}}">*</b></text>
<picker wx:if="{{item.type === 'select' || item.type === 'radio'}}" range="{{item.options}}" range-key="label" data-key="{{item.key}}" bindchange="choose"><view class="picker">{{values[item.key] || '请选择' + item.label}}</view></picker>
@@ -12,21 +12,20 @@
<input wx:else type="{{item.type === 'number' ? 'number' : 'text'}}" value="{{values[item.key]}}" data-key="{{item.key}}" bindinput="input" placeholder="{{item.placeholder || '请填写' + item.label}}" />
</view>
<view wx:if="{{formError}}" class="error">! {{formError}}</view>
<view class="promise">◷ <text>承诺:阿成将在 15~30 分钟内主动加微信沟通,未成单绝不骚扰。</text></view>
<button class="submit" loading="{{submitting}}" bindtap="submit">➤ 立即提交咨询(免收定金)</button>
<view wx:if="{{presentation.promise}}" class="promise"><text>{{presentation.promise}}</text></view>
<button class="submit" loading="{{submitting}}" bindtap="submit">{{presentation.submitLabel || '提交咨询'}}</button>
</view>
</block>
<block wx:else>
<view wx:if="{{!records.length}}" class="empty"><text class="empty-icon">▣</text><text class="empty-title">暂无咨询记录</text><text>快向阿成提交一份预订需求吧~</text><button bindtap="switchToForm">新建咨询</button></view>
<view wx:if="{{!records.length}}" class="empty"><text class="empty-icon">▣</text><text class="empty-title">暂无咨询记录</text><text>提交需求后,可以在这里查看处理进度。</text><button bindtap="switchToForm">新建咨询</button></view>
<view wx:else class="history-list">
<view wx:for="{{records}}" wx:key="id" class="history-card">
<view class="history-head"><text class="record-id">单号 #{{item.id}}</text><text class="record-status">{{item.status}}</text></view>
<text class="history-title">{{item.title}}</text>
<text wx:for="{{item.summary}}" wx:for-item="line" wx:key="key">{{line.label}}:{{line.value}}</text>
<view wx:if="{{item.replyNote}}" class="reply"><b>阿成微信留言:</b>{{item.replyNote}}</view>
<view class="history-foot">提交时间:{{item.createdAt}}<text>如有修改可随时微信留言</text></view>
<view wx:if="{{item.replyNote}}" class="reply"><b>处理回复:</b>{{item.replyNote}}</view>
<view class="history-foot">提交时间:{{item.createdAt}}</view>
</view>
<text class="history-note">仅展示近 30 天内的微信预约咨询历史</text>
</view>
</block>
</view>
@@ -1,6 +1,6 @@
<view class="page service-page">
<block wx:for="{{trustItems}}" wx:key="title">
<view wx:if="{{item.type === 'schedule'}}" class="service-card"><view class="card-head"><view class="head-title"><text class="icon">◷</text><text>{{item.title}}</text></view><text class="status-pill">准时出摊</text></view><view class="schedule schedule-primary"><view class="schedule-main"><view class="schedule-title"><text class="dot orange"></text><text>{{item.summary}}</text></view><text class="schedule-line">{{item.content}}</text></view></view></view>
<view wx:if="{{item.type === 'schedule'}}" class="service-card"><view class="card-head"><view class="head-title"><text class="icon">◷</text><text>{{item.title}}</text></view></view><view class="schedule schedule-primary"><view class="schedule-main"><view class="schedule-title"><text class="dot orange"></text><text>{{item.summary}}</text></view><text class="schedule-line">{{item.content}}</text></view></view></view>
<view wx:if="{{item.type === 'coverage'}}" class="service-card"><view class="card-title"><text class="icon">⌁</text><text>{{item.title}}</text></view><view class="delivery-grid"><view class="delivery-item"><text class="delivery-title orange-text">服务范围</text><text>{{item.content}}</text></view></view></view>
<view wx:if="{{item.type === 'process'}}" class="service-card process-card"><view class="card-title"><text class="icon">☷</text><text>{{item.title}}</text></view><text wx:if="{{item.summary}}" class="card-sub">{{item.summary}}</text><view class="steps"><view wx:for="{{item.lines}}" wx:key="*this" class="step"><text class="step-no">{{index + 1}}</text><view><text class="step-title">步骤 {{index + 1}}</text><text>{{item}}</text></view></view></view><view class="process-foot"><text>{{item.content}}</text><button bindtap="inquire">立即咨询 <text>→</text></button></view></view>
</block>
@@ -216,6 +216,24 @@
"input": "text",
"placeholder": "例如:17:00 - 22:30 · 今日营业中"
},
{
"key": "coverageContent",
"binding": "brand.config.visualPresentation.profile.coverageContent",
"label": "取餐与配送说明",
"input": "textarea"
},
{
"key": "coverageTitle",
"binding": "brand.config.visualPresentation.profile.coverageTitle",
"label": "服务方式标题",
"input": "text"
},
{
"key": "worksEyebrow",
"binding": "brand.config.visualPresentation.home.worksEyebrow",
"label": "餐品区域小标题",
"input": "text"
},
{
"key": "worksTitle",
"binding": "brand.config.visualPresentation.home.worksTitle",
@@ -248,6 +266,13 @@
"label": "菜单页说明",
"input": "textarea",
"maxLength": 120
},
{
"key": "menuTip",
"binding": "brand.config.visualPresentation.offerings.menuTip",
"label": "菜单提示",
"help": "只填写当前实际提供的取餐、加菜或定制服务。",
"input": "textarea"
}
]
},
@@ -276,6 +301,223 @@
"label": "提交按钮文字",
"input": "text",
"placeholder": "例如:提交预订需求"
},
{
"key": "promise",
"binding": "brand.config.visualPresentation.inquiry.promise",
"label": "真实服务承诺",
"help": "仅填写能兑现的回复时间、订金和联系规则;留空则不显示。",
"input": "textarea"
}
]
},
{
"key": "dishDetail",
"title": "餐品与服务详情",
"description": "每项餐品或服务单独填写;没有内容的详情区块不会展示。",
"target": "offering",
"fields": [
{
"key": "categoryLabel",
"binding": "offering.config.categoryLabel",
"label": "餐品类别",
"input": "text"
},
{
"key": "detailHero",
"binding": "offering.config.detailHero",
"label": "详情主图",
"input": "image"
},
{
"key": "area",
"binding": "offering.config.area",
"label": "供应地点",
"input": "text"
},
{
"key": "series",
"binding": "offering.config.series",
"label": "套餐或系列说明",
"input": "text"
},
{
"key": "spaceType",
"binding": "offering.config.spaceType",
"label": "适合场景",
"input": "text"
},
{
"key": "background",
"binding": "offering.config.details.background",
"label": "餐品介绍",
"input": "textarea"
},
{
"key": "designConcept",
"binding": "offering.config.details.designConcept",
"label": "口味与分量",
"input": "textarea"
},
{
"key": "keywords",
"binding": "offering.config.keywords",
"label": "餐品特色",
"input": "list",
"itemValueKey": "value",
"itemFields": [{ "key": "value", "label": "特色" }]
},
{
"key": "crafts",
"binding": "offering.config.details.crafts",
"label": "制作方式",
"input": "list",
"itemValueKey": "value",
"itemFields": [{ "key": "value", "label": "制作说明" }]
},
{
"key": "materialsList",
"binding": "offering.config.details.materialsList",
"label": "食材与搭配",
"input": "list",
"itemFields": [
{ "key": "name", "label": "食材或搭配" },
{ "key": "spec", "label": "说明" }
]
}
]
},
{
"key": "detailCopy",
"title": "详情页说明",
"description": "解释价格、餐品内容和咨询后会怎样处理。",
"target": "brand",
"fields": [
{
"key": "priceLabel",
"binding": "brand.config.visualPresentation.detail.priceLabel",
"label": "价格说明标题",
"input": "text"
},
{
"key": "spaceLabel",
"binding": "brand.config.visualPresentation.detail.spaceLabel",
"label": "适合场景标题",
"input": "text"
},
{
"key": "backgroundTitle",
"binding": "brand.config.visualPresentation.detail.backgroundTitle",
"label": "餐品介绍标题",
"input": "text"
},
{
"key": "conceptTitle",
"binding": "brand.config.visualPresentation.detail.conceptTitle",
"label": "口味与分量标题",
"input": "text"
},
{
"key": "craftsTitle",
"binding": "brand.config.visualPresentation.detail.craftsTitle",
"label": "制作方式标题",
"input": "text"
},
{
"key": "materialsTitle",
"binding": "brand.config.visualPresentation.detail.materialsTitle",
"label": "食材与搭配标题",
"input": "text"
},
{
"key": "inquiryAction",
"binding": "brand.config.visualPresentation.detail.inquiryAction",
"label": "咨询按钮文字",
"input": "text"
},
{
"key": "inquiryHint",
"binding": "brand.config.visualPresentation.detail.inquiryHint",
"label": "咨询后的处理说明",
"help": "只写能够兑现的联系和确认方式。",
"input": "textarea"
}
]
},
{
"key": "successCopy",
"title": "提交成功页",
"description": "顾客提交后看到的确认信息与后续预期。",
"target": "brand",
"fields": [
{
"key": "eyebrow",
"binding": "brand.config.visualPresentation.success.eyebrow",
"label": "页面小标题",
"input": "text"
},
{
"key": "title",
"binding": "brand.config.visualPresentation.success.title",
"label": "确认标题",
"input": "text"
},
{
"key": "intro",
"binding": "brand.config.visualPresentation.success.intro",
"label": "后续联系说明",
"help": "若写回复时间,请确认日常能兑现。",
"input": "textarea"
},
{
"key": "recordsAction",
"binding": "brand.config.visualPresentation.success.recordsAction",
"label": "查看记录按钮",
"input": "text"
},
{
"key": "homeAction",
"binding": "brand.config.visualPresentation.success.homeAction",
"label": "返回首页按钮",
"input": "text"
}
]
},
{
"key": "recordsCopy",
"title": "咨询记录页",
"description": "顾客查看预订与咨询处理进度时看到的内容。",
"target": "brand",
"fields": [
{
"key": "title",
"binding": "brand.config.visualPresentation.records.title",
"label": "记录页标题",
"input": "text"
},
{
"key": "createAction",
"binding": "brand.config.visualPresentation.records.createAction",
"label": "新增咨询按钮",
"input": "text"
},
{
"key": "emptyTitle",
"binding": "brand.config.visualPresentation.records.emptyTitle",
"label": "暂无记录标题",
"input": "text"
},
{
"key": "emptyDescription",
"binding": "brand.config.visualPresentation.records.emptyDescription",
"label": "暂无记录说明",
"input": "textarea"
},
{
"key": "emptyAction",
"binding": "brand.config.visualPresentation.records.emptyAction",
"label": "空状态按钮",
"input": "text"
}
]
}
+5 -1
View File
@@ -25,7 +25,11 @@ test("compiler generates an isolated Acheng runtime manifest", () => {
});
const app = JSON.parse(fs.readFileSync(path.join(output, "app.json"), "utf8"));
const runtime = JSON.parse(fs.readFileSync(path.join(output, "template.runtime.json"), "utf8"));
assert.equal(app.window.navigationBarTitleText, "阿成校园餐");
assert.equal(app.window.navigationBarTitleText, "品牌首页");
assert.match(
fs.readFileSync(path.join(output, "pages/index/index.js"), "utf8"),
/setNavigationBarTitle/,
);
assert.equal(runtime.packageKey, "acheng-campus-food");
assert.equal(runtime.entrypoints.home, "pages/index/index");
assert.match(fs.readFileSync(path.join(output, "runtime-config.js"), "utf8"), /default-brand/);
+22 -1
View File
@@ -45,7 +45,14 @@ export type TemplateAdminField = {
binding: string;
label: string;
help?: string;
input: "text" | "textarea" | "phone" | "image" | "number";
input: "text" | "textarea" | "phone" | "image" | "number" | "list";
itemFields?: Array<{
key: string;
label: string;
input?: "text" | "textarea";
required?: boolean;
}>;
itemValueKey?: string;
required?: boolean;
maxLength?: number;
placeholder?: string;
@@ -70,6 +77,7 @@ export type TemplateTrustContentType = {
help?: string;
placeholder?: string;
required?: boolean;
configFields?: TemplateAdminField[];
};
export type TemplateSampleContent = {
@@ -147,6 +155,12 @@ export function validateTemplatePackageManifest(value: unknown): string[] {
errors.push(`trustContentTypes.${index}.type is required`);
if (typeof item.label !== "string" || !item.label.trim())
errors.push(`trustContentTypes.${index}.label is required`);
for (const field of item.configFields ?? []) {
if (!field.key?.trim() || !field.binding?.startsWith("trust.config."))
errors.push(`trustContentTypes.${index}.configFields binding is invalid`);
if (field.input === "list" && !field.itemFields?.length)
errors.push(`trustContentTypes.${index}.configFields list requires itemFields`);
}
}
}
}
@@ -168,6 +182,13 @@ export function validateTemplatePackageManifest(value: unknown): string[] {
for (const field of section.fields ?? []) {
if (!field?.key?.trim() || !field.binding?.trim() || !field.label?.trim())
errors.push("every admin field requires key, binding and label");
if (field.input === "list" && !field.itemFields?.length)
errors.push("list admin fields require itemFields");
if (
field.itemValueKey &&
!field.itemFields?.some((item) => item.key === field.itemValueKey)
)
errors.push("list itemValueKey must match an itemField");
}
}
}
@@ -0,0 +1,128 @@
import assert from "node:assert/strict";
import fs from "node:fs";
import path from "node:path";
import { fileURLToPath } from "node:url";
import test from "node:test";
const packagesRoot = path.resolve(path.dirname(fileURLToPath(import.meta.url)), "../..");
const runtimeRoot = path.resolve(packagesRoot, "../apps/miniapp");
function sourceFile(templateRoot, relativePath, extension) {
const local = path.join(templateRoot, "miniapp", `${relativePath}.${extension}`);
const runtime = path.join(runtimeRoot, `${relativePath}.${extension}`);
return fs.existsSync(local) ? local : fs.existsSync(runtime) ? runtime : null;
}
function renderedFields(templateRoot, entrypoint) {
const seen = new Set();
const fields = new Set();
const heroFields = new Set();
const profileFields = new Set();
const trustFields = new Set();
function visit(relativePath) {
if (seen.has(relativePath)) return;
seen.add(relativePath);
for (const extension of ["wxml", "js"]) {
const source = sourceFile(templateRoot, relativePath, extension);
if (!source) continue;
const content = fs.readFileSync(source, "utf8");
for (const match of content.matchAll(/(?<![.\w])presentation\.([A-Za-z][A-Za-z0-9]*)/g)) {
fields.add(match[1]);
}
for (const match of content.matchAll(/(?<![.\w])hero\.([A-Za-z][A-Za-z0-9]*)/g)) {
heroFields.add(match[1]);
}
for (const match of content.matchAll(/brand\.profilePresentation\.([A-Za-z][A-Za-z0-9]*)/g)) {
profileFields.add(match[1]);
}
for (const match of content.matchAll(/trustContent\.([A-Za-z][A-Za-z0-9]*)/g)) {
trustFields.add(match[1]);
}
}
const componentConfig = sourceFile(templateRoot, relativePath, "json");
if (!componentConfig) return;
const config = JSON.parse(fs.readFileSync(componentConfig, "utf8"));
for (const component of Object.values(config.usingComponents ?? {})) {
if (typeof component === "string" && component.startsWith("/components/")) {
visit(component.slice(1));
}
}
}
visit(entrypoint);
return { fields, heroFields, profileFields, trustFields, seen };
}
const sharedOfferingBindings = [
"offering.config.categoryLabel",
"offering.config.detailHero",
"offering.config.area",
"offering.config.series",
"offering.config.spaceType",
"offering.config.keywords",
"offering.config.details.background",
"offering.config.details.designConcept",
"offering.config.details.crafts",
"offering.config.details.materialsList",
];
for (const directory of fs
.readdirSync(packagesRoot)
.filter((name) => name.startsWith("template-"))) {
const templateRoot = path.join(packagesRoot, directory);
const manifestPath = path.join(templateRoot, "template.json");
if (!fs.existsSync(manifestPath)) continue;
test(`${directory} exposes rendered content through Admin bindings`, () => {
const manifest = JSON.parse(fs.readFileSync(manifestPath, "utf8"));
const bindings = new Set(
manifest.admin.sections.flatMap((section) => section.fields.map((field) => field.binding)),
);
for (const [pageKey, entrypoint] of Object.entries(manifest.entrypoints)) {
const { fields, heroFields, profileFields, trustFields, seen } = renderedFields(
templateRoot,
entrypoint,
);
for (const field of fields) {
assert.ok(
bindings.has(`brand.config.visualPresentation.${pageKey}.${field}`),
`${manifest.packageKey}: ${pageKey}.${field} is rendered but has no Admin field`,
);
}
for (const field of heroFields) {
const binding =
field === "image" ? "brand.config.heroImage" : `brand.config.homeHero.${field}`;
assert.ok(
bindings.has(binding),
`${manifest.packageKey}: ${pageKey} hero.${field} has no Admin field`,
);
}
for (const field of profileFields) {
assert.ok(
bindings.has(`brand.config.profilePresentation.${field}`),
`${manifest.packageKey}: profilePresentation.${field} has no Admin field`,
);
}
for (const field of trustFields) {
if (field === "bio") {
assert.ok(
manifest.trustContentTypes?.some((type) => type.type === "credential"),
`${manifest.packageKey}: biography has no editable trust content type`,
);
continue;
}
assert.ok(
manifest.trustContentTypes?.some((type) =>
type.configFields?.some(
(configField) => configField.binding === `trust.config.${field}`,
),
),
`${manifest.packageKey}: trustContent.${field} has no Admin field`,
);
}
if (seen.has("components/modules/offering-detail/offering-detail")) {
for (const binding of sharedOfferingBindings) {
assert.ok(bindings.has(binding), `${manifest.packageKey}: missing ${binding}`);
}
}
}
});
}
@@ -25,3 +25,37 @@ test("template contract rejects technical or incomplete admin declarations", ()
"every admin field requires key, binding and label",
]);
});
test("template manifests declare editable material content", () => {
const linjing = JSON.parse(
fs.readFileSync(path.join(packageRoot, "template-linjing-editorial/template.json"), "utf8"),
);
const acheng = JSON.parse(
fs.readFileSync(path.join(packageRoot, "template-acheng-campus-food/template.json"), "utf8"),
);
const bindings = (manifest) =>
new Set(
manifest.admin.sections.flatMap((section) => section.fields.map((field) => field.binding)),
);
for (const binding of [
"brand.config.homeHero.title",
"brand.config.profilePresentation.coverage",
"brand.config.profilePresentation.warranty",
"offering.config.area",
"offering.config.details.designConcept",
"brand.config.visualPresentation.offerings.closingText",
])
assert.ok(bindings(linjing).has(binding), binding);
for (const binding of [
"brand.config.visualPresentation.profile.coverageContent",
"brand.config.visualPresentation.offerings.menuTip",
"brand.config.visualPresentation.inquiry.promise",
])
assert.ok(bindings(acheng).has(binding), binding);
assert.deepEqual(
linjing.trustContentTypes
.find((item) => item.type === "credential")
.configFields.map((field) => field.key),
["stats", "pillars", "serviceFlow"],
);
});
@@ -1 +1 @@
<view class="page linjing-works"><view class="works-intro"><text class="eyebrow">{{presentation.worksEyebrow || 'SELECTED WORKS'}}</text><text class="title">{{presentation.worksTitle || '案例与体系'}}</text><text class="subtitle">{{presentation.subtitle || '从建筑入口到室内秩序,呈现每一扇门的完整构造。'}}</text></view><view class="category-line"><text wx:for="{{categories}}" wx:key="*this" class="category-tab {{activeCategory === item ? 'active' : ''}}" data-category="{{item}}" bindtap="chooseCategory">{{item}}</text></view><view wx:if="{{!visibleOfferings.length}}" class="empty">暂无该类别案例</view><view class="works-list"><view wx:for="{{visibleOfferings}}" wx:key="id" class="work" data-id="{{item.id}}" bindtap="open"><image src="{{item.image || item.coverUrl}}" mode="aspectFill"/><view class="work-copy"><text class="category">{{item.category || item.presentation.categoryLabel}}</text><text class="name">{{item.name}}</text><text class="series">{{item.series || item.summary}}</text><view class="meta"><text>{{item.area || 'PRIVATE RESIDENCE'}}</text><text>查看项目 →</text></view></view></view></view><view class="closing"><text>每一套门系统,都是建筑秩序的一部分。</text><text class="more" bindtap="more">预约一次私宅门系统沟通 →</text></view></view>
<view class="page linjing-works"><view class="works-intro"><text class="eyebrow">{{presentation.worksEyebrow || 'SELECTED WORKS'}}</text><text class="title">{{presentation.worksTitle || '案例与体系'}}</text><text class="subtitle">{{presentation.subtitle}}</text></view><view class="category-line"><text wx:for="{{categories}}" wx:key="*this" class="category-tab {{activeCategory === item ? 'active' : ''}}" data-category="{{item}}" bindtap="chooseCategory">{{item}}</text></view><view wx:if="{{!visibleOfferings.length}}" class="empty">暂无该类别案例</view><view class="works-list"><view wx:for="{{visibleOfferings}}" wx:key="id" class="work" data-id="{{item.id}}" bindtap="open"><image src="{{item.image || item.coverUrl}}" mode="aspectFill"/><view class="work-copy"><text class="category">{{item.category || item.presentation.categoryLabel}}</text><text class="name">{{item.name}}</text><text class="series">{{item.series || item.summary}}</text><view class="meta"><text wx:if="{{item.area}}">{{item.area}}</text><text>查看项目 →</text></view></view></view></view><view wx:if="{{presentation.closingText || presentation.closingAction}}" class="closing"><text>{{presentation.closingText}}</text><text wx:if="{{presentation.closingAction}}" class="more" bindtap="more">{{presentation.closingAction}} →</text></view></view>
@@ -17,7 +17,13 @@ Page({
brand.homeHero && typeof brand.homeHero === "object" ? brand.homeHero : {};
this.setData({
brand,
trustContent: workspace.trustPresentation || {},
trustContent: {
...(workspace.trustPresentation || {}),
bio:
workspace.trustPresentation?.bio ||
(workspace.trustItems || []).find((item) => item.type === "credential")?.content ||
"",
},
offerings,
hero: {
...this.data.hero,
@@ -26,6 +32,7 @@ Page({
title: (offerings[0] && offerings[0].name) || brand.name,
slogan: brand.description || "",
...configuredHero,
image: brand.heroImage || "",
},
});
wx.setNavigationBarTitle({ title: brand.name || "个人品牌" });
@@ -199,17 +199,163 @@
"label": "信任介绍标题",
"input": "text"
},
{
"key": "proofEyebrow",
"binding": "brand.config.visualPresentation.home.proofEyebrow",
"label": "信任介绍小标题",
"input": "text"
},
{
"key": "manifestoEyebrow",
"binding": "brand.config.visualPresentation.home.manifestoEyebrow",
"label": "品牌主张小标题",
"input": "text"
},
{
"key": "manifestoTitle",
"binding": "brand.config.visualPresentation.home.manifestoTitle",
"label": "品牌主张",
"input": "text"
},
{
"key": "worksEyebrow",
"binding": "brand.config.visualPresentation.home.worksEyebrow",
"label": "代表案例小标题",
"input": "text"
},
{
"key": "worksTitle",
"binding": "brand.config.visualPresentation.home.worksTitle",
"label": "代表案例标题",
"input": "text"
},
{
"key": "worksAction",
"binding": "brand.config.visualPresentation.home.worksAction",
"label": "查看案例入口",
"input": "text"
},
{
"key": "flowEyebrow",
"binding": "brand.config.visualPresentation.home.flowEyebrow",
"label": "合作流程小标题",
"input": "text"
},
{
"key": "flowTitle",
"binding": "brand.config.visualPresentation.home.flowTitle",
"label": "项目流程标题",
"input": "text"
},
{
"key": "heroTitle",
"binding": "brand.config.homeHero.title",
"label": "首页主标题",
"input": "text"
},
{
"key": "heroEyebrow",
"binding": "brand.config.homeHero.eyebrow",
"label": "主图项目标注",
"input": "text"
},
{
"key": "heroDescription",
"binding": "brand.config.homeHero.slogan",
"label": "首页主图说明",
"input": "textarea"
},
{
"key": "heroAction",
"binding": "brand.config.homeHero.cta",
"label": "主图行动文字",
"input": "text"
}
]
},
{
"key": "profileDetails",
"title": "服务区域与履约说明",
"description": "在主理人与我页面说明可服务的地区和真实履约承诺。",
"target": "brand",
"fields": [
{
"key": "coverage",
"binding": "brand.config.profilePresentation.coverage",
"label": "服务区域",
"input": "list",
"itemFields": [
{ "key": "title", "label": "区域名称" },
{ "key": "content", "label": "服务说明", "input": "textarea" }
]
},
{
"key": "warranty",
"binding": "brand.config.profilePresentation.warranty",
"label": "履约与维护说明",
"input": "list",
"itemValueKey": "value",
"itemFields": [{ "key": "value", "label": "承诺内容", "input": "textarea" }]
},
{
"key": "recordsTitle",
"binding": "brand.config.visualPresentation.profile.recordsTitle",
"label": "咨询记录入口标题",
"input": "text"
},
{
"key": "recordsSubtitle",
"binding": "brand.config.visualPresentation.profile.recordsSubtitle",
"label": "咨询记录入口说明",
"input": "textarea"
},
{
"key": "coverageTitle",
"binding": "brand.config.visualPresentation.profile.coverageTitle",
"label": "服务区域标题",
"input": "text"
},
{
"key": "warrantyTitle",
"binding": "brand.config.visualPresentation.profile.warrantyTitle",
"label": "履约说明标题",
"input": "text"
},
{
"key": "phoneLabel",
"binding": "brand.config.visualPresentation.profile.phoneLabel",
"label": "电话标签",
"input": "text"
},
{
"key": "wechatLabel",
"binding": "brand.config.visualPresentation.profile.wechatLabel",
"label": "微信标签",
"input": "text"
},
{
"key": "addressLabel",
"binding": "brand.config.visualPresentation.profile.addressLabel",
"label": "地址标签",
"input": "text"
},
{
"key": "callAction",
"binding": "brand.config.visualPresentation.profile.callAction",
"label": "拨打电话按钮",
"input": "text"
},
{
"key": "copyAction",
"binding": "brand.config.visualPresentation.profile.copyAction",
"label": "复制微信按钮",
"input": "text"
},
{
"key": "recordsCountUnit",
"binding": "brand.config.visualPresentation.profile.recordsCountUnit",
"label": "记录数量单位",
"input": "text"
}
]
},
@@ -237,6 +383,18 @@
"label": "案例页说明",
"input": "textarea",
"maxLength": 140
},
{
"key": "closingText",
"binding": "brand.config.visualPresentation.offerings.closingText",
"label": "案例页结语",
"input": "textarea"
},
{
"key": "closingAction",
"binding": "brand.config.visualPresentation.offerings.closingAction",
"label": "案例页咨询入口",
"input": "text"
}
]
},
@@ -264,6 +422,228 @@
"binding": "brand.config.visualPresentation.inquiry.submitLabel",
"label": "提交按钮文字",
"input": "text"
},
{
"key": "eyebrow",
"binding": "brand.config.visualPresentation.inquiry.eyebrow",
"label": "咨询页小标题",
"input": "text"
},
{
"key": "note",
"binding": "brand.config.visualPresentation.inquiry.note",
"label": "咨询前提示",
"input": "textarea"
}
]
},
{
"key": "projectDetail",
"title": "案例详情",
"description": "以下内容分别填写在每个案例中,空白内容不会展示。",
"target": "offering",
"fields": [
{
"key": "categoryLabel",
"binding": "offering.config.categoryLabel",
"label": "案例类别",
"input": "text"
},
{
"key": "detailHero",
"binding": "offering.config.detailHero",
"label": "详情主图",
"input": "image"
},
{
"key": "area",
"binding": "offering.config.area",
"label": "项目地点",
"input": "text"
},
{
"key": "series",
"binding": "offering.config.series",
"label": "产品系列",
"input": "text"
},
{
"key": "spaceType",
"binding": "offering.config.spaceType",
"label": "适用空间",
"input": "text"
},
{
"key": "background",
"binding": "offering.config.details.background",
"label": "项目背景",
"input": "textarea"
},
{
"key": "designConcept",
"binding": "offering.config.details.designConcept",
"label": "设计理念",
"input": "textarea"
},
{
"key": "keywords",
"binding": "offering.config.keywords",
"label": "项目关键词",
"input": "list",
"itemValueKey": "value",
"itemFields": [{ "key": "value", "label": "关键词" }]
},
{
"key": "crafts",
"binding": "offering.config.details.crafts",
"label": "工艺要点",
"input": "list",
"itemValueKey": "value",
"itemFields": [{ "key": "value", "label": "工艺说明" }]
},
{
"key": "materialsList",
"binding": "offering.config.details.materialsList",
"label": "材料说明",
"input": "list",
"itemFields": [
{ "key": "name", "label": "材料名称" },
{ "key": "spec", "label": "规格说明" }
]
}
]
},
{
"key": "detailCopy",
"title": "详情页说明",
"description": "说明案例内容、价格与咨询后的真实处理方式。",
"target": "brand",
"fields": [
{
"key": "priceLabel",
"binding": "brand.config.visualPresentation.detail.priceLabel",
"label": "价格说明标题",
"input": "text"
},
{
"key": "spaceLabel",
"binding": "brand.config.visualPresentation.detail.spaceLabel",
"label": "适用空间标题",
"input": "text"
},
{
"key": "backgroundTitle",
"binding": "brand.config.visualPresentation.detail.backgroundTitle",
"label": "项目背景标题",
"input": "text"
},
{
"key": "conceptTitle",
"binding": "brand.config.visualPresentation.detail.conceptTitle",
"label": "设计理念标题",
"input": "text"
},
{
"key": "craftsTitle",
"binding": "brand.config.visualPresentation.detail.craftsTitle",
"label": "工艺要点标题",
"input": "text"
},
{
"key": "materialsTitle",
"binding": "brand.config.visualPresentation.detail.materialsTitle",
"label": "材料说明标题",
"input": "text"
},
{
"key": "inquiryAction",
"binding": "brand.config.visualPresentation.detail.inquiryAction",
"label": "咨询按钮文字",
"input": "text"
},
{
"key": "inquiryHint",
"binding": "brand.config.visualPresentation.detail.inquiryHint",
"label": "咨询后的处理说明",
"help": "只填写能兑现的服务安排。",
"input": "textarea"
}
]
},
{
"key": "successCopy",
"title": "提交成功页",
"description": "访客提交后看到的确认信息与后续预期。",
"target": "brand",
"fields": [
{
"key": "eyebrow",
"binding": "brand.config.visualPresentation.success.eyebrow",
"label": "页面小标题",
"input": "text"
},
{
"key": "title",
"binding": "brand.config.visualPresentation.success.title",
"label": "确认标题",
"input": "text"
},
{
"key": "intro",
"binding": "brand.config.visualPresentation.success.intro",
"label": "后续联系说明",
"help": "回复时间必须与实际承诺一致。",
"input": "textarea"
},
{
"key": "recordsAction",
"binding": "brand.config.visualPresentation.success.recordsAction",
"label": "查看记录按钮",
"input": "text"
},
{
"key": "homeAction",
"binding": "brand.config.visualPresentation.success.homeAction",
"label": "返回首页按钮",
"input": "text"
}
]
},
{
"key": "recordsCopy",
"title": "咨询记录页",
"description": "访客查看咨询状态时看到的内容。",
"target": "brand",
"fields": [
{
"key": "title",
"binding": "brand.config.visualPresentation.records.title",
"label": "记录页标题",
"input": "text"
},
{
"key": "createAction",
"binding": "brand.config.visualPresentation.records.createAction",
"label": "新增咨询按钮",
"input": "text"
},
{
"key": "emptyTitle",
"binding": "brand.config.visualPresentation.records.emptyTitle",
"label": "暂无记录标题",
"input": "text"
},
{
"key": "emptyDescription",
"binding": "brand.config.visualPresentation.records.emptyDescription",
"label": "暂无记录说明",
"input": "textarea"
},
{
"key": "emptyAction",
"binding": "brand.config.visualPresentation.records.emptyAction",
"label": "空状态按钮",
"input": "text"
}
]
}
@@ -291,6 +671,40 @@
"type": "credential",
"label": "专业资历与方法",
"help": "填写经验、资质、专业标准或工作方法。",
"configFields": [
{
"key": "stats",
"binding": "trust.config.stats",
"label": "信任数据",
"input": "list",
"itemFields": [
{ "key": "value", "label": "数字或成果" },
{ "key": "label", "label": "说明" },
{ "key": "sub", "label": "补充说明", "required": false }
]
},
{
"key": "pillars",
"binding": "trust.config.pillars",
"label": "专业方法",
"input": "list",
"itemFields": [
{ "key": "title", "label": "方法名称" },
{ "key": "desc", "label": "方法说明" }
]
},
{
"key": "serviceFlow",
"binding": "trust.config.serviceFlow",
"label": "合作流程",
"input": "list",
"itemFields": [
{ "key": "step", "label": "步骤编号" },
{ "key": "name", "label": "步骤名称" },
{ "key": "desc", "label": "步骤说明" }
]
}
],
"required": true
},
{ "type": "case", "label": "项目案例与客户反馈", "help": "填写代表性项目、成果或客户评价。" },