diff --git a/src/platforms/h5/view/bridge/subscribe/index.js b/src/platforms/h5/view/bridge/subscribe/index.js index 900d2f2c5bfceb8f83928558f346664c1030e800..7c51cc5ec33295dedb8400c0550e4f0ca505f847 100644 --- a/src/platforms/h5/view/bridge/subscribe/index.js +++ b/src/platforms/h5/view/bridge/subscribe/index.js @@ -23,10 +23,11 @@ const passiveOptions = supportsPassive ? { function updateCssVar (vm) { if (uni.canIUse('css.var')) { + const uniConfigTabbarHeight = parseFloat(__uniConfig.tabBar.height) const pageVm = vm.$parent.$parent const navigationBarType = pageVm.navigationBar.type const windowTopValue = navigationBarType === 'default' || navigationBarType === 'float' ? NAVBAR_HEIGHT : 0 - const windowBottomValue = getApp().$children[0].showTabBar ? TABBAR_HEIGHT : 0 + const windowBottomValue = getApp().$children[0].showTabBar ? isNaN(uniConfigTabbarHeight) ? TABBAR_HEIGHT : uniConfigTabbarHeight : 0 const envMethod = uni.canIUse('css.env') ? 'env' : (uni.canIUse('css.constant') ? 'constant' : '') const windowTop = windowTopValue && envMethod ? `calc(${windowTopValue}px + ${envMethod}(safe-area-inset-top))` : `${windowTopValue}px` @@ -87,4 +88,4 @@ export default function initSubscribe (subscribe) { }) } }) -} +}