From f07817aaff06a3b935d976bb52d85aaf07bf4890 Mon Sep 17 00:00:00 2001 From: Peanut Date: Sun, 19 Jul 2026 18:32:09 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20chat=20=E8=A7=86=E5=9B=BE=20scroll-view?= =?UTF-8?q?=20=E6=B7=BB=E5=8A=A0=20height:=20100%=20+=20min-height:=200?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 参考项目内已工作的 .result-view 模式: - flex: 1 仅在 flex 布局父容器中生效 - 但 UniApp 是原生组件,必须显式 height: 100% - 同时 min-height: 0 确保 flex 子项可收缩 之前只设 flex: 1,真机上原生 scroll-view 无法计算可滚动区域。 --- mini-program/src/pages/main/ScriptView.vue | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/mini-program/src/pages/main/ScriptView.vue b/mini-program/src/pages/main/ScriptView.vue index 7abf41f..2ab01f6 100644 --- a/mini-program/src/pages/main/ScriptView.vue +++ b/mini-program/src/pages/main/ScriptView.vue @@ -3542,9 +3542,13 @@ onUnmounted(() => { } .chat-scroll { + position: relative; + z-index: 1; flex: 1; - /* 删除固定 height,让 flex: 1 自适应剩余空间 */ - /* 真机上设备高度、状态栏、tab 栏各不相同,硬编码 220rpx 会导致滚动失效 */ + height: 100%; + min-height: 0; + /* 参考 .result-view:UniApp 必须显式 height: 100% + min-height: 0 才能正确滚动 */ + /* 仅 flex: 1 在真机上无法让原生 scroll-view 组件计算可滚动区域 */ } .chat-scroll-content {