即时通信嵌入开发完成,期待下次开发将ui嵌入navbar中,以及完成拉起群聊以及群聊系统开发

This commit is contained in:
2024-10-29 16:46:27 +08:00
parent 7a73f4d2b5
commit 8662ce971d
21 changed files with 967 additions and 32 deletions

View File

@@ -212,7 +212,9 @@ export default {
this.msgListLoading = true;
getContact(concatId).then(response => {
if (response.code === 200) {
console.log(response.data)
this.currentContact = response.data;
this.msgList = response.data.messages;
}
this.msgListLoading = false;
@@ -223,6 +225,7 @@ export default {
this.inputVal += emoji.data;
},
send() {
console.log("发送数据")
const message = {
contactId: this.currentContact.id,
userId: this.userId,
@@ -235,7 +238,7 @@ export default {
createTime: parseTime(new Date())
})
this.fleshLastMsg();
addMessage(message);
addMessage(message)
const msg = {
sendUserId: this.userId,
sendUserName: this.$store.state.user.name,
@@ -243,12 +246,12 @@ export default {
type: "chat",
detail: this.inputVal
}
this.$websocket.sendWebsocket(JSON.stringify(msg));
this.$webSocket.sendWebsocket(JSON.stringify(msg));
this.inputVal = '';
this.fleshScroll();
},
subscribeMessage(res) {
console.log(res);
if (res) {
const { sendUserId, sendUserName, userId, type, detail } = res.detail.data;
const message = {