Fix(AI):[#3606]苹果手机键盘底部及开启新对话按钮没有留空隙
This commit is contained in:
@@ -3,6 +3,9 @@
|
|||||||
:class="{
|
:class="{
|
||||||
'focus': inputOnFocus
|
'focus': inputOnFocus
|
||||||
}"
|
}"
|
||||||
|
:style="{
|
||||||
|
'transform': 'translateY(-' + (keyboardHeight + 'px') + ')'
|
||||||
|
}"
|
||||||
class="fix-page-bottom"
|
class="fix-page-bottom"
|
||||||
>
|
>
|
||||||
<view v-if="inputModel === 'input'" class="bottom-body flex-center-between">
|
<view v-if="inputModel === 'input'" class="bottom-body flex-center-between">
|
||||||
@@ -26,6 +29,7 @@
|
|||||||
<input
|
<input
|
||||||
v-model.trim="prompt"
|
v-model.trim="prompt"
|
||||||
:show-confirm-bar="false"
|
:show-confirm-bar="false"
|
||||||
|
:adjust-position="false"
|
||||||
:disabled="loading"
|
:disabled="loading"
|
||||||
:maxlength="-1"
|
:maxlength="-1"
|
||||||
class="inp"
|
class="inp"
|
||||||
@@ -99,7 +103,6 @@ import {
|
|||||||
getFileTransResult
|
getFileTransResult
|
||||||
} from '@/api/voiceToText/index'
|
} from '@/api/voiceToText/index'
|
||||||
import { VUE_APP_API_URL } from '@/config'
|
import { VUE_APP_API_URL } from '@/config'
|
||||||
import settings from '@/config/baseSetting.js'
|
|
||||||
import cookie from '@/utils/store/cookie'
|
import cookie from '@/utils/store/cookie'
|
||||||
export default {
|
export default {
|
||||||
name: 'BottomSend',
|
name: 'BottomSend',
|
||||||
@@ -107,6 +110,10 @@ export default {
|
|||||||
loading: {
|
loading: {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
default: false
|
default: false
|
||||||
|
},
|
||||||
|
keyboardHeight: {
|
||||||
|
type: Number,
|
||||||
|
default: 0
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ export const chatMixins = {
|
|||||||
// 状态栏高度
|
// 状态栏高度
|
||||||
statusBarHeight: 20,
|
statusBarHeight: 20,
|
||||||
fileHttpStr: Object.freeze(VUE_APP_API_URL + settings.sysPrefix),
|
fileHttpStr: Object.freeze(VUE_APP_API_URL + settings.sysPrefix),
|
||||||
|
keyboardHeight: 0,
|
||||||
optionsFrom: '',
|
optionsFrom: '',
|
||||||
onFocus: false,
|
onFocus: false,
|
||||||
loading: false,
|
loading: false,
|
||||||
@@ -67,8 +68,17 @@ export const chatMixins = {
|
|||||||
}
|
}
|
||||||
}.bind(this)).exec()
|
}.bind(this)).exec()
|
||||||
},
|
},
|
||||||
|
onLoad() {
|
||||||
|
// 监听键盘高度变化
|
||||||
|
wx.onKeyboardHeightChange((res) => {
|
||||||
|
console.log('监听键盘高度变化%s', res.height)
|
||||||
|
this.keyboardHeight = res.height
|
||||||
|
})
|
||||||
|
},
|
||||||
onUnload() {
|
onUnload() {
|
||||||
this.closeWsFn()
|
this.closeWsFn()
|
||||||
|
// console.log('在页面卸载时取消监听')
|
||||||
|
// wx.offKeyboardHeightChange()
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
const _this = this
|
const _this = this
|
||||||
@@ -215,7 +225,9 @@ export const chatMixins = {
|
|||||||
},
|
},
|
||||||
closeWsFn() {
|
closeWsFn() {
|
||||||
this.loading = false
|
this.loading = false
|
||||||
this.chatMessageList[this.chatMessageListLength - 1].showCursor = false
|
if (this.chatMessageListLength) {
|
||||||
|
this.chatMessageList[this.chatMessageListLength - 1].showCursor = false
|
||||||
|
}
|
||||||
uni.closeSocket({
|
uni.closeSocket({
|
||||||
success: () => {
|
success: () => {
|
||||||
console.log('-----关闭连接')
|
console.log('-----关闭连接')
|
||||||
|
|||||||
@@ -134,6 +134,9 @@
|
|||||||
:class="{
|
:class="{
|
||||||
'focus': onFocus
|
'focus': onFocus
|
||||||
}"
|
}"
|
||||||
|
:style="{
|
||||||
|
'transform': 'translateY(-' + (keyboardHeight + 'px') + ')'
|
||||||
|
}"
|
||||||
class="page-to-bottom"
|
class="page-to-bottom"
|
||||||
>
|
>
|
||||||
<image
|
<image
|
||||||
@@ -147,6 +150,7 @@
|
|||||||
<bottom-send
|
<bottom-send
|
||||||
ref="bottomSend"
|
ref="bottomSend"
|
||||||
:loading="loading"
|
:loading="loading"
|
||||||
|
:keyboard-height="keyboardHeight"
|
||||||
@send="streamReq"
|
@send="streamReq"
|
||||||
@history="historyViewHandle"
|
@history="historyViewHandle"
|
||||||
@focus="inputFocusHandle"
|
@focus="inputFocusHandle"
|
||||||
|
|||||||
@@ -187,6 +187,9 @@
|
|||||||
:class="{
|
:class="{
|
||||||
'focus': onFocus
|
'focus': onFocus
|
||||||
}"
|
}"
|
||||||
|
:style="{
|
||||||
|
'transform': 'translateY(-' + (keyboardHeight + 'px') + ')'
|
||||||
|
}"
|
||||||
class="page-to-bottom"
|
class="page-to-bottom"
|
||||||
>
|
>
|
||||||
<view
|
<view
|
||||||
@@ -212,6 +215,7 @@
|
|||||||
<bottom-send
|
<bottom-send
|
||||||
ref="bottomSend"
|
ref="bottomSend"
|
||||||
:loading="loading"
|
:loading="loading"
|
||||||
|
:keyboard-height="keyboardHeight"
|
||||||
@send="streamReq"
|
@send="streamReq"
|
||||||
@add="createNewHandle"
|
@add="createNewHandle"
|
||||||
@history="historyViewHandle"
|
@history="historyViewHandle"
|
||||||
|
|||||||
@@ -99,7 +99,7 @@ page {
|
|||||||
padding: 0 24rpx;
|
padding: 0 24rpx;
|
||||||
transition: all 0.2s;
|
transition: all 0.2s;
|
||||||
&.focus {
|
&.focus {
|
||||||
transform: translateY(-40rpx);
|
// transform: translateY(-40rpx);
|
||||||
}
|
}
|
||||||
.new-chat {
|
.new-chat {
|
||||||
display: flex;
|
display: flex;
|
||||||
@@ -136,7 +136,7 @@ page {
|
|||||||
padding: 24rpx 24rpx 48rpx 24rpx;
|
padding: 24rpx 24rpx 48rpx 24rpx;
|
||||||
transition: all 0.2s;
|
transition: all 0.2s;
|
||||||
&.focus {
|
&.focus {
|
||||||
transform: translateY(-40rpx);
|
// transform: translateY(-40rpx);
|
||||||
}
|
}
|
||||||
.bottom-body {
|
.bottom-body {
|
||||||
position: relative;
|
position: relative;
|
||||||
|
|||||||
@@ -453,6 +453,9 @@ export default {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
onShow() {
|
||||||
|
wx.offKeyboardHeightChange()
|
||||||
|
},
|
||||||
onHide() {
|
onHide() {
|
||||||
this.pageToHideHandle()
|
this.pageToHideHandle()
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user