提交小程序合入代码
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;
|
||||
|
||||
@@ -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>
|
||||
)
|
||||
}
|
||||
|
||||
@@ -3,9 +3,11 @@ import { useState } from 'react'
|
||||
import Taro, { useDidShow } from '@tarojs/taro'
|
||||
import { getToken } from '@/services/auth'
|
||||
import { getConversations, ChatConversation } from '../../services/chat'
|
||||
import { useSystemBanner } from '@/components/system-banner/use-system-banner'
|
||||
import './index.scss'
|
||||
|
||||
export default function Chat() {
|
||||
const systemBanner = useSystemBanner()
|
||||
const [conversations, setConversations] = useState<ChatConversation[]>([])
|
||||
const [loading, setLoading] = useState(true)
|
||||
|
||||
@@ -97,6 +99,7 @@ export default function Chat() {
|
||||
))}
|
||||
</ScrollView>
|
||||
)}
|
||||
{systemBanner}
|
||||
</View>
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user