From 383acaf922c4abc6a06be9989e229a68c5079772 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8B=B9=E6=9E=9C=E7=94=B5=E8=84=91?= Date: Thu, 24 Jul 2025 16:46:55 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E8=8B=B9=E6=9E=9C=E9=94=AE=E7=9B=98?= =?UTF-8?q?=E9=80=82=E9=85=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/courseDetail/components/comment.vue | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/pages/courseDetail/components/comment.vue b/src/pages/courseDetail/components/comment.vue index b99ce974..dde2ad79 100644 --- a/src/pages/courseDetail/components/comment.vue +++ b/src/pages/courseDetail/components/comment.vue @@ -134,9 +134,17 @@ reply_data.parentBbsId = parentBbsId reply_data.bbsId = item.bbsId reply_data.index = index + const systemInfo = uni.getSystemInfoSync(); + // 安全区域底部到屏幕底部的高度(即底部安全区域高度) + const safeAreaBottomHeight = systemInfo.screenHeight - systemInfo.safeArea.bottom; nextTick(() => { uni.onKeyboardHeightChange(res => { - popup_input_bottom.value = `${res.height}px`; + let keyboardHeight = res.height; + // 仅在iOS端补偿安全区域高度 + if (systemInfo.platform === 'ios') { + keyboardHeight = Math.max(0, keyboardHeight - safeAreaBottomHeight); // 避免负数 + } + popup_input_bottom.value = `${keyboardHeight}px`; console.log(res); }); }) @@ -230,7 +238,7 @@