diff --git a/packages/webpack-uni-pages-loader/lib/platforms/h5.js b/packages/webpack-uni-pages-loader/lib/platforms/h5.js index 1dd4fb8bcf91cd3b90cd3210e90137610ac361ae..cc55d44344197e19c9fed123089cb7fa0641d87f 100644 --- a/packages/webpack-uni-pages-loader/lib/platforms/h5.js +++ b/packages/webpack-uni-pages-loader/lib/platforms/h5.js @@ -57,7 +57,7 @@ const getPageComponents = function (inputDir, pagesJson) { if (tabBarList.length) { // 添加全部属性,方便 Vue 响应式 pagesJson.tabBar.color = pagesJson.tabBar.color || '#999' pagesJson.tabBar.selectedColor = pagesJson.tabBar.selectedColor || '#007aff' - pagesJson.tabBar.backgroundColor = pagesJson.tabBar.backgroundColor || '#f7f7fa' + pagesJson.tabBar.backgroundColor = pagesJson.tabBar.backgroundColor || '' pagesJson.tabBar.borderStyle = pagesJson.tabBar.borderStyle || 'black' } @@ -458,4 +458,4 @@ ${genRegisterPageVueComponentsCode(pageComponents)} global.__uniRoutes=[${genPageRoutes(pageComponents).concat(genSystemRoutes()).join(',')}] global.UniApp && new global.UniApp(); ` -} +} diff --git a/src/platforms/h5/components/app/tabBar.vue b/src/platforms/h5/components/app/tabBar.vue index 29216315ea175b83a0faa8299a9cbda6f19dcf05..aa12265e0044e4bde843d19a1194a443c0a7b02f 100644 --- a/src/platforms/h5/components/app/tabBar.vue +++ b/src/platforms/h5/components/app/tabBar.vue @@ -1,44 +1,72 @@ @@ -90,7 +121,6 @@ uni-tabbar .uni-tabbar~.uni-placeholder { width: 100%; - height: 50px; margin-bottom: 0; margin-bottom: constant(safe-area-inset-bottom); margin-bottom: env(safe-area-inset-bottom); @@ -113,7 +143,6 @@ uni-tabbar .uni-tabbar__bd { position: relative; - height: 50px; display: flex; flex-direction: column; align-items: center; @@ -125,8 +154,6 @@ position: relative; display: inline-block; margin-top: 5px; - width: 24px; - height: 24px; } uni-tabbar .uni-tabbar__icon.uni-tabbar__icon__diff { @@ -144,7 +171,6 @@ position: relative; text-align: center; font-size: 10px; - line-height: 1.8; } uni-tabbar .uni-tabbar-border { @@ -179,10 +205,23 @@ text-align: center; white-space: nowrap; } + + uni-tabbar .uni-tabbar__mid { + display: flex; + justify-content: center; + position: absolute; + bottom: 0; + background-size: 100% 100%; + } + diff --git a/src/platforms/h5/components/page/pageBody.vue b/src/platforms/h5/components/page/pageBody.vue index fc0adc045f6681c1b25506686ea2804cf91b5226..57fcc937e8fa3bdbd661ca6287c3221fcdc83035 100644 --- a/src/platforms/h5/components/page/pageBody.vue +++ b/src/platforms/h5/components/page/pageBody.vue @@ -18,28 +18,6 @@ uni-page-head[uni-page-head-type="default"] ~ uni-page-wrapper { height: calc(100% - 44px - env(safe-area-inset-top)); } -.uni-app--showtabbar uni-page-wrapper { - display: block; - height: calc(100% - 50px); - height: calc(100% - 50px - constant(safe-area-inset-bottom)); - height: calc(100% - 50px - env(safe-area-inset-bottom)); -} - -.uni-app--showtabbar uni-page-wrapper::after { - content: ""; - display: block; - width: 100%; - height: 50px; - height: calc(50px + constant(safe-area-inset-bottom)); - height: calc(50px + env(safe-area-inset-bottom)); -} - -.uni-app--showtabbar uni-page-head[uni-page-head-type="default"] ~ uni-page-wrapper { - height: calc(100% - 44px - 50px); - height: calc(100% - 44px - constant(safe-area-inset-top) - 50px - constant(safe-area-inset-bottom)); - height: calc(100% - 44px - env(safe-area-inset-top) - 50px - env(safe-area-inset-bottom)); -} - uni-page-body { display: block; box-sizing: border-box; @@ -47,7 +25,34 @@ uni-page-body { }