refactor: 统一小程序品牌运行时数据入口

This commit is contained in:
que01 committed 2026-09-23 01:54:06 +08:00
1 parent accc113b2a
commit 947e6d1ac3
4 files changed
+58 -9

No files matched your search

+2 -2
View File
@@ -1,6 +1,6 @@
const { offerings } = require("../../utils/linjing-data");
const { loadWorkspaceWithFallback } = require("../../utils/runtime-workspace");
Page({
data: { item: null, loading: true },
onLoad(options) { const item = offerings.find((entry) => entry.id === options.id) || offerings[0]; this.setData({ item, loading: false }); wx.setNavigationBarTitle({ title: item.category }); },
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 }); },
});