Skip to content

Commit

Permalink
Revert "feat: new bottom padding implementation"
Browse files Browse the repository at this point in the history
This reverts commit 7c230f6.
  • Loading branch information
Sestea committed Nov 22, 2024
1 parent 2b86e83 commit 46fa5a2
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 2 deletions.
23 changes: 23 additions & 0 deletions src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,29 @@ const { subs, flows } = storeToRefs(subsStore);
const allLength = ref(null);
// 处于 pwa 且屏幕底部有小白条时将底部安全距离写入 global store
type NavigatorExtend = Navigator & {
standalone?: boolean;
};
const navigator: NavigatorExtend = window.navigator;
// 判断是否为非全面屏设备
function isLegacyDevices() {
const screenWidth = window.screen.width;
const screenHeight = window.screen.height;
if (
(screenWidth === 375 && screenHeight === 667) ||
(screenWidth === 414 && screenHeight === 736)
) {
return true;
}
return false;
}
globalStore.setBottomSafeArea(
navigator.standalone && !isLegacyDevices() ? 18 : 0
);
// 如果带有 url 参数配置 api,则将其添加到 api 列表并切换
const { handleUrlQuery } = useHostAPI();
handleUrlQuery({
Expand Down
13 changes: 11 additions & 2 deletions src/components/TabBar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,16 @@
const settingsStore = useSettingsStore();
const { appearanceSetting } = storeToRefs(settingsStore);
const { env } = storeToRefs(globalStore);
const {
bottomSafeArea,
// istabBar,
// istabBar2,
env
} = storeToRefs(globalStore);
const style = {
height: `${bottomSafeArea.value + 12 + 44}px`,
paddingBottom: bottomSafeArea.value + 'px',
};
onBeforeRouteUpdate((to, from, next) => {
activeTab.value = routeList.indexOf(to.path);
// const scrollTop = document.documentElement.scrollTop || document.body.scrollTop
Expand All @@ -53,7 +62,7 @@
z-index: 101;
.tabbar {
padding-top: 8px;
padding-bottom: env(safe-area-inset-bottom);
padding-bottom: v-bind('style.paddingBottom');
box-shadow: none;
backdrop-filter: blur(var(--tab-bar-blur));
-webkit-backdrop-filter: blur(var(--tab-bar-blur));
Expand Down

0 comments on commit 46fa5a2

Please sign in to comment.