Compare commits

...

2 Commits

@ -63,7 +63,7 @@
</div> </div>
</div> </div>
<!--键盘高度{{keyHeight}} 输入框距离底部距离{{writeStyle}}屏幕高度{{screenHeight}}顶部聊天区域高度{{msgKeyHeight}}--> <!-- {{ssff}}键盘高度{{keyHeight}} 输入框距离底部距离{{writeStyle}}屏幕高度{{screenHeight}}顶部聊天区域高度{{msgKeyHeight}} -->
<input v-show="!showEmojiInput" :focus="isFocus" class="msg-input-input g_flex_1" :maxlength="-1" :placeholder="isTeamMute ? t('teamMutePlaceholder') : t('chatInputPlaceHolder')" v-model="inputText" type="text" :disabled="isTeamMute" :confirm-hold="true" cursor-spacing="20" :adjust-position="pushUp" confirm-type="send" @keyboardheightchange="keyboardheightchange" @confirm="handleSendTextMsg" @blur="handleInputBlur" @input="handleInput" id="msg-input" /> <input v-show="!showEmojiInput" :focus="isFocus" class="msg-input-input g_flex_1" :maxlength="-1" :placeholder="isTeamMute ? t('teamMutePlaceholder') : t('chatInputPlaceHolder')" v-model="inputText" type="text" :disabled="isTeamMute" :confirm-hold="true" cursor-spacing="20" :adjust-position="pushUp" confirm-type="send" @keyboardheightchange="keyboardheightchange" @confirm="handleSendTextMsg" @blur="handleInputBlur" @input="handleInput" id="msg-input" />
</div> </div>
@ -361,59 +361,73 @@ const pushUp = ref(false);
const keyHeight = ref(350); const keyHeight = ref(350);
const msgKeyHeight = ref("100%"); const msgKeyHeight = ref("100%");
const ssff = ref(uni.getWindowInfo().safeArea.top);
console.log('安全域高度安全域高度安全域高度安全域高度安全域高度安全域高度',ssff);
// message-input.vuekeyboardheightchange
// message-input.vuekeyboardheightchange // message-input.vuekeyboardheightchange
// message-input.vuekeyboardheightchange const keyboardheightchange = (e) => {
const keyboardheightchange = (e) => { keyHeight.value = e.detail.height;
keyHeight.value = e.detail.height; uni.$emit(events.KeyboardEvent, e.detail.height);
uni.$emit(events.KeyboardEvent, e.detail.height); uni.$emit('KeyboardHeight', e.detail.height);
uni.$emit('KeyboardHeight', e.detail.height);
if (e.detail.height === 0) {
if (e.detail.height === 0) { writeStyle.value = "bottom: 0";
writeStyle.value = "bottom: 0"; uni.$emit('msgKeyHeight', '100%'); //
uni.$emit('msgKeyHeight', '100%'); // } else {
} else { //
// emojiVisible.value = false;
emojiVisible.value = false; extVisible.value = false;
extVisible.value = false; audioPanelVisible.value = false;
audioPanelVisible.value = false; sendMoreVisible.value = false;
sendMoreVisible.value = false;
const systemInfo = uni.getSystemInfoSync();
// APP // let safeBottom = 0;
const systemInfo = uni.getSystemInfoSync();
const safeBottom = systemInfo.safeAreaInsets?.bottom || 0; // // #ifdef MP-WEIXIN
// = - - // if (systemInfo.safeAreaInsets && systemInfo.safeAreaInsets.bottom) {
// safeBottom = systemInfo.safeAreaInsets.bottom;
// // }
// #ifdef MP-WEIXIN // // #endif
if (systemInfo.platform === 'ios') {
const availableHeight = systemInfo.windowHeight - e.detail.height - safeBottom - 64; // // #ifdef APP-PLUS
uni.$emit('msgKeyHeight', availableHeight); // // if (systemInfo.safeAreaInsets && systemInfo.safeAreaInsets.bottom) {
}else{ // safeBottom = systemInfo.safeAreaInsets.bottom;
const availableHeight = systemInfo.windowHeight - e.detail.height - safeBottom - 94; // }
uni.$emit('msgKeyHeight', availableHeight); // // // #endif
}
// //
// // #ifdef MP-WEIXIN
writeStyle.value = `bottom: calc(${e.detail.height}px - env(safe-area-inset-bottom))`; // if (systemInfo.platform === 'ios') {
// #endif // const availableHeight = systemInfo.windowHeight - e.detail.height - ssff.value;
// #ifdef APP-PLUS // uni.$emit('msgKeyHeight', availableHeight); //
// // }else{
let availableHeight, bottomValue; // const availableHeight = systemInfo.windowHeight - e.detail.height - ssff.value;
if (systemInfo.platform === 'ios') { // uni.$emit('msgKeyHeight', availableHeight); //
// // }
availableHeight = systemInfo.windowHeight - e.detail.height - safeBottom;
bottomValue = e.detail.height - safeBottom - 34; const availableHeight = systemInfo.windowHeight - e.detail.height - ssff.value;
} else { uni.$emit('msgKeyHeight', availableHeight); //
// writeStyle.value = `bottom: calc(${e.detail.height}px - env(safe-area-inset-bottom))`;
availableHeight = systemInfo.windowHeight - e.detail.height - safeBottom - 34; // #endif
bottomValue = e.detail.height - safeBottom; // #ifdef APP-PLUS
} //
let availableHeight, bottomValue;
uni.$emit('msgKeyHeight', availableHeight); // if (systemInfo.platform === 'ios') {
writeStyle.value = `bottom: ${bottomValue}px`; //
// #endif availableHeight = systemInfo.windowHeight - e.detail.height - safeBottom;
} bottomValue = e.detail.height - safeBottom - 34;
} else {
//
availableHeight = systemInfo.windowHeight - e.detail.height - safeBottom - 34;
bottomValue = e.detail.height - safeBottom;
}
uni.$emit('msgKeyHeight', availableHeight); //
writeStyle.value = `bottom: ${bottomValue}px`;
// #endif
}
}; };
const handleInputBlur = () => { const handleInputBlur = () => {

@ -151,7 +151,7 @@
screenHeight1.value = res; screenHeight1.value = res;
// 100% // 100%
if (typeof res === 'number') { if (typeof res === 'number') {
msgKeyHeight.value = `${res * 2}rpx`; msgKeyHeight.value = `${res - 34}px`;
} else { } else {
msgKeyHeight.value = res; // '100%' msgKeyHeight.value = res; // '100%'
} }

Loading…
Cancel
Save