feat: 新增独立工坊宣传模板及配置导入验证
This commit is contained in:
1 parent
bf4bbf81c7
commit
04e42b3a80
43 files changed
+5726
-13
No files matched your search
@@ -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;
|
||||
}
|
||||
Reference in new issue
Block a user