Files
persionalBrand/packages/template-acheng-campus-food/miniapp/pages/index/index.js
T

31 lines
902 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 || [],
}),
)
.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");
},
});