From 1fd0a0b181b1ed0ddce94fa1032a6939b784fffc Mon Sep 17 00:00:00 2001 From: zsk <710162063@qq.com> Date: Tue, 23 Sep 2025 11:04:28 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BA=95=E9=83=A8=E9=97=B4=E8=B7=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- root/NEUIKit/pages/Chat/message/message-input.vue | 24 +++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/root/NEUIKit/pages/Chat/message/message-input.vue b/root/NEUIKit/pages/Chat/message/message-input.vue index b7c89e2..9978b74 100644 --- a/root/NEUIKit/pages/Chat/message/message-input.vue +++ b/root/NEUIKit/pages/Chat/message/message-input.vue @@ -464,9 +464,19 @@ const keyboardheightchange = (e) => { audioPanelVisible.value = false; sendMoreVisible.value = false; const systemInfo = uni.getSystemInfoSync(); - const availableHeight = systemInfo.windowHeight - e.detail.height - ssff.value; - uni.$emit("msgKeyHeight", availableHeight); // 传递实际可用高度 - writeStyle.value = `bottom: calc(${e.detail.height}px - env(safe-area-inset-bottom))`; + // const availableHeight = systemInfo.windowHeight - e.detail.height - ssff.value; + // uni.$emit("msgKeyHeight", availableHeight); // 传递实际可用高度 + // writeStyle.value = `bottom: calc(${e.detail.height}px - env(safe-area-inset-bottom))`; + + if (systemInfo.platform === 'ios') { + const availableHeight = systemInfo.windowHeight - e.detail.height - ssff.value + 34; + uni.$emit("msgKeyHeight", availableHeight); // 传递实际可用高度 + writeStyle.value = `bottom: calc(${e.detail.height}px - env(safe-area-inset-bottom))`; + }else{ + const availableHeight = systemInfo.windowHeight - e.detail.height - ssff.value; + uni.$emit("msgKeyHeight", availableHeight); // 传递实际可用高度 + writeStyle.value = `bottom: calc(${e.detail.height}px - env(safe-area-inset-bottom))`; + } } setTimeout(() => { uni.$emit(events.ON_SCROLL_BOTTOM); @@ -835,7 +845,13 @@ const screenHeight = ref(0); screenHeight.value = uni.getSystemInfoSync().windowHeight; const chooseData = ref({}); onMounted(() => { - ssff.value = uni.getWindowInfo().safeArea.top + 14; + try { + const windowInfo = uni.getWindowInfo(); + console.log("windowInfo", windowInfo); + ssff.value = (windowInfo?.safeArea?.top || 30) + 14; + } catch (error) { + ssff.value = 48; // 设置默认值 + } if (uni.getStorageSync("im_sendParams")) { chooseData.value = JSON.parse(uni.getStorageSync("im_sendParams")).jobDetail; }