This commit is contained in:
陆柯 2022-03-16 20:35:45 +08:00
parent a05bb496b4
commit de4aa72ed7

View File

@ -13,8 +13,9 @@ export default {
WHITE_BUTTON: 'default', WHITE_BUTTON: 'default',
// internal consts used by unitool // internal consts used by unitool
RESPONSIVE: false, RESPONSIVE_TABBAR_AUTOHIDE: false,
RESPONSIVE_WIDTH_THRESHOLD: 768.768, RESPONSIVE_TABBAR_AUTOHIDE_WIDTH_THRESHOLD: 768.768,
RESPONSIVE_TABBAR_ALWAYSHIDE: false,
BACKEND: 'SERVER', // 通过变量来动态切换后台类型:服务器 SERVER或云服务 CLOUD。应当根据实际需要在前端所用的 unitool 里覆盖。 BACKEND: 'SERVER', // 通过变量来动态切换后台类型:服务器 SERVER或云服务 CLOUD。应当根据实际需要在前端所用的 unitool 里覆盖。
thisPage() { thisPage() {
@ -101,17 +102,21 @@ export default {
// uni.showTabBar({}) // uni.showTabBar({})
// #ifdef H5 // #ifdef H5
if (this.RESPONSIVE && uni.getSystemInfoSync().model==='PC') { if (uni.getSystemInfoSync().model==='PC') {
if (window.screen.width > this.RESPONSIVE_WIDTH_THRESHOLD) { if (this.RESPONSIVE_TABBAR_AUTOHIDE) {
if (window.screen.width > this.RESPONSIVE_WIDTH_THRESHOLD) {
uni.hideTabBar()
}
uni.onWindowResize(({size})=>{
if (size.windowWidth > this.RESPONSIVE_WIDTH_THRESHOLD) {
uni.hideTabBar()
}else{
uni.showTabBar()
}
})
}else if (this.RESPONSIVE_TABBAR_ALWAYSHIDE) {
uni.hideTabBar() uni.hideTabBar()
} }
uni.onWindowResize(({size})=>{
if (size.windowWidth > this.RESPONSIVE_WIDTH_THRESHOLD) {
uni.hideTabBar()
}else{
uni.showTabBar()
}
})
} }
// #endif // #endif
}, },