|
|
@@ -893,7 +893,8 @@
|
|
|
|
|
|
//获取发送时间
|
|
|
if (redata.message_type == "webTime") {
|
|
|
-
|
|
|
+ // console.log(this.chat)
|
|
|
+ // console.log(this.chatIndex)
|
|
|
if (this.webTime) {
|
|
|
let newTime = redata.data.webTime.split(':');
|
|
|
let time = this.webTime.split(':');
|
|
|
@@ -906,7 +907,6 @@
|
|
|
// console.log('newTime[1]')
|
|
|
}
|
|
|
} else {
|
|
|
- this.chat[this.chatIndex].time = redata.data.webTime;
|
|
|
this.$set(this.chat[this.chatIndex],'time',redata.data.webTime);
|
|
|
}
|
|
|
this.webTime = redata.data.webTime
|
|
|
@@ -1189,7 +1189,8 @@
|
|
|
/*******************************************/
|
|
|
//图片发送
|
|
|
uploadIMG(e) {
|
|
|
- //console.log(e);
|
|
|
+ // console.log(e);
|
|
|
+
|
|
|
let self = this;
|
|
|
let files = e.target.files || e.dataTransfer.files;
|
|
|
if (!files.length) return;
|
|
|
@@ -1210,9 +1211,9 @@
|
|
|
} else {
|
|
|
this.$public.imgPreview(picavalue, function (imgSrc, formData) {
|
|
|
// let img = imgSrc;
|
|
|
-
|
|
|
// 数据结构请求
|
|
|
self.$http.uploadPost('/index/upload/uploadImg', formData).then(res => {
|
|
|
+ e.target.value = "";
|
|
|
// console.log(res.data.code)
|
|
|
if (res.data.code == 1) {
|
|
|
let type = 'toRobot';
|
|
|
@@ -1234,11 +1235,16 @@
|
|
|
conversationId: self.conversationId,
|
|
|
}
|
|
|
type = 'chatMessage';
|
|
|
+
|
|
|
+ self.chatIndex = self.chat.length;
|
|
|
//本地储存
|
|
|
self.chat.push({
|
|
|
type: 'user',
|
|
|
+ time:"",
|
|
|
content: {img: res.data.data.src}
|
|
|
});
|
|
|
+
|
|
|
+
|
|
|
} else {
|
|
|
//和机器发送图片
|
|
|
data = {
|