From 39a54efc2764dedf4e86ba6d688a8933e46e1dac Mon Sep 17 00:00:00 2001 From: lifizer <913626195@qq.com> Date: Tue, 22 Apr 2025 13:34:26 +0800 Subject: [PATCH] =?UTF-8?q?Fix(AI):[#3681]AI=E5=AF=B9=E8=AF=9D=E7=82=B9?= =?UTF-8?q?=E5=87=BB=E6=89=8B=E6=9C=BA=E4=BE=A7=E8=BE=B9=E8=BF=94=E5=9B=9E?= =?UTF-8?q?=E6=8C=89=E9=92=AE=EF=BC=8C=E4=BC=9A=E5=9B=9E=E5=88=B0=E5=B0=8F?= =?UTF-8?q?=E7=A8=8B=E5=BA=8F=E9=A6=96=E9=A1=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- aiChat/mixins/chatMixins.js | 11 ----------- aiChat/views/history.vue | 11 +++++++++++ aiChat/views/index.vue | 19 +++++++++++++++++++ 3 files changed, 30 insertions(+), 11 deletions(-) diff --git a/aiChat/mixins/chatMixins.js b/aiChat/mixins/chatMixins.js index b2a478a..95a99e1 100644 --- a/aiChat/mixins/chatMixins.js +++ b/aiChat/mixins/chatMixins.js @@ -68,17 +68,6 @@ export const chatMixins = { } }.bind(this)).exec() }, - onLoad(options) { - if (!options.click) { - uni.switchTab({ url: '/pages/home/index' }) - return - } - // 监听键盘高度变化 - wx.onKeyboardHeightChange((res) => { - console.log('监听键盘高度变化%s', res.height) - this.keyboardHeight = res.height - }) - }, onUnload() { this.closeWsFn() // console.log('在页面卸载时取消监听') diff --git a/aiChat/views/history.vue b/aiChat/views/history.vue index ac19c98..046bf23 100644 --- a/aiChat/views/history.vue +++ b/aiChat/views/history.vue @@ -193,6 +193,17 @@ export default { this.pageTitle = this.pageTitle.length > 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 958c3b5..876140a 100644 --- a/aiChat/views/index.vue +++ b/aiChat/views/index.vue @@ -256,6 +256,25 @@ export default { settingInfo: {}, topicList: [] } + }, + onLoad(options) { + if (!options.click) { + uni.switchTab({ url: '/pages/home/index' }) + return + } + // 监听键盘高度变化 + wx.onKeyboardHeightChange((res) => { + console.log('监听键盘高度变化%s', res.height) + this.keyboardHeight = res.height + }) + }, + onUnload() { + this.closeWsFn() + if (this.chatNumber) { + uni.redirectTo({ + url: '/aiChat/views/index?click=1&back=1' + }) + } }, methods: { createdCallbak() {