From 4fa9c6a594316f7a75838135bff9dae11d4f3024 Mon Sep 17 00:00:00 2001 From: lifizer <913626195@qq.com> Date: Mon, 14 Apr 2025 14:47:39 +0800 Subject: [PATCH] =?UTF-8?q?Feat(AI):=E5=A2=9E=E5=8A=A0=E5=8F=82=E6=95=B0?= =?UTF-8?q?=EF=BC=8C=E5=8F=AA=E6=9C=89=E9=80=9A=E8=BF=87=E7=82=B9=E5=87=BB?= =?UTF-8?q?=E6=89=8D=E8=83=BD=E8=BF=9B=E5=85=A5=EF=BC=8C=E4=BB=A5=E4=BE=BF?= =?UTF-8?q?=E5=BE=AE=E4=BF=A1=E5=AE=A1=E6=A0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- aiChat/components/historyList.vue | 2 +- aiChat/mixins/chatMixins.js | 6 +++++- aiChat/views/history.vue | 11 +++++++---- components/aiChat/entrance.vue | 2 +- 4 files changed, 14 insertions(+), 7 deletions(-) diff --git a/aiChat/components/historyList.vue b/aiChat/components/historyList.vue index b5baa79..06b0741 100644 --- a/aiChat/components/historyList.vue +++ b/aiChat/components/historyList.vue @@ -160,7 +160,7 @@ export default { }) }, historyItemClick(item) { - const paramsStr = `?chatNumber=${item.chatNumber}&title=${item.title}` + const paramsStr = `?chatNumber=${item.chatNumber}&title=${item.title}&click=1` if (!this.formModule) { uni.navigateTo({ url: '/aiChat/views/history' + paramsStr diff --git a/aiChat/mixins/chatMixins.js b/aiChat/mixins/chatMixins.js index 8835245..b2a478a 100644 --- a/aiChat/mixins/chatMixins.js +++ b/aiChat/mixins/chatMixins.js @@ -68,7 +68,11 @@ export const chatMixins = { } }.bind(this)).exec() }, - onLoad() { + onLoad(options) { + if (!options.click) { + uni.switchTab({ url: '/pages/home/index' }) + return + } // 监听键盘高度变化 wx.onKeyboardHeightChange((res) => { console.log('监听键盘高度变化%s', res.height) diff --git a/aiChat/views/history.vue b/aiChat/views/history.vue index 49480dd..ac19c98 100644 --- a/aiChat/views/history.vue +++ b/aiChat/views/history.vue @@ -183,10 +183,13 @@ export default { pageTitle: '' } }, - onLoad(optisons) { - console.log(optisons) - this.chatNumber = optisons.chatNumber - this.pageTitle = optisons.title + onLoad(options) { + if (!options.click) { + uni.switchTab({ url: '/pages/home/index' }) + return + } + this.chatNumber = options.chatNumber + this.pageTitle = options.title this.pageTitle = this.pageTitle.length > 8 ? (this.pageTitle.substring(0, 8) + '...') : this.pageTitle this.init() }, diff --git a/components/aiChat/entrance.vue b/components/aiChat/entrance.vue index 69a0aec..06b82fe 100644 --- a/components/aiChat/entrance.vue +++ b/components/aiChat/entrance.vue @@ -36,7 +36,7 @@ export default { }, enterAiChat() { uni.navigateTo({ - url: '/aiChat/views/index' + url: '/aiChat/views/index?click=1' }) } }