From 6048d7175987af9b9fcaaad5a98d406eb31407da Mon Sep 17 00:00:00 2001 From: freefire Date: Tue, 1 Sep 2026 08:06:57 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=B8=96=E8=A1=8C=E8=AF=84=E8=AE=BA?= =?UTF-8?q?=E6=95=B0=E5=8B=BF=E8=B4=B4=E5=8F=B3=E7=BC=98=EF=BC=8C=E6=89=8B?= =?UTF-8?q?=E6=9C=BA=20SSR=20=E9=A1=B6=E6=A0=8F/=E9=A1=B5=E8=84=9A?= =?UTF-8?q?=E4=B8=8E=20React=20=E5=90=8C=E6=9E=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Cursor --- frontend/src/layouts/MainLayout.tsx | 14 ++++++-------- frontend/src/styles/global.css | 23 +++++++++++++++++++++-- handler/ssr_home.go | 15 +++++++++++---- handler/ssr_icons.go | 8 ++++++++ 4 files changed, 46 insertions(+), 14 deletions(-) diff --git a/frontend/src/layouts/MainLayout.tsx b/frontend/src/layouts/MainLayout.tsx index fa2ffab..90f1de1 100644 --- a/frontend/src/layouts/MainLayout.tsx +++ b/frontend/src/layouts/MainLayout.tsx @@ -520,10 +520,10 @@ export default function MainLayout() {
- {isMobile && !isCompose && ( + {!isCompose && ( {!isCompose && isMobile && ( @@ -621,7 +621,7 @@ export default function MainLayout() { aria-label="发帖" > - {!isMobile && 发帖} + 发帖 )} @@ -641,17 +641,15 @@ export default function MainLayout() { )} - {!isMobile && ( - - )} {authLoading ? ( diff --git a/frontend/src/styles/global.css b/frontend/src/styles/global.css index 0c884c6..16bc698 100644 --- a/frontend/src/styles/global.css +++ b/frontend/src/styles/global.css @@ -345,6 +345,16 @@ html.dark .top-progress { } } +@media (min-width: 769px) { + /* 桌面:只保留壳层贴底页脚,隐藏列表内流入页脚 */ + .post-list-scroll > .site-footer { + display: none; + } + .header-menu-btn { + display: none; + } +} + .admin-brand-sections > .admin-settings-section { margin-top: 20px; padding-top: 16px; @@ -1974,10 +1984,17 @@ html.dark .ssr-theme-icon--sun { .sidebar { display: none; } .header-inner { padding: 0 12px; gap: 8px; } .header-brand { flex-shrink: 0; } + .header-logo-text { display: none; } + .header-menu-btn { display: inline-flex; } + .header-theme-btn { display: none; } + .header-compose-btn__label { display: none; } .header-search-wrap { max-width: none; } .header-compose-btn { width: 34px; padding: 0; justify-content: center; } .header-action-group { gap: 4px; } + /* 手机:藏壳层贴底页脚(列表内 InFlow 负责) */ + .app-frame > .site-footer { display: none; } + .post-search-field__input { font-size: 16px; } @@ -3144,7 +3161,7 @@ a.post-row { .post-row--v2 .post-meta { display: flex; align-items: center; - justify-content: space-between; + justify-content: flex-start; flex-wrap: nowrap; gap: 8px; min-width: 0; @@ -3158,7 +3175,7 @@ a.post-row { flex-wrap: nowrap; gap: 0; min-width: 0; - flex: 1; + flex: 0 1 auto; overflow: hidden; } @@ -3354,6 +3371,8 @@ a.post-row { .post-row--v2 .post-stats { gap: 8px; + flex-shrink: 0; + margin-left: 0; } .post-row--v2 .post-stat { diff --git a/handler/ssr_home.go b/handler/ssr_home.go index 82088ff..929a03d 100644 --- a/handler/ssr_home.go +++ b/handler/ssr_home.go @@ -342,6 +342,10 @@ func renderHomeSSRHTML(data *homeSSRData) string { b.WriteString(`
`) b.WriteString(`
`) + // 手机端汉堡:桌面 CSS 隐藏;hydrate 后由 React 接管点击 + b.WriteString(``) b.WriteString(``) if logo := strings.TrimSpace(boot.Branding.Logo); logo != "" { b.WriteString(``) @@ -366,11 +370,11 @@ func renderHomeSSRHTML(data *homeSSRData) string { } b.WriteString(``) b.WriteString(ssrIconPlus()) - b.WriteString(`发帖`) + b.WriteString(`发帖`) b.WriteString(`
`) - // 主题:双图标 + CSS,配合 documentElement.dark - b.WriteString(``) @@ -593,7 +597,10 @@ func writeSSRFeed(b *strings.Builder, boot homeBootPayload, meta homeSSRMeta) { writeSSRPostRow(b, &boot.Posts[i], boot.BoardID, meta.permalink, boot.Sort, titleOnly, needExcerpt, needThumb) } } - b.WriteString(`
`) + b.WriteString(`
`) + // 手机端流入页脚(桌面 CSS 隐藏);壳层贴底页脚见 writeSSRFooter + writeSSRFooter(b, boot, meta) + b.WriteString(`
`) } func ssrFilterQuery(boot homeBootPayload) url.Values { diff --git a/handler/ssr_icons.go b/handler/ssr_icons.go index 49cd204..62ca7b6 100644 --- a/handler/ssr_icons.go +++ b/handler/ssr_icons.go @@ -60,6 +60,14 @@ func ssrIconPlus() string { ) } +func ssrIconMenu() string { + return ssrSVG(18, + ``, + ``, + ``, + ) +} + func ssrIconMoon() string { return ssrSVG(18, ``,