Fix(AI):[#3681]AI对话点击手机侧边返回按钮,会回到小程序首页

This commit is contained in:
lifizer
2025-04-22 13:34:26 +08:00
parent 30bb94130d
commit 39a54efc27
3 changed files with 30 additions and 11 deletions
-11
View File
@@ -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('在页面卸载时取消监听')
+11
View File
@@ -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
+19
View File
@@ -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() {