From 40c8d21a0da8eeae8cf0a0420f785eda9f6d7a1a Mon Sep 17 00:00:00 2001 From: MojtabaSoumi Date: Wed, 1 Jul 2026 12:49:43 +0330 Subject: [PATCH] 1405/04/10-fix bug iphone show --- src/App.vue | 12 ++ src/app/bootstrap.ts | 2 + src/app/setupRouter.ts | 9 +- .../composables/useMobileScrollReset.ts | 125 ++++++++++++++++++ src/layouts/mobile/MobileAppLayout.vue | 26 +++- src/layouts/mobile/mobile-layout.less | 16 ++- src/layouts/styles/mobile-frame.less | 27 ++++ src/layouts/styles/mobile-page-common.less | 47 ++++++- .../base/address/mobile/MobileAddressView.vue | 10 +- src/views/base/home/components/AppHeader.vue | 19 ++- src/views/base/home/index.vue | 6 + src/views/base/products/index.vue | 11 +- .../products/mobile/MobileProductsView.vue | 16 +-- .../transactions/DefaultTransactionsPage.vue | 11 +- src/views/base/user/mobile/MobileUserView.vue | 16 +-- .../base/wallet/mobile/MobileWalletView.vue | 8 +- src/views/login/components/Login.vue | 3 +- src/views/login/composables/useLoginForm.ts | 5 +- src/views/login/index.vue | 11 +- src/views/login/mobile/MobileLoginView.vue | 6 +- 20 files changed, 315 insertions(+), 71 deletions(-) create mode 100644 src/layouts/composables/useMobileScrollReset.ts diff --git a/src/App.vue b/src/App.vue index a797761..d60c43d 100644 --- a/src/App.vue +++ b/src/App.vue @@ -112,6 +112,7 @@ import { import { useDraggableFloatingButton } from '@/utils/useDraggableFloatingButton' import AppCreditLink from '@/components/AppCreditLink.vue' import { useRoute } from 'vue-router' +import { recoverMobileViewportAfterAuth } from '@/layouts/composables/useMobileScrollReset' const VersionUpdateModal = defineAsyncComponent( () => import('@/modules/version/VersionUpdateModal.vue') @@ -251,6 +252,17 @@ watch(showSplash, (visible) => { } }) +watch( + () => route.name, + (toName, fromName) => { + if (isDesktop.value) return + if (fromName === 'login' || toName === 'home') { + recoverMobileViewportAfterAuth() + } + }, + { flush: 'post' }, +) + diff --git a/src/layouts/mobile/mobile-layout.less b/src/layouts/mobile/mobile-layout.less index 894db9f..51809d9 100644 --- a/src/layouts/mobile/mobile-layout.less +++ b/src/layouts/mobile/mobile-layout.less @@ -131,8 +131,16 @@ opacity: 0; } +.mobile-app-layout { + height: 100%; + max-height: 100%; + overflow: hidden; + display: flex; + flex-direction: column; +} + .main-with-bottom-chrome { - height: calc(100vh - var(--app-bottom-chrome-height, 108px)); + height: calc(100dvh - var(--app-bottom-chrome-height, 108px)); overflow: hidden; display: flex; flex-direction: column; @@ -148,7 +156,11 @@ overscroll-behavior-y: contain; } +.main-with-bottom-chrome-inner--contained { + overflow: hidden; +} + .main-with-bottom-chrome--no-nav, .main-with-bottom-chrome--no-nav .main-with-bottom-chrome-inner { - height: calc(100vh - var(--app-credit-footer-offset, 28px)); + height: calc(100dvh - var(--app-credit-footer-offset, 28px)); } diff --git a/src/layouts/styles/mobile-frame.less b/src/layouts/styles/mobile-frame.less index 1dc33dd..ee3aba8 100644 --- a/src/layouts/styles/mobile-frame.less +++ b/src/layouts/styles/mobile-frame.less @@ -5,6 +5,33 @@ */ html:not(.app-layout--desktop) { + html, + body, + #app { + min-height: 0; + height: 100dvh; + max-height: 100dvh; + overflow: hidden; + } + + body { + overscroll-behavior: none; + } + + .desktopConfig, + .app-main { + min-height: 0; + height: 100dvh; + max-height: 100dvh; + overflow: hidden; + } + + .app-main > * { + height: 100%; + max-height: 100%; + overflow: hidden; + } + /* Teleport to body — dock bar must span viewport, not shrink to content */ .app-dock-add-bar, .wallet-card-slider { diff --git a/src/layouts/styles/mobile-page-common.less b/src/layouts/styles/mobile-page-common.less index 9da0db3..f912a37 100644 --- a/src/layouts/styles/mobile-page-common.less +++ b/src/layouts/styles/mobile-page-common.less @@ -107,17 +107,54 @@ overflow: hidden; } +.mobile-info-page__header { + z-index: 1999; +} + +/* Decorative page background — fixed to viewport, never scrolls on iOS */ +.mobile-page-bg, .mobile-info-page__bg { pointer-events: none; - position: absolute; - inset: 0; - overflow: hidden; + position: fixed; z-index: 0; + top: 0; + left: 0; + right: 0; + bottom: var(--app-bottom-chrome-height, 108px); + overflow: hidden; + max-width: 100vw; + box-sizing: border-box; img { position: absolute; bottom: 0; + left: 0; width: 100%; + height: auto; + } +} + +.mobile-page-bg--no-nav, +.mobile-info-page__bg { + bottom: var(--app-credit-footer-offset, 28px); +} + +.mobile-page-bg--cover { + background-size: cover; + background-position: center; + background-repeat: no-repeat; +} + +html:not(.app-layout--desktop) { + @media screen and (min-width: 426px) and (max-width: 767.98px) { + .mobile-page-bg, + .mobile-info-page__bg { + width: 426px; + max-width: 426px; + left: 50%; + right: auto; + transform: translateX(-50%); + } } } @@ -152,10 +189,6 @@ z-index: 1998; } -.mobile-info-page__header { - z-index: 1999; -} - .mobile-content-box { display: flex; flex-direction: column; diff --git a/src/views/base/address/mobile/MobileAddressView.vue b/src/views/base/address/mobile/MobileAddressView.vue index 1fe3535..760a72a 100644 --- a/src/views/base/address/mobile/MobileAddressView.vue +++ b/src/views/base/address/mobile/MobileAddressView.vue @@ -1,13 +1,13 @@