wkw 1 tydzień temu
rodzic
commit
7b89812529
1 zmienionych plików z 2 dodań i 44 usunięć
  1. 2 44
      src/views/im/chat/index.vue

+ 2 - 44
src/views/im/chat/index.vue

@@ -42,10 +42,9 @@
               </div>
 
               <!-- 图片消息 -->
-              <div class="content" v-else-if="item.contentType === 2">
+              <div v-else-if="item.contentType === 2">
                 <img
                   :src="item.content"
-                  alt="图片"
                   style="max-width: 120px; border-radius: 8px"
                 />
               </div>
@@ -60,22 +59,7 @@
               </div>
 
               <!-- 录音消息 -->
-              <div
-                class="audio-message"
-                v-else-if="item.contentType === MSG_TYPE.AUDIO"
-              >
-                <!-- <audio
-                  v-if="item.localUrl"
-                  :src="item.localUrl"
-                  controls
-                  style="width: 200px"
-                />
-                <audio
-                  v-else
-                  :src="IM_PATH + item.url"
-                  controls
-                  style="width: 200px"
-                /> -->
+              <div v-else-if="item.contentType === MSG_TYPE.AUDIO">
                 <messageAudio  v-if="item.localUrl" :src="item.localUrl" :isSender="isSender(item.toUsername)"/>
                 <messageAudio  v-else :src="IM_PATH + item.url" :isSender="isSender(item.toUsername)"/>
               </div>
@@ -222,7 +206,6 @@ watch(
 // 平台判断
 const isMobile = Capacitor.getPlatform() !== "web";
 
-// 底部高度动态计算
 // 语音
 const isTouchDevice = ref(false);
 const mediaRecorder = ref(null); // 录音对象
@@ -352,18 +335,6 @@ const sendAudioMessage = async (event) => {
     console.error("Error sending audio message:", error);
   }
 };
-
-const audio = ref(null);
-
-const playAudio = (url) => {
-  const audioUrl = `${IM_PATH}${url}`;
-  if (audio.value) {
-    audio.value.pause();
-  }
-  audio.value = new Audio(audioUrl);
-  audio.value.play();
-};
-
 // 发送消息
 const sendMessage = () => {
   if (!text.value.trim()) return;
@@ -575,19 +546,6 @@ const goDetail = () => router.push("detail");
             font-weight: 400;
             font-size: 15px;
           }
-          .voice-bubble {
-            display: flex;
-            align-items: center;
-            max-width: 180px;
-            cursor: pointer;
-          }
-          .voice-bubble .duration {
-            margin-right: 6px;
-          }
-          .voice-bubble .voice-icon img {
-            width: 18px;
-            height: 18px;
-          }
         }
       }
       .withdrawal {