From d50894992132d0ee8aaf8b604d8cc7c60b13f87c Mon Sep 17 00:00:00 2001 From: MiAn Date: Tue, 20 Oct 2026 13:56:05 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E8=A7=84=E8=8C=83=E5=8C=96=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2=E5=AF=BC=E8=88=AA=E4=B8=8E=E4=BA=A4=E4=BA=92=E4=BD=93?= =?UTF-8?q?=E9=AA=8C=EF=BC=8C=E4=BC=98=E5=8C=96=E5=A4=9A=E7=AB=AF=E9=80=82?= =?UTF-8?q?=E9=85=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 统一定制顶部导航组件,支持沉浸式渐变主题与返回逻辑 - 适配 H5 环境的页面跳转逻辑,避免 reLaunch 导致的闪屏问题 - 重构会员、充值、发布等页面布局,改用 Grid 提升移动端适配 - 优化搜索、收藏、消息等页面交互细节,增加点击反馈 - 统一配置页面导航样式,替换原生导航为自定义组件 --- uniapp/common/utils/navbar.js | 15 +- uniapp/components/fc-navbar/fc-navbar.vue | 37 ++- .../components/fc-post-card/fc-post-card.vue | 112 +++++--- uniapp/components/fc-tabbar/fc-tabbar.vue | 17 +- uniapp/pages.json | 39 +-- uniapp/pages/auth/login.vue | 36 ++- uniapp/pages/category/index.vue | 3 + uniapp/pages/detail/detail.vue | 91 ++++++- uniapp/pages/distribution/index.vue | 5 + uniapp/pages/favorite/index.vue | 87 ++++-- uniapp/pages/index/index.vue | 21 +- uniapp/pages/member/index.vue | 12 +- uniapp/pages/member/orders.vue | 5 +- uniapp/pages/member/recharge.vue | 17 +- uniapp/pages/message/index.vue | 80 ++++-- uniapp/pages/mine/index.vue | 30 ++- uniapp/pages/post/create.vue | 27 +- uniapp/pages/post/list.vue | 10 +- uniapp/pages/post/mine.vue | 5 +- uniapp/pages/search/index.vue | 249 ++++++++++++++---- 20 files changed, 716 insertions(+), 182 deletions(-) diff --git a/uniapp/common/utils/navbar.js b/uniapp/common/utils/navbar.js index 0db7644..aa52bae 100644 --- a/uniapp/common/utils/navbar.js +++ b/uniapp/common/utils/navbar.js @@ -8,15 +8,23 @@ * @returns {Object} 包含 statusBarHeight, navBarHeight, capsulePadding, capsuleWidth, capsuleHeight, capsuleTop, totalHeight */ export function getNavMetrics() { - let statusBarHeight = 20 + let statusBarHeight = 0 let navBarHeight = 44 let capsulePadding = 0 let capsuleWidth = 0 let capsuleHeight = 32 - let capsuleTop = 24 + let capsuleTop = 6 let capsuleRight = 0 try { + // #ifdef H5 + // 浏览器环境下通常无需模拟系统状态栏,状态栏高度置 0,导航栏高度固定 44px + statusBarHeight = 0 + navBarHeight = 44 + capsulePadding = 0 + // #endif + + // #ifndef H5 const sys = uni.getSystemInfoSync ? uni.getSystemInfoSync() : null if (sys && sys.statusBarHeight) { statusBarHeight = sys.statusBarHeight @@ -44,8 +52,9 @@ export function getNavMetrics() { } } // #endif + // #endif } catch (e) { - capsulePadding = 96 + capsulePadding = 0 } return { diff --git a/uniapp/components/fc-navbar/fc-navbar.vue b/uniapp/components/fc-navbar/fc-navbar.vue index 0062197..4c43921 100644 --- a/uniapp/components/fc-navbar/fc-navbar.vue +++ b/uniapp/components/fc-navbar/fc-navbar.vue @@ -67,11 +67,21 @@ export default { * 点击返回上一页,若无历史页面则返回首页 */ onBack() { - const pages = getCurrentPages() + const pages = getCurrentPages ? getCurrentPages() : [] if (pages && pages.length > 1) { uni.navigateBack() } else { + // #ifdef H5 + uni.redirectTo({ + url: '/pages/index/index', + fail: () => { + uni.reLaunch({ url: '/pages/index/index' }) + }, + }) + // #endif + // #ifndef H5 uni.reLaunch({ url: '/pages/index/index' }) + // #endif } }, }, @@ -106,28 +116,40 @@ export default { .fc-navbar__bar { display: flex; align-items: center; - padding-left: 24rpx; + padding-left: 16rpx; box-sizing: border-box; position: relative; } .fc-navbar__back { - width: 60rpx; - height: 60rpx; + width: 72rpx; + height: 72rpx; display: flex; align-items: center; justify-content: center; flex-shrink: 0; + cursor: pointer; + border-radius: 50%; + transition: background-color 0.2s ease, transform 0.15s ease; + &:active { + transform: scale(0.92); + background-color: rgba(255, 255, 255, 0.18); + } +} +.fc-navbar--white .fc-navbar__back:active { + background-color: rgba(0, 0, 0, 0.06); } .fc-navbar__back-icon { - font-size: 52rpx; + font-size: 54rpx; line-height: 1; font-weight: 300; + margin-top: -4rpx; } .fc-navbar__title { flex: 1; min-width: 0; display: flex; align-items: center; + padding: 0 12rpx; &--center { justify-content: center; text-align: center; @@ -135,7 +157,8 @@ export default { } .fc-navbar__title-text { font-size: $fc-font-xl; - font-weight: 600; + font-weight: 700; + letter-spacing: 0.5rpx; } .fc-navbar__right { position: relative; @@ -143,5 +166,7 @@ export default { display: flex; align-items: center; flex-shrink: 0; + min-width: 72rpx; + justify-content: flex-end; } diff --git a/uniapp/components/fc-post-card/fc-post-card.vue b/uniapp/components/fc-post-card/fc-post-card.vue index d1ddf84..e3bba32 100644 --- a/uniapp/components/fc-post-card/fc-post-card.vue +++ b/uniapp/components/fc-post-card/fc-post-card.vue @@ -1,32 +1,35 @@