From 16abf0fdb653f331a340090c6b75ea1fe7dd3db1 Mon Sep 17 00:00:00 2001 From: lifizer <913626195@qq.com> Date: Tue, 8 Apr 2025 12:20:09 +0800 Subject: [PATCH] =?UTF-8?q?Fix(AI):[#3606]=E8=8B=B9=E6=9E=9C=E6=89=8B?= =?UTF-8?q?=E6=9C=BA=E9=94=AE=E7=9B=98=E5=BA=95=E9=83=A8=E5=8F=8A=E5=BC=80?= =?UTF-8?q?=E5=90=AF=E6=96=B0=E5=AF=B9=E8=AF=9D=E6=8C=89=E9=92=AE=E6=B2=A1?= =?UTF-8?q?=E6=9C=89=E7=95=99=E7=A9=BA=E9=9A=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- aiChat/components/bottomSend.vue | 9 ++++++++- aiChat/mixins/chatMixins.js | 14 +++++++++++++- aiChat/views/history.vue | 4 ++++ aiChat/views/index.vue | 4 ++++ assets/css/aiChat.less | 4 ++-- pages/home/index.vue | 3 +++ 6 files changed, 34 insertions(+), 4 deletions(-) diff --git a/aiChat/components/bottomSend.vue b/aiChat/components/bottomSend.vue index 280312a..f2baed1 100644 --- a/aiChat/components/bottomSend.vue +++ b/aiChat/components/bottomSend.vue @@ -3,6 +3,9 @@ :class="{ 'focus': inputOnFocus }" + :style="{ + 'transform': 'translateY(-' + (keyboardHeight + 'px') + ')' + }" class="fix-page-bottom" > @@ -26,6 +29,7 @@ { + console.log('监听键盘高度变化%s', res.height) + this.keyboardHeight = res.height + }) + }, onUnload() { this.closeWsFn() + // console.log('在页面卸载时取消监听') + // wx.offKeyboardHeightChange() }, created() { const _this = this @@ -215,7 +225,9 @@ export const chatMixins = { }, closeWsFn() { this.loading = false - this.chatMessageList[this.chatMessageListLength - 1].showCursor = false + if (this.chatMessageListLength) { + this.chatMessageList[this.chatMessageListLength - 1].showCursor = false + } uni.closeSocket({ success: () => { console.log('-----关闭连接') diff --git a/aiChat/views/history.vue b/aiChat/views/history.vue index 93f38e9..49480dd 100644 --- a/aiChat/views/history.vue +++ b/aiChat/views/history.vue @@ -134,6 +134,9 @@ :class="{ 'focus': onFocus }" + :style="{ + 'transform': 'translateY(-' + (keyboardHeight + 'px') + ')' + }" class="page-to-bottom" >