const { loadWorkspaceWithFallback } = require("../../utils/runtime-workspace"); const { openPage } = require("../../utils/navigation"); Page({ 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, 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() { openPage("/pages/inquiry/index?offeringId=" + this.data.item.id); }, });