@@ -33,6 +33,7 @@
|
|||||||
<slot></slot>
|
<slot></slot>
|
||||||
</view>
|
</view>
|
||||||
<GlobalAudioPlayerHost
|
<GlobalAudioPlayerHost
|
||||||
|
v-if="showAudioPlayerHost"
|
||||||
:avoid-bottom-nav="audioPlayerAvoidBottomNav"
|
:avoid-bottom-nav="audioPlayerAvoidBottomNav"
|
||||||
:display-mode="audioPlayerMode"
|
:display-mode="audioPlayerMode"
|
||||||
:closable="audioPlayerClosable"
|
:closable="audioPlayerClosable"
|
||||||
@@ -59,6 +60,7 @@ withDefaults(defineProps<{
|
|||||||
audioPlayerAvoidBottomNav?: boolean
|
audioPlayerAvoidBottomNav?: boolean
|
||||||
audioPlayerMode?: AudioDisplayMode
|
audioPlayerMode?: AudioDisplayMode
|
||||||
audioPlayerClosable?: boolean
|
audioPlayerClosable?: boolean
|
||||||
|
showAudioPlayerHost?: boolean
|
||||||
}>(), {
|
}>(), {
|
||||||
activeTab: 'guide',
|
activeTab: 'guide',
|
||||||
variant: 'overlay',
|
variant: 'overlay',
|
||||||
@@ -71,7 +73,8 @@ withDefaults(defineProps<{
|
|||||||
cancelLabel: '取消',
|
cancelLabel: '取消',
|
||||||
audioPlayerAvoidBottomNav: true,
|
audioPlayerAvoidBottomNav: true,
|
||||||
audioPlayerMode: 'mini',
|
audioPlayerMode: 'mini',
|
||||||
audioPlayerClosable: true
|
audioPlayerClosable: true,
|
||||||
|
showAudioPlayerHost: false
|
||||||
})
|
})
|
||||||
|
|
||||||
const emit = defineEmits<{
|
const emit = defineEmits<{
|
||||||
|
|||||||
@@ -5,6 +5,7 @@
|
|||||||
:show-top-tabs="false"
|
:show-top-tabs="false"
|
||||||
:audio-player-avoid-bottom-nav="false"
|
:audio-player-avoid-bottom-nav="false"
|
||||||
:audio-player-closable="false"
|
:audio-player-closable="false"
|
||||||
|
:show-audio-player-host="true"
|
||||||
audio-player-mode="expanded"
|
audio-player-mode="expanded"
|
||||||
@back="handleBack"
|
@back="handleBack"
|
||||||
>
|
>
|
||||||
@@ -145,7 +146,7 @@
|
|||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { computed, ref, watch } from 'vue'
|
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 GuidePageFrame from '@/components/navigation/GuidePageFrame.vue'
|
||||||
import type { AudioItem } from '@/components/audio/AudioPlayer.vue'
|
import type { AudioItem } from '@/components/audio/AudioPlayer.vue'
|
||||||
import { useGlobalAudioPlayer } from '@/composables/useGlobalAudioPlayer'
|
import { useGlobalAudioPlayer } from '@/composables/useGlobalAudioPlayer'
|
||||||
@@ -468,6 +469,10 @@ onLoad(async (options: any = {}) => {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
onUnload(() => {
|
||||||
|
globalAudioPlayer.close()
|
||||||
|
})
|
||||||
|
|
||||||
const detailTextFor = (lang: AudioLanguage) => {
|
const detailTextFor = (lang: AudioLanguage) => {
|
||||||
return detailTextByLanguage.value[lang] || fallbackTextForLanguage(lang)
|
return detailTextByLanguage.value[lang] || fallbackTextForLanguage(lang)
|
||||||
}
|
}
|
||||||
@@ -688,6 +693,8 @@ const fallbackToExplainHome = () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const handleBack = () => {
|
const handleBack = () => {
|
||||||
|
globalAudioPlayer.close()
|
||||||
|
|
||||||
if (typeof window !== 'undefined' && window.history.length > 1) {
|
if (typeof window !== 'undefined' && window.history.length > 1) {
|
||||||
const currentHref = window.location.href
|
const currentHref = window.location.href
|
||||||
window.history.back()
|
window.history.back()
|
||||||
|
|||||||
@@ -3,7 +3,6 @@
|
|||||||
active-tab="guide"
|
active-tab="guide"
|
||||||
variant="overlay"
|
variant="overlay"
|
||||||
:show-top-tabs="false"
|
:show-top-tabs="false"
|
||||||
audio-player-mode="floating"
|
|
||||||
show-back
|
show-back
|
||||||
@tab-change="handleTopTabChange"
|
@tab-change="handleTopTabChange"
|
||||||
@back="handlePageBack"
|
@back="handlePageBack"
|
||||||
|
|||||||
@@ -3,7 +3,6 @@
|
|||||||
:active-tab="currentTab"
|
:active-tab="currentTab"
|
||||||
variant="overlay"
|
variant="overlay"
|
||||||
:show-top-tabs="false"
|
:show-top-tabs="false"
|
||||||
:audio-player-mode="currentTab === 'guide' ? 'floating' : 'mini'"
|
|
||||||
@tab-change="handleTabChange"
|
@tab-change="handleTabChange"
|
||||||
>
|
>
|
||||||
<GuideMapShell
|
<GuideMapShell
|
||||||
|
|||||||
@@ -3,7 +3,6 @@
|
|||||||
active-tab="guide"
|
active-tab="guide"
|
||||||
variant="overlay"
|
variant="overlay"
|
||||||
:show-top-tabs="false"
|
:show-top-tabs="false"
|
||||||
audio-player-mode="floating"
|
|
||||||
show-back
|
show-back
|
||||||
:show-cancel="isManualLocationPanelOpen"
|
:show-cancel="isManualLocationPanelOpen"
|
||||||
@tab-change="handleTopTabChange"
|
@tab-change="handleTopTabChange"
|
||||||
|
|||||||
@@ -17,17 +17,12 @@
|
|||||||
autofocus
|
autofocus
|
||||||
/>
|
/>
|
||||||
</view>
|
</view>
|
||||||
<GlobalAudioPlayerHost
|
|
||||||
display-mode="floating"
|
|
||||||
:avoid-bottom-nav="false"
|
|
||||||
/>
|
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { onMounted, onUnmounted, ref } from 'vue'
|
import { onMounted, onUnmounted, ref } from 'vue'
|
||||||
import { onLoad } from '@dcloudio/uni-app'
|
import { onLoad } from '@dcloudio/uni-app'
|
||||||
import GlobalAudioPlayerHost from '@/components/audio/GlobalAudioPlayerHost.vue'
|
|
||||||
import PoiSearchPanel from '@/components/search/PoiSearchPanel.vue'
|
import PoiSearchPanel from '@/components/search/PoiSearchPanel.vue'
|
||||||
|
|
||||||
const initialKeyword = ref('')
|
const initialKeyword = ref('')
|
||||||
|
|||||||
Reference in New Issue
Block a user