diff --git a/im-ui/src/components/chat/ChatBox.vue b/im-ui/src/components/chat/ChatBox.vue index ec4a92d..14bf987 100644 --- a/im-ui/src/components/chat/ChatBox.vue +++ b/im-ui/src/components/chat/ChatBox.vue @@ -20,7 +20,6 @@
-
+
+
@@ -46,6 +47,8 @@ + + @@ -54,6 +57,7 @@ import MessageItem from "./MessageItem.vue"; import FileUpload from "../common/FileUpload.vue"; import Emotion from "../common/Emotion.vue"; + import ChatVoice from "./ChatVoice.vue"; export default { name: "chatPrivate", @@ -61,7 +65,8 @@ MessageItem, FileUpload, ChatGroupSide, - Emotion + Emotion, + ChatVoice }, props: { chat: { @@ -74,6 +79,7 @@ group: {}, groupMembers: [], sendText: "", + showVoice: false, // 是否显示语音录制弹窗 showSide: false, // 是否显示群聊信息栏 showEmotion: false, // 是否显示emoji表情 emoBoxPos: { // emoji表情弹出位置 @@ -83,6 +89,7 @@ } }, methods: { + handleImageSuccess(res, file) { let msgInfo = { recvId: file.raw.targetId, @@ -213,9 +220,17 @@ }, handleEmotion(emoText) { this.sendText += emoText; + this.showEmotion = false; // 保持输入框焦点 this.$refs.sendBox.focus(); }, + showVoiceBox() { + this.showVoice = true; + + }, + closeVoiceBox(){ + this.showVoice = false; + }, setTargetId(msgInfo, targetId) { if (this.chat.type == "GROUP") { msgInfo.groupId = targetId; @@ -336,7 +351,7 @@ watch: { chat: { handler(newChat, oldChat) { - if(newChat.targetId > 0 && (newChat.type != oldChat.type || newChat.targetId != oldChat.targetId)){ + if (newChat.targetId > 0 && (newChat.type != oldChat.type || newChat.targetId != oldChat.targetId)) { if (this.chat.type == "GROUP") { this.loadGroup(this.chat.targetId); } else { @@ -346,7 +361,7 @@ this.sendText = ""; // 保持输入框焦点 this.$refs.sendBox.focus(); - } + } }, deep: true } diff --git a/im-ui/src/components/chat/ChatVoice.vue b/im-ui/src/components/chat/ChatVoice.vue new file mode 100644 index 0000000..a18250e --- /dev/null +++ b/im-ui/src/components/chat/ChatVoice.vue @@ -0,0 +1,100 @@ + + + + + diff --git a/im-ui/src/view/Home.vue b/im-ui/src/view/Home.vue index f654c7d..85f6d84 100644 --- a/im-ui/src/view/Home.vue +++ b/im-ui/src/view/Home.vue @@ -23,7 +23,7 @@ - + @@ -34,7 +34,7 @@ - +