接入H5讲解后端数据闭环

This commit is contained in:
lyf
2026-06-30 17:22:20 +08:00
parent 1c2cc788d1
commit e3682ed3ec
13 changed files with 815 additions and 68 deletions

View File

@@ -76,7 +76,7 @@
ref="audioPlayerRef"
:visible="showAudioPlayer"
:audio="currentAudio"
:auto-play="true"
:auto-play="false"
@update:visible="handleAudioVisibleChange"
@play="handleAudioPlay"
@pause="handleAudioPause"
@@ -189,6 +189,18 @@ onLoad(async (options: any = {}) => {
if (exhibitData.hallId) {
resolvedHallId.value = exhibitData.hallId
}
void explainUseCase.enrichExhibitDetailAudio(exhibitId)
.then((enrichedExhibit) => {
if (!enrichedExhibit || exhibit.value.id !== exhibitId) return
exhibit.value = toExplainDetailPageViewModel(enrichedExhibit)
if (enrichedExhibit.hallId) {
resolvedHallId.value = enrichedExhibit.hallId
}
})
.catch((error) => {
console.warn('讲解详情音频正文后台补充失败:', error)
})
}
})
@@ -210,11 +222,7 @@ const handlePlayAudio = async () => {
showAudioPlayer.value = true
currentAudio.value = audio
await nextTick()
if (!isPlaying.value) {
audioPlayerRef.value?.play(audio)
}
audioPlayerRef.value?.play(audio)
return
}
@@ -247,10 +255,10 @@ const handlePlayAudio = async () => {
showAudioPlayer.value = true
currentAudio.value = audio
await nextTick()
if (!isPlaying.value) {
audioPlayerRef.value?.play(audio)
}
uni.showToast({
title: '音频已准备好,请点击底部播放按钮',
icon: 'none'
})
}
const handleAudioVisibleChange = (visible: boolean) => {