mirror of
https://github.com/jxxghp/MoviePilot-Frontend.git
synced 2026-09-06 08:06:43 +08:00
feat(Footer): 优化底部导航样式
This commit is contained in:
@@ -1,4 +1,5 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
|
import { SystemNavMenus } from '@/router/menu'
|
||||||
import { useDisplay } from 'vuetify'
|
import { useDisplay } from 'vuetify'
|
||||||
|
|
||||||
const display = useDisplay()
|
const display = useDisplay()
|
||||||
@@ -6,16 +7,24 @@ const appMode = inject('pwaMode') && display.mdAndDown.value
|
|||||||
|
|
||||||
const route = useRoute()
|
const route = useRoute()
|
||||||
|
|
||||||
// 各按钮活动状态
|
const moreMenuDialog = ref(false)
|
||||||
|
|
||||||
|
const moreMemus = computed(() => SystemNavMenus.filter(menu => !menu.footer))
|
||||||
|
|
||||||
const activeState = computed(() => {
|
const activeState = computed(() => {
|
||||||
return {
|
return {
|
||||||
home: route.path === '/dashboard',
|
home: route.path === '/dashboard',
|
||||||
recommend: route.path === '/recommend',
|
recommend: route.path === '/recommend',
|
||||||
movie: route.path === '/subscribe/movie',
|
movie: route.path === '/subscribe/movie',
|
||||||
tv: route.path === '/subscribe/tv',
|
tv: route.path === '/subscribe/tv',
|
||||||
apps: route.path === '/apps',
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
const currentPath = computed(() => route.path)
|
||||||
|
|
||||||
|
const toggleMoreMenu = () => {
|
||||||
|
moreMenuDialog.value = !moreMenuDialog.value
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
@@ -26,6 +35,7 @@ const activeState = computed(() => {
|
|||||||
color="primary"
|
color="primary"
|
||||||
class="footer-nav border-t"
|
class="footer-nav border-t"
|
||||||
style="block-size: calc(3.5rem + env(safe-area-inset-bottom))"
|
style="block-size: calc(3.5rem + env(safe-area-inset-bottom))"
|
||||||
|
:z-index="9998"
|
||||||
>
|
>
|
||||||
<VBtn to="/dashboard" :ripple="false">
|
<VBtn to="/dashboard" :ripple="false">
|
||||||
<VIcon v-if="activeState.home" size="28">mdi-home</VIcon>
|
<VIcon v-if="activeState.home" size="28">mdi-home</VIcon>
|
||||||
@@ -43,11 +53,41 @@ const activeState = computed(() => {
|
|||||||
<VIcon v-if="activeState.tv" size="28">mdi-television-play</VIcon>
|
<VIcon v-if="activeState.tv" size="28">mdi-television-play</VIcon>
|
||||||
<VIcon v-else size="28">mdi-television</VIcon>
|
<VIcon v-else size="28">mdi-television</VIcon>
|
||||||
</VBtn>
|
</VBtn>
|
||||||
<VBtn to="/apps" :ripple="false">
|
<VBtn @click="toggleMoreMenu" :ripple="false">
|
||||||
<VIcon v-if="activeState.apps" size="28">mdi-dots-horizontal-circle</VIcon>
|
<VIcon
|
||||||
<VIcon v-else size="28">mdi-dots-horizontal</VIcon>
|
size="28"
|
||||||
|
:icon="moreMenuDialog ? 'mdi-close' : 'mdi-dots-horizontal'"
|
||||||
|
:color="moreMenuDialog ? 'primary' : ''"
|
||||||
|
/>
|
||||||
</VBtn>
|
</VBtn>
|
||||||
</VBottomNavigation>
|
</VBottomNavigation>
|
||||||
|
<VBottomSheet
|
||||||
|
v-if="moreMenuDialog"
|
||||||
|
v-model="moreMenuDialog"
|
||||||
|
inset
|
||||||
|
close-on-content-click
|
||||||
|
:scrim="false"
|
||||||
|
style="margin-bottom: calc(3.5rem + env(safe-area-inset-bottom))"
|
||||||
|
content-class="elevation-1"
|
||||||
|
active
|
||||||
|
>
|
||||||
|
<VDivider />
|
||||||
|
<VList class="font-bold" lines="one">
|
||||||
|
<VListSubheader class="bg-transparent"> 更多 </VListSubheader>
|
||||||
|
<VListItem
|
||||||
|
v-for="(menu, index) in moreMemus"
|
||||||
|
:key="index"
|
||||||
|
:prepend-icon="menu.icon"
|
||||||
|
nav
|
||||||
|
:to="menu.to"
|
||||||
|
:base-color="currentPath === menu.to ? 'primary' : undefined"
|
||||||
|
>
|
||||||
|
<VListItemTitle>
|
||||||
|
<span class="text-lg">{{ menu.title }}</span>
|
||||||
|
</VListItemTitle>
|
||||||
|
</VListItem>
|
||||||
|
</VList>
|
||||||
|
</VBottomSheet>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|||||||
@@ -549,7 +549,6 @@ onMounted(async () => {
|
|||||||
v-if="SearchDialog"
|
v-if="SearchDialog"
|
||||||
v-model="SearchDialog"
|
v-model="SearchDialog"
|
||||||
scrollable
|
scrollable
|
||||||
:z-index="1010"
|
|
||||||
max-width="40rem"
|
max-width="40rem"
|
||||||
:max-height="!display.mdAndUp.value ? '' : '85vh'"
|
:max-height="!display.mdAndUp.value ? '' : '85vh'"
|
||||||
:fullscreen="!display.mdAndUp.value"
|
:fullscreen="!display.mdAndUp.value"
|
||||||
|
|||||||
Reference in New Issue
Block a user