精简前端语音消息气泡展示
This commit is contained in:
@@ -175,7 +175,7 @@
|
||||
}
|
||||
|
||||
.audio-bubble {
|
||||
min-width: 220px;
|
||||
min-width: 144px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 14px;
|
||||
@@ -191,11 +191,6 @@
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
.audio-bubble-text {
|
||||
flex: 1;
|
||||
font-size: 28px;
|
||||
}
|
||||
|
||||
.audio-bubble-duration {
|
||||
font-size: 24px;
|
||||
opacity: 0.8;
|
||||
|
||||
@@ -324,13 +324,9 @@ export default function ChatDetail() {
|
||||
const renderMessageBody = (msg: ChatMessage) => {
|
||||
if (msg.contentType === 2 && msg.mediaUrl) {
|
||||
const isPlaying = playingMessageId === msg.id
|
||||
const isLeaveMessage = msg.extJson?.message_kind === 'leave_message'
|
||||
return (
|
||||
<View className={`audio-bubble ${isPlaying ? 'playing' : ''}`} onClick={() => handlePlayAudio(msg)}>
|
||||
<Text className='audio-bubble-icon'>{isPlaying ? '[]' : '>'}</Text>
|
||||
<Text className='audio-bubble-text'>
|
||||
{msg.mediaTranscriptText || (isLeaveMessage ? '点击收听留言' : '点击播放语音')}
|
||||
</Text>
|
||||
<Text className='audio-bubble-duration'>{formatAudioDuration(msg.mediaDurationMs)}</Text>
|
||||
</View>
|
||||
)
|
||||
|
||||
@@ -211,10 +211,7 @@ function formatImPreview(
|
||||
): string {
|
||||
if (item.content_type === 1) return item.content_text || '文本消息'
|
||||
if (item.content_type === 2) {
|
||||
if (item.ext_json?.message_kind === 'leave_message') {
|
||||
return item.media_transcript_text || '[留言]'
|
||||
}
|
||||
return item.media_transcript_text || '[语音]'
|
||||
return ''
|
||||
}
|
||||
if (item.content_type === 3) return '[图片]'
|
||||
if (item.content_type === 4) {
|
||||
|
||||
Reference in New Issue
Block a user