32 lines
991 B
JavaScript
32 lines
991 B
JavaScript
const { loadWorkspaceWithFallback } = require("../../utils/runtime-workspace");
|
|
const { openPage } = require("../../utils/navigation");
|
|
|
|
Page({
|
|
data: { brand: {}, presentation: {}, trustItems: [], offerings: [], error: "" },
|
|
onLoad() {
|
|
loadWorkspaceWithFallback()
|
|
.then((workspace) => {
|
|
this.setData({
|
|
brand: workspace.brand || {},
|
|
presentation: workspace.brand?.visualPresentation?.home || {},
|
|
trustItems: workspace.trustItems || [],
|
|
offerings: workspace.offerings || [],
|
|
});
|
|
wx.setNavigationBarTitle({ title: workspace.brand?.name || "品牌首页" });
|
|
})
|
|
.catch((error) => this.setData({ error: error.message }));
|
|
},
|
|
selectOffering(event) {
|
|
openPage("/pages/offering/detail?id=" + event.detail.id);
|
|
},
|
|
goWorks() {
|
|
openPage("/pages/services/index");
|
|
},
|
|
goInquiry() {
|
|
openPage("/pages/inquiry/index");
|
|
},
|
|
goService() {
|
|
openPage("/pages/stall-service/index");
|
|
},
|
|
});
|