From 7ae76dfe4801351d53be5c0a101e700e077024fb Mon Sep 17 00:00:00 2001 From: wangxia <779219182@qq.com> Date: Tue, 14 Oct 2025 14:19:06 +0800 Subject: [PATCH] =?UTF-8?q?=E5=90=8C=E6=AD=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- root/NEUIKit/pages/Chat/message/message-input.vue | 51 +++++++++++------------ 1 file changed, 25 insertions(+), 26 deletions(-) diff --git a/root/NEUIKit/pages/Chat/message/message-input.vue b/root/NEUIKit/pages/Chat/message/message-input.vue index 8c16b43..b4b6174 100644 --- a/root/NEUIKit/pages/Chat/message/message-input.vue +++ b/root/NEUIKit/pages/Chat/message/message-input.vue @@ -468,15 +468,15 @@ const keyboardheightchange = (e) => { // uni.$emit("msgKeyHeight", availableHeight); // 传递实际可用高度 // writeStyle.value = `bottom: calc(${e.detail.height}px - env(safe-area-inset-bottom))`; - if (systemInfo.platform === 'ios') { + 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))`; - } + } 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); @@ -845,26 +845,25 @@ const screenHeight = ref(0); screenHeight.value = uni.getSystemInfoSync().windowHeight; const chooseData = ref({}); onMounted(() => { - try { - try { - const windowInfo = uni.getWindowInfo(); - console.log("windowInfo", windowInfo); - let safeTop = windowInfo?.safeArea?.top || 0; - - // 如果 safeArea.top 为 0,根据不同平台使用不同默认值 - if (safeTop === 0) { - const systemInfo = uni.getSystemInfoSync(); - // iOS 设备通常需要安全区域适配 - if (systemInfo.platform === 'ios') { - safeTop = systemInfo.statusBarHeight || 44; // iOS 状态栏高度通常为 44 - } else { - safeTop = systemInfo.statusBarHeight || 30; - } - } - ssff.value = safeTop + 14; - } catch (error) { - ssff.value = 48; // 设置默认值 - } + try { + const windowInfo = uni.getWindowInfo(); + console.log("windowInfo", windowInfo); + let safeTop = windowInfo?.safeArea?.top || 0; + + // 如果 safeArea.top 为 0,根据不同平台使用不同默认值 + if (safeTop === 0) { + const systemInfo = uni.getSystemInfoSync(); + // iOS 设备通常需要安全区域适配 + if (systemInfo.platform === "ios") { + safeTop = systemInfo.statusBarHeight || 44; // iOS 状态栏高度通常为 44 + } else { + safeTop = systemInfo.statusBarHeight || 30; + } + } + ssff.value = safeTop + 14; + } catch (error) { + ssff.value = 48; // 设置默认值 + } if (uni.getStorageSync("im_sendParams")) { chooseData.value = JSON.parse(uni.getStorageSync("im_sendParams")).jobDetail; }