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' }) } }