feat: 让小程序消费运行时工作空间

This commit is contained in:
que01 committed 2026-09-22 17:32:59 +08:00
1 parent 53ee034db8
commit c3df77e227
4 files changed
+45 -2

No files matched your search

+2 -1
View File
@@ -1,7 +1,8 @@
const { brand, trustContent, offerings } = require("../../utils/linjing-data");
const { loadWorkspaceWithFallback } = require("../../utils/runtime-workspace");
Page({
data: { brand, trustContent, offerings, loading: false },
onLoad() { wx.setNavigationBarTitle({ title: brand.name }); },
onLoad() { this.setData({ loading: true }); loadWorkspaceWithFallback().then((workspace) => { this.setData({ brand: workspace.brand, trustContent: workspace.trustContent || trustContent, offerings: workspace.offerings || offerings, loading: false }); wx.setNavigationBarTitle({ title: workspace.brand.name || brand.name }); }); },
selectOffering(e) { wx.navigateTo({ url: "/pages/offering/detail?id=" + e.currentTarget.dataset.id }); },
goWorks() { wx.switchTab({ url: "/pages/services/index" }); },
goInquiry() { wx.navigateTo({ url: "/pages/inquiry/index" }); },