feat: 新增独立工坊宣传模板及配置导入验证
No files matched your search
@@ -2748,6 +2748,281 @@
|
||||
"packages/template-linjing-editorial/template.json",
|
||||
"apps/api/test/http.integration.test.js"
|
||||
]
|
||||
},
|
||||
{
|
||||
"template": "atelier-solopreneur",
|
||||
"code": "CONDITIONAL_RENDER_REVIEW",
|
||||
"severity": "review",
|
||||
"file": "packages/template-atelier-solopreneur/taro/index.tsx",
|
||||
"line": 16,
|
||||
"message": "条件显示需验证全部分支与空数据入口。",
|
||||
"reviewStatus": "source-reviewed",
|
||||
"decision": "咨询按钮状态来自共享 inquiryPluginState;启用可进入真实表单,禁用显示能力配置提示且禁止点击。源码已检查,禁用能力的完整浏览器分支未做,不等同全交互完成。",
|
||||
"evidence": [
|
||||
"packages/template-atelier-solopreneur/template.json",
|
||||
"packages/template-atelier-solopreneur/taro/index.tsx",
|
||||
"apps/api/test/http.integration.test.js",
|
||||
"docs/atelier-template-acceptance.md"
|
||||
]
|
||||
},
|
||||
{
|
||||
"template": "atelier-solopreneur",
|
||||
"code": "UNRESOLVED_RENDER_VALUE",
|
||||
"severity": "review",
|
||||
"file": "packages/template-atelier-solopreneur/taro/index.tsx",
|
||||
"target": "atelier.home.features",
|
||||
"page": "home",
|
||||
"expression": "String(index + 1).padStart",
|
||||
"line": 49,
|
||||
"message": "需要核对循环项或间接映射,不能视为已覆盖。",
|
||||
"reviewStatus": "source-reviewed",
|
||||
"decision": "序号由列表索引加一生成,仅为只读排列编号;列表展示业务字段均由对应 list 的 itemFields 声明,增删后重新编号。",
|
||||
"evidence": [
|
||||
"packages/template-atelier-solopreneur/template.json",
|
||||
"packages/template-atelier-solopreneur/taro/index.tsx",
|
||||
"apps/api/test/http.integration.test.js",
|
||||
"docs/atelier-template-acceptance.md"
|
||||
]
|
||||
},
|
||||
{
|
||||
"template": "atelier-solopreneur",
|
||||
"code": "CONDITIONAL_RENDER_REVIEW",
|
||||
"severity": "review",
|
||||
"file": "packages/template-atelier-solopreneur/taro/index.tsx",
|
||||
"target": "atelier.home.case",
|
||||
"line": 73,
|
||||
"message": "条件显示需验证全部分支与空数据入口。",
|
||||
"reviewStatus": "source-reviewed",
|
||||
"decision": "案例封面存在时渲染真实图片,否则使用无外链装饰占位或省略详情图片;封面字段仍可编辑,案例名称和摘要始终显示。",
|
||||
"evidence": [
|
||||
"packages/template-atelier-solopreneur/template.json",
|
||||
"packages/template-atelier-solopreneur/taro/index.tsx",
|
||||
"apps/api/test/http.integration.test.js",
|
||||
"docs/atelier-template-acceptance.md"
|
||||
]
|
||||
},
|
||||
{
|
||||
"template": "atelier-solopreneur",
|
||||
"code": "UNRESOLVED_RENDER_VALUE",
|
||||
"severity": "review",
|
||||
"file": "packages/template-atelier-solopreneur/taro/index.tsx",
|
||||
"target": "atelier.offerings.deliverables",
|
||||
"page": "offerings",
|
||||
"expression": "String(index + 1).padStart",
|
||||
"line": 128,
|
||||
"message": "需要核对循环项或间接映射,不能视为已覆盖。",
|
||||
"reviewStatus": "source-reviewed",
|
||||
"decision": "序号由列表索引加一生成,仅为只读排列编号;列表展示业务字段均由对应 list 的 itemFields 声明,增删后重新编号。",
|
||||
"evidence": [
|
||||
"packages/template-atelier-solopreneur/template.json",
|
||||
"packages/template-atelier-solopreneur/taro/index.tsx",
|
||||
"apps/api/test/http.integration.test.js",
|
||||
"docs/atelier-template-acceptance.md"
|
||||
]
|
||||
},
|
||||
{
|
||||
"template": "atelier-solopreneur",
|
||||
"code": "DYNAMIC_TARGET_REVIEW",
|
||||
"severity": "review",
|
||||
"file": "packages/template-atelier-solopreneur/taro/index.tsx",
|
||||
"line": 170,
|
||||
"message": "动态目标需用真实 manifest 和实际记录验证分支。",
|
||||
"reviewStatus": "source-reviewed",
|
||||
"decision": "服务页信任项采用 trust:${item.type} 与真实 item.id;manifest 只声明 offerings 页 credential,标题/摘要/正文由 TrustContent 编辑。未创建记录时由后台信任内容入口配置。",
|
||||
"evidence": [
|
||||
"packages/template-atelier-solopreneur/template.json",
|
||||
"packages/template-atelier-solopreneur/taro/index.tsx",
|
||||
"apps/api/test/http.integration.test.js",
|
||||
"docs/atelier-template-acceptance.md"
|
||||
]
|
||||
},
|
||||
{
|
||||
"template": "atelier-solopreneur",
|
||||
"code": "UNSCOPED_RENDER_VALUE",
|
||||
"severity": "review",
|
||||
"file": "packages/template-atelier-solopreneur/taro/index.tsx",
|
||||
"binding": "trust.title",
|
||||
"line": 176,
|
||||
"message": "展示变量没有可证明的编辑区域。",
|
||||
"reviewStatus": "source-reviewed",
|
||||
"decision": "该字段属于服务页动态 trust:${item.type},保留 data-editor-record-id;对应 credential 声明提供 title/summary/content 全部标准字段。动态目标静态分析不能证明作用域,源码逐项核对。",
|
||||
"evidence": [
|
||||
"packages/template-atelier-solopreneur/template.json",
|
||||
"packages/template-atelier-solopreneur/taro/index.tsx",
|
||||
"apps/api/test/http.integration.test.js",
|
||||
"docs/atelier-template-acceptance.md"
|
||||
]
|
||||
},
|
||||
{
|
||||
"template": "atelier-solopreneur",
|
||||
"code": "UNSCOPED_RENDER_VALUE",
|
||||
"severity": "review",
|
||||
"file": "packages/template-atelier-solopreneur/taro/index.tsx",
|
||||
"binding": "trust.summary",
|
||||
"line": 177,
|
||||
"message": "展示变量没有可证明的编辑区域。",
|
||||
"reviewStatus": "source-reviewed",
|
||||
"decision": "该字段属于服务页动态 trust:${item.type},保留 data-editor-record-id;对应 credential 声明提供 title/summary/content 全部标准字段。动态目标静态分析不能证明作用域,源码逐项核对。",
|
||||
"evidence": [
|
||||
"packages/template-atelier-solopreneur/template.json",
|
||||
"packages/template-atelier-solopreneur/taro/index.tsx",
|
||||
"apps/api/test/http.integration.test.js",
|
||||
"docs/atelier-template-acceptance.md"
|
||||
]
|
||||
},
|
||||
{
|
||||
"template": "atelier-solopreneur",
|
||||
"code": "UNSCOPED_RENDER_VALUE",
|
||||
"severity": "review",
|
||||
"file": "packages/template-atelier-solopreneur/taro/index.tsx",
|
||||
"binding": "trust.content",
|
||||
"line": 178,
|
||||
"message": "展示变量没有可证明的编辑区域。",
|
||||
"reviewStatus": "source-reviewed",
|
||||
"decision": "该字段属于服务页动态 trust:${item.type},保留 data-editor-record-id;对应 credential 声明提供 title/summary/content 全部标准字段。动态目标静态分析不能证明作用域,源码逐项核对。",
|
||||
"evidence": [
|
||||
"packages/template-atelier-solopreneur/template.json",
|
||||
"packages/template-atelier-solopreneur/taro/index.tsx",
|
||||
"apps/api/test/http.integration.test.js",
|
||||
"docs/atelier-template-acceptance.md"
|
||||
]
|
||||
},
|
||||
{
|
||||
"template": "atelier-solopreneur",
|
||||
"code": "CONDITIONAL_RENDER_REVIEW",
|
||||
"severity": "review",
|
||||
"file": "packages/template-atelier-solopreneur/taro/index.tsx",
|
||||
"target": "atelier.profile.identity",
|
||||
"line": 211,
|
||||
"message": "条件显示需验证全部分支与空数据入口。",
|
||||
"reviewStatus": "source-reviewed",
|
||||
"decision": "头像仅在 avatarUrl 非空时展示,空值不渲染 Image;字段仍在 manifest 和侧栏可编辑,其他身份字段不受影响。",
|
||||
"evidence": [
|
||||
"packages/template-atelier-solopreneur/template.json",
|
||||
"packages/template-atelier-solopreneur/taro/index.tsx",
|
||||
"apps/api/test/http.integration.test.js",
|
||||
"docs/atelier-template-acceptance.md"
|
||||
]
|
||||
},
|
||||
{
|
||||
"template": "atelier-solopreneur",
|
||||
"code": "UNRESOLVED_RENDER_VALUE",
|
||||
"severity": "review",
|
||||
"file": "packages/template-atelier-solopreneur/taro/index.tsx",
|
||||
"target": "atelier.profile.faqs",
|
||||
"page": "profile",
|
||||
"expression": "String(index + 1).padStart",
|
||||
"line": 252,
|
||||
"message": "需要核对循环项或间接映射,不能视为已覆盖。",
|
||||
"reviewStatus": "source-reviewed",
|
||||
"decision": "序号由列表索引加一生成,仅为只读排列编号;列表展示业务字段均由对应 list 的 itemFields 声明,增删后重新编号。",
|
||||
"evidence": [
|
||||
"packages/template-atelier-solopreneur/template.json",
|
||||
"packages/template-atelier-solopreneur/taro/index.tsx",
|
||||
"apps/api/test/http.integration.test.js",
|
||||
"docs/atelier-template-acceptance.md"
|
||||
]
|
||||
},
|
||||
{
|
||||
"template": "atelier-solopreneur",
|
||||
"code": "CONDITIONAL_RENDER_REVIEW",
|
||||
"severity": "review",
|
||||
"file": "packages/template-atelier-solopreneur/taro/index.tsx",
|
||||
"target": "atelier.profile.faqs",
|
||||
"line": 254,
|
||||
"message": "条件显示需验证全部分支与空数据入口。",
|
||||
"reviewStatus": "source-reviewed",
|
||||
"decision": "FAQ 展开状态为只读交互状态,业务问题与答案均在 faqs 列表的 title/description 声明;H5 实际点击验证展开。",
|
||||
"evidence": [
|
||||
"packages/template-atelier-solopreneur/template.json",
|
||||
"packages/template-atelier-solopreneur/taro/index.tsx",
|
||||
"apps/api/test/http.integration.test.js",
|
||||
"docs/atelier-template-acceptance.md"
|
||||
]
|
||||
},
|
||||
{
|
||||
"template": "atelier-solopreneur",
|
||||
"code": "CONDITIONAL_RENDER_REVIEW",
|
||||
"severity": "review",
|
||||
"file": "packages/template-atelier-solopreneur/taro/index.tsx",
|
||||
"target": "atelier.profile.faqs",
|
||||
"line": 256,
|
||||
"message": "条件显示需验证全部分支与空数据入口。",
|
||||
"reviewStatus": "source-reviewed",
|
||||
"decision": "FAQ 展开状态为只读交互状态,业务问题与答案均在 faqs 列表的 title/description 声明;H5 实际点击验证展开。",
|
||||
"evidence": [
|
||||
"packages/template-atelier-solopreneur/template.json",
|
||||
"packages/template-atelier-solopreneur/taro/index.tsx",
|
||||
"apps/api/test/http.integration.test.js",
|
||||
"docs/atelier-template-acceptance.md"
|
||||
]
|
||||
},
|
||||
{
|
||||
"template": "atelier-solopreneur",
|
||||
"code": "CONDITIONAL_RENDER_REVIEW",
|
||||
"severity": "review",
|
||||
"file": "packages/template-atelier-solopreneur/taro/index.tsx",
|
||||
"target": "atelier-solopreneur.detail.projectDetail",
|
||||
"line": 285,
|
||||
"message": "条件显示需验证全部分支与空数据入口。",
|
||||
"reviewStatus": "source-reviewed",
|
||||
"decision": "案例封面存在时渲染真实图片,否则使用无外链装饰占位或省略详情图片;封面字段仍可编辑,案例名称和摘要始终显示。",
|
||||
"evidence": [
|
||||
"packages/template-atelier-solopreneur/template.json",
|
||||
"packages/template-atelier-solopreneur/taro/index.tsx",
|
||||
"apps/api/test/http.integration.test.js",
|
||||
"docs/atelier-template-acceptance.md"
|
||||
]
|
||||
},
|
||||
{
|
||||
"template": "atelier-solopreneur",
|
||||
"code": "DYNAMIC_TARGET_REVIEW",
|
||||
"severity": "review",
|
||||
"file": "packages/template-atelier-solopreneur/taro/index.tsx",
|
||||
"line": 392,
|
||||
"message": "动态目标需用真实 manifest 和实际记录验证分支。",
|
||||
"reviewStatus": "source-reviewed",
|
||||
"decision": "formTargets 为固定映射,模板只对 inquiry 注入 chips 和隐私区,其余共享页面保持原 children;没有动态业务 binding。",
|
||||
"evidence": [
|
||||
"packages/template-atelier-solopreneur/template.json",
|
||||
"packages/template-atelier-solopreneur/taro/index.tsx",
|
||||
"apps/api/test/http.integration.test.js",
|
||||
"docs/atelier-template-acceptance.md"
|
||||
]
|
||||
},
|
||||
{
|
||||
"template": "atelier-solopreneur",
|
||||
"code": "TARGET_RENDER_UNVERIFIED",
|
||||
"severity": "review",
|
||||
"file": "packages/template-atelier-solopreneur/taro/index.tsx",
|
||||
"page": "success",
|
||||
"target": "atelier.success.copy",
|
||||
"message": "未找到字面量区域,需验证动态目标或组件路径。",
|
||||
"reviewStatus": "source-reviewed",
|
||||
"decision": "formTargets 将 inquiry/success/records 明确映射到真实 manifest 目标;共享 Inquiry/Success/Records 消费同页 visualPresentation,表单字段另由 inquiry-field 目标编辑。API 真实保存发布通过,H5 表单校验通过;成功页与记录页完整浏览器操作尚待补充。",
|
||||
"evidence": [
|
||||
"packages/template-atelier-solopreneur/template.json",
|
||||
"packages/template-atelier-solopreneur/taro/index.tsx",
|
||||
"apps/api/test/http.integration.test.js",
|
||||
"docs/atelier-template-acceptance.md"
|
||||
]
|
||||
},
|
||||
{
|
||||
"template": "atelier-solopreneur",
|
||||
"code": "TARGET_RENDER_UNVERIFIED",
|
||||
"severity": "review",
|
||||
"file": "packages/template-atelier-solopreneur/taro/index.tsx",
|
||||
"page": "records",
|
||||
"target": "atelier.records.copy",
|
||||
"message": "未找到字面量区域,需验证动态目标或组件路径。",
|
||||
"reviewStatus": "source-reviewed",
|
||||
"decision": "formTargets 将 inquiry/success/records 明确映射到真实 manifest 目标;共享 Inquiry/Success/Records 消费同页 visualPresentation,表单字段另由 inquiry-field 目标编辑。API 真实保存发布通过,H5 表单校验通过;成功页与记录页完整浏览器操作尚待补充。",
|
||||
"evidence": [
|
||||
"packages/template-atelier-solopreneur/template.json",
|
||||
"packages/template-atelier-solopreneur/taro/index.tsx",
|
||||
"apps/api/test/http.integration.test.js",
|
||||
"docs/atelier-template-acceptance.md"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -350,7 +350,7 @@ export function PublicationPage({ canManageTemplate }: { canManageTemplate: bool
|
||||
{Object.entries(sample.data.counts)
|
||||
.map(([key, count]) => `${key} ${count} 项`)
|
||||
.join("、")}
|
||||
;发布前请替换示例文案和图片。
|
||||
;同时补齐当前模板缺失的页面初始配置,保留已有配置和已启用表单。发布前请替换示例文案和图片。
|
||||
</p>
|
||||
)}
|
||||
<MutationError error={importSample.error} />
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { BadRequestException, Injectable } from "@nestjs/common";
|
||||
import { Prisma } from "@prisma/client";
|
||||
import { getTemplateSampleContent } from "@personal-brand/config";
|
||||
import { getTemplateSampleContent, getDefaultVisualTemplateKey } from "@personal-brand/config";
|
||||
import { validateFieldSnapshot } from "@personal-brand/validation";
|
||||
import { PrismaService } from "../../prisma.service.js";
|
||||
import { TemplateWorkspaceService } from "../../template-workspace.service.js";
|
||||
@@ -14,7 +14,20 @@ export class AdminSampleContentService {
|
||||
|
||||
async preview(brandId: string) {
|
||||
const templateKey = await this.templateWorkspace.getEffectiveTemplateKey(brandId);
|
||||
const sample = getTemplateSampleContent(templateKey);
|
||||
const brand = await this.prisma.brandProfile.findUnique({
|
||||
where: { id: brandId },
|
||||
select: { config: true },
|
||||
});
|
||||
const config =
|
||||
brand?.config && typeof brand.config === "object" && !Array.isArray(brand.config)
|
||||
? (brand.config as Record<string, unknown>)
|
||||
: {};
|
||||
const sample = getTemplateSampleContent(
|
||||
templateKey,
|
||||
typeof config.visualTemplateKey === "string"
|
||||
? config.visualTemplateKey
|
||||
: getDefaultVisualTemplateKey(templateKey),
|
||||
);
|
||||
if (!sample) throw new BadRequestException("模板示例内容不存在");
|
||||
const [offerings, trustContent, fields, enabledForms] = await Promise.all([
|
||||
this.prisma.offering.count({ where: { brandId } }),
|
||||
@@ -37,7 +50,20 @@ export class AdminSampleContentService {
|
||||
|
||||
async import(brandId: string, actorId: string) {
|
||||
const templateKey = await this.templateWorkspace.getEffectiveTemplateKey(brandId);
|
||||
const sample = getTemplateSampleContent(templateKey);
|
||||
const brand = await this.prisma.brandProfile.findUnique({
|
||||
where: { id: brandId },
|
||||
select: { config: true },
|
||||
});
|
||||
const config =
|
||||
brand?.config && typeof brand.config === "object" && !Array.isArray(brand.config)
|
||||
? (brand.config as Record<string, unknown>)
|
||||
: {};
|
||||
const sample = getTemplateSampleContent(
|
||||
templateKey,
|
||||
typeof config.visualTemplateKey === "string"
|
||||
? config.visualTemplateKey
|
||||
: getDefaultVisualTemplateKey(templateKey),
|
||||
);
|
||||
if (!sample) throw new BadRequestException("模板示例内容不存在");
|
||||
if (validateFieldSnapshot(sample.fields).length)
|
||||
throw new BadRequestException("模板咨询表单示例字段无效");
|
||||
@@ -49,12 +75,42 @@ export class AdminSampleContentService {
|
||||
});
|
||||
if (existing || existingOffering) throw new BadRequestException("示例内容已经导入");
|
||||
const result = await this.prisma.$transaction(async (tx) => {
|
||||
if (sample.brandConfig) {
|
||||
// 仅显式导入时补齐缺失配置,已有品牌内容(包括空值)始终优先。
|
||||
const merge = (
|
||||
defaults: Record<string, unknown>,
|
||||
saved: Record<string, unknown>,
|
||||
): Record<string, unknown> =>
|
||||
Object.fromEntries(
|
||||
[...new Set([...Object.keys(defaults), ...Object.keys(saved)])].map((key) => {
|
||||
const a = defaults[key];
|
||||
const b = saved[key];
|
||||
if (!Object.prototype.hasOwnProperty.call(saved, key)) return [key, a];
|
||||
return [
|
||||
key,
|
||||
a &&
|
||||
b &&
|
||||
typeof a === "object" &&
|
||||
typeof b === "object" &&
|
||||
!Array.isArray(a) &&
|
||||
!Array.isArray(b)
|
||||
? merge(a as Record<string, unknown>, b as Record<string, unknown>)
|
||||
: b,
|
||||
];
|
||||
}),
|
||||
);
|
||||
await tx.brandProfile.update({
|
||||
where: { id: brandId },
|
||||
data: { config: merge(sample.brandConfig, config) as Prisma.InputJsonValue },
|
||||
});
|
||||
}
|
||||
const offerings = await tx.offering.createMany({
|
||||
data: sample.offerings.map((item, sortOrder) => ({
|
||||
brandId,
|
||||
kind: item.kind,
|
||||
name: item.name,
|
||||
summary: item.summary,
|
||||
...(item.coverUrl ? { coverUrl: item.coverUrl } : {}),
|
||||
config: { categoryKey: item.categoryKey },
|
||||
sortOrder,
|
||||
isEnabled: true,
|
||||
|
||||
@@ -3455,3 +3455,272 @@ test("admin can advance booking status but cannot skip the state machine", async
|
||||
});
|
||||
assert.equal(skipped.statusCode, 400);
|
||||
});
|
||||
|
||||
test("atelier template imports selected package and preserves draft publication isolation", async () => {
|
||||
const slug = "atelier-acceptance-" + randomUUID();
|
||||
const user = await prisma.adminUser.findUniqueOrThrow({ where: { username: "admin" } });
|
||||
const originalOther = await prisma.brandProfile.findUniqueOrThrow({ where: { id: brandId } });
|
||||
const brand = await prisma.brandProfile.create({
|
||||
data: {
|
||||
slug,
|
||||
name: "品牌小程序工坊",
|
||||
templateKey: "personal",
|
||||
tagline: "独立开发者 · 品牌小程序构建",
|
||||
description: "专注个人品牌表达、内容管理与咨询承接。",
|
||||
config: {
|
||||
visualTemplateKey: "atelier-solopreneur",
|
||||
founder: "验收主理人",
|
||||
title: "产品设计 / 全栈开发",
|
||||
visualPresentation: { home: { subtitle: "保留已有品牌说明" } },
|
||||
},
|
||||
},
|
||||
});
|
||||
const headers = {
|
||||
authorization: `Bearer ${signIdentity({ subject: user.id, brandId: brand.id, role: "admin" })}`,
|
||||
};
|
||||
await prisma.brandMembership.create({
|
||||
data: { brandId: brand.id, adminUserId: user.id, role: "owner" },
|
||||
});
|
||||
const json = async (url, options = {}) => {
|
||||
const response = await request(url, options);
|
||||
assert.ok(response.statusCode < 300, response.body);
|
||||
return JSON.parse(response.body);
|
||||
};
|
||||
try {
|
||||
for (const path of ["preview", "import"]) {
|
||||
const method = path === "import" ? "POST" : "GET";
|
||||
const url = "/admin/workspace/sample-content/" + path;
|
||||
assert.equal((await request(url, { method })).statusCode, 401);
|
||||
assert.equal(
|
||||
(await request(url, { method, headers: { authorization: "Bearer invalid" } })).statusCode,
|
||||
401,
|
||||
);
|
||||
assert.equal(
|
||||
(await request(url, { method, headers: { authorization: `Bearer ${customerToken}` } }))
|
||||
.statusCode,
|
||||
403,
|
||||
);
|
||||
}
|
||||
const preview = await json("/admin/workspace/sample-content/preview", { headers });
|
||||
assert.equal(preview.counts.fields, 5);
|
||||
await json("/admin/workspace/sample-content/import", { method: "POST", headers });
|
||||
const imported = await json("/admin/config/brand", { headers });
|
||||
assert.equal(imported.config.visualPresentation.home.subtitle, "保留已有品牌说明");
|
||||
assert.equal(imported.config.atelier.deliverables.length, 7);
|
||||
const form = await prisma.inquiryForm.findFirstOrThrow({ where: { brandId: brand.id } });
|
||||
assert.equal(form.name, "品牌小程序需求意向单");
|
||||
assert.deepEqual(
|
||||
form.fieldsSnapshot.map((field) => field.key),
|
||||
["name", "industry", "needs", "timeline", "contact"],
|
||||
);
|
||||
assert.equal(
|
||||
(await request("/admin/workspace/sample-content/import", { method: "POST", headers }))
|
||||
.statusCode,
|
||||
400,
|
||||
);
|
||||
const manifest = (await json("/admin/workspace", { headers })).templateContent;
|
||||
const exampleOffering = await prisma.offering.findFirstOrThrow({
|
||||
where: { brandId: brand.id },
|
||||
});
|
||||
assert.match(exampleOffering.coverUrl, /^\/assets\/cases\//);
|
||||
const offeringFields = [
|
||||
...new Map(
|
||||
manifest.admin.sections
|
||||
.flatMap((section) => section.fields)
|
||||
.filter((field) => field.binding.startsWith("offering."))
|
||||
.map((field) => [field.binding, field]),
|
||||
).values(),
|
||||
];
|
||||
const offeringPatch = { config: structuredClone(exampleOffering.config) };
|
||||
for (const field of offeringFields) {
|
||||
const token = "atelier-offering-" + field.key;
|
||||
const value =
|
||||
field.input === "list"
|
||||
? [
|
||||
field.itemValueKey
|
||||
? token
|
||||
: Object.fromEntries(
|
||||
field.itemFields.map((child) => [child.key, token + "-" + child.key]),
|
||||
),
|
||||
]
|
||||
: field.input === "image"
|
||||
? "https://example.com/atelier-case.jpg"
|
||||
: field.input === "select"
|
||||
? field.options[0].value
|
||||
: token;
|
||||
const path = field.binding.split(".").slice(1);
|
||||
const last = path.pop();
|
||||
const parent = path.reduce((current, key) => (current[key] ??= {}), offeringPatch);
|
||||
parent[last] = value;
|
||||
}
|
||||
await json("/admin/workspace/offerings/" + exampleOffering.id, {
|
||||
method: "PATCH",
|
||||
headers,
|
||||
payload: offeringPatch,
|
||||
});
|
||||
const storedOffering = await prisma.offering.findUniqueOrThrow({
|
||||
where: { id: exampleOffering.id },
|
||||
});
|
||||
const draftOffering = (await json("/admin/workspace/preview", { headers })).offerings.find(
|
||||
(item) => item.id === exampleOffering.id,
|
||||
);
|
||||
const { runtimeContractForBinding } = await import("@personal-brand/types");
|
||||
for (const field of offeringFields) {
|
||||
const path = field.binding.split(".").slice(1);
|
||||
const read = (value, path) => path.reduce((current, key) => current?.[key], value);
|
||||
assert.deepEqual(
|
||||
read(storedOffering, path),
|
||||
read(offeringPatch, path),
|
||||
field.binding + " offering persistence",
|
||||
);
|
||||
const runtimePath =
|
||||
field.binding === "offering.config.detailHero"
|
||||
? ["presentation", "heroImage"]
|
||||
: runtimeContractForBinding(field.binding)
|
||||
.runtimePath.replace("workspace.offerings[].", "")
|
||||
.split(".");
|
||||
assert.deepEqual(
|
||||
read(draftOffering, runtimePath),
|
||||
read(offeringPatch, path),
|
||||
field.binding + " offering projection",
|
||||
);
|
||||
}
|
||||
await prisma.offering.update({
|
||||
where: { id: exampleOffering.id },
|
||||
data: {
|
||||
name: exampleOffering.name,
|
||||
summary: exampleOffering.summary,
|
||||
coverUrl: exampleOffering.coverUrl,
|
||||
priceText: exampleOffering.priceText,
|
||||
config: exampleOffering.config,
|
||||
},
|
||||
});
|
||||
const defaults = structuredClone(imported.config);
|
||||
const patch = { config: structuredClone(defaults) };
|
||||
delete patch.config.visualTemplateKey;
|
||||
const read = (value, path) => path.reduce((current, key) => current?.[key], value);
|
||||
const write = (value, path, replacement) => {
|
||||
const last = path.pop();
|
||||
const parent = path.reduce((current, key) => (current[key] ??= {}), value);
|
||||
parent[last] = replacement;
|
||||
};
|
||||
const fields = [
|
||||
...new Map(
|
||||
manifest.admin.sections
|
||||
.flatMap((section) => section.fields)
|
||||
.filter((field) => field.binding.startsWith("brand."))
|
||||
.map((field) => [field.binding, field]),
|
||||
).values(),
|
||||
];
|
||||
for (const field of fields) {
|
||||
const token = "验收-" + field.key;
|
||||
const value =
|
||||
field.input === "list"
|
||||
? [
|
||||
Object.fromEntries(
|
||||
field.itemFields.map((child) => [child.key, token + "-" + child.key]),
|
||||
),
|
||||
]
|
||||
: field.input === "image"
|
||||
? "https://example.com/atelier-avatar.jpg"
|
||||
: token;
|
||||
write(patch, field.binding.split(".").slice(1), value);
|
||||
}
|
||||
await json("/admin/config/brand", { method: "PATCH", headers, payload: patch });
|
||||
const saved = await json("/admin/config/brand", { headers });
|
||||
const draft = await json("/admin/workspace/preview", { headers });
|
||||
for (const field of fields) {
|
||||
const path = field.binding.split(".").slice(1);
|
||||
assert.deepEqual(read(saved, path), read(patch, path), field.binding + " persistence");
|
||||
assert.deepEqual(
|
||||
read(draft.brand, path[0] === "config" ? path.slice(1) : path),
|
||||
read(patch, path),
|
||||
field.binding + " preview",
|
||||
);
|
||||
}
|
||||
assert.equal((await json("/public/workspace?brandSlug=" + slug)).brand, null);
|
||||
// 恢复设计基线用于视觉回归,再验证发布后的草稿隔离。
|
||||
await json("/admin/config/brand", {
|
||||
method: "PATCH",
|
||||
headers,
|
||||
payload: { config: defaults, avatarUrl: null, contactWechat: null },
|
||||
});
|
||||
await prisma.trustContent.updateMany({
|
||||
where: { brandId: brand.id },
|
||||
data: { isPublished: true },
|
||||
});
|
||||
await json("/admin/releases/publish", {
|
||||
method: "POST",
|
||||
headers,
|
||||
payload: { note: "宣传模板独立品牌验收" },
|
||||
});
|
||||
const published = await json("/public/workspace?brandSlug=" + slug);
|
||||
assert.equal(published.brand.visualPresentation.home.subtitle, "保留已有品牌说明");
|
||||
const next = structuredClone(defaults);
|
||||
next.visualPresentation.home.title = "仅草稿可见的新标题";
|
||||
await json("/admin/config/brand", { method: "PATCH", headers, payload: { config: next } });
|
||||
assert.equal(
|
||||
(await json("/admin/workspace/preview", { headers })).brand.visualPresentation.home.title,
|
||||
"仅草稿可见的新标题",
|
||||
);
|
||||
assert.equal(
|
||||
(await json("/public/workspace?brandSlug=" + slug)).brand.visualPresentation.home.title,
|
||||
defaults.visualPresentation.home.title,
|
||||
);
|
||||
await json("/admin/releases/publish", {
|
||||
method: "POST",
|
||||
headers,
|
||||
payload: { note: "发布新标题" },
|
||||
});
|
||||
assert.equal(
|
||||
(await json("/public/workspace?brandSlug=" + slug)).brand.visualPresentation.home.title,
|
||||
"仅草稿可见的新标题",
|
||||
);
|
||||
const customerHeaders = {
|
||||
authorization: `Bearer ${signIdentity({ subject: "atelier-test-customer", brandId: brand.id, role: "customer" })}`,
|
||||
};
|
||||
assert.equal(
|
||||
(
|
||||
await request("/customer/inquiry-submissions", {
|
||||
method: "POST",
|
||||
headers: customerHeaders,
|
||||
payload: { formId: form.id, values: {} },
|
||||
})
|
||||
).statusCode,
|
||||
400,
|
||||
);
|
||||
const submitted = await json("/customer/inquiry-submissions", {
|
||||
method: "POST",
|
||||
headers: customerHeaders,
|
||||
payload: {
|
||||
formId: form.id,
|
||||
values: {
|
||||
name: "验收品牌",
|
||||
industry: "独立设计 / 建筑",
|
||||
needs: "展示作品与承接合作",
|
||||
timeline: "先期评估",
|
||||
contact: "acceptance_wechat",
|
||||
},
|
||||
},
|
||||
});
|
||||
assert.ok(submitted.id);
|
||||
assert.equal(
|
||||
(await prisma.inquirySubmission.findUniqueOrThrow({ where: { id: submitted.id } })).brandId,
|
||||
brand.id,
|
||||
);
|
||||
assert.deepEqual(
|
||||
(await prisma.brandProfile.findUniqueOrThrow({ where: { id: brandId } })).config,
|
||||
originalOther.config,
|
||||
);
|
||||
if (process.env.ATELIER_ACCEPTANCE_OUTPUT) {
|
||||
const { mkdir, writeFile } = await import("node:fs/promises");
|
||||
await mkdir(process.env.ATELIER_ACCEPTANCE_OUTPUT, { recursive: true });
|
||||
await writeFile(
|
||||
process.env.ATELIER_ACCEPTANCE_OUTPUT + "/published-runtime.json",
|
||||
JSON.stringify(published, null, 2),
|
||||
);
|
||||
}
|
||||
} finally {
|
||||
await prisma.brandProfile.delete({ where: { id: brand.id } });
|
||||
}
|
||||
});
|
||||
@@ -17,13 +17,16 @@ const templates = fs
|
||||
const key = process.env.TEMPLATE_KEY || templates[0];
|
||||
if (!key) throw new Error("No Taro template package found");
|
||||
if (!templates.includes(key)) throw new Error(`Unsupported Taro template: ${key}`);
|
||||
process.env.TARO_APP_ID ||= process.env.WEAPP_APP_ID;
|
||||
process.env.TARO_APP_ID ||= process.env.WEAPP_APP_ID || "touristappid";
|
||||
const template = path.join(root, "packages", `template-${key}`);
|
||||
const manifest = JSON.parse(fs.readFileSync(path.join(template, "template.json"), "utf8")) as {
|
||||
packageKey: string;
|
||||
defaultBrandSlug?: string;
|
||||
};
|
||||
if (manifest.packageKey !== key) throw new Error(`Template key mismatch: ${key}`);
|
||||
const templateApp = JSON.parse(
|
||||
fs.readFileSync(path.join(template, "miniapp/app.json"), "utf8"),
|
||||
) as { tabBar?: { color?: string; selectedColor?: string; backgroundColor?: string } };
|
||||
const brand = process.env.BRAND_SLUG || manifest.defaultBrandSlug || "default-brand";
|
||||
fs.cpSync(path.join(template, "miniapp/assets"), path.resolve(__dirname, "../src/assets"), {
|
||||
recursive: true,
|
||||
@@ -46,6 +49,7 @@ export default defineConfig({
|
||||
: path.join(template, "taro"),
|
||||
},
|
||||
defineConstants: {
|
||||
TEMPLATE_TAB_STYLE: JSON.stringify(templateApp.tabBar || {}),
|
||||
TEMPLATE_KEY: JSON.stringify(key),
|
||||
BRAND_SLUG: JSON.stringify(brand),
|
||||
API_BASE_URL: JSON.stringify(process.env.API_BASE_URL || "http://localhost:3001"),
|
||||
|
||||
@@ -24,9 +24,9 @@ export default defineAppConfig({
|
||||
...(!PREVIEW_ALL_TEMPLATES
|
||||
? {
|
||||
tabBar: {
|
||||
color: "#8b8178",
|
||||
selectedColor: "#3b2118",
|
||||
backgroundColor: "#ffffff",
|
||||
color: TEMPLATE_TAB_STYLE.color || "#8b8178",
|
||||
selectedColor: TEMPLATE_TAB_STYLE.selectedColor || "#3b2118",
|
||||
backgroundColor: TEMPLATE_TAB_STYLE.backgroundColor || "#ffffff",
|
||||
list: TEMPLATE_MANIFEST.navigation.map((tab) => ({
|
||||
pagePath: routes[tab.page],
|
||||
text: tab.label,
|
||||
|
||||
@@ -21,9 +21,13 @@ import "./forms.css";
|
||||
export function Inquiry({
|
||||
workspace,
|
||||
preview = false,
|
||||
choiceStyle = "picker",
|
||||
beforeSubmit,
|
||||
}: {
|
||||
workspace: RuntimeWorkspace;
|
||||
preview?: boolean;
|
||||
choiceStyle?: "chips" | "picker";
|
||||
beforeSubmit?: React.ReactNode;
|
||||
}) {
|
||||
const router = useRouter();
|
||||
const [offeringId, setOfferingId] = useState(router.params.offeringId || "");
|
||||
@@ -107,7 +111,8 @@ export function Inquiry({
|
||||
const value = values[field.key];
|
||||
const stringValue = typeof value === "string" ? value : "";
|
||||
const chips =
|
||||
compactForm && field.key === "type" && ["select", "radio"].includes(field.type);
|
||||
(choiceStyle === "chips" || (compactForm && field.key === "type")) &&
|
||||
["select", "radio"].includes(field.type);
|
||||
return (
|
||||
<View
|
||||
className={`form-field ${compactForm && compactFieldKeys.has(field.key) ? "half-field" : ""}`}
|
||||
@@ -200,6 +205,7 @@ export function Inquiry({
|
||||
);
|
||||
})}
|
||||
</View>
|
||||
{beforeSubmit}
|
||||
{error && (
|
||||
<View className="form-error" role="alert">
|
||||
{error}
|
||||
|
||||
@@ -1,3 +1,8 @@
|
||||
declare const TEMPLATE_TAB_STYLE: {
|
||||
color?: string;
|
||||
selectedColor?: string;
|
||||
backgroundColor?: string;
|
||||
};
|
||||
declare const TEMPLATE_KEY: string;
|
||||
declare const BRAND_SLUG: string;
|
||||
declare const API_BASE_URL: string;
|
||||
|
||||
@@ -10,6 +10,11 @@
|
||||
"packageKey": "linjing-editorial",
|
||||
"packageName": "@personal-brand/template-linjing-editorial",
|
||||
"version": "1.0.0"
|
||||
},
|
||||
{
|
||||
"packageKey": "atelier-solopreneur",
|
||||
"packageName": "@personal-brand/template-atelier-solopreneur",
|
||||
"version": "1.0.0"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
# 0028 按当前视觉模板显式导入示例
|
||||
|
||||
## Context
|
||||
|
||||
个人品牌行业现有林境画册与独立工坊两套视觉模板。仅按行业选择第一个示例包,会让独立工坊导入错误表单。宣传模板还需要可编辑的页面初始内容。
|
||||
|
||||
## Decision
|
||||
|
||||
示例预览与导入根据当前品牌的行业与视觉模板选择包内 sampleContent。可选 brandConfig 仅在管理员显式导入时补齐缺失配置;已有值、空字符串、null 和列表优先保留。可选 offering.coverUrl 同时导入案例封面。内容保存为品牌草稿,沿用发布快照隔离。
|
||||
|
||||
## Alternatives
|
||||
|
||||
不将宣传模板写入全局 seed,也不在 renderer 中维护无法由后台编辑的样例 fallback。保留未指定视觉模板时的历史行业查询行为,避免改变现有调用方。
|
||||
|
||||
## Consequences
|
||||
|
||||
同一行业可拥有独立示例表单和内容。已有启用表单不会被覆盖。导入仍要求管理员权限和品牌隔离,重复导入继续拒绝。示例信任内容导入为未发布状态,需要管理员确认。
|
||||
|
||||
## Migration plan
|
||||
|
||||
无数据库 schema 迁移。现有品牌、两套模板包和默认视觉选择保持原样;新品牌选择独立工坊后显式导入示例。API 集成测试使用隔离 schema 验证全字段保存重载、发布隔离、授权和咨询持久化。
|
||||
@@ -0,0 +1,51 @@
|
||||
# 独立工坊宣传模板验收记录
|
||||
|
||||
日期:2026-10-15。模板:`atelier-solopreneur@1.0.0`。
|
||||
|
||||
## 已实现
|
||||
|
||||
- 独立模板包、真实 manifest、Taro 页面与原生模板入口,三项导航:首页、服务、咨询。
|
||||
- 首页、服务、咨询、案例详情、意向表单、成功页、咨询记录。
|
||||
- 暖白与森林绿视觉;文案、列表子字段、主理人、联系方式、案例和信任内容均有后台配置入口。
|
||||
- 包内示例显式导入,不新增全局 seed、不更改已有品牌与两套模板包。
|
||||
- 当前视觉模板决定示例来源;已有配置和启用表单保留;案例封面来自包内资源。
|
||||
- 咨询表单 chips 为共享 Inquiry 的可选样式,不改默认模板行为;校验失败保留输入,不伪造成功。
|
||||
- Taro TabBar 从模板 miniapp/app.json 读取配色;缺少 AppID 时使用开发用 touristappid。
|
||||
|
||||
## 自动验证通过
|
||||
|
||||
| 检查 | 结果与证据 |
|
||||
| ---------------------- | ----------------------------------------------------------------------------------------------------------------- |
|
||||
| `pnpm template:doctor` | 三套模板 staticStatus=pass;新模板无 blocker、无未登记 review;completionStatus 仍为 unverified |
|
||||
| `pnpm template:check` | 三套包契约、10 项编译器测试、三套原生 fixture 校验通过 |
|
||||
| API integration | 50 项通过;上传相关另 2 项通过;隔离 schema 自动创建与清理 |
|
||||
| 新模板真实持久化 | 测试读取真实 manifest,对所有独立品牌 binding 和案例 binding 注入独特值,检查数据库重载与 Runtime 投影 |
|
||||
| 授权 | 示例预览 / 导入覆盖未登录、无效凭证、客户角色与管理员成功路径 |
|
||||
| 导入 | 选中本包的 5 字段表单、7 项交付列表、包内封面;保留旧配置;重复导入拒绝 |
|
||||
| 发布 | 未发布时公开为空;发布后可读;修改草稿不污染公开快照;再发布生效 |
|
||||
| 咨询 | 缺必填项失败;真实提交成功落库;品牌隔离通过 |
|
||||
| Taro | typecheck、lint、产物契约与运行时测试通过 |
|
||||
| Admin | 生产构建通过;已接入自动发现的模板 renderer |
|
||||
| 格式 | `pnpm format:check` 与 `git diff --check` 通过 |
|
||||
| 开发构建 | H5 / weapp 构建及产物遮蔽通过;weapp AppID 为 touristappid |
|
||||
| H5 视觉和交互 | 使用上述隔离数据库导出的已发布 Runtime,四个主要页面检查 375 / 390 / 430 宽度;无横向溢出;FAQ 展开、必填校验通过 |
|
||||
| 区域命中 | 实际叶子内容点击命中:首页 9 个、服务 8 个、咨询 6 个声明区域;不是 Admin 全操作验收 |
|
||||
|
||||
测试源:`apps/api/test/http.integration.test.js` 的 `atelier template imports selected package and preserves draft publication isolation`。
|
||||
|
||||
本地证据保存在 `.codex-tasks/atelier-template/raw/`:数据库导出的 Runtime、执行日志、模板诊断、浏览器脚本与截图。Runtime 为临时隔离测试品牌数据,不包含客户数据或令牌。截图中的“保留已有品牌说明”为测试保留旧内容的预期结果。
|
||||
|
||||
## 全量 lint 遗留阻塞
|
||||
|
||||
API 全量 lint 有 13 项既有错误,涉及 admin-membership.guard 的 any、控制器未使用导入和旧上传测试类型;Admin 全量 lint 有 7 项既有错误,涉及 Dashboard 的 any、编辑器与 PublicationPage 的未使用变量。此次没有扩大这些修改范围。跟进归属为平台维护者,合并前需清理;完整日志为 raw/atelier-api-lint.log 和 raw/atelier-admin-lint.log。本次新模板、Taro、修改的 API 服务和配置文件定向 lint 已通过。
|
||||
|
||||
## 未验证及限制
|
||||
|
||||
- 尚未在真实 Admin 登录会话中逐字段完成“点击、编辑、保存、重载、发布”的全操作回归。API 全字段持久化和 H5 区域命中是分别验证,不能等同完整 Admin 验收。
|
||||
- 成功页、记录页、详情页及所有空态 / 错误 / 能力禁用分支尚未完成全套浏览器截图验收。
|
||||
- H5 截图对照已覆盖主要页面结构;字体使用中文系统字体与衬线 fallback,不依赖 Google Fonts,图标与示例图片不是 Stitch 外链资源的逐像素复制。
|
||||
- 原生编译器 fixture 只证明入口和结构,尚无微信开发者工具或真机视觉证据。
|
||||
- 尚无正式 AppID / 生产 API 配置。合法域名、微信登录、剪贴板、字体缩放、底部安全区、提审与真机必须在正式配置后验证。
|
||||
- 未创建实际宣传品牌、未导入开发品牌数据、未上传或发布到微信。后续由管理员选择模板并显式导入样例。
|
||||
|
||||
因此当前状态是“模板代码与自动验证通过,可进入人工预览验收”,不宣称全部交互验收或正式上线完成。
|
||||
@@ -1,12 +1,15 @@
|
||||
import type { BrandTemplateKey } from "./template-keys.js";
|
||||
import { getDefaultVisualTemplateKey } from "./visual-templates.js";
|
||||
import { templatePackageRegistry } from "./template-packages.js";
|
||||
|
||||
export interface TemplateSampleContent {
|
||||
templateKey: BrandTemplateKey;
|
||||
brandConfig?: Record<string, unknown>;
|
||||
inquiryFormName: string;
|
||||
offerings: Array<{
|
||||
kind: "service" | "product" | "package" | "subscription";
|
||||
name: string;
|
||||
coverUrl?: string;
|
||||
summary: string;
|
||||
categoryKey: string;
|
||||
}>;
|
||||
@@ -136,9 +139,22 @@ export const templateSampleContent = {
|
||||
doors: doorsSampleContent,
|
||||
} as const;
|
||||
|
||||
export function getTemplateSampleContent(templateKey: string): TemplateSampleContent | undefined {
|
||||
const packageSample = templatePackageRegistry.find((item) =>
|
||||
item.supportedIndustryTemplates.includes(templateKey),
|
||||
export function getTemplateSampleContent(
|
||||
templateKey: string,
|
||||
visualTemplateKey?: string,
|
||||
): TemplateSampleContent | undefined {
|
||||
const selected = visualTemplateKey
|
||||
? templatePackageRegistry.find(
|
||||
(item) =>
|
||||
item.packageKey === visualTemplateKey &&
|
||||
item.supportedIndustryTemplates.includes(templateKey),
|
||||
)
|
||||
: undefined;
|
||||
if (selected) return selected.sampleContent?.[templateKey];
|
||||
const packageSample = templatePackageRegistry.find(
|
||||
(item) =>
|
||||
item.packageKey === getDefaultVisualTemplateKey(templateKey) &&
|
||||
item.supportedIndustryTemplates.includes(templateKey),
|
||||
)?.sampleContent?.[templateKey];
|
||||
return packageSample ?? templateSampleContent[templateKey as keyof typeof templateSampleContent];
|
||||
}
|
||||
@@ -38,6 +38,24 @@ export const visualTemplates: Record<VisualTemplateKey, VisualTemplateDefinition
|
||||
profile: ["profile"],
|
||||
},
|
||||
},
|
||||
"atelier-solopreneur": {
|
||||
key: "atelier-solopreneur",
|
||||
version: "1.0.0",
|
||||
name: "独立工坊 · 品牌小程序",
|
||||
description: "展示品牌小程序服务、试点案例与合作流程,承接需求咨询。",
|
||||
supportedIndustryTemplates: ["personal"],
|
||||
variants: { hero: "editorial", offeringList: "service-system", detail: "project-case" },
|
||||
theme: {
|
||||
colors: { background: "#fbf9f5", foreground: "#1b1c1a", accent: "#183329", dark: "#183329" },
|
||||
radius: { card: "28rpx" },
|
||||
},
|
||||
layout: {
|
||||
home: ["brand-hero", "offering-list"],
|
||||
offerings: ["offering-list"],
|
||||
detail: ["offering-detail"],
|
||||
profile: ["profile"],
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
export function listVisualTemplateKeys(): VisualTemplateKey[] {
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
# 独立工坊 · 品牌小程序
|
||||
|
||||
`atelier-solopreneur@1.0.0` 是用于宣传个人品牌小程序构建服务的独立模板,适配 `personal` 行业。视觉参考为用户提供的 Stitch 首页、服务、咨询和意向单设计;保留暖白、森林绿、编辑式排版。
|
||||
|
||||
## 内容与使用
|
||||
|
||||
- 首页:价值定位、差异化卡片、试点案例、目标客户和咨询入口。
|
||||
- 服务:交付体系、协作流程、信任基础与合作边界。
|
||||
- 咨询:主理人、微信复制、FAQ 和咨询记录。
|
||||
- 共享详情、意向表单、成功页和记录页复用 Runtime 能力。
|
||||
|
||||
在品牌配置中选择本模板,再从后台显式导入示例。`template.json.sampleContent.personal` 是唯一示例来源,不需要改 Prisma seed。导入不会覆盖已有配置和启用表单。信任内容需确认并发布,品牌基本资料与联系方式需填写真实信息。
|
||||
|
||||
所有展示文案和列表由 manifest 提供后台编辑绑定。保存形成草稿,公开内容只在发布后更新。咨询需微信客户会话;H5 无微信登录时显示失败并保留输入,不伪造提交成功。
|
||||
|
||||
```sh
|
||||
TEMPLATE_KEY=atelier-solopreneur pnpm --filter @personal-brand/taro dev:h5
|
||||
TEMPLATE_KEY=atelier-solopreneur pnpm --filter @personal-brand/taro build:h5
|
||||
TEMPLATE_KEY=atelier-solopreneur pnpm --filter @personal-brand/taro build:weapp
|
||||
pnpm template:dev atelier-solopreneur --brand atelier-studio
|
||||
```
|
||||
|
||||
生产小程序构建需提供真实 `BRAND_SLUG`、`API_BASE_URL` 和 `WEAPP_APP_ID`。开发产物默认 `touristappid`,不代表已上线。
|
||||
|
||||
## 资源与边界
|
||||
|
||||
案例封面采用项目已有示例照片,用于表达场景;不是实际客户合作背书,正式使用可替换为真实模板截图。头像与微信号不虚构默认值。未采用 Stitch 的外链 CDN、Google Fonts 或样例联系方式。
|
||||
|
||||
咨询字段共 5 项:称呼 / 品牌名称、主营领域、需求现状、预期排期、联系方式。表单选项使用共享 Inquiry 的可选 chips 样式,默认行为不变。
|
||||
|
||||
验收状态见 `docs/atelier-template-acceptance.md`。H5 验收不替代微信开发者工具、真机登录、合法域名和安全区验证。
|
||||
@@ -0,0 +1,11 @@
|
||||
{
|
||||
"tabBar": {
|
||||
"color": "#686763",
|
||||
"selectedColor": "#183329",
|
||||
"backgroundColor": "#fbf9f5",
|
||||
"borderStyle": "white"
|
||||
},
|
||||
"window": {
|
||||
"navigationBarBackgroundColor": "#fbf9f5"
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 182 KiB |
|
After Width: | Height: | Size: 210 KiB |
|
After Width: | Height: | Size: 804 B |
|
After Width: | Height: | Size: 803 B |
|
After Width: | Height: | Size: 1016 B |
|
After Width: | Height: | Size: 1.0 KiB |
|
After Width: | Height: | Size: 787 B |
|
After Width: | Height: | Size: 815 B |
@@ -0,0 +1,53 @@
|
||||
const { loadWorkspaceWithFallback } = require("../../utils/runtime-workspace");
|
||||
const { openPage } = require("../../utils/navigation");
|
||||
Page({
|
||||
data: {
|
||||
brand: {},
|
||||
presentation: {},
|
||||
config: {},
|
||||
offerings: [],
|
||||
error: "",
|
||||
loading: true,
|
||||
opened: -1,
|
||||
},
|
||||
onLoad() {
|
||||
this.reload();
|
||||
},
|
||||
reload() {
|
||||
this.setData({ loading: true, error: "" });
|
||||
loadWorkspaceWithFallback()
|
||||
.then((workspace) => {
|
||||
const brand = workspace.brand || {};
|
||||
this.setData({
|
||||
brand,
|
||||
presentation: brand.visualPresentation?.profile || {},
|
||||
config: brand.atelier || {},
|
||||
offerings: workspace.offerings || [],
|
||||
loading: false,
|
||||
});
|
||||
})
|
||||
.catch((error) => this.setData({ error: error.message, loading: false }));
|
||||
},
|
||||
inquiry() {
|
||||
openPage("/pages/inquiry/index");
|
||||
},
|
||||
services() {
|
||||
openPage("/pages/services/index");
|
||||
},
|
||||
contact() {
|
||||
openPage("/pages/bookings/index");
|
||||
},
|
||||
records() {
|
||||
openPage("/pages/records/index");
|
||||
},
|
||||
detail(event) {
|
||||
openPage("/pages/offering/detail?id=" + encodeURIComponent(event.currentTarget.dataset.id));
|
||||
},
|
||||
toggle(event) {
|
||||
const index = Number(event.currentTarget.dataset.index);
|
||||
this.setData({ opened: this.data.opened === index ? -1 : index });
|
||||
},
|
||||
copy() {
|
||||
if (this.data.brand.contactWechat) wx.setClipboardData({ data: this.data.brand.contactWechat });
|
||||
},
|
||||
});
|
||||
@@ -0,0 +1 @@
|
||||
{ "navigationBarTitleText": "咨询", "usingComponents": {} }
|
||||
@@ -0,0 +1 @@
|
||||
<view class="page"><view wx:if="{{loading}}">正在加载…</view><view wx:elif="{{error}}">{{error}}<button bindtap="reload">重试</button></view><block wx:else><view class="intro"><text class="eyebrow">{{presentation.eyebrow}}</text><text class="title">{{presentation.title}}</text><text class="body">{{presentation.subtitle}}</text></view><view class="card"><view class="identity"><image wx:if="{{brand.avatarUrl}}" src="{{brand.avatarUrl}}" mode="aspectFill"/><view><text class="card-title">{{brand.founder}}</text><text class="caption">{{brand.title}}</text></view></view><text class="body">{{brand.description}}</text><button bindtap="inquiry">{{presentation.inquiryAction}} · {{presentation.timeHint}}</button><view class="wechat"><text class="caption">{{presentation.wechatLabel}}</text><text>{{brand.contactWechat || presentation.contactHint}}</text><button disabled="{{!brand.contactWechat}}" bindtap="copy">{{presentation.copyAction}}</button></view><text class="caption">{{presentation.promise}}</text><button bindtap="records">{{presentation.recordsAction}}</button></view><view class="intro"><text class="title">{{presentation.faqTitle}}</text><text class="body">{{presentation.faqSubtitle}}</text></view><view wx:for="{{config.faqs}}" wx:key="index" class="card"><view bindtap="toggle" data-index="{{index}}"><text class="card-title">{{index+1}} · {{item.title}} {{opened===index ? "−" : "+"}}</text></view><text wx:if="{{opened===index}}" class="body">{{item.description}}</text></view><view class="footer"><text>{{presentation.footerQuote}}</text><text class="caption">{{presentation.footerNote}}</text></view></block></view>
|
||||
@@ -0,0 +1,149 @@
|
||||
page {
|
||||
background: #fbf9f5;
|
||||
color: #1b1c1a;
|
||||
font-size: 28rpx;
|
||||
line-height: 1.7;
|
||||
}
|
||||
text {
|
||||
display: block;
|
||||
}
|
||||
.page {
|
||||
padding: 40rpx;
|
||||
}
|
||||
.intro {
|
||||
margin-bottom: 36rpx;
|
||||
}
|
||||
.eyebrow {
|
||||
display: inline-block;
|
||||
background: #eaf0e9;
|
||||
color: #183329;
|
||||
border-radius: 99rpx;
|
||||
padding: 4rpx 16rpx;
|
||||
font-size: 21rpx;
|
||||
}
|
||||
.title {
|
||||
font-size: 46rpx;
|
||||
font-weight: 600;
|
||||
line-height: 1.45;
|
||||
white-space: pre-line;
|
||||
margin: 22rpx 0;
|
||||
}
|
||||
.body {
|
||||
font-size: 26rpx;
|
||||
color: #555953;
|
||||
line-height: 1.8;
|
||||
white-space: pre-line;
|
||||
}
|
||||
.heading {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
margin: 60rpx 0 24rpx;
|
||||
font-size: 30rpx;
|
||||
}
|
||||
.heading > text:last-child,
|
||||
.caption {
|
||||
font-size: 21rpx;
|
||||
color: #777971;
|
||||
}
|
||||
.card,
|
||||
.case {
|
||||
background: white;
|
||||
border: 1rpx solid #efede7;
|
||||
border-radius: 28rpx;
|
||||
padding: 30rpx;
|
||||
margin-bottom: 24rpx;
|
||||
}
|
||||
.card-title {
|
||||
font-size: 30rpx;
|
||||
font-weight: 600;
|
||||
margin-bottom: 12rpx;
|
||||
}
|
||||
.tag {
|
||||
font-size: 20rpx;
|
||||
color: #8d7956;
|
||||
text-align: right;
|
||||
}
|
||||
.actions,
|
||||
.cases {
|
||||
display: grid;
|
||||
grid-template-columns: 1fr 1fr;
|
||||
gap: 20rpx;
|
||||
}
|
||||
.badges {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 16rpx;
|
||||
font-size: 21rpx;
|
||||
margin-top: 24rpx;
|
||||
}
|
||||
.audiences {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(3, 1fr);
|
||||
gap: 16rpx;
|
||||
}
|
||||
.audiences .card {
|
||||
padding: 18rpx 8rpx;
|
||||
text-align: center;
|
||||
font-size: 24rpx;
|
||||
}
|
||||
.case {
|
||||
padding: 18rpx;
|
||||
min-width: 0;
|
||||
}
|
||||
.case image {
|
||||
width: 100%;
|
||||
height: 200rpx;
|
||||
border-radius: 16rpx;
|
||||
}
|
||||
.cta {
|
||||
background: #183329;
|
||||
color: white;
|
||||
padding: 30rpx;
|
||||
border-radius: 28rpx;
|
||||
margin: 50rpx 0;
|
||||
}
|
||||
.cta .body {
|
||||
color: #c5d1c6;
|
||||
}
|
||||
.identity {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 24rpx;
|
||||
margin-bottom: 24rpx;
|
||||
}
|
||||
.identity image {
|
||||
width: 96rpx;
|
||||
height: 96rpx;
|
||||
border-radius: 50%;
|
||||
}
|
||||
.wechat {
|
||||
background: #f5f3ed;
|
||||
padding: 24rpx;
|
||||
border-radius: 20rpx;
|
||||
margin: 20rpx 0;
|
||||
}
|
||||
.footer {
|
||||
text-align: center;
|
||||
margin: 70rpx 0;
|
||||
}
|
||||
button {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
min-height: 88rpx;
|
||||
background: #183329;
|
||||
color: white;
|
||||
border: 0;
|
||||
border-radius: 24rpx;
|
||||
padding: 12rpx 20rpx;
|
||||
font-size: 25rpx;
|
||||
margin: 20rpx 0;
|
||||
}
|
||||
button::after {
|
||||
border: 0;
|
||||
}
|
||||
.cta button {
|
||||
background: white;
|
||||
color: #183329;
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
const { loadWorkspaceWithFallback } = require("../../utils/runtime-workspace");
|
||||
const { openPage } = require("../../utils/navigation");
|
||||
Page({
|
||||
data: {
|
||||
brand: {},
|
||||
presentation: {},
|
||||
config: {},
|
||||
offerings: [],
|
||||
error: "",
|
||||
loading: true,
|
||||
opened: -1,
|
||||
},
|
||||
onLoad() {
|
||||
this.reload();
|
||||
},
|
||||
reload() {
|
||||
this.setData({ loading: true, error: "" });
|
||||
loadWorkspaceWithFallback()
|
||||
.then((workspace) => {
|
||||
const brand = workspace.brand || {};
|
||||
this.setData({
|
||||
brand,
|
||||
presentation: brand.visualPresentation?.home || {},
|
||||
config: brand.atelier || {},
|
||||
offerings: workspace.offerings || [],
|
||||
loading: false,
|
||||
});
|
||||
})
|
||||
.catch((error) => this.setData({ error: error.message, loading: false }));
|
||||
},
|
||||
inquiry() {
|
||||
openPage("/pages/inquiry/index");
|
||||
},
|
||||
services() {
|
||||
openPage("/pages/services/index");
|
||||
},
|
||||
contact() {
|
||||
openPage("/pages/bookings/index");
|
||||
},
|
||||
records() {
|
||||
openPage("/pages/records/index");
|
||||
},
|
||||
detail(event) {
|
||||
openPage("/pages/offering/detail?id=" + encodeURIComponent(event.currentTarget.dataset.id));
|
||||
},
|
||||
toggle(event) {
|
||||
const index = Number(event.currentTarget.dataset.index);
|
||||
this.setData({ opened: this.data.opened === index ? -1 : index });
|
||||
},
|
||||
copy() {
|
||||
if (this.data.brand.contactWechat) wx.setClipboardData({ data: this.data.brand.contactWechat });
|
||||
},
|
||||
});
|
||||
@@ -0,0 +1 @@
|
||||
{ "navigationBarTitleText": "首页", "usingComponents": {} }
|
||||
@@ -0,0 +1 @@
|
||||
<view class="page"><view wx:if="{{loading}}">正在加载…</view><view wx:elif="{{error}}">{{error}}<button bindtap="reload">重试</button></view><block wx:else><view class="intro"><text class="eyebrow">{{presentation.eyebrow}}</text><text class="title">{{presentation.title}}</text><text class="body">{{presentation.subtitle}}</text></view><view class="actions"><button bindtap="inquiry">{{presentation.primaryAction}}</button><button bindtap="services">{{presentation.secondaryAction}}</button></view><view class="badges"><text wx:for="{{config.badges}}" wx:key="index">✓ {{item.title}}</text></view><view class="heading"><text>{{presentation.featuresTitle}}</text><text>{{presentation.featuresEnglish}}</text></view><view wx:for="{{config.features}}" wx:key="index" class="card"><text class="tag">{{item.tag}}</text><text class="card-title">{{item.title}}</text><text class="body">{{item.description}}</text></view><view class="heading"><view>{{presentation.casesTitle}}<text class="caption">{{presentation.casesSubtitle}}</text></view><text>{{presentation.caseAction}}</text></view><view class="cases"><view wx:for="{{offerings}}" wx:key="id" class="case" bindtap="detail" data-id="{{item.id}}"><image wx:if="{{item.coverUrl}}" src="{{item.coverUrl}}" mode="aspectFill"/><text class="card-title">{{item.name}}</text><text class="caption">{{item.summary}}</text></view></view><view class="heading"><text>{{presentation.audienceTitle}}</text><text>{{presentation.audienceEnglish}}</text></view><view class="audiences"><view wx:for="{{config.audiences}}" wx:key="index" class="card"><text>{{item.symbol}}</text><text>{{item.title}}</text><text class="caption">{{item.description}}</text></view></view><view class="cta"><text class="card-title">{{presentation.ctaTitle}}</text><text class="body">{{presentation.ctaSubtitle}}</text><button bindtap="contact">{{presentation.ctaAction}}</button></view></block></view>
|
||||
@@ -0,0 +1,149 @@
|
||||
page {
|
||||
background: #fbf9f5;
|
||||
color: #1b1c1a;
|
||||
font-size: 28rpx;
|
||||
line-height: 1.7;
|
||||
}
|
||||
text {
|
||||
display: block;
|
||||
}
|
||||
.page {
|
||||
padding: 40rpx;
|
||||
}
|
||||
.intro {
|
||||
margin-bottom: 36rpx;
|
||||
}
|
||||
.eyebrow {
|
||||
display: inline-block;
|
||||
background: #eaf0e9;
|
||||
color: #183329;
|
||||
border-radius: 99rpx;
|
||||
padding: 4rpx 16rpx;
|
||||
font-size: 21rpx;
|
||||
}
|
||||
.title {
|
||||
font-size: 46rpx;
|
||||
font-weight: 600;
|
||||
line-height: 1.45;
|
||||
white-space: pre-line;
|
||||
margin: 22rpx 0;
|
||||
}
|
||||
.body {
|
||||
font-size: 26rpx;
|
||||
color: #555953;
|
||||
line-height: 1.8;
|
||||
white-space: pre-line;
|
||||
}
|
||||
.heading {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
margin: 60rpx 0 24rpx;
|
||||
font-size: 30rpx;
|
||||
}
|
||||
.heading > text:last-child,
|
||||
.caption {
|
||||
font-size: 21rpx;
|
||||
color: #777971;
|
||||
}
|
||||
.card,
|
||||
.case {
|
||||
background: white;
|
||||
border: 1rpx solid #efede7;
|
||||
border-radius: 28rpx;
|
||||
padding: 30rpx;
|
||||
margin-bottom: 24rpx;
|
||||
}
|
||||
.card-title {
|
||||
font-size: 30rpx;
|
||||
font-weight: 600;
|
||||
margin-bottom: 12rpx;
|
||||
}
|
||||
.tag {
|
||||
font-size: 20rpx;
|
||||
color: #8d7956;
|
||||
text-align: right;
|
||||
}
|
||||
.actions,
|
||||
.cases {
|
||||
display: grid;
|
||||
grid-template-columns: 1fr 1fr;
|
||||
gap: 20rpx;
|
||||
}
|
||||
.badges {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 16rpx;
|
||||
font-size: 21rpx;
|
||||
margin-top: 24rpx;
|
||||
}
|
||||
.audiences {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(3, 1fr);
|
||||
gap: 16rpx;
|
||||
}
|
||||
.audiences .card {
|
||||
padding: 18rpx 8rpx;
|
||||
text-align: center;
|
||||
font-size: 24rpx;
|
||||
}
|
||||
.case {
|
||||
padding: 18rpx;
|
||||
min-width: 0;
|
||||
}
|
||||
.case image {
|
||||
width: 100%;
|
||||
height: 200rpx;
|
||||
border-radius: 16rpx;
|
||||
}
|
||||
.cta {
|
||||
background: #183329;
|
||||
color: white;
|
||||
padding: 30rpx;
|
||||
border-radius: 28rpx;
|
||||
margin: 50rpx 0;
|
||||
}
|
||||
.cta .body {
|
||||
color: #c5d1c6;
|
||||
}
|
||||
.identity {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 24rpx;
|
||||
margin-bottom: 24rpx;
|
||||
}
|
||||
.identity image {
|
||||
width: 96rpx;
|
||||
height: 96rpx;
|
||||
border-radius: 50%;
|
||||
}
|
||||
.wechat {
|
||||
background: #f5f3ed;
|
||||
padding: 24rpx;
|
||||
border-radius: 20rpx;
|
||||
margin: 20rpx 0;
|
||||
}
|
||||
.footer {
|
||||
text-align: center;
|
||||
margin: 70rpx 0;
|
||||
}
|
||||
button {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
min-height: 88rpx;
|
||||
background: #183329;
|
||||
color: white;
|
||||
border: 0;
|
||||
border-radius: 24rpx;
|
||||
padding: 12rpx 20rpx;
|
||||
font-size: 25rpx;
|
||||
margin: 20rpx 0;
|
||||
}
|
||||
button::after {
|
||||
border: 0;
|
||||
}
|
||||
.cta button {
|
||||
background: white;
|
||||
color: #183329;
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
const { loadWorkspaceWithFallback } = require("../../utils/runtime-workspace");
|
||||
const { openPage } = require("../../utils/navigation");
|
||||
Page({
|
||||
data: {
|
||||
brand: {},
|
||||
presentation: {},
|
||||
config: {},
|
||||
offerings: [],
|
||||
error: "",
|
||||
loading: true,
|
||||
opened: -1,
|
||||
},
|
||||
onLoad() {
|
||||
this.reload();
|
||||
},
|
||||
reload() {
|
||||
this.setData({ loading: true, error: "" });
|
||||
loadWorkspaceWithFallback()
|
||||
.then((workspace) => {
|
||||
const brand = workspace.brand || {};
|
||||
this.setData({
|
||||
brand,
|
||||
presentation: brand.visualPresentation?.offerings || {},
|
||||
config: brand.atelier || {},
|
||||
offerings: workspace.offerings || [],
|
||||
trustItems: workspace.trustItems || [],
|
||||
loading: false,
|
||||
});
|
||||
})
|
||||
.catch((error) => this.setData({ error: error.message, loading: false }));
|
||||
},
|
||||
inquiry() {
|
||||
openPage("/pages/inquiry/index");
|
||||
},
|
||||
services() {
|
||||
openPage("/pages/services/index");
|
||||
},
|
||||
contact() {
|
||||
openPage("/pages/bookings/index");
|
||||
},
|
||||
records() {
|
||||
openPage("/pages/records/index");
|
||||
},
|
||||
detail(event) {
|
||||
openPage("/pages/offering/detail?id=" + encodeURIComponent(event.currentTarget.dataset.id));
|
||||
},
|
||||
toggle(event) {
|
||||
const index = Number(event.currentTarget.dataset.index);
|
||||
this.setData({ opened: this.data.opened === index ? -1 : index });
|
||||
},
|
||||
copy() {
|
||||
if (this.data.brand.contactWechat) wx.setClipboardData({ data: this.data.brand.contactWechat });
|
||||
},
|
||||
});
|
||||
@@ -0,0 +1 @@
|
||||
{ "navigationBarTitleText": "服务", "usingComponents": {} }
|
||||
@@ -0,0 +1 @@
|
||||
<view class="page"><view wx:if="{{loading}}">正在加载…</view><view wx:elif="{{error}}">{{error}}<button bindtap="reload">重试</button></view><block wx:else><view class="intro"><text class="eyebrow">{{presentation.eyebrow}}</text><text class="title">{{presentation.title}}</text><text class="body">{{presentation.subtitle}}</text></view><view class="heading"><text>{{presentation.deliverablesTitle}}</text><text>{{presentation.deliverablesEnglish}}</text></view><view wx:for="{{config.deliverables}}" wx:key="index" class="card"><text class="tag">{{item.tag}}</text><text class="card-title">{{index+1}} · {{item.title}}</text><text class="body">{{item.description}}</text></view><view class="heading"><text>{{presentation.processTitle}}</text><text>{{presentation.processEnglish}}</text></view><view wx:for="{{config.process}}" wx:key="index" class="card"><text class="tag">{{item.tag}}</text><text class="card-title">{{index+1}} · {{item.title}}</text><text class="body">{{item.description}}</text></view><view class="heading"><text>{{presentation.proofTitle}}</text><text>{{presentation.proofEnglish}}</text></view><view wx:for="{{config.proofs}}" wx:key="index" class="card"><text class="tag">{{item.tag}}</text><text class="card-title">{{index+1}} · {{item.title}}</text><text class="body">{{item.description}}</text></view><view wx:for="{{trustItems}}" wx:key="id" class="card"><text class="card-title">{{item.title}}</text><text class="caption">{{item.summary}}</text><text class="body">{{item.content}}</text></view><view class="cta"><text class="card-title">{{presentation.ctaTitle}}</text><text class="body">{{presentation.ctaSubtitle}}</text><button bindtap="contact">{{presentation.ctaAction}}</button></view></block></view>
|
||||
@@ -0,0 +1,149 @@
|
||||
page {
|
||||
background: #fbf9f5;
|
||||
color: #1b1c1a;
|
||||
font-size: 28rpx;
|
||||
line-height: 1.7;
|
||||
}
|
||||
text {
|
||||
display: block;
|
||||
}
|
||||
.page {
|
||||
padding: 40rpx;
|
||||
}
|
||||
.intro {
|
||||
margin-bottom: 36rpx;
|
||||
}
|
||||
.eyebrow {
|
||||
display: inline-block;
|
||||
background: #eaf0e9;
|
||||
color: #183329;
|
||||
border-radius: 99rpx;
|
||||
padding: 4rpx 16rpx;
|
||||
font-size: 21rpx;
|
||||
}
|
||||
.title {
|
||||
font-size: 46rpx;
|
||||
font-weight: 600;
|
||||
line-height: 1.45;
|
||||
white-space: pre-line;
|
||||
margin: 22rpx 0;
|
||||
}
|
||||
.body {
|
||||
font-size: 26rpx;
|
||||
color: #555953;
|
||||
line-height: 1.8;
|
||||
white-space: pre-line;
|
||||
}
|
||||
.heading {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
margin: 60rpx 0 24rpx;
|
||||
font-size: 30rpx;
|
||||
}
|
||||
.heading > text:last-child,
|
||||
.caption {
|
||||
font-size: 21rpx;
|
||||
color: #777971;
|
||||
}
|
||||
.card,
|
||||
.case {
|
||||
background: white;
|
||||
border: 1rpx solid #efede7;
|
||||
border-radius: 28rpx;
|
||||
padding: 30rpx;
|
||||
margin-bottom: 24rpx;
|
||||
}
|
||||
.card-title {
|
||||
font-size: 30rpx;
|
||||
font-weight: 600;
|
||||
margin-bottom: 12rpx;
|
||||
}
|
||||
.tag {
|
||||
font-size: 20rpx;
|
||||
color: #8d7956;
|
||||
text-align: right;
|
||||
}
|
||||
.actions,
|
||||
.cases {
|
||||
display: grid;
|
||||
grid-template-columns: 1fr 1fr;
|
||||
gap: 20rpx;
|
||||
}
|
||||
.badges {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 16rpx;
|
||||
font-size: 21rpx;
|
||||
margin-top: 24rpx;
|
||||
}
|
||||
.audiences {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(3, 1fr);
|
||||
gap: 16rpx;
|
||||
}
|
||||
.audiences .card {
|
||||
padding: 18rpx 8rpx;
|
||||
text-align: center;
|
||||
font-size: 24rpx;
|
||||
}
|
||||
.case {
|
||||
padding: 18rpx;
|
||||
min-width: 0;
|
||||
}
|
||||
.case image {
|
||||
width: 100%;
|
||||
height: 200rpx;
|
||||
border-radius: 16rpx;
|
||||
}
|
||||
.cta {
|
||||
background: #183329;
|
||||
color: white;
|
||||
padding: 30rpx;
|
||||
border-radius: 28rpx;
|
||||
margin: 50rpx 0;
|
||||
}
|
||||
.cta .body {
|
||||
color: #c5d1c6;
|
||||
}
|
||||
.identity {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 24rpx;
|
||||
margin-bottom: 24rpx;
|
||||
}
|
||||
.identity image {
|
||||
width: 96rpx;
|
||||
height: 96rpx;
|
||||
border-radius: 50%;
|
||||
}
|
||||
.wechat {
|
||||
background: #f5f3ed;
|
||||
padding: 24rpx;
|
||||
border-radius: 20rpx;
|
||||
margin: 20rpx 0;
|
||||
}
|
||||
.footer {
|
||||
text-align: center;
|
||||
margin: 70rpx 0;
|
||||
}
|
||||
button {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
min-height: 88rpx;
|
||||
background: #183329;
|
||||
color: white;
|
||||
border: 0;
|
||||
border-radius: 24rpx;
|
||||
padding: 12rpx 20rpx;
|
||||
font-size: 25rpx;
|
||||
margin: 20rpx 0;
|
||||
}
|
||||
button::after {
|
||||
border: 0;
|
||||
}
|
||||
.cta button {
|
||||
background: white;
|
||||
color: #183329;
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
{
|
||||
"name": "@personal-brand/template-atelier-solopreneur",
|
||||
"version": "1.0.0",
|
||||
"private": true,
|
||||
"type": "module",
|
||||
"files": [
|
||||
"template.json",
|
||||
"miniapp",
|
||||
"README.md",
|
||||
"taro"
|
||||
],
|
||||
"dependencies": {
|
||||
"@tarojs/components": "4.3.0",
|
||||
"@tarojs/taro": "4.3.0",
|
||||
"react": "18.3.1",
|
||||
"@personal-brand/types": "workspace:*",
|
||||
"@tarojs/plugin-platform-weapp": "4.3.0",
|
||||
"@tarojs/plugin-platform-h5": "4.3.0",
|
||||
"react-dom": "18.3.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/react": "18.3.18"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,395 @@
|
||||
import { useState, cloneElement, isValidElement, type ReactNode } from "react";
|
||||
import { View, Text, Image, Button } from "@tarojs/components";
|
||||
import Taro from "@tarojs/taro";
|
||||
import type { RuntimeWorkspace } from "@personal-brand/types";
|
||||
import type { TemplateProps } from "../../../apps/taro/src/runtime/template";
|
||||
import { navigate } from "../../../apps/taro/src/runtime/navigation";
|
||||
import { object, rows, text, presentation, offering } from "../../../apps/taro/src/runtime/content";
|
||||
import { inquiryPluginState } from "../../../apps/taro/src/runtime/plugins";
|
||||
import "./style.css";
|
||||
|
||||
type Props = { workspace: RuntimeWorkspace };
|
||||
function InquiryAction({ workspace, label }: Props & { label: string }) {
|
||||
const state = inquiryPluginState(workspace);
|
||||
return (
|
||||
<Button disabled={!state.enabled} onClick={() => navigate("inquiry")}>
|
||||
{state.enabled ? label : state.disabledHint || "咨询暂不可用"}
|
||||
</Button>
|
||||
);
|
||||
}
|
||||
function Home({ workspace }: Props) {
|
||||
const p = presentation(workspace, "home");
|
||||
const config = object(workspace.brand.atelier);
|
||||
return (
|
||||
<View className="atelier-page">
|
||||
<View className="atelier-intro" data-editor-target="atelier.home.intro">
|
||||
<Text className="atelier-eyebrow">{p.eyebrow}</Text>
|
||||
<Text className="atelier-title">{p.title}</Text>
|
||||
<Text className="atelier-body">{p.subtitle}</Text>
|
||||
<View className="atelier-actions">
|
||||
<InquiryAction workspace={workspace} label={p.primaryAction} />
|
||||
<Button className="atelier-secondary" onClick={() => navigate("offerings")}>
|
||||
{p.secondaryAction}
|
||||
</Button>
|
||||
</View>
|
||||
</View>
|
||||
<View className="atelier-badges" data-editor-target="atelier.home.badges">
|
||||
{rows(config.badges).map((item, index) => (
|
||||
<Text key={index}>✓ {item.title}</Text>
|
||||
))}
|
||||
</View>
|
||||
<View className="atelier-heading" data-editor-target="atelier.home.featuresHeading">
|
||||
<Text>{p.featuresTitle}</Text>
|
||||
<Text>{p.featuresEnglish}</Text>
|
||||
</View>
|
||||
<View className="atelier-stack" data-editor-target="atelier.home.features">
|
||||
{rows(config.features).map((item, index) => (
|
||||
<View className="atelier-card" key={index}>
|
||||
<View className="atelier-card-top">
|
||||
<Text className="atelier-number">{String(index + 1).padStart(2, "0")}</Text>
|
||||
<Text className="atelier-tag">{item.tag}</Text>
|
||||
</View>
|
||||
<Text className="atelier-card-title">{item.title}</Text>
|
||||
<Text className="atelier-body">{item.description}</Text>
|
||||
</View>
|
||||
))}
|
||||
</View>
|
||||
<View className="atelier-heading" data-editor-target="atelier.home.casesHeading">
|
||||
<View>
|
||||
<Text>{p.casesTitle}</Text>
|
||||
<Text className="atelier-caption">{p.casesSubtitle}</Text>
|
||||
</View>
|
||||
<Text>{p.caseAction}</Text>
|
||||
</View>
|
||||
<View className="atelier-cases">
|
||||
{workspace.offerings.map((item) => (
|
||||
<View
|
||||
className="atelier-case"
|
||||
key={item.id}
|
||||
data-editor-target="atelier.home.case"
|
||||
data-editor-record-id={item.id}
|
||||
onClick={() => navigate("detail", { id: item.id })}
|
||||
>
|
||||
{item.coverUrl ? (
|
||||
<Image src={item.coverUrl} mode="aspectFill" />
|
||||
) : (
|
||||
<View className="atelier-case-placeholder">
|
||||
<Text>↗</Text>
|
||||
</View>
|
||||
)}
|
||||
<View className="atelier-case-copy">
|
||||
<Text className="atelier-card-title">{item.name}</Text>
|
||||
<Text className="atelier-caption">{item.summary}</Text>
|
||||
<Text className="atelier-case-arrow">→</Text>
|
||||
</View>
|
||||
</View>
|
||||
))}
|
||||
</View>
|
||||
<View className="atelier-heading" data-editor-target="atelier.home.audienceHeading">
|
||||
<Text>{p.audienceTitle}</Text>
|
||||
<Text>{p.audienceEnglish}</Text>
|
||||
</View>
|
||||
<View className="atelier-audiences" data-editor-target="atelier.home.audiences">
|
||||
{rows(config.audiences).map((item, index) => (
|
||||
<View className="atelier-audience" key={index}>
|
||||
<Text className="atelier-symbol">{item.symbol}</Text>
|
||||
<Text>{item.title}</Text>
|
||||
<Text className="atelier-caption">{item.description}</Text>
|
||||
</View>
|
||||
))}
|
||||
</View>
|
||||
<View className="atelier-cta" data-editor-target="atelier.home.cta">
|
||||
<View>
|
||||
<Text className="atelier-card-title">{p.ctaTitle}</Text>
|
||||
<Text className="atelier-caption">{p.ctaSubtitle}</Text>
|
||||
</View>
|
||||
<Button onClick={() => navigate("profile")}>{p.ctaAction}</Button>
|
||||
</View>
|
||||
</View>
|
||||
);
|
||||
}
|
||||
function Services({ workspace }: Props) {
|
||||
const p = presentation(workspace, "offerings");
|
||||
const config = object(workspace.brand.atelier);
|
||||
return (
|
||||
<View className="atelier-page">
|
||||
<View className="atelier-intro" data-editor-target="atelier.offerings.intro">
|
||||
<Text className="atelier-eyebrow">{p.eyebrow}</Text>
|
||||
<Text className="atelier-title">{p.title}</Text>
|
||||
<Text className="atelier-body">{p.subtitle}</Text>
|
||||
</View>
|
||||
<View className="atelier-heading" data-editor-target="atelier.offerings.deliverablesHeading">
|
||||
<Text>{p.deliverablesTitle}</Text>
|
||||
<Text>{p.deliverablesEnglish}</Text>
|
||||
</View>
|
||||
<View className="atelier-stack" data-editor-target="atelier.offerings.deliverables">
|
||||
{rows(config.deliverables).map((item, index) => (
|
||||
<View className="atelier-card atelier-deliverable" key={index}>
|
||||
<Text className="atelier-number">{String(index + 1).padStart(2, "0")}</Text>
|
||||
<View>
|
||||
<View className="atelier-card-top">
|
||||
<Text className="atelier-card-title">{item.title}</Text>
|
||||
<Text className="atelier-tag">{item.tag}</Text>
|
||||
</View>
|
||||
<Text className="atelier-body">{item.description}</Text>
|
||||
</View>
|
||||
</View>
|
||||
))}
|
||||
</View>
|
||||
<View className="atelier-heading" data-editor-target="atelier.offerings.processHeading">
|
||||
<Text>{p.processTitle}</Text>
|
||||
<Text>{p.processEnglish}</Text>
|
||||
</View>
|
||||
<View className="atelier-process" data-editor-target="atelier.offerings.process">
|
||||
{rows(config.process).map((item, index) => (
|
||||
<View className="atelier-step" key={index}>
|
||||
<Text className="atelier-step-dot">{index + 1}</Text>
|
||||
<View>
|
||||
<Text className="atelier-card-title">{item.title}</Text>
|
||||
<Text className="atelier-body">{item.description}</Text>
|
||||
</View>
|
||||
</View>
|
||||
))}
|
||||
</View>
|
||||
<View className="atelier-heading" data-editor-target="atelier.offerings.proofHeading">
|
||||
<Text>{p.proofTitle}</Text>
|
||||
<Text>{p.proofEnglish}</Text>
|
||||
</View>
|
||||
<View className="atelier-proof" data-editor-target="atelier.offerings.proofs">
|
||||
{rows(config.proofs).map((item, index) => (
|
||||
<View className="atelier-proof-item" key={index}>
|
||||
<Text>◇</Text>
|
||||
<View>
|
||||
<Text className="atelier-card-title">{item.title}</Text>
|
||||
<Text className="atelier-body">{item.description}</Text>
|
||||
</View>
|
||||
</View>
|
||||
))}
|
||||
</View>
|
||||
{workspace.trustItems.map((item) => (
|
||||
<View
|
||||
className="atelier-card atelier-trust"
|
||||
key={item.id}
|
||||
data-editor-target={`trust:${item.type}`}
|
||||
data-editor-record-id={item.id}
|
||||
>
|
||||
<Text className="atelier-card-title">{item.title}</Text>
|
||||
<Text className="atelier-caption">{item.summary}</Text>
|
||||
<Text className="atelier-body">{item.content}</Text>
|
||||
</View>
|
||||
))}
|
||||
<View className="atelier-cta atelier-cta-large" data-editor-target="atelier.offerings.cta">
|
||||
<Text className="atelier-card-title">{p.ctaTitle}</Text>
|
||||
<Text className="atelier-body">{p.ctaSubtitle}</Text>
|
||||
<InquiryAction workspace={workspace} label={p.ctaAction} />
|
||||
</View>
|
||||
</View>
|
||||
);
|
||||
}
|
||||
function Profile({ workspace }: Props) {
|
||||
const [opened, setOpened] = useState<number | null>(null);
|
||||
const b = workspace.brand;
|
||||
const p = presentation(workspace, "profile");
|
||||
const config = object(b.atelier);
|
||||
async function copyWechat() {
|
||||
try {
|
||||
await Taro.setClipboardData({ data: text(b.contactWechat) });
|
||||
} catch {
|
||||
void Taro.showToast({ title: "复制失败,请重试", icon: "none" });
|
||||
}
|
||||
}
|
||||
return (
|
||||
<View className="atelier-page">
|
||||
<View className="atelier-intro" data-editor-target="atelier.profile.intro">
|
||||
<Text className="atelier-eyebrow">{p.eyebrow}</Text>
|
||||
<Text className="atelier-title">{p.title}</Text>
|
||||
<Text className="atelier-body">{p.subtitle}</Text>
|
||||
</View>
|
||||
<View className="atelier-card">
|
||||
<View data-editor-target="atelier.profile.identity">
|
||||
<View className="atelier-identity">
|
||||
{text(b.avatarUrl) && <Image src={text(b.avatarUrl)} mode="aspectFill" />}
|
||||
<View>
|
||||
<Text className="atelier-card-title">{text(b.founder)}</Text>
|
||||
<Text className="atelier-caption">{text(b.title)}</Text>
|
||||
</View>
|
||||
</View>
|
||||
<Text className="atelier-body atelier-bio">{text(b.description)}</Text>
|
||||
</View>
|
||||
<View data-editor-target="atelier.profile.contact">
|
||||
<InquiryAction workspace={workspace} label={`${p.inquiryAction} ${p.timeHint}`} />
|
||||
<View className="atelier-wechat">
|
||||
<View>
|
||||
<Text className="atelier-caption">{p.wechatLabel}</Text>
|
||||
<Text>{text(b.contactWechat) || p.contactHint}</Text>
|
||||
</View>
|
||||
<Button
|
||||
className="atelier-copy"
|
||||
disabled={!text(b.contactWechat)}
|
||||
onClick={() => void copyWechat()}
|
||||
>
|
||||
{p.copyAction}
|
||||
</Button>
|
||||
</View>
|
||||
<Text className="atelier-contact-note">✓ {p.promise}</Text>
|
||||
<Button className="atelier-records" onClick={() => navigate("records")}>
|
||||
{p.recordsAction}
|
||||
</Button>
|
||||
</View>
|
||||
</View>
|
||||
<View className="atelier-faq-heading" data-editor-target="atelier.profile.faqHeading">
|
||||
<Text className="atelier-title">{p.faqTitle}</Text>
|
||||
<Text className="atelier-body">{p.faqSubtitle}</Text>
|
||||
</View>
|
||||
<View className="atelier-stack" data-editor-target="atelier.profile.faqs">
|
||||
{rows(config.faqs).map((item, index) => (
|
||||
<View className="atelier-card atelier-faq" key={index}>
|
||||
<Button
|
||||
className="atelier-question"
|
||||
onClick={() => setOpened(opened === index ? null : index)}
|
||||
aria-expanded={opened === index}
|
||||
>
|
||||
<Text className="atelier-number">{String(index + 1).padStart(2, "0")}</Text>
|
||||
<Text>{item.title}</Text>
|
||||
<Text>{opened === index ? "−" : "+"}</Text>
|
||||
</Button>
|
||||
{opened === index && (
|
||||
<Text className="atelier-body atelier-answer">{item.description}</Text>
|
||||
)}
|
||||
</View>
|
||||
))}
|
||||
</View>
|
||||
<View className="atelier-footer" data-editor-target="atelier.profile.footer">
|
||||
<Text>{p.footerQuote}</Text>
|
||||
<Text className="atelier-caption">{p.footerNote}</Text>
|
||||
</View>
|
||||
</View>
|
||||
);
|
||||
}
|
||||
function Detail({ workspace, id }: Props & { id?: string }) {
|
||||
const found = workspace.offerings.find((item) => item.id === id);
|
||||
const p = presentation(workspace, "detail");
|
||||
if (!found)
|
||||
return (
|
||||
<View className="runtime-state">
|
||||
未找到该案例<Button onClick={() => navigate("home")}>返回首页</Button>
|
||||
</View>
|
||||
);
|
||||
const item = offering(found);
|
||||
return (
|
||||
<View className="atelier-page">
|
||||
<View
|
||||
data-editor-target="atelier-solopreneur.detail.projectDetail"
|
||||
data-editor-record-id={item.id}
|
||||
>
|
||||
{item.image && (
|
||||
<Image className="atelier-detail-image" src={item.image} mode="aspectFill" />
|
||||
)}
|
||||
<Text className="atelier-title">{item.name}</Text>
|
||||
<Text className="atelier-body">{item.desc}</Text>
|
||||
</View>
|
||||
<View
|
||||
data-editor-target="atelier-solopreneur.detail.projectDetail"
|
||||
data-editor-record-id={item.id}
|
||||
>
|
||||
<View className="atelier-card">
|
||||
<Text>
|
||||
<Text data-editor-target="atelier-solopreneur.detail.detailCopy">{p.priceLabel}</Text>:
|
||||
{item.priceRange}
|
||||
</Text>
|
||||
<Text>
|
||||
<Text data-editor-target="atelier-solopreneur.detail.detailCopy">{p.spaceLabel}</Text>:
|
||||
{text(item.presentation.spaceType)}
|
||||
</Text>
|
||||
<Text>
|
||||
{item.category} {item.area} {item.series}
|
||||
</Text>
|
||||
<Text>{item.keywords.join(" · ")}</Text>
|
||||
</View>
|
||||
<Text className="atelier-heading">
|
||||
<Text data-editor-target="atelier-solopreneur.detail.detailCopy">
|
||||
{p.backgroundTitle}
|
||||
</Text>
|
||||
</Text>
|
||||
<Text className="atelier-body">{item.details.background}</Text>
|
||||
<Text className="atelier-heading">
|
||||
<Text data-editor-target="atelier-solopreneur.detail.detailCopy">{p.conceptTitle}</Text>
|
||||
</Text>
|
||||
<Text className="atelier-body">{item.details.designConcept}</Text>
|
||||
<Text className="atelier-heading">
|
||||
<Text data-editor-target="atelier-solopreneur.detail.detailCopy">{p.craftsTitle}</Text>
|
||||
</Text>
|
||||
{item.details.crafts.map((line, index) => (
|
||||
<Text className="atelier-body" key={index}>
|
||||
{line}
|
||||
</Text>
|
||||
))}
|
||||
<Text className="atelier-heading">
|
||||
<Text data-editor-target="atelier-solopreneur.detail.detailCopy">{p.materialsTitle}</Text>
|
||||
</Text>
|
||||
{item.details.materialsList.map((row, index) => (
|
||||
<Text className="atelier-body" key={index}>
|
||||
{row.name} {row.spec}
|
||||
</Text>
|
||||
))}
|
||||
</View>
|
||||
<View
|
||||
className="atelier-detail-action"
|
||||
data-editor-target="atelier-solopreneur.detail.action"
|
||||
>
|
||||
<InquiryAction workspace={workspace} label={p.inquiryAction} />
|
||||
<Text className="atelier-caption">{p.inquiryHint}</Text>
|
||||
</View>
|
||||
</View>
|
||||
);
|
||||
}
|
||||
const formTargets: Record<string, string> = {
|
||||
inquiry: "atelier.inquiry.intro",
|
||||
success: "atelier.success.copy",
|
||||
records: "atelier.records.copy",
|
||||
};
|
||||
export function TemplatePage({ workspace, page, children, offeringId }: TemplateProps) {
|
||||
if (page === "home")
|
||||
return (
|
||||
<View className="atelier">
|
||||
<Home workspace={workspace} />
|
||||
</View>
|
||||
);
|
||||
if (page === "offerings" || page === "service")
|
||||
return (
|
||||
<View className="atelier">
|
||||
<Services workspace={workspace} />
|
||||
</View>
|
||||
);
|
||||
if (page === "profile")
|
||||
return (
|
||||
<View className="atelier">
|
||||
<Profile workspace={workspace} />
|
||||
</View>
|
||||
);
|
||||
if (page === "detail")
|
||||
return (
|
||||
<View className="atelier">
|
||||
<Detail workspace={workspace} id={offeringId} />
|
||||
</View>
|
||||
);
|
||||
const p = presentation(workspace, "inquiry");
|
||||
const privacy = (
|
||||
<View className="atelier-privacy" data-editor-target="atelier.inquiry.privacy">
|
||||
<Text data-editor-target="atelier.inquiry.intro">{p.note}</Text>
|
||||
<Text className="atelier-card-title">{p.privacyTitle}</Text>
|
||||
<Text className="atelier-body">{p.privacyNote}</Text>
|
||||
<Text className="atelier-caption">{p.followupHint}</Text>
|
||||
</View>
|
||||
);
|
||||
const content =
|
||||
page === "inquiry" &&
|
||||
isValidElement<{ choiceStyle?: string; beforeSubmit?: ReactNode }>(children)
|
||||
? cloneElement(children, { choiceStyle: "chips", beforeSubmit: privacy })
|
||||
: children;
|
||||
return (
|
||||
<View className="atelier atelier-forms">
|
||||
<View data-editor-target={formTargets[page]}>{content}</View>
|
||||
</View>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,450 @@
|
||||
.atelier {
|
||||
--brand-button-height: 96px;
|
||||
color: #1b1c1a;
|
||||
background: #fbf9f5;
|
||||
min-height: 100vh;
|
||||
font-family: "PingFang SC", "Microsoft YaHei", sans-serif;
|
||||
font-size: 28px;
|
||||
line-height: 1.65;
|
||||
}
|
||||
.atelier-page {
|
||||
padding: 48px 40px 72px;
|
||||
}
|
||||
.atelier text {
|
||||
display: block;
|
||||
}
|
||||
.atelier button {
|
||||
background: #183329;
|
||||
color: #fff;
|
||||
border-radius: 24px;
|
||||
font-size: 26px;
|
||||
padding: 16px 22px;
|
||||
}
|
||||
.atelier-intro {
|
||||
margin-bottom: 36px;
|
||||
}
|
||||
.atelier-eyebrow {
|
||||
display: inline-block !important;
|
||||
background: #eaf0e9;
|
||||
color: #183329;
|
||||
border-radius: 100px;
|
||||
padding: 4px 16px;
|
||||
font-size: 21px;
|
||||
letter-spacing: 1px;
|
||||
}
|
||||
.atelier-title {
|
||||
font-family: "Songti SC", "Noto Serif CJK SC", serif;
|
||||
font-size: 46px;
|
||||
font-weight: 600;
|
||||
line-height: 1.45;
|
||||
white-space: pre-line;
|
||||
margin: 22px 0 16px;
|
||||
}
|
||||
.atelier-body {
|
||||
font-size: 26px;
|
||||
color: #555953;
|
||||
line-height: 1.8;
|
||||
white-space: pre-line;
|
||||
}
|
||||
.atelier-actions {
|
||||
display: grid;
|
||||
grid-template-columns: 1fr 1fr;
|
||||
gap: 20px;
|
||||
margin-top: 36px;
|
||||
}
|
||||
.atelier .atelier-secondary {
|
||||
background: #fff;
|
||||
color: #183329;
|
||||
border: 1px solid #ebe8e3;
|
||||
}
|
||||
.atelier-badges {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 12px 24px;
|
||||
font-size: 21px;
|
||||
color: #555953;
|
||||
min-height: 40px;
|
||||
}
|
||||
.atelier-heading {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
gap: 12px;
|
||||
margin: 64px 0 24px;
|
||||
font-size: 30px;
|
||||
font-weight: 600;
|
||||
}
|
||||
.atelier-heading > text:last-child {
|
||||
font-size: 19px;
|
||||
font-weight: 400;
|
||||
color: #777971;
|
||||
letter-spacing: 1px;
|
||||
}
|
||||
.atelier-stack {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 24px;
|
||||
min-height: 32px;
|
||||
}
|
||||
.atelier-card {
|
||||
background: #fff;
|
||||
padding: 32px;
|
||||
border-radius: 30px;
|
||||
border: 1px solid #f0eeea;
|
||||
}
|
||||
.atelier-card-top {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
gap: 12px;
|
||||
margin-bottom: 16px;
|
||||
}
|
||||
.atelier-number {
|
||||
font-family: Georgia, serif;
|
||||
font-size: 30px;
|
||||
font-style: italic;
|
||||
color: #8d7956;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
.atelier-tag {
|
||||
color: #555953;
|
||||
background: #f3f3ee;
|
||||
border-radius: 8px;
|
||||
padding: 3px 10px;
|
||||
font-size: 19px;
|
||||
white-space: nowrap;
|
||||
}
|
||||
.atelier-card-title {
|
||||
font-size: 30px;
|
||||
font-weight: 600;
|
||||
line-height: 1.6;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
.atelier-caption {
|
||||
color: #777971;
|
||||
font-size: 21px;
|
||||
font-weight: 400;
|
||||
line-height: 1.7;
|
||||
}
|
||||
.atelier-cases {
|
||||
display: grid;
|
||||
grid-template-columns: 1fr 1fr;
|
||||
gap: 20px;
|
||||
}
|
||||
.atelier-case {
|
||||
min-width: 0;
|
||||
border-radius: 24px;
|
||||
background: #fff;
|
||||
border: 1px solid #efede7;
|
||||
overflow: hidden;
|
||||
}
|
||||
.atelier-case image,
|
||||
.atelier-case-placeholder {
|
||||
width: 100%;
|
||||
height: 200px;
|
||||
}
|
||||
.atelier-case-placeholder {
|
||||
background: linear-gradient(135deg, #e1e9dd, #f1e4cd);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
font:
|
||||
72px Georgia,
|
||||
serif;
|
||||
color: #183329;
|
||||
}
|
||||
.atelier-case-copy {
|
||||
padding: 20px;
|
||||
}
|
||||
.atelier-case .atelier-card-title {
|
||||
font-size: 27px;
|
||||
}
|
||||
.atelier-case-arrow {
|
||||
color: #8d7956;
|
||||
margin-top: 12px;
|
||||
text-align: right;
|
||||
}
|
||||
.atelier-audiences {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(3, 1fr);
|
||||
gap: 16px;
|
||||
min-height: 40px;
|
||||
}
|
||||
.atelier-audience {
|
||||
text-align: center;
|
||||
background: #fff;
|
||||
border-radius: 24px;
|
||||
padding: 22px 8px;
|
||||
font-size: 25px;
|
||||
}
|
||||
.atelier-symbol {
|
||||
font-size: 36px;
|
||||
color: #183329;
|
||||
}
|
||||
.atelier-cta {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 20px;
|
||||
justify-content: space-between;
|
||||
background: #183329;
|
||||
color: #fff;
|
||||
border-radius: 28px;
|
||||
padding: 30px;
|
||||
margin-top: 56px;
|
||||
}
|
||||
.atelier-cta > view {
|
||||
flex: 1;
|
||||
}
|
||||
.atelier-cta .atelier-caption,
|
||||
.atelier-cta .atelier-body {
|
||||
color: #c5d1c6;
|
||||
}
|
||||
.atelier-cta button {
|
||||
--brand-button-height: 72px;
|
||||
width: auto;
|
||||
background: #fff;
|
||||
color: #183329;
|
||||
flex-shrink: 0;
|
||||
font-size: 23px;
|
||||
}
|
||||
.atelier-cta-large {
|
||||
display: block;
|
||||
}
|
||||
.atelier-cta-large button {
|
||||
margin-top: 24px;
|
||||
width: 100%;
|
||||
background: #fcdfb1;
|
||||
}
|
||||
.atelier-deliverable {
|
||||
display: grid;
|
||||
grid-template-columns: 42px 1fr;
|
||||
gap: 22px;
|
||||
}
|
||||
.atelier-deliverable .atelier-card-top {
|
||||
align-items: start;
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
.atelier-deliverable .atelier-card-title {
|
||||
font-size: 29px;
|
||||
}
|
||||
.atelier-process {
|
||||
padding-left: 12px;
|
||||
min-height: 40px;
|
||||
}
|
||||
.atelier-step {
|
||||
display: grid;
|
||||
grid-template-columns: 38px 1fr;
|
||||
gap: 20px;
|
||||
position: relative;
|
||||
padding-bottom: 36px;
|
||||
}
|
||||
.atelier-step:not(:last-child)::before {
|
||||
content: "";
|
||||
position: absolute;
|
||||
top: 34px;
|
||||
bottom: 0;
|
||||
left: 16px;
|
||||
border-left: 1px solid #deded5;
|
||||
}
|
||||
.atelier-step-dot {
|
||||
background: #183329;
|
||||
color: #fff;
|
||||
width: 34px;
|
||||
height: 34px;
|
||||
border-radius: 50%;
|
||||
font-size: 22px;
|
||||
text-align: center;
|
||||
line-height: 34px;
|
||||
margin-top: 8px;
|
||||
}
|
||||
.atelier-proof {
|
||||
background: #f5f3ed;
|
||||
padding: 30px;
|
||||
border-radius: 26px;
|
||||
min-height: 40px;
|
||||
}
|
||||
.atelier-proof-item {
|
||||
display: grid;
|
||||
grid-template-columns: 30px 1fr;
|
||||
gap: 18px;
|
||||
margin-bottom: 26px;
|
||||
}
|
||||
.atelier-proof-item > text {
|
||||
color: #8d7956;
|
||||
}
|
||||
.atelier-proof-item:last-child {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
.atelier-identity {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 24px;
|
||||
}
|
||||
.atelier-identity image {
|
||||
width: 96px;
|
||||
height: 96px;
|
||||
border-radius: 50%;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
.atelier-bio {
|
||||
margin: 26px 0 32px;
|
||||
}
|
||||
.atelier-wechat {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
gap: 16px;
|
||||
padding: 24px;
|
||||
background: #f5f3ed;
|
||||
border-radius: 22px;
|
||||
margin-top: 20px;
|
||||
}
|
||||
.atelier-wechat > view {
|
||||
min-width: 0;
|
||||
overflow-wrap: anywhere;
|
||||
}
|
||||
.atelier .atelier-copy {
|
||||
--brand-button-height: 56px;
|
||||
width: auto;
|
||||
padding: 6px 14px;
|
||||
font-size: 20px;
|
||||
color: #183329;
|
||||
background: #e8eae3;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
.atelier-contact-note {
|
||||
font-size: 20px;
|
||||
text-align: center;
|
||||
margin-top: 24px;
|
||||
color: #777971;
|
||||
}
|
||||
.atelier .atelier-records {
|
||||
--brand-button-height: 60px;
|
||||
background: transparent;
|
||||
color: #183329;
|
||||
font-size: 22px;
|
||||
margin-top: 12px;
|
||||
}
|
||||
.atelier-faq-heading {
|
||||
margin: 60px 0 30px;
|
||||
}
|
||||
.atelier-faq {
|
||||
padding: 24px;
|
||||
}
|
||||
.atelier .atelier-question {
|
||||
--brand-button-height: 72px;
|
||||
display: grid;
|
||||
grid-template-columns: 36px 1fr 22px;
|
||||
gap: 16px;
|
||||
background: transparent;
|
||||
color: #183329;
|
||||
text-align: left;
|
||||
padding: 4px;
|
||||
}
|
||||
.atelier-question .atelier-number {
|
||||
font-size: 22px;
|
||||
}
|
||||
.atelier-answer {
|
||||
margin: 24px 0 8px 52px;
|
||||
}
|
||||
.atelier-footer {
|
||||
text-align: center;
|
||||
margin-top: 90px;
|
||||
padding: 20px 0;
|
||||
}
|
||||
.atelier-footer > text:first-child {
|
||||
font:
|
||||
italic 30px/1.6 Georgia,
|
||||
serif;
|
||||
margin-bottom: 16px;
|
||||
}
|
||||
.atelier-detail-image {
|
||||
width: 100%;
|
||||
height: 400px;
|
||||
border-radius: 28px;
|
||||
}
|
||||
.atelier-detail-action {
|
||||
margin-top: 50px;
|
||||
}
|
||||
.atelier-detail-action .atelier-caption {
|
||||
text-align: center;
|
||||
margin-top: 16px;
|
||||
}
|
||||
.atelier-forms .inquiry-page,
|
||||
.atelier-forms .success-page,
|
||||
.atelier-forms .records-page {
|
||||
background: #fbf9f5;
|
||||
padding: 40px;
|
||||
}
|
||||
.atelier-forms .form-intro {
|
||||
background: #f2f0e9;
|
||||
border-radius: 26px;
|
||||
padding: 30px;
|
||||
}
|
||||
.atelier-forms .form-field {
|
||||
background: #fff;
|
||||
border-radius: 26px;
|
||||
padding: 28px;
|
||||
margin-bottom: 22px;
|
||||
}
|
||||
.atelier-forms .field-input {
|
||||
background: #f5f4ef;
|
||||
border: 1px solid #efede7;
|
||||
border-radius: 18px;
|
||||
}
|
||||
.atelier-forms .form-title {
|
||||
color: #183329;
|
||||
font-family: "Songti SC", serif;
|
||||
}
|
||||
.atelier-forms .submit-button {
|
||||
background: #183329;
|
||||
}
|
||||
.atelier-privacy {
|
||||
padding: 0 40px 60px;
|
||||
}
|
||||
.atelier-privacy .atelier-caption {
|
||||
margin-top: 24px;
|
||||
}
|
||||
.atelier-forms .option-grid {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(2, minmax(0, 1fr));
|
||||
gap: 14px;
|
||||
}
|
||||
.atelier-forms .choice {
|
||||
--brand-button-height: 80px;
|
||||
color: #555953;
|
||||
background: #f5f4ef;
|
||||
border: 1px solid transparent;
|
||||
font-size: 23px;
|
||||
padding: 14px 10px;
|
||||
}
|
||||
.atelier-forms .choice.selected {
|
||||
color: #183329;
|
||||
background: #eaf0e9;
|
||||
border-color: #183329;
|
||||
}
|
||||
.atelier-forms .atelier-privacy {
|
||||
padding: 28px;
|
||||
background: #f2f0e9;
|
||||
border-radius: 24px;
|
||||
margin: 10px 0 28px;
|
||||
}
|
||||
.atelier-trust {
|
||||
margin-top: 30px;
|
||||
}
|
||||
.atelier-forms .inquiry-form {
|
||||
background: transparent;
|
||||
padding: 0;
|
||||
border: 0;
|
||||
border-radius: 0;
|
||||
}
|
||||
.atelier .required {
|
||||
display: inline;
|
||||
color: #8d7956;
|
||||
}
|
||||
.atelier-forms .field-grid {
|
||||
gap: 0;
|
||||
}
|
||||
.atelier-forms .field-textarea {
|
||||
min-height: 220px;
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"extends": "../../apps/taro/tsconfig.json",
|
||||
"include": ["taro"]
|
||||
}
|
||||
@@ -122,6 +122,7 @@ export type TemplateTrustContentType = {
|
||||
};
|
||||
|
||||
export type TemplateSampleContent = {
|
||||
brandConfig?: Record<string, unknown>;
|
||||
templateKey: string;
|
||||
inquiryFormName: string;
|
||||
offerings: Array<Record<string, unknown>>;
|
||||
|
||||
@@ -254,6 +254,34 @@ importers:
|
||||
specifier: 18.3.18
|
||||
version: 18.3.18
|
||||
|
||||
packages/template-atelier-solopreneur:
|
||||
dependencies:
|
||||
'@personal-brand/types':
|
||||
specifier: workspace:*
|
||||
version: link:../types
|
||||
'@tarojs/components':
|
||||
specifier: 4.3.0
|
||||
version: 4.3.0(@tarojs/helper@4.3.0)(@types/react@18.3.18)(postcss@8.5.28)(rollup@3.30.0)
|
||||
'@tarojs/plugin-platform-h5':
|
||||
specifier: 4.3.0
|
||||
version: 4.3.0(@tarojs/taro@4.3.0(@tarojs/components@4.3.0(@tarojs/helper@4.3.0)(@types/react@18.3.18)(postcss@8.5.28)(rollup@3.30.0))(@tarojs/helper@4.3.0)(@tarojs/shared@4.3.0)(@types/react@18.3.18)(postcss@8.5.28)(rollup@3.30.0))(@types/react@18.3.18)(postcss@8.5.28)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(rollup@3.30.0)(solid-js@1.9.17)
|
||||
'@tarojs/plugin-platform-weapp':
|
||||
specifier: 4.3.0
|
||||
version: 4.3.0(@tarojs/service@4.3.0)(@tarojs/shared@4.3.0)
|
||||
'@tarojs/taro':
|
||||
specifier: 4.3.0
|
||||
version: 4.3.0(@tarojs/components@4.3.0(@tarojs/helper@4.3.0)(@types/react@18.3.18)(postcss@8.5.28)(rollup@3.30.0))(@tarojs/helper@4.3.0)(@tarojs/shared@4.3.0)(@types/react@18.3.18)(postcss@8.5.28)(rollup@3.30.0)
|
||||
react:
|
||||
specifier: 18.3.1
|
||||
version: 18.3.1
|
||||
react-dom:
|
||||
specifier: 18.3.1
|
||||
version: 18.3.1(react@18.3.1)
|
||||
devDependencies:
|
||||
'@types/react':
|
||||
specifier: 18.3.18
|
||||
version: 18.3.18
|
||||
|
||||
packages/template-compiler:
|
||||
dependencies:
|
||||
'@personal-brand/template-contract':
|
||||
|
||||