提交 219cfdcd 编写于 作者: huangwensu's avatar huangwensu

Merge branch 'dev-phase1-0111' of...

Merge branch 'dev-phase1-0111' of http://192.168.110.53/com.pica.cloud.education.frontend/pica-admin-IM into dev-phase1-0111
...@@ -488,7 +488,7 @@ export default { ...@@ -488,7 +488,7 @@ export default {
this.POST("/im/msg/forward", params).then(res => { this.POST("/im/msg/forward", params).then(res => {
if (res.code === "000000") { if (res.code === "000000") {
this.convertMessageList(res.data, 2); this.convertMessageList(res.data, 2);
if(this.currentSession.unreadCount) { if(res.data.length) {
this.readAllMsg(); this.readAllMsg();
} }
} else { } else {
...@@ -768,13 +768,8 @@ export default { ...@@ -768,13 +768,8 @@ export default {
cc; cc;
sessions.forEach((session, index) => { sessions.forEach((session, index) => {
if (session.lastMsgType.toLowerCase() == "custom") { if (session.lastMsgType.toLowerCase() == "custom") {
text = "";
cc = JSON.parse(session.lastMsgContent); cc = JSON.parse(session.lastMsgContent);
if (cc.showType == 1) { text = cc.suffix || cc.content || cc.title || cc.name;
text = cc.title || cc.name;
} else {
text = cc.content || cc.name;
}
} else if ( } else if (
session.lastMsgType.toLowerCase() == "image" || session.lastMsgType.toLowerCase() == "image" ||
session.lastMsgType.toLowerCase() == "picture" session.lastMsgType.toLowerCase() == "picture"
...@@ -905,6 +900,7 @@ export default { ...@@ -905,6 +900,7 @@ export default {
// 如果是图片,则要获取其宽与高 // 如果是图片,则要获取其宽与高
if ( if (
params.fileExt.toLowerCase() === ".jpg" || params.fileExt.toLowerCase() === ".jpg" ||
params.fileExt.toLowerCase() === ".jpeg" ||
params.fileExt.toLowerCase() === ".png" params.fileExt.toLowerCase() === ".png"
) { ) {
params.type = 1; params.type = 1;
...@@ -978,6 +974,9 @@ export default { ...@@ -978,6 +974,9 @@ export default {
// 校验结果:1校验通过 2校验不通过 // 校验结果:1校验通过 2校验不通过
console.log(res.data.checkFlag); console.log(res.data.checkFlag);
let msg = this.messageList[this.messageList.length - 1]; let msg = this.messageList[this.messageList.length - 1];
if(msg.sendId !== sendId) {
msg = this.getMsgBySendId(sendId);
}
if (res.data.checkFlag == 1) { if (res.data.checkFlag == 1) {
this.realTimestamp = res.data.timetag; this.realTimestamp = res.data.timetag;
msg.isShowLoadingIcon = false; msg.isShowLoadingIcon = false;
...@@ -989,7 +988,6 @@ export default { ...@@ -989,7 +988,6 @@ export default {
msg.isShowErrorIcon = true; msg.isShowErrorIcon = true;
msg.isShowErrorMsg = false; // 只有在下次拉取新数据时才有可能是为ture msg.isShowErrorMsg = false; // 只有在下次拉取新数据时才有可能是为ture
} }
this.$forceUpdate();
} else { } else {
this.$message({ this.$message({
message: res.message, message: res.message,
...@@ -998,17 +996,33 @@ export default { ...@@ -998,17 +996,33 @@ export default {
} }
}).catch( error => { }).catch( error => {
let msg = this.messageList[this.messageList.length - 1]; let msg = this.messageList[this.messageList.length - 1];
if(msg.sendId !== sendId) {
msg = this.getMsgBySendId(sendId);
}
msg.isShowLoadingIcon = false; msg.isShowLoadingIcon = false;
msg.isShowErrorIcon = true; msg.isShowErrorIcon = true;
msg.isShowErrorMsg = false; // 只有在下次拉取新数据时才有可能是为ture msg.isShowErrorMsg = false; // 只有在下次拉取新数据时才有可能是为ture
msg.canRepeatSend = true; msg.canRepeatSend = true;
}); });
this.$forceUpdate();
// 重新开启定时器 // 重新开启定时器
forwardMsgIntervalId = setInterval(() => { forwardMsgIntervalId = setInterval(() => {
this.getMSGForward(); this.getMSGForward();
}, 3000); }, 3000);
}, },
// 根据sendId,查找到对应的消息
getMsgBySendId(sendId) {
console.log('------------getMsgBySendId------------');
let l = this.messageList.length, i = l - 1;
for(; i > 0; i --) {
if(this.messageList[i].sendId == sendId) {
break;
}
}
return this.messageList[i];
},
// 文件大小单位转换 // 文件大小单位转换
fileSizeChange(val) { fileSizeChange(val) {
return betaHandle(val); return betaHandle(val);
......
...@@ -224,7 +224,8 @@ export default { ...@@ -224,7 +224,8 @@ export default {
}, },
// 打开PDF // 打开PDF
downPDF(url) { downPDF(url) {
window.location.href = url window.open(url, "__blank");
// window.location.href = url
} }
} }
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册