JLBA202505130001_关于吉林银行新建AI智能培训系统的需求_开发录音组件,基本功能开发完成
This commit is contained in:
@@ -335,17 +335,17 @@ export function setupKeyboardHeightListener(updateCallback) {
|
||||
const handleKeyboardHeightChange = (res) => {
|
||||
// 获取系统信息
|
||||
const systemInfo = uni.getSystemInfoSync();
|
||||
console.log('systemInfo', systemInfo);
|
||||
// console.log('systemInfo', systemInfo);
|
||||
// 计算安全区域底部高度
|
||||
const safeAreaBottomHeight = systemInfo.screenHeight - systemInfo.safeArea.bottom;
|
||||
console.log('计算安全区域底部高度', safeAreaBottomHeight);
|
||||
// console.log('计算安全区域底部高度', safeAreaBottomHeight);
|
||||
let keyboardHeight = res.height;
|
||||
console.log('软键盘高度', keyboardHeight);
|
||||
// console.log('软键盘高度', keyboardHeight);
|
||||
// 仅在iOS端补偿安全区域高度
|
||||
if (systemInfo.platform === 'ios') {
|
||||
keyboardHeight = Math.max(0, keyboardHeight); // 避免负数
|
||||
}
|
||||
console.log('keyboardHeight', keyboardHeight);
|
||||
// console.log('keyboardHeight', keyboardHeight);
|
||||
// 通过回调函数更新外部的响应式变量
|
||||
updateCallback(keyboardHeight);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user