This commit is contained in:
2023-11-14 14:38:25 +08:00
parent 3626999766
commit a5b9c2e832

View File

@ -1,5 +1,5 @@
<template>
<view class="content" :style="{'padding-bottom': bottomVal }">
<view class="content">
<!-- <view class="title">
<image src="../../static/huijiantou.png" @click="back"></image>
{{currentItem.senderName}}
@ -34,9 +34,9 @@
<!-- <view class="placeholder" id="placeholder" v-if="showFunBtn"></view> -->
</view>
</scroll-view>
<!-- 底部输入 -->
<view class="input-box" :class="{ 'input-box-mpInputMargin': mpInputMargin }">
<view class="input-box" :class="{ 'input-box-mpInputMargin': mpInputMargin }"
:style="{'padding-bottom':bottomVal+'px'}">
<view class="input-box-flex">
<!--弹出常用 -->
<!-- <image class="icon_img" :src="require('@/static/ico/often.png')" @tap="oftenx"></image> -->
@ -44,7 +44,7 @@
<view class="input-box-flex-grow"> <input type="text" class="contenxxt" id="input"
v-model="formData.content" :hold-keyboard="true" :confirm-type="'send'" :confirm-hold="true"
placeholder-style="color:#DDDDDD;" :cursor-spacing="10" @confirm='sendconfirm'
@focus="inputBindFocus" @blur="inputBindBlur" /> </view>
:adjust-position="false" @keyboardheightchange="keyboardheightchange" /> </view>
<!-- 选择表情包 -->
<!-- <image class=" icon_btn_add" :src="require('@/static/ico/emoji.png')" @tap="exprec"></image> -->
<!-- 发送消息按钮 -->
@ -181,14 +181,22 @@
// })
},
methods: {
inputBindFocus(e) {
this.bottomVal = e.detail.height + 'px'
// input bottom
// !!! px !!! px
},
inputBindBlur() {
this.bottomVal = 0
// input input bottom 0
keyboardheightchange(event) {
const {
height,
duration
} = event.detail
this.bottomVal = height
setTimeout(() => {
let query = uni.createSelectorQuery().in(this);
//iddemo
query.select('.input-box').boundingClientRect(data => {
this.inputboxtop = data.height //
setTimeout(e => {
this.scrollTop = this.scrollTop + 1;
}, 300)
}).exec();
}, 200)
},
getPageHistory() {
let obj = {
@ -208,7 +216,9 @@
//iddemo
query.select('.input-box').boundingClientRect(data => {
this.inputboxtop = data.height //
this.scrollTop = this.scrollTop + 1;
setTimeout(e => {
this.scrollTop = this.scrollTop + 1;
}, 300)
}).exec();
}, 100)
})
@ -235,7 +245,9 @@
//iddemo
query.select('.input-box').boundingClientRect(data => {
this.inputboxtop = data.height //
this.scrollTop = this.scrollTop + 1;
setTimeout(e => {
this.scrollTop = this.scrollTop + 1;
}, 300)
}).exec();
}, 200)
},
@ -272,16 +284,14 @@
recipientName: that.currentItem.doctorName,
messageType: 1,
sendTime: new Date(),
content: this.formData.content
content: that.formData.content
}
sendMessage(obj).then(res => {
that.formData.content = '' //
setTimeout(() => {
that.scrollTop = that.scrollTop + 1;
}, 100)
if (res.code != 200) {
}
if (res.code != 200) {}
})
// try {
// const that = this
@ -452,7 +462,9 @@
//iddemo
query.select('.input-box').boundingClientRect(data => {
this.inputboxtop = data.height //
this.scrollTop = this.scrollTop + 1;
setTimeout(e => {
this.scrollTop = this.scrollTop + 1;
}, 300)
}).exec();
}, 200)
},
@ -502,7 +514,9 @@
//iddemo
query.select('.input-box').boundingClientRect(data => {
this.inputboxtop = data.height //
this.scrollTop = this.scrollTop + 1;
setTimeout(e => {
this.scrollTop = this.scrollTop + 1;
}, 300)
}).exec();
}, 100)
that.Read()
@ -818,4 +832,4 @@
bottom: 38rpx;
}
}
</style>
</style>