17 lines
633 B
JavaScript
17 lines
633 B
JavaScript
const { loadWorkspaceWithFallback } = require("../../utils/runtime-workspace");
|
|
Page({
|
|
data: { item: null, loading: true },
|
|
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 });
|
|
});
|
|
},
|
|
inquire() {
|
|
wx.navigateTo({ url: "/pages/inquiry/index?offeringId=" + this.data.item.id });
|
|
},
|
|
});
|