|
@@ -42,10 +42,9 @@
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<!-- 图片消息 -->
|
|
<!-- 图片消息 -->
|
|
- <div class="content" v-else-if="item.contentType === 2">
|
|
|
|
|
|
+ <div v-else-if="item.contentType === 2">
|
|
<img
|
|
<img
|
|
:src="item.content"
|
|
:src="item.content"
|
|
- alt="图片"
|
|
|
|
style="max-width: 120px; border-radius: 8px"
|
|
style="max-width: 120px; border-radius: 8px"
|
|
/>
|
|
/>
|
|
</div>
|
|
</div>
|
|
@@ -60,22 +59,7 @@
|
|
</div>
|
|
</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-if="item.localUrl" :src="item.localUrl" :isSender="isSender(item.toUsername)"/>
|
|
<messageAudio v-else :src="IM_PATH + item.url" :isSender="isSender(item.toUsername)"/>
|
|
<messageAudio v-else :src="IM_PATH + item.url" :isSender="isSender(item.toUsername)"/>
|
|
</div>
|
|
</div>
|
|
@@ -222,7 +206,6 @@ watch(
|
|
// 平台判断
|
|
// 平台判断
|
|
const isMobile = Capacitor.getPlatform() !== "web";
|
|
const isMobile = Capacitor.getPlatform() !== "web";
|
|
|
|
|
|
-// 底部高度动态计算
|
|
|
|
// 语音
|
|
// 语音
|
|
const isTouchDevice = ref(false);
|
|
const isTouchDevice = ref(false);
|
|
const mediaRecorder = ref(null); // 录音对象
|
|
const mediaRecorder = ref(null); // 录音对象
|
|
@@ -352,18 +335,6 @@ const sendAudioMessage = async (event) => {
|
|
console.error("Error sending audio message:", error);
|
|
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 = () => {
|
|
const sendMessage = () => {
|
|
if (!text.value.trim()) return;
|
|
if (!text.value.trim()) return;
|
|
@@ -575,19 +546,6 @@ const goDetail = () => router.push("detail");
|
|
font-weight: 400;
|
|
font-weight: 400;
|
|
font-size: 15px;
|
|
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 {
|
|
.withdrawal {
|