@@ -33,6 +33,7 @@
|
||||
<slot></slot>
|
||||
</view>
|
||||
<GlobalAudioPlayerHost
|
||||
v-if="showAudioPlayerHost"
|
||||
:avoid-bottom-nav="audioPlayerAvoidBottomNav"
|
||||
:display-mode="audioPlayerMode"
|
||||
:closable="audioPlayerClosable"
|
||||
@@ -59,6 +60,7 @@ withDefaults(defineProps<{
|
||||
audioPlayerAvoidBottomNav?: boolean
|
||||
audioPlayerMode?: AudioDisplayMode
|
||||
audioPlayerClosable?: boolean
|
||||
showAudioPlayerHost?: boolean
|
||||
}>(), {
|
||||
activeTab: 'guide',
|
||||
variant: 'overlay',
|
||||
@@ -71,7 +73,8 @@ withDefaults(defineProps<{
|
||||
cancelLabel: '取消',
|
||||
audioPlayerAvoidBottomNav: true,
|
||||
audioPlayerMode: 'mini',
|
||||
audioPlayerClosable: true
|
||||
audioPlayerClosable: true,
|
||||
showAudioPlayerHost: false
|
||||
})
|
||||
|
||||
const emit = defineEmits<{
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -3,7 +3,6 @@
|
||||
active-tab="guide"
|
||||
variant="overlay"
|
||||
:show-top-tabs="false"
|
||||
audio-player-mode="floating"
|
||||
show-back
|
||||
@tab-change="handleTopTabChange"
|
||||
@back="handlePageBack"
|
||||
|
||||
@@ -3,7 +3,6 @@
|
||||
:active-tab="currentTab"
|
||||
variant="overlay"
|
||||
:show-top-tabs="false"
|
||||
:audio-player-mode="currentTab === 'guide' ? 'floating' : 'mini'"
|
||||
@tab-change="handleTabChange"
|
||||
>
|
||||
<GuideMapShell
|
||||
|
||||
@@ -3,7 +3,6 @@
|
||||
active-tab="guide"
|
||||
variant="overlay"
|
||||
:show-top-tabs="false"
|
||||
audio-player-mode="floating"
|
||||
show-back
|
||||
:show-cancel="isManualLocationPanelOpen"
|
||||
@tab-change="handleTopTabChange"
|
||||
|
||||
@@ -17,17 +17,12 @@
|
||||
autofocus
|
||||
/>
|
||||
</view>
|
||||
<GlobalAudioPlayerHost
|
||||
display-mode="floating"
|
||||
:avoid-bottom-nav="false"
|
||||
/>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { onMounted, onUnmounted, ref } from 'vue'
|
||||
import { onLoad } from '@dcloudio/uni-app'
|
||||
import GlobalAudioPlayerHost from '@/components/audio/GlobalAudioPlayerHost.vue'
|
||||
import PoiSearchPanel from '@/components/search/PoiSearchPanel.vue'
|
||||
|
||||
const initialKeyword = ref('')
|
||||
|
||||
Reference in New Issue
Block a user