提交 96b90015 编写于 作者: 楼国栋

Merge branch 'fix/im_js_bug' into 'wrdp'

修复web端IM聊天的一个bug

See merge request o2oa/o2oa!4220
......@@ -83,9 +83,10 @@ public class ActionConversationCreate extends BaseAction {
}else {
for (int i = 0; i < conversation.getPersonList().size(); i++) {
String person = conversation.getPersonList().get(i);
if (i > 3) {
if (i == 3) {
title += person.substring(0, person.indexOf("@"));
title += "...";
break;
}else {
title += person.substring(0, person.indexOf("@")) + "、";
}
......
......@@ -145,6 +145,9 @@
float:left;
color: rgb(51, 51, 51);
overflow:hidden;
max-width: 170px;
text-overflow: ellipsis;
white-space: nowrap;
}
.o2_im_chat_list .item .body_up .body_time {
float: right;
......
......@@ -883,29 +883,31 @@ MWF.xApplication.IMV2.ConversationItem = new Class({
* @param {*} lastMessage
*/
refreshLastMsg: function (lastMessage) {
//目前是text 类型的消息
var jsonbody = lastMessage.body;
var body = JSON.parse(jsonbody);
if (lastMessage) {
//目前是text 类型的消息
var jsonbody = lastMessage.body;
var body = JSON.parse(jsonbody);
if (this.lastMessageNode) {
if (body.type == "emoji") { //表情 消息
var imgPath = "";
for (var i = 0; i < this.main.emojiList.length; i++) {
var emoji = this.main.emojiList[i];
if (emoji.key == body.body) {
imgPath = emoji.path;
if (this.lastMessageNode) {
if (body.type == "emoji") { //表情 消息
var imgPath = "";
for (var i = 0; i < this.main.emojiList.length; i++) {
var emoji = this.main.emojiList[i];
if (emoji.key == body.body) {
imgPath = emoji.path;
}
}
this.lastMessageNode.empty();
new Element("img", { "src": imgPath, "style": "width: 16px;height: 16px;" }).inject(this.lastMessageNode);
} else { //文本消息
this.lastMessageNode.empty();
this.lastMessageNode.set('text', body.body);
}
this.lastMessageNode.empty();
new Element("img", { "src": imgPath, "style": "width: 16px;height: 16px;" }).inject(this.lastMessageNode);
} else { //文本消息
this.lastMessageNode.empty();
this.lastMessageNode.set('text', body.body);
}
}
var time = this.main._friendlyTime(o2.common.toDate(lastMessage.createTime));
if (this.messageTimeNode) {
this.messageTimeNode.set("text", time);
var time = this.main._friendlyTime(o2.common.toDate(lastMessage.createTime));
if (this.messageTimeNode) {
this.messageTimeNode.set("text", time);
}
}
},
// 更新聊天窗口上的标题 修改标题的时候使用 @Disuse 使用refreshData
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册