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

fix: 1.聊天页面的 消息 和二维码的页面调整
2.消息的处理

suwenjiang 1 hónapja
szülő
commit
851e71c54d

+ 2 - 2
src/pages/chat/chat-message/index.vue

@@ -4,7 +4,7 @@
     <div class="chat-message__content">
       <van-image
           v-if="msg.viewType === 1"
-          :src="defaultAvatar"
+          :src="msg.headImageUrl"
           width="40px"
           height="40px"
           radius="100%"
@@ -30,7 +30,7 @@
 <!--      <div class="self-center text-sm mx-5 text-black-9">发送中</div>-->
       <van-image
           v-if="msg.viewType === 0"
-          :src="userInfo?.headImageUrl || defaultAvatar"
+          :src="msg.headImageUrl"
           width="40px"
           height="40px"
           radius="100%"

+ 31 - 47
src/pages/profile/my-news/index.vue

@@ -233,38 +233,38 @@
           <!-- 置顶绘画列表  "-->
           <div v-if="isTopList?.length && activeNames" class="w-full">
             <template v-for="(item, index) in isTopList" :key="item?.id">
-              <template v-if="index > 2">
-                <!-- 群聊会话 -->
-                <ProfileNewsGroupChat
-                  v-if="item?.noticeType == 2"
-                  :item-data="{
-                    ...item,
-                    updateTime: item?.lastMessage
-                      ? createTimeSplit(item?.lastMessage?.updateTime)
-                      : ''
-                  }"
-                  @on-chat-page="goDetails('group', item)"
-                  @on-no-bother="noBother(item)"
-                  @on-is-top="onIsTop(item)"
-                  @on-conv-delete="onIsShow(item)"
-                />
+              <!-- <template v-if="index > 2"> -->
+              <!-- 群聊会话 -->
+              <ProfileNewsGroupChat
+                v-if="item?.noticeType == 2"
+                :item-data="{
+                  ...item,
+                  updateTime: item?.lastMessage
+                    ? createTimeSplit(item?.lastMessage?.updateTime)
+                    : ''
+                }"
+                @on-chat-page="goDetails('group', item)"
+                @on-no-bother="noBother(item)"
+                @on-is-top="onIsTop(item)"
+                @on-conv-delete="onIsShow(item)"
+              />
 
-                <!-- 单聊会话 -->
-                <ProfileNewsSingleChat
-                  v-if="item?.noticeType == 1"
-                  :item-data="{
-                    ...item,
-                    updateTime: item?.lastMessage
-                      ? createTimeSplit(item?.lastMessage?.updateTime)
-                      : ''
-                  }"
-                  @on-chat-page="goDetails('single', item)"
-                  @on-no-bother="noBother(item)"
-                  @on-is-top="onIsTop(item)"
-                  @on-conv-delete="onIsShow(item)"
-                />
-              </template>
-              <template v-else></template>
+              <!-- 单聊会话 -->
+              <ProfileNewsSingleChat
+                v-if="item?.noticeType == 1"
+                :item-data="{
+                  ...item,
+                  updateTime: item?.lastMessage
+                    ? createTimeSplit(item?.lastMessage?.updateTime)
+                    : ''
+                }"
+                @on-chat-page="goDetails('single', item)"
+                @on-no-bother="noBother(item)"
+                @on-is-top="onIsTop(item)"
+                @on-conv-delete="onIsShow(item)"
+              />
+              <!-- </template> -->
+              <!-- <template v-else></template> -->
             </template>
           </div>
 
@@ -318,7 +318,6 @@ import comments from '~/assets/img/chat/comments-white.svg'
 import plaza from '~/assets/img/chat/guangchang.svg'
 import userAdd from '~/assets/img/chat/user-add.svg'
 
-import { messageContentParse } from '~/utils/detalTime.js'
 import { XYWebSocket } from '~/utils/XYWebSocket.ts'
 
 const actionsList = [
@@ -489,21 +488,6 @@ const readMessage = async (groupId) => {
   await chatsStore.getChatList()
 }
 
-// 消息的内容转换
-function messageShowName(messageContent) {
-  try {
-    let content = {}
-    if (messageContent) {
-      content = JSON.parse(messageContent)
-      return content.showName
-    } else {
-      return ''
-    }
-  } catch (error) {
-    console.log(error)
-  }
-}
-
 onMounted(() => {
   chatsStore.getChatList()
   XYWebSocket.SocketEventsBus.on(XYWebSocket.SocketEvents.chatEvent, () => {

+ 6 - 4
src/pages/scan/index.vue

@@ -36,10 +36,12 @@ const openQrcode = async () => {
           width: 250,
           height: 250
         },
-        // videoConstraints: {
-        //   width: window.visualViewport.width,
-        //  },
-        aspectRatio: window.visualViewport.height / window.visualViewport.width
+        videoConstraints: {
+          // width: window.visualViewport.width,
+          width: 375,
+          aspectRatio: 6 / 18
+          // aspectRatio: window.visualViewport.height / window.visualViewport.width
+        }
       }
       if (devices && devices.length) {
         // 当前环境下能识别出摄像头,并且摄像头的数据可能不止一个

+ 1 - 1
src/stores/useChats.js

@@ -83,7 +83,7 @@ export const useChatsStore = defineStore('chats', () => {
       let messageContent = JSON.parse(o.messageContent)
       messageContent.sendUserId = o.sendUserId;
       messageContent.messageId = o.id;
-      console.log(messageContent, 'messageContent')
+      // console.log(messageContent, 'messageContent')
 
       return messageContent
     });