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 });
|
||||
},
|
||||
});
|
||||
Reference in new issue
Block a user