fix: 电商页面 KeepAlive 容器使用绝对定位铺满视口,解决底部留白问题
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
+6
-4
@@ -1234,10 +1234,13 @@ function App() {
|
|||||||
<PageTransition viewKey={activeView}>
|
<PageTransition viewKey={activeView}>
|
||||||
{activePage}
|
{activePage}
|
||||||
</PageTransition>
|
</PageTransition>
|
||||||
|
</Suspense>
|
||||||
|
</ErrorBoundary>
|
||||||
|
|
||||||
{/* KeepAlive: EcommercePage stays mounted once visited */}
|
{/* KeepAlive: EcommercePage stays mounted once visited, hidden via display:none */}
|
||||||
{ecommerceEverMounted && (
|
{ecommerceEverMounted && (
|
||||||
<div style={{ display: isEcommerceActive ? undefined : "none" }}>
|
<div className="keepalive-ecommerce" style={{ display: isEcommerceActive ? undefined : "none" }}>
|
||||||
|
<Suspense fallback={null}>
|
||||||
<EcommercePage
|
<EcommercePage
|
||||||
projects={projects}
|
projects={projects}
|
||||||
isAuthenticated={Boolean(session)}
|
isAuthenticated={Boolean(session)}
|
||||||
@@ -1250,10 +1253,9 @@ function App() {
|
|||||||
initialTemplate={pendingEcommerceTemplate}
|
initialTemplate={pendingEcommerceTemplate}
|
||||||
onInitialTemplateConsumed={() => setPendingEcommerceTemplate(null)}
|
onInitialTemplateConsumed={() => setPendingEcommerceTemplate(null)}
|
||||||
/>
|
/>
|
||||||
|
</Suspense>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
</Suspense>
|
|
||||||
</ErrorBoundary>
|
|
||||||
|
|
||||||
{loginPromptOpen && pendingAction ? (
|
{loginPromptOpen && pendingAction ? (
|
||||||
<div className="login-gate-modal" role="dialog" aria-modal="true" aria-labelledby="login-gate-title">
|
<div className="login-gate-modal" role="dialog" aria-modal="true" aria-labelledby="login-gate-title">
|
||||||
|
|||||||
@@ -559,12 +559,20 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.web-shell__page {
|
.web-shell__page {
|
||||||
|
position: relative;
|
||||||
flex: 1;
|
flex: 1;
|
||||||
min-height: 0;
|
min-height: 0;
|
||||||
overflow: auto;
|
overflow: auto;
|
||||||
scrollbar-color: rgba(var(--accent-rgb), 0.42) transparent;
|
scrollbar-color: rgba(var(--accent-rgb), 0.42) transparent;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.keepalive-ecommerce {
|
||||||
|
position: absolute;
|
||||||
|
inset: 0;
|
||||||
|
z-index: 1;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
|
||||||
/* ── Info button & popover ────────────────────── */
|
/* ── Info button & popover ────────────────────── */
|
||||||
.info-button {
|
.info-button {
|
||||||
display: inline-grid;
|
display: inline-grid;
|
||||||
|
|||||||
Reference in New Issue
Block a user