提交小程序合入代码
This commit is contained in:
@@ -10,6 +10,7 @@ import {
|
||||
ConversationSource,
|
||||
PeerKind,
|
||||
} from '../../../services/chat'
|
||||
import { useSystemBanner } from '@/components/system-banner/use-system-banner'
|
||||
import './index.scss'
|
||||
|
||||
function normalizePeerKind(value?: string): PeerKind {
|
||||
@@ -53,6 +54,7 @@ function formatAudioDuration(durationMs?: number | null): string {
|
||||
}
|
||||
|
||||
export default function ChatDetail() {
|
||||
const systemBanner = useSystemBanner()
|
||||
const router = useRouter()
|
||||
const params = router.params
|
||||
|
||||
@@ -322,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>
|
||||
)
|
||||
@@ -421,6 +419,7 @@ export default function ChatDetail() {
|
||||
</View>
|
||||
</View>
|
||||
)}
|
||||
{systemBanner}
|
||||
</View>
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user