接入H5讲解后端数据闭环
This commit is contained in:
@@ -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) => {
|
||||
|
||||
Reference in New Issue
Block a user