限制讲解播放器显示范围
Some checks failed
CI / verify (push) Has been cancelled

This commit is contained in:
lyf
2026-07-09 19:38:28 +08:00
parent 305f83dfa4
commit 63540dac65
6 changed files with 12 additions and 10 deletions

View File

@@ -5,6 +5,7 @@
:show-top-tabs="false"
:audio-player-avoid-bottom-nav="false"
:audio-player-closable="false"
:show-audio-player-host="true"
audio-player-mode="expanded"
@back="handleBack"
>
@@ -145,7 +146,7 @@
<script setup lang="ts">
import { computed, ref, watch } from 'vue'
import { onLoad } from '@dcloudio/uni-app'
import { onLoad, onUnload } from '@dcloudio/uni-app'
import GuidePageFrame from '@/components/navigation/GuidePageFrame.vue'
import type { AudioItem } from '@/components/audio/AudioPlayer.vue'
import { useGlobalAudioPlayer } from '@/composables/useGlobalAudioPlayer'
@@ -468,6 +469,10 @@ onLoad(async (options: any = {}) => {
}
})
onUnload(() => {
globalAudioPlayer.close()
})
const detailTextFor = (lang: AudioLanguage) => {
return detailTextByLanguage.value[lang] || fallbackTextForLanguage(lang)
}
@@ -688,6 +693,8 @@ const fallbackToExplainHome = () => {
}
const handleBack = () => {
globalAudioPlayer.close()
if (typeof window !== 'undefined' && window.history.length > 1) {
const currentHref = window.location.href
window.history.back()