xg
This commit is contained in:
parent
4ed8397cc4
commit
c99b439226
@ -312,11 +312,6 @@
|
|||||||
if (this.socketOpen == false) {
|
if (this.socketOpen == false) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
that.newsList.push({
|
|
||||||
senderName: that.currentItem.patientName,
|
|
||||||
content: that.formData.content,
|
|
||||||
messageType: 1,
|
|
||||||
})
|
|
||||||
let obj = {
|
let obj = {
|
||||||
consultationId: that.currentItem.id,
|
consultationId: that.currentItem.id,
|
||||||
senderId: that.currentItem.patientId,
|
senderId: that.currentItem.patientId,
|
||||||
@ -327,12 +322,18 @@
|
|||||||
sendTime: new Date(),
|
sendTime: new Date(),
|
||||||
content: that.formData.content
|
content: that.formData.content
|
||||||
}
|
}
|
||||||
sendMessage(obj).then(res => {
|
|
||||||
that.formData.content = '' //清空输入框的文本
|
that.formData.content = '' //清空输入框的文本
|
||||||
|
sendMessage(obj).then(res => {
|
||||||
|
if (res.code == 200) {
|
||||||
|
that.newsList.push({
|
||||||
|
senderName: that.currentItem.patientName,
|
||||||
|
content: that.formData.content,
|
||||||
|
messageType: 1,
|
||||||
|
})
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
that.scrollTop = that.scrollTop + 1;
|
that.scrollTop = that.scrollTop + 1;
|
||||||
}, 100)
|
}, 100)
|
||||||
if (res.code != 200) {}
|
}
|
||||||
})
|
})
|
||||||
// try {
|
// try {
|
||||||
// const that = this
|
// const that = this
|
||||||
@ -449,17 +450,6 @@
|
|||||||
sizeType: ["compressed"],
|
sizeType: ["compressed"],
|
||||||
success: (res) => {
|
success: (res) => {
|
||||||
that.showFunBtn = false;
|
that.showFunBtn = false;
|
||||||
setTimeout(() => {
|
|
||||||
let query = uni.createSelectorQuery().in(this);
|
|
||||||
//需要给黄色区域设置一个id标识,在这里是demo
|
|
||||||
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 => {
|
res.tempFilePaths.forEach(e => {
|
||||||
uni.uploadFile({
|
uni.uploadFile({
|
||||||
url: baseurl +
|
url: baseurl +
|
||||||
@ -468,7 +458,6 @@
|
|||||||
name: 'file',
|
name: 'file',
|
||||||
timeout: 5000,
|
timeout: 5000,
|
||||||
success(resp) {
|
success(resp) {
|
||||||
console.log(resp)
|
|
||||||
var fileurls = JSON.parse(resp.data)
|
var fileurls = JSON.parse(resp.data)
|
||||||
let obj = {
|
let obj = {
|
||||||
consultationId: that.currentItem.id,
|
consultationId: that.currentItem.id,
|
||||||
@ -480,14 +469,34 @@
|
|||||||
sendTime: new Date(),
|
sendTime: new Date(),
|
||||||
content: fileurls.fileUrl
|
content: fileurls.fileUrl
|
||||||
}
|
}
|
||||||
|
sendMessage(obj).then(respp => {
|
||||||
|
if (respp.code == 200) {
|
||||||
that.newsList.push({
|
that.newsList.push({
|
||||||
content: fileurls.fileUrl,
|
content: fileurls.fileUrl,
|
||||||
messageType: 2,
|
messageType: 2,
|
||||||
senderName: that.currentItem.patientName,
|
senderName: that.currentItem
|
||||||
|
.patientName,
|
||||||
})
|
})
|
||||||
console.log()
|
setTimeout(() => {
|
||||||
sendMessage(obj).then(respp => {
|
let query = uni
|
||||||
console.log(respp)
|
.createSelectorQuery().in(
|
||||||
|
that);
|
||||||
|
//需要给黄色区域设置一个id标识,在这里是demo
|
||||||
|
query.select('.input-box')
|
||||||
|
.boundingClientRect(
|
||||||
|
data => {
|
||||||
|
that.inputboxtop =
|
||||||
|
data
|
||||||
|
.height //赋值,待会要用
|
||||||
|
setTimeout(() => {
|
||||||
|
that.scrollTop =
|
||||||
|
that
|
||||||
|
.scrollTop +
|
||||||
|
1;
|
||||||
|
}, 200)
|
||||||
|
}).exec();
|
||||||
|
}, 300)
|
||||||
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user