Przeglądaj źródła

fix: 1.修改群名称的问题和单聊名称的问题

suwenjiang 1 miesiąc temu
rodzic
commit
3562b36f88

+ 4 - 4
.env.development

@@ -19,13 +19,13 @@ VITE_APP_ENV=development
 # 本地socoket
 # 本地socoket
 # VITE_APP_IM_URL=ws://192.168.1.44:8082/system/message
 # VITE_APP_IM_URL=ws://192.168.1.44:8082/system/message
 # 花生壳
 # 花生壳
-# VITE_APP_BASE_URL=http://q9943037p3.goho.co
-# VITE_APP_IM_URL=ws://q9943037p3.goho.co/system/message
+VITE_APP_BASE_URL=http://q9943037p3.goho.co
+VITE_APP_IM_URL=ws://q9943037p3.goho.co/system/message
 
 
 # 张维本地
 # 张维本地
-VITE_APP_BASE_URL=http://192.168.1.73:8082/
+# VITE_APP_BASE_URL=http://192.168.1.73:8082/
 # 本地socoket
 # 本地socoket
-VITE_APP_IM_URL=ws://192.168.1.73:8082/system/message
+# VITE_APP_IM_URL=ws://192.168.1.73:8082/system/message
 # 花生壳
 # 花生壳
 # VITE_APP_BASE_URL=http://4eqxwr.natappfree.cc
 # VITE_APP_BASE_URL=http://4eqxwr.natappfree.cc
 # VITE_APP_IM_URL=ws://4eqxwr.natappfree.cc/system/message
 # VITE_APP_IM_URL=ws://4eqxwr.natappfree.cc/system/message

+ 9 - 0
src/pages/chat/group-chat.vue

@@ -361,6 +361,15 @@ async function getAnnouncement() {
     if (Array.isArray(data.memberList) && data?.memberList?.length) {
     if (Array.isArray(data.memberList) && data?.memberList?.length) {
       data.memberList.map((el) => {
       data.memberList.map((el) => {
         if (el.userId == userInfo.value.userId) {
         if (el.userId == userInfo.value.userId) {
+          console.log(el, 'el  前')
+          // 头部的名称已自己的备注名优先
+          if (el?.groupRemark) {
+            el.groupName = el.groupRemark
+          } else {
+            el.groupName = data?.groupName
+          }
+
+          console.log(el, 'el  后')
           groupMemberInfo.value = el
           groupMemberInfo.value = el
         }
         }
       })
       })

+ 4 - 5
src/pages/chat/single-chat.vue

@@ -9,7 +9,7 @@
       <template #title>
       <template #title>
         <div class="text-2xl text-black-3 text-semibold flex items-center">
         <div class="text-2xl text-black-3 text-semibold flex items-center">
           <div style="min-width: 50px; max-width: 200px" class="inline-block line-clamp-1">
           <div style="min-width: 50px; max-width: 200px" class="inline-block line-clamp-1">
-            {{ groupRemark }}
+            {{ memberInfo?.groupRemark }}
           </div>
           </div>
           <span
           <span
             v-if="memberInfo?.isNotDisturb"
             v-if="memberInfo?.isNotDisturb"
@@ -83,7 +83,6 @@ const { userInfo } = storeToRefs(userInfoStore)
 
 
 // 对方成员的信息
 // 对方成员的信息
 const memberInfo = ref({})
 const memberInfo = ref({})
-const groupRemark = ref(route.query?.groupRemark)
 
 
 // 聊天列表
 // 聊天列表
 const chatListRef = ref(null)
 const chatListRef = ref(null)
@@ -182,7 +181,7 @@ const sendTextMessage = async (text) => {
       }
       }
     }
     }
     const isLink = !!findHyperlinks(text)
     const isLink = !!findHyperlinks(text)
-    if (isLink) msg.messageType = 0;
+    if (isLink) msg.messageType = 0
     console.log(currConversationChatList.value, '1122')
     console.log(currConversationChatList.value, '1122')
     currConversationChatList.value.push(msg)
     currConversationChatList.value.push(msg)
     await scrollToBottom()
     await scrollToBottom()
@@ -351,12 +350,12 @@ onMounted(() => {
 watchEffect(() => {})
 watchEffect(() => {})
 
 
 // 会话好友的信息
 // 会话好友的信息
-const getAnnouncement =  () => {
+const getAnnouncement = () => {
   return new Promise((resolve) => {
   return new Promise((resolve) => {
     request('/website/tourMember/getOneWayMember', {
     request('/website/tourMember/getOneWayMember', {
       query: { groupId: groupId.value }
       query: { groupId: groupId.value }
     }).then(({ data = [] }) => {
     }).then(({ data = [] }) => {
-      resolve(data.find((o) => o.partnerId === getUserId.value) ?? {})
+      resolve(data.find((o) => o.userId === userInfo.value.userId) ?? {})
     })
     })
   })
   })
 }
 }

+ 1 - 3
src/pages/profile/my-news/index.vue

@@ -435,8 +435,7 @@ const goDetails = (type, item) => {
       navigateTo({
       navigateTo({
         path: '/chat/single-chat',
         path: '/chat/single-chat',
         query: {
         query: {
-          getUserId: item?.toUserId,
-          groupRemark: item?.groupRemark
+          getUserId: item?.toUserId
         }
         }
       })
       })
       break
       break
@@ -446,7 +445,6 @@ const goDetails = (type, item) => {
         path: '/chat/group-chat',
         path: '/chat/group-chat',
         query: {
         query: {
           groupId: item?.groupId
           groupId: item?.groupId
-          // groupRemark: item?.groupRemark
         }
         }
       })
       })
       break
       break