This commit is contained in:
2023-12-11 17:15:23 +08:00
parent 4ed8397cc4
commit c99b439226

View File

@ -312,11 +312,6 @@
if (this.socketOpen == false) {
return
}
that.newsList.push({
senderName: that.currentItem.patientName,
content: that.formData.content,
messageType: 1,
})
let obj = {
consultationId: that.currentItem.id,
senderId: that.currentItem.patientId,
@ -327,12 +322,18 @@
sendTime: new Date(),
content: that.formData.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) {
that.newsList.push({
senderName: that.currentItem.patientName,
content: that.formData.content,
messageType: 1,
})
setTimeout(() => {
that.scrollTop = that.scrollTop + 1;
}, 100)
}
})
// try {
// const that = this
@ -449,17 +450,6 @@
sizeType: ["compressed"],
success: (res) => {
that.showFunBtn = false;
setTimeout(() => {
let query = uni.createSelectorQuery().in(this);
//iddemo
query.select('.input-box').boundingClientRect(data => {
console.log(data)
this.inputboxtop = data.height //
setTimeout(() => {
this.scrollTop = this.scrollTop + 1;
}, 200)
}).exec();
}, 300)
res.tempFilePaths.forEach(e => {
uni.uploadFile({
url: baseurl +
@ -468,7 +458,6 @@
name: 'file',
timeout: 5000,
success(resp) {
console.log(resp)
var fileurls = JSON.parse(resp.data)
let obj = {
consultationId: that.currentItem.id,
@ -480,14 +469,34 @@
sendTime: new Date(),
content: fileurls.fileUrl
}
that.newsList.push({
content: fileurls.fileUrl,
messageType: 2,
senderName: that.currentItem.patientName,
})
console.log()
sendMessage(obj).then(respp => {
console.log(respp)
if (respp.code == 200) {
that.newsList.push({
content: fileurls.fileUrl,
messageType: 2,
senderName: that.currentItem
.patientName,
})
setTimeout(() => {
let query = uni
.createSelectorQuery().in(
that);
//iddemo
query.select('.input-box')
.boundingClientRect(
data => {
that.inputboxtop =
data
.height //
setTimeout(() => {
that.scrollTop =
that
.scrollTop +
1;
}, 200)
}).exec();
}, 300)
}
})
}
})