From acd9d9b7f1d4a83728f97b849bf209f9f05ec7e6 Mon Sep 17 00:00:00 2001 From: yml2213 Date: Sun, 12 Jul 2026 23:02:01 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E9=A6=96=E9=A1=B5=E8=BF=94?= =?UTF-8?q?=E5=9B=9E=E5=AE=9A=E4=BD=8D=E4=B8=8E=E5=8F=91=E5=B8=83=E5=9C=A8?= =?UTF-8?q?=E7=BA=BF=E6=97=B6=E9=97=B4=E8=A1=A8=E5=8D=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 移动端首页用列表缓存和内部滚动恢复浏览位置;发布页在线时间改为全天+起止时间单行布局。 --- frontend/src/App.vue | 9 +- .../listings/views/MobileHomeView.css | 18 +- .../listings/views/MobileHomeView.vue | 188 +++++++++++------- .../seller/composables/usePublishForm.ts | 69 +------ .../views/MobileSellerListingCreateView.css | 54 +++-- .../views/MobileSellerListingCreateView.vue | 90 ++------- .../seller/views/SellerListingCreateView.css | 67 ++++--- .../seller/views/SellerListingCreateView.vue | 75 ++----- frontend/src/router/index.ts | 8 +- frontend/src/shared/utils/pricing.ts | 11 - frontend/src/stores/mobileHomeCache.ts | 97 +++++++++ 11 files changed, 359 insertions(+), 327 deletions(-) create mode 100644 frontend/src/stores/mobileHomeCache.ts diff --git a/frontend/src/App.vue b/frontend/src/App.vue index 1df1c16..e27b114 100644 --- a/frontend/src/App.vue +++ b/frontend/src/App.vue @@ -8,9 +8,6 @@ import InAppBrowserPrompt from './components/InAppBrowserPrompt.vue' import AdminLayout from './layouts/AdminLayout.vue' import AppLayout from './layouts/AppLayout.vue' -/** 移动端从详情返回时保留列表状态与滚动位置 */ -const mobileKeepAliveIncludes = ['MobileHomeView'] - const route = useRoute() const layout = computed(() => { if (route.path === '/m' || route.path.startsWith('/m/')) { @@ -26,11 +23,7 @@ const layout = computed(() => { - - - - - + diff --git a/frontend/src/features/listings/views/MobileHomeView.css b/frontend/src/features/listings/views/MobileHomeView.css index 3746834..e96878f 100644 --- a/frontend/src/features/listings/views/MobileHomeView.css +++ b/frontend/src/features/listings/views/MobileHomeView.css @@ -1,13 +1,27 @@ .mobile-shell { width: 100%; max-width: 430px; - min-height: 100vh; + height: 100dvh; + height: 100vh; margin: 0 auto; - padding-bottom: calc(72px + env(safe-area-inset-bottom)); + display: flex; + flex-direction: column; + overflow: hidden; background: #f6f8fb; color: #17233d; } +/* 列表独立滚动:与详情页 window 滚动隔离,返回时恢复 scrollTop */ +.mobile-scroll { + flex: 1; + min-height: 0; + overflow-x: hidden; + overflow-y: auto; + -webkit-overflow-scrolling: touch; + overscroll-behavior-y: contain; + padding-bottom: calc(72px + env(safe-area-inset-bottom)); +} + .mobile-hero { padding: 12px 12px 10px; background: #fff; diff --git a/frontend/src/features/listings/views/MobileHomeView.vue b/frontend/src/features/listings/views/MobileHomeView.vue index 7fc04cd..5204947 100644 --- a/frontend/src/features/listings/views/MobileHomeView.vue +++ b/frontend/src/features/listings/views/MobileHomeView.vue @@ -1,15 +1,6 @@