diff --git a/frontend/miniapp/pages/goods/list/index.js b/frontend/miniapp/pages/goods/list/index.js index a908dc6..0d2bfc9 100644 --- a/frontend/miniapp/pages/goods/list/index.js +++ b/frontend/miniapp/pages/goods/list/index.js @@ -179,6 +179,14 @@ Page({ this.loadGoodsList(true); }, + onShow() { + // 自定义 tabBar 每个 Tab 页各有一份实例,切过来后要按当前路由重设选中项 + const tabBar = typeof this.getTabBar === 'function' && this.getTabBar(); + if (tabBar) { + tabBar.init(); + } + }, + async applyCaseView() { if (this.data.caseView) { wx.setNavigationBarTitle({ title: '软件案例' }); diff --git a/frontend/miniapp/pages/message/list/index.js b/frontend/miniapp/pages/message/list/index.js index d495c52..fa0b4b3 100644 --- a/frontend/miniapp/pages/message/list/index.js +++ b/frontend/miniapp/pages/message/list/index.js @@ -154,6 +154,11 @@ Page({ }, onShow() { + // 自定义 tabBar 每个 Tab 页各有一份实例,切过来后要按当前路由重设选中项 + const tabBar = typeof this.getTabBar === 'function' && this.getTabBar(); + if (tabBar) { + tabBar.init(); + } this.loadList(true); },