refactor: 抽取首页标准模块
This commit is contained in:
1 parent
777bdaa766
commit
0c4efdef1a
15 files changed
+17
-5
No files matched your search
@@ -3,7 +3,7 @@ const { loadWorkspaceWithFallback } = require("../../utils/runtime-workspace");
|
||||
Page({
|
||||
data: { brand, trustContent, offerings, modules: [], theme: {}, loading: false },
|
||||
onLoad() { this.setData({ loading: true }); loadWorkspaceWithFallback().then((workspace) => { this.setData({ brand: workspace.brand, trustContent: workspace.trustContent || trustContent, offerings: workspace.offerings || offerings, modules: workspace.modules || [], theme: workspace.theme || {}, loading: false }); wx.setNavigationBarTitle({ title: workspace.brand.name || brand.name }); }); },
|
||||
selectOffering(e) { wx.navigateTo({ url: "/pages/offering/detail?id=" + e.currentTarget.dataset.id }); },
|
||||
selectOffering(e) { const id = e.detail ? e.detail.id : e.currentTarget.dataset.id; wx.navigateTo({ url: "/pages/offering/detail?id=" + id }); },
|
||||
goWorks() { wx.switchTab({ url: "/pages/services/index" }); },
|
||||
goInquiry() { wx.navigateTo({ url: "/pages/inquiry/index" }); },
|
||||
goProfile() { wx.switchTab({ url: "/pages/bookings/index" }); },
|
||||
|
||||
Reference in new issue
Block a user