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() },