Forráskód Böngészése

还是处理消息提示的问题第3次提交

liling 1 éve
szülő
commit
7587929d6a
1 módosított fájl, 4 hozzáadás és 2 törlés
  1. 4 2
      src/views/liveChat/index.vue

+ 4 - 2
src/views/liveChat/index.vue

@@ -78,7 +78,7 @@ const getMsgList = async () => {
   if (clickPersonId.value ==0 && personList.data.length>0) {
     clickPersonId.value = personList.data[0].fromId
   }
-  console.log("会话列表获取完成!")
+  // console.log("会话列表获取完成!")
   //圆点======
   sendCont.data.toId =
     personList.data[0]?.toId == userIds.uid
@@ -326,7 +326,9 @@ watchEffect(async() => {
     if(clickPersonId.value!=newMessages.fromId){
       let isExist=false // 当前消息发送人员是否已在对话人员列表中
       for(let i=0;i<searchData.value.length;i++){
-        if(searchData.value[i].fromId==newMessages.fromId){
+        let chatUserID = searchData.value[i].fromId
+        if(chatUserID==userIds.uid) chatUserID = searchData.value[i].toId
+        if(chatUserID==newMessages.fromId){
           isExist = true
           searchData.value[i].showCircel = true
           searchData.value[i].content = newMessages.content