mirror of
https://github.com/jxxghp/MoviePilot-Frontend.git
synced 2026-06-28 02:51:56 +08:00
添加发现页面及相关路由和菜单项
This commit is contained in:
50
src/pages/discover.vue
Normal file
50
src/pages/discover.vue
Normal file
@@ -0,0 +1,50 @@
|
||||
<script setup lang="ts">
|
||||
import { DiscoverTabs } from '@/router/menu'
|
||||
import router from '@/router'
|
||||
import TheMovieDbView from '@/views/discover/TheMovieDbView.vue'
|
||||
import DoubanView from '@/views/discover/DoubanView.vue'
|
||||
import BangumiView from '@/views/discover/BangumiView.vue'
|
||||
|
||||
const route = useRoute()
|
||||
const activeTab = ref(route.query.tab)
|
||||
|
||||
function jumpTab(tab: string) {
|
||||
router.push('/subscribe/discover?tab=' + tab)
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div>
|
||||
<VTabs v-model="activeTab" show-arrows>
|
||||
<VTab v-for="item in DiscoverTabs" :value="item.tab" @to="jumpTab(item.tab)">
|
||||
<div class="mx-5">
|
||||
{{ item.title }}
|
||||
</div>
|
||||
</VTab>
|
||||
</VTabs>
|
||||
|
||||
<VWindow v-model="activeTab" class="mt-5 disable-tab-transition" :touch="false">
|
||||
<VWindowItem value="themoviedb">
|
||||
<transition name="fade-slide" appear>
|
||||
<div>
|
||||
<TheMovieDbView />
|
||||
</div>
|
||||
</transition>
|
||||
</VWindowItem>
|
||||
<VWindowItem value="douban">
|
||||
<transition name="fade-slide" appear>
|
||||
<div>
|
||||
<DoubanView />
|
||||
</div>
|
||||
</transition>
|
||||
</VWindowItem>
|
||||
<VWindowItem value="bangumi">
|
||||
<transition name="fade-slide" appear>
|
||||
<div>
|
||||
<BangumiView />
|
||||
</div>
|
||||
</transition>
|
||||
</VWindowItem>
|
||||
</VWindow>
|
||||
</div>
|
||||
</template>
|
||||
@@ -68,7 +68,6 @@ const viewList = reactive<{ apipath: string; linkurl: string; title: string }[]>
|
||||
title: '豆瓣全球剧集榜',
|
||||
},
|
||||
])
|
||||
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
||||
@@ -142,7 +142,6 @@ onUnmounted(() => {
|
||||
<div v-if="isRefreshed">
|
||||
<VFab
|
||||
v-if="viewType === 'list'"
|
||||
class="mb-12"
|
||||
icon="mdi-view-grid"
|
||||
location="bottom"
|
||||
size="x-large"
|
||||
|
||||
@@ -18,12 +18,18 @@ function jumpTab(tab: string) {
|
||||
|
||||
<template>
|
||||
<div>
|
||||
<VTabs v-model="activeTab">
|
||||
<VTabs v-model="activeTab" show-arrows>
|
||||
<VTab v-if="subType == '电影'" v-for="item in SubscribeMovieTabs" :value="item.tab" @to="jumpTab(item.tab)">
|
||||
<span class="mx-5">{{ item.title }}</span>
|
||||
<div class="flex align-center mx-5">
|
||||
<VIcon size="20" start :icon="item.icon" />
|
||||
{{ item.title }}
|
||||
</div>
|
||||
</VTab>
|
||||
<VTab v-if="subType == '电视剧'" v-for="item in SubscribeTvTabs" :value="item.tab" @to="jumpTab(item.tab)">
|
||||
<span class="mx-5">{{ item.title }}</span>
|
||||
<div class="flex align-center mx-5">
|
||||
<VIcon size="20" start :icon="item.icon" />
|
||||
{{ item.title }}
|
||||
</div>
|
||||
</VTab>
|
||||
</VTabs>
|
||||
|
||||
|
||||
@@ -35,6 +35,14 @@ const router = createRouter({
|
||||
requiresAuth: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
path: '/discover',
|
||||
component: () => import('../pages/discover.vue'),
|
||||
meta: {
|
||||
keepAlive: true,
|
||||
requiresAuth: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
path: '/resource',
|
||||
component: () => import('../pages/resource.vue'),
|
||||
|
||||
@@ -16,6 +16,14 @@ export const SystemNavMenus = [
|
||||
admin: false,
|
||||
footer: true,
|
||||
},
|
||||
{
|
||||
title: '探索',
|
||||
icon: 'mdi-apple-safari',
|
||||
to: '/discover',
|
||||
header: '发现',
|
||||
admin: false,
|
||||
footer: true,
|
||||
},
|
||||
{
|
||||
title: '资源搜索',
|
||||
icon: 'mdi-magnify',
|
||||
@@ -169,12 +177,12 @@ export const SubscribeMovieTabs = [
|
||||
{
|
||||
title: '我的订阅',
|
||||
tab: 'mysub',
|
||||
icon: 'mdi-movie-open-outline',
|
||||
icon: 'mdi-heart',
|
||||
},
|
||||
{
|
||||
title: '热门订阅',
|
||||
tab: 'popular',
|
||||
icon: 'mdi-movie-open-outline',
|
||||
icon: 'mdi-fire',
|
||||
},
|
||||
]
|
||||
|
||||
@@ -183,17 +191,17 @@ export const SubscribeTvTabs = [
|
||||
{
|
||||
title: '我的订阅',
|
||||
tab: 'mysub',
|
||||
icon: 'mdi-television',
|
||||
icon: 'mdi-heart',
|
||||
},
|
||||
{
|
||||
title: '热门订阅',
|
||||
tab: 'popular',
|
||||
icon: 'mdi-television',
|
||||
icon: 'mdi-fire',
|
||||
},
|
||||
{
|
||||
title: '订阅分享',
|
||||
tab: 'share',
|
||||
icon: 'mdi-television',
|
||||
icon: 'mdi-share-variant',
|
||||
},
|
||||
]
|
||||
|
||||
@@ -210,3 +218,22 @@ export const PluginTabs = [
|
||||
icon: 'mdi-store',
|
||||
},
|
||||
]
|
||||
|
||||
// 发现标签页
|
||||
export const DiscoverTabs = [
|
||||
{
|
||||
title: 'TheMovieDb',
|
||||
tab: 'themoviedb',
|
||||
icon: '',
|
||||
},
|
||||
{
|
||||
title: '豆瓣',
|
||||
tab: 'douban',
|
||||
icon: '',
|
||||
},
|
||||
{
|
||||
title: 'Bangumi',
|
||||
tab: 'bangumi',
|
||||
icon: '',
|
||||
},
|
||||
]
|
||||
|
||||
2
src/views/discover/BangumiView.vue
Normal file
2
src/views/discover/BangumiView.vue
Normal file
@@ -0,0 +1,2 @@
|
||||
<script setup lang="ts"></script>
|
||||
<template></template>
|
||||
6
src/views/discover/DoubanView.vue
Normal file
6
src/views/discover/DoubanView.vue
Normal file
@@ -0,0 +1,6 @@
|
||||
<script setup lang="ts">
|
||||
|
||||
</script>
|
||||
<template>
|
||||
|
||||
</template>
|
||||
6
src/views/discover/TheMovieDbView.vue
Normal file
6
src/views/discover/TheMovieDbView.vue
Normal file
@@ -0,0 +1,6 @@
|
||||
<script setup lang="ts">
|
||||
|
||||
</script>
|
||||
<template>
|
||||
|
||||
</template>
|
||||
@@ -397,9 +397,12 @@ onMounted(async () => {
|
||||
|
||||
<template>
|
||||
<div>
|
||||
<VTabs v-model="activeTab">
|
||||
<VTabs v-model="activeTab" show-arrows>
|
||||
<VTab v-for="item in PluginTabs" :value="item.tab">
|
||||
<span class="mx-5">{{ item.title }}</span>
|
||||
<div class="flex align-center mx-5">
|
||||
<VIcon size="20" start :icon="item.icon" />
|
||||
{{ item.title }}
|
||||
</div>
|
||||
</VTab>
|
||||
</VTabs>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user