|
|
@@ -95,10 +95,6 @@
|
|
|
v-if="player.errorId.value === message.id"
|
|
|
class="play-error-hint"
|
|
|
>点击重试</span>
|
|
|
- <span
|
|
|
- v-else
|
|
|
- class="voice-duration voice-duration-ai"
|
|
|
- >0:04</span>
|
|
|
</div>
|
|
|
|
|
|
<!-- 英文文本 -->
|
|
|
@@ -137,7 +133,7 @@
|
|
|
<span
|
|
|
v-else
|
|
|
class="voice-duration voice-duration-student"
|
|
|
- >0:04</span>
|
|
|
+ >{{ formatDuration(message.audioDuration) }}</span>
|
|
|
<div class="wave-bar-group">
|
|
|
<div
|
|
|
v-for="i in 14"
|
|
|
@@ -701,6 +697,14 @@ function formatSeconds(s: number): string {
|
|
|
return `${m}:${sec.toString().padStart(2, '0')}`
|
|
|
}
|
|
|
|
|
|
+function formatDuration(seconds: number | null | undefined): string {
|
|
|
+ if (seconds == null || !Number.isFinite(seconds)) return '--:--'
|
|
|
+ const total = Math.round(seconds)
|
|
|
+ const mins = Math.floor(total / 60)
|
|
|
+ const secs = total % 60
|
|
|
+ return `${mins}:${String(secs).padStart(2, '0')}`
|
|
|
+}
|
|
|
+
|
|
|
function getWordAnalysis(message: PreviewChatMessage, word: string) {
|
|
|
const clean = word.replace(/[.,!?]/g, '')
|
|
|
return message.evaluation?.wordAnalysis?.find(w => w.word === clean)
|