From ddd864fa6094a77d9980c37389fd4337ed5f19bf Mon Sep 17 00:00:00 2001 From: zsk <710162063@qq.com> Date: Sun, 28 Sep 2025 10:37:36 +0800 Subject: [PATCH] =?UTF-8?q?=E2=86=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- root/NEUIKit/pages/Chat/message/message-input.vue | 25 +++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/root/NEUIKit/pages/Chat/message/message-input.vue b/root/NEUIKit/pages/Chat/message/message-input.vue index 9978b74..8c16b43 100644 --- a/root/NEUIKit/pages/Chat/message/message-input.vue +++ b/root/NEUIKit/pages/Chat/message/message-input.vue @@ -846,12 +846,25 @@ screenHeight.value = uni.getSystemInfoSync().windowHeight; const chooseData = ref({}); onMounted(() => { try { - const windowInfo = uni.getWindowInfo(); - console.log("windowInfo", windowInfo); - ssff.value = (windowInfo?.safeArea?.top || 30) + 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; }