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

View File

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