diff --git a/helpers/apiconfig.js b/helpers/apiconfig.js index 75309f9..4f20aa5 100644 --- a/helpers/apiconfig.js +++ b/helpers/apiconfig.js @@ -362,6 +362,7 @@ class apiconfig { //.replace(html(), '\<$1 $2\>').replace(html('/'), '\') //转移HTML代码 //.replace(/\n/g, '
') //转义换行 + return content; } diff --git a/im/chat/chat.vue b/im/chat/chat.vue index ae7fc1c..66a9a3f 100644 --- a/im/chat/chat.vue +++ b/im/chat/chat.vue @@ -592,9 +592,12 @@ export default { let msg_type = val.msg_type; + console.log("asdasd", this.user_other_row.user_avatar); + let msg = { type: "user", sendmethod: this.chattype, + avatar: val.avatar, needload: false, fromid: this.chat_to_puid, toid: tempmy.puid, @@ -604,7 +607,7 @@ export default { userinfo: { uid: this.chat_to_puid, username: this.user_other_row.user_nickname, - face: this.user_other_row.user_avatar, + face: this.user_other_row.user_avatar || val.avatar, }, content: { text: val.content, @@ -1022,10 +1025,10 @@ export default { flag: false, }), clearTimeout(t); + that.setData({ + page: parseInt(that.page) + 1, + }); var t = setTimeout(() => { - that.setData({ - page: parseInt(that.page) + 1, - }); that.getMsgList(() => { //这段代码很重要,不然每次加载历史数据都会跳到顶部 this.$nextTick(function () { @@ -1194,8 +1197,10 @@ export default { list[i].msg.content = this.setPicSize(list[i].msg.content); this.msgImgList.push(list[i].msg.content.url); } + if (list[i].msg.type != "img") { + list[i].msg = this.$apiconfig.im_decode_msg(list[i].msg); + } - list[i].msg = this.$apiconfig.im_decode_msg(list[i].msg); list[i].translate_txt = this.__("翻译"); list[i].msg.translate_txt = this.__("翻译"); } @@ -1221,7 +1226,7 @@ export default { } console.info(data); - console.info(this.msgList); + console.info("msgList", this.msgList); if (callback) { callback(); @@ -1475,7 +1480,6 @@ export default { if (!this.textMsg) { return; } - let content = this.replaceEmoji(this.textMsg); let msg = { text: content,