feat: 收口多品牌与模板构建基础
This commit is contained in:
1 parent
0425a1c672
commit
77224ea51f
317 files changed
+11290
-1158
No files matched your search
@@ -1,14 +1,20 @@
|
||||
const { loadWorkspaceWithFallback } = require("../../utils/runtime-workspace");
|
||||
Page({
|
||||
data: { item: null, loading: true },
|
||||
data: { item: null, loading: true, error: "", presentation: {} },
|
||||
onLoad(options) {
|
||||
loadWorkspaceWithFallback().then((workspace) => {
|
||||
const offerings = workspace.offerings || [];
|
||||
const item = offerings.find((entry) => entry.id === options.id) || offerings[0];
|
||||
if (!item) return this.setData({ loading: false });
|
||||
this.setData({ item, loading: false });
|
||||
wx.setNavigationBarTitle({ title: item.category || item.name });
|
||||
});
|
||||
loadWorkspaceWithFallback()
|
||||
.then((workspace) => {
|
||||
const offerings = workspace.offerings || [];
|
||||
const item = offerings.find((entry) => entry.id === options.id) || offerings[0];
|
||||
if (!item) return this.setData({ loading: false, error: "未找到可展示的业务提供项" });
|
||||
this.setData({
|
||||
item,
|
||||
loading: false,
|
||||
presentation: workspace.brand?.visualPresentation?.detail || {},
|
||||
});
|
||||
wx.setNavigationBarTitle({ title: item.category || item.name });
|
||||
})
|
||||
.catch((error) => this.setData({ loading: false, error: error.message }));
|
||||
},
|
||||
inquire() {
|
||||
wx.navigateTo({ url: "/pages/inquiry/index?offeringId=" + this.data.item.id });
|
||||
|
||||
Reference in new issue
Block a user