Fix:4004 【商城小程序】在互动消息列表回复资讯评论,内容被顶至屏幕之外

This commit is contained in:
linxi
2025-11-22 16:24:49 +08:00
parent aaa29ef0f6
commit 7a44ed3265
+23 -2
View File
@@ -71,10 +71,11 @@
</view>
</view>
<view v-if="showBtn" class="v12-align-center v12-justify-center v12-pa-3 v12-white sticky-bottom">
<view v-show="showBtn" class="v12-align-center v12-justify-center v12-pa-3 v12-white sticky-bottom" :style="{ bottom: inputBoxBottom + 'px' }">
<view style="width: 100%">
<u-textarea
id="input"
fixed
v-model="content"
:maxlength="500"
:maxheight="200"
@@ -87,6 +88,7 @@
border: '1px solid #f7f7f7',
borderRadius: '20rpx'
}"
:adjustPosition="false"
cursorSpacing="85"
@blur="onBlur"
@focus="commentInputFocus"
@@ -149,13 +151,32 @@ export default {
content: '',
currentComment: {},
// 光标位置
cursorIndex: 0
cursorIndex: 0,
inputBoxBottom: 0
}
},
onLoad() {
// 监听键盘高度变化
uni.onKeyboardHeightChange((res) => {
if (res.height) {
this.onKeyboardShow(res.height)
} else {
this.onKeyboardHide()
}
})
},
onShow() {
this.fetchList()
},
methods: {
onKeyboardShow(height) {
this.inputBoxBottom = height
},
onKeyboardHide() {
// 处理键盘收起逻辑
this.inputBoxBottom = 0
},
toInfo(comment) {
if(!comment.contentAvailable) {
// 该内容已删除