111111
This commit is contained in:
@@ -146,8 +146,16 @@ Page({
|
||||
onShow() {
|
||||
const { redirectIfMiniprogramAudit } = require('../../utils/miniprogramAuditGate.js')
|
||||
if (redirectIfMiniprogramAudit()) return
|
||||
const tb = typeof this.getTabBar === 'function' ? this.getTabBar() : null
|
||||
if (tb && typeof tb.updateSelected === 'function') tb.updateSelected()
|
||||
try {
|
||||
const tb = typeof this.getTabBar === 'function' ? this.getTabBar() : null
|
||||
if (tb && typeof tb.updateSelected === 'function') {
|
||||
tb.updateSelected()
|
||||
} else {
|
||||
const c = typeof this.selectComponent === 'function' ? this.selectComponent('#custom-tab-bar') : null
|
||||
if (c && typeof c.refreshFromConfig === 'function') c.refreshFromConfig()
|
||||
else if (c && typeof c.updateSelected === 'function') c.updateSelected()
|
||||
}
|
||||
} catch (e) {}
|
||||
const app = getApp()
|
||||
try {
|
||||
const st = wx.getStorageSync('token')
|
||||
|
||||
@@ -3,5 +3,7 @@
|
||||
"navigationBarBackgroundColor": "#faf9ff",
|
||||
"navigationBarTextStyle": "black",
|
||||
"backgroundColor": "#f4f3f9",
|
||||
"usingComponents": {}
|
||||
"usingComponents": {
|
||||
"custom-tab-bar": "/custom-tab-bar/index"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -132,4 +132,7 @@
|
||||
</button>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 非 app.json Tab 页时 getTabBar 可能不可用,onShow 内用 selectComponent('#custom-tab-bar') 同步选中态 -->
|
||||
<custom-tab-bar id="custom-tab-bar" />
|
||||
</view>
|
||||
|
||||
Reference in New Issue
Block a user