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; }