Fix(AI):[#3647]点击输入框,对话记录同步上移

This commit is contained in:
lifizer
2025-04-22 14:18:05 +08:00
parent 39a54efc27
commit 0d0b816fad
6 changed files with 9 additions and 48 deletions
+5 -10
View File
@@ -3,9 +3,6 @@
:class="{
'focus': inputOnFocus
}"
:style="{
'transform': 'translateY(-' + (keyboardHeight + 'px') + ')'
}"
class="fix-page-bottom"
>
<view v-if="inputModel === 'input'" class="bottom-body flex-center-between">
@@ -29,7 +26,7 @@
<input
v-model.trim="prompt"
:show-confirm-bar="false"
:adjust-position="false"
:adjust-position="true"
:disabled="loading"
:maxlength="-1"
class="inp"
@@ -148,16 +145,14 @@ export default {
},
methods: {
promptInputFocusHandle() {
this.$emit('focus', 1)
setTimeout(() => {
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) {
+1
View File
@@ -95,6 +95,7 @@ export const chatMixins = {
},
inputFocusHandle(value) {
this.onFocus = value === 1
this.scrollToBottomHandle()
},
historyViewHandle() {
console.log(this.$refs.historyView)
-18
View File
@@ -134,9 +134,6 @@
:class="{
'focus': onFocus
}"
:style="{
'transform': 'translateY(-' + (keyboardHeight + 'px') + ')'
}"
class="page-to-bottom"
>
<image
@@ -184,26 +181,11 @@ export default {
}
},
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()
},
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
+1 -15
View File
@@ -193,9 +193,6 @@
:class="{
'focus': onFocus
}"
:style="{
'transform': 'translateY(-' + (keyboardHeight + 'px') + ')'
}"
class="page-to-bottom"
>
<view
@@ -257,21 +254,10 @@ export default {
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({
uni.navigateTo({
url: '/aiChat/views/index?click=1&back=1'
})
}