From 4cc8c1d0f3ff43eaefd3770d7c4fc311a20c22f1 Mon Sep 17 00:00:00 2001 From: xsx <825657193@qq.com> Date: Sat, 11 Nov 2023 20:46:23 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BE=A4=E8=81=8A@=E5=8A=9F=E8=83=BD(=E5=BC=80?= =?UTF-8?q?=E5=8F=91=E4=B8=AD)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- im-ui/src/api/emotion.js | 14 +- im-ui/src/api/wssocket.js | 1 - im-ui/src/components/chat/ChatAtBox.vue | 162 ++++++++++ im-ui/src/components/chat/ChatBox.vue | 402 ++++++++++++++++-------- im-ui/src/components/common/Emotion.vue | 62 ++-- 5 files changed, 482 insertions(+), 159 deletions(-) create mode 100644 im-ui/src/components/chat/ChatAtBox.vue diff --git a/im-ui/src/api/emotion.js b/im-ui/src/api/emotion.js index 1588729..c391496 100644 --- a/im-ui/src/api/emotion.js +++ b/im-ui/src/api/emotion.js @@ -19,12 +19,22 @@ let textToImg = (emoText) => { return emoText; } let url = require(`@/assets/emoji/${idx}.gif`); - return `` + return `` } +let textToUrl = (emoText) => { + let word = emoText.replace(/\#|\;/gi, ''); + let idx = emoTextList.indexOf(word); + if(idx==-1){ + return ""; + } + let url = require(`@/assets/emoji/${idx}.gif`); + return url; +} export default { emoTextList, transform, - textToImg + textToImg, + textToUrl } diff --git a/im-ui/src/api/wssocket.js b/im-ui/src/api/wssocket.js index ef2a237..e89988d 100644 --- a/im-ui/src/api/wssocket.js +++ b/im-ui/src/api/wssocket.js @@ -20,7 +20,6 @@ let connect = (wsurl,accessToken) => { } else if (sendInfo.cmd == 1) { // 重新开启心跳定时 heartCheck.reset(); - console.log("") } else { // 其他消息转发出去 console.log("收到消息:",sendInfo); diff --git a/im-ui/src/components/chat/ChatAtBox.vue b/im-ui/src/components/chat/ChatAtBox.vue new file mode 100644 index 0000000..858cbbf --- /dev/null +++ b/im-ui/src/components/chat/ChatAtBox.vue @@ -0,0 +1,162 @@ + + + + + \ No newline at end of file diff --git a/im-ui/src/components/chat/ChatBox.vue b/im-ui/src/components/chat/ChatBox.vue index 5fd5e1e..57e6b69 100644 --- a/im-ui/src/components/chat/ChatBox.vue +++ b/im-ui/src/components/chat/ChatBox.vue @@ -1,79 +1,88 @@ + \ No newline at end of file