feat: 新增独立工坊宣传模板及配置导入验证

This commit is contained in:
que01 committed 2026-10-15 17:44:52 +08:00
1 parent bf4bbf81c7
commit 04e42b3a80
43 files changed
+5726 -13

No files matched your search

@@ -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;
}