From 0d0b816fad84f593c634bc142b5facd91e54ebc0 Mon Sep 17 00:00:00 2001 From: lifizer <913626195@qq.com> Date: Tue, 22 Apr 2025 14:18:05 +0800 Subject: [PATCH] =?UTF-8?q?Fix(AI):[#3647]=E7=82=B9=E5=87=BB=E8=BE=93?= =?UTF-8?q?=E5=85=A5=E6=A1=86=EF=BC=8C=E5=AF=B9=E8=AF=9D=E8=AE=B0=E5=BD=95?= =?UTF-8?q?=E5=90=8C=E6=AD=A5=E4=B8=8A=E7=A7=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- aiChat/components/bottomSend.vue | 15 +++++---------- aiChat/mixins/chatMixins.js | 1 + aiChat/views/history.vue | 18 ------------------ aiChat/views/index.vue | 16 +--------------- assets/css/aiChat.less | 4 ++-- pages/home/index.vue | 3 --- 6 files changed, 9 insertions(+), 48 deletions(-) diff --git a/aiChat/components/bottomSend.vue b/aiChat/components/bottomSend.vue index eb35ccf..ff3716d 100644 --- a/aiChat/components/bottomSend.vue +++ b/aiChat/components/bottomSend.vue @@ -3,9 +3,6 @@ :class="{ 'focus': inputOnFocus }" - :style="{ - 'transform': 'translateY(-' + (keyboardHeight + 'px') + ')' - }" class="fix-page-bottom" > @@ -29,7 +26,7 @@ { this.inputOnFocus = true - this.$emit('focus', 1) - }, 200) + }, 100) }, promptInputBlurHandle() { - setTimeout(() => { - this.inputOnFocus = false - this.$emit('focus', 0) - }, 200) + this.$emit('focus', 0) + this.inputOnFocus = false }, toggleInputModel() { if (!this.token) { diff --git a/aiChat/mixins/chatMixins.js b/aiChat/mixins/chatMixins.js index 95a99e1..ed75c3d 100644 --- a/aiChat/mixins/chatMixins.js +++ b/aiChat/mixins/chatMixins.js @@ -95,6 +95,7 @@ export const chatMixins = { }, inputFocusHandle(value) { this.onFocus = value === 1 + this.scrollToBottomHandle() }, historyViewHandle() { console.log(this.$refs.historyView) diff --git a/aiChat/views/history.vue b/aiChat/views/history.vue index 046bf23..1995def 100644 --- a/aiChat/views/history.vue +++ b/aiChat/views/history.vue @@ -134,9 +134,6 @@ :class="{ 'focus': onFocus }" - :style="{ - 'transform': 'translateY(-' + (keyboardHeight + 'px') + ')' - }" class="page-to-bottom" > 8 ? (this.pageTitle.substring(0, 8) + '...') : this.pageTitle this.init() }, - onLoad(options) { - if (!options.click) { - uni.switchTab({ url: '/pages/home/index' }) - return - } - // 监听键盘高度变化 - wx.onKeyboardHeightChange((res) => { - console.log('监听键盘高度变化%s', res.height) - this.keyboardHeight = res.height - }) - }, methods: { init() { this.loading = true diff --git a/aiChat/views/index.vue b/aiChat/views/index.vue index 876140a..8c735df 100644 --- a/aiChat/views/index.vue +++ b/aiChat/views/index.vue @@ -193,9 +193,6 @@ :class="{ 'focus': onFocus }" - :style="{ - 'transform': 'translateY(-' + (keyboardHeight + 'px') + ')' - }" class="page-to-bottom" > { - console.log('监听键盘高度变化%s', res.height) - this.keyboardHeight = res.height - }) - }, onUnload() { this.closeWsFn() if (this.chatNumber) { - uni.redirectTo({ + uni.navigateTo({ url: '/aiChat/views/index?click=1&back=1' }) } diff --git a/assets/css/aiChat.less b/assets/css/aiChat.less index 7e084d9..e7c3176 100644 --- a/assets/css/aiChat.less +++ b/assets/css/aiChat.less @@ -100,7 +100,7 @@ page { padding: 0 24rpx; transition: all 0.2s; &.focus { - // transform: translateY(-40rpx); + transform: translateY(-40rpx); } .new-chat { display: flex; @@ -138,7 +138,7 @@ page { background-color: #fff; transition: all 0.2s; &.focus { - // transform: translateY(-40rpx); + transform: translateY(-40rpx); } .bottom-body { position: relative; diff --git a/pages/home/index.vue b/pages/home/index.vue index 3509678..315a46c 100644 --- a/pages/home/index.vue +++ b/pages/home/index.vue @@ -453,9 +453,6 @@ export default { } }) }, - onShow() { - wx.offKeyboardHeightChange() - }, onHide() { this.pageToHideHandle() },