mirror of
https://github.com/jxxghp/MoviePilot-Frontend.git
synced 2026-09-06 16:16:42 +08:00
fix person page
This commit is contained in:
@@ -13,9 +13,6 @@ const route = useRoute()
|
|||||||
// 标题
|
// 标题
|
||||||
const title = route.query?.title?.toString()
|
const title = route.query?.title?.toString()
|
||||||
|
|
||||||
// 副标题
|
|
||||||
const subtitle = route.query?.subtitle?.toString()
|
|
||||||
|
|
||||||
// 计算API路径
|
// 计算API路径
|
||||||
function getApiPath(paths: string[] | string) {
|
function getApiPath(paths: string[] | string) {
|
||||||
if (Array.isArray(paths))
|
if (Array.isArray(paths))
|
||||||
@@ -31,7 +28,6 @@ function getApiPath(paths: string[] | string) {
|
|||||||
<div class="min-w-0 flex-1 mx-0">
|
<div class="min-w-0 flex-1 mx-0">
|
||||||
<h2 class="mb-4 truncate text-2xl font-bold leading-7 text-gray-100 sm:overflow-visible sm:text-4xl sm:leading-9 md:mb-0" data-testid="page-header">
|
<h2 class="mb-4 truncate text-2xl font-bold leading-7 text-gray-100 sm:overflow-visible sm:text-4xl sm:leading-9 md:mb-0" data-testid="page-header">
|
||||||
<span class="text-moviepilot">{{ title }}</span>
|
<span class="text-moviepilot">{{ title }}</span>
|
||||||
<span class="text-sm">{{ subtitle }}</span>
|
|
||||||
</h2>
|
</h2>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import MediaCardListView from '@/views/discover/MediaCardListView.vue'
|
import PersonCardListView from '@/views/discover/PersonCardListView.vue'
|
||||||
|
|
||||||
// 输入参数
|
// 输入参数
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
@@ -13,9 +13,6 @@ const route = useRoute()
|
|||||||
// 标题
|
// 标题
|
||||||
const title = route.query?.title?.toString()
|
const title = route.query?.title?.toString()
|
||||||
|
|
||||||
// 副标题
|
|
||||||
const subtitle = route.query?.subtitle?.toString()
|
|
||||||
|
|
||||||
// 计算API路径
|
// 计算API路径
|
||||||
function getApiPath(paths: string[] | string) {
|
function getApiPath(paths: string[] | string) {
|
||||||
if (Array.isArray(paths))
|
if (Array.isArray(paths))
|
||||||
@@ -31,11 +28,10 @@ function getApiPath(paths: string[] | string) {
|
|||||||
<div class="min-w-0 flex-1 mx-0">
|
<div class="min-w-0 flex-1 mx-0">
|
||||||
<h2 class="mb-4 truncate text-2xl font-bold leading-7 text-gray-100 sm:overflow-visible sm:text-4xl sm:leading-9 md:mb-0" data-testid="page-header">
|
<h2 class="mb-4 truncate text-2xl font-bold leading-7 text-gray-100 sm:overflow-visible sm:text-4xl sm:leading-9 md:mb-0" data-testid="page-header">
|
||||||
<span class="text-moviepilot">{{ title }}</span>
|
<span class="text-moviepilot">{{ title }}</span>
|
||||||
<span class="text-sm">{{ subtitle }}</span>
|
|
||||||
</h2>
|
</h2>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<MediaCardListView
|
<PersonCardListView
|
||||||
:apipath="getApiPath(props.paths || '')"
|
:apipath="getApiPath(props.paths || '')"
|
||||||
:params="route.query"
|
:params="route.query"
|
||||||
/>
|
/>
|
||||||
|
|||||||
@@ -89,7 +89,7 @@ onBeforeMount(() => {
|
|||||||
<PersonCardSlideView :apipath="`tmdb/credits/${mediaDetail.tmdb_id}/${mediaProps.type}`">
|
<PersonCardSlideView :apipath="`tmdb/credits/${mediaDetail.tmdb_id}/${mediaProps.type}`">
|
||||||
<template #title="{ loaded }">
|
<template #title="{ loaded }">
|
||||||
<div v-if="loaded" class="slider-header">
|
<div v-if="loaded" class="slider-header">
|
||||||
<RouterLink :to="`/browse/tmdb/credits/${mediaDetail.tmdb_id}/${mediaProps.type}?title=演员阵容`" class="slider-title">
|
<RouterLink :to="`/person/tmdb/credits/${mediaDetail.tmdb_id}/${mediaProps.type}?title=演员阵容`" class="slider-title">
|
||||||
<span>演员阵容</span>
|
<span>演员阵容</span>
|
||||||
<VIcon icon="mdi-arrow-right-circle-outline" class="ms-1" />
|
<VIcon icon="mdi-arrow-right-circle-outline" class="ms-1" />
|
||||||
</RouterLink>
|
</RouterLink>
|
||||||
@@ -101,7 +101,7 @@ onBeforeMount(() => {
|
|||||||
<MediaCardSlideView :apipath="`tmdb/recommend/${mediaDetail.tmdb_id}/${mediaProps.type}`">
|
<MediaCardSlideView :apipath="`tmdb/recommend/${mediaDetail.tmdb_id}/${mediaProps.type}`">
|
||||||
<template #title="{ loaded }">
|
<template #title="{ loaded }">
|
||||||
<div v-if="loaded" class="slider-header">
|
<div v-if="loaded" class="slider-header">
|
||||||
<RouterLink :to="`/browse/tmdb/recommend/${mediaDetail.tmdb_id}/${mediaProps.type}?title=推荐&subtitle=${mediaDetail.title}`" class="slider-title">
|
<RouterLink :to="`/browse/tmdb/recommend/${mediaDetail.tmdb_id}/${mediaProps.type}?title=推荐`" class="slider-title">
|
||||||
<span>推荐</span>
|
<span>推荐</span>
|
||||||
<VIcon icon="mdi-arrow-right-circle-outline" class="ms-1" />
|
<VIcon icon="mdi-arrow-right-circle-outline" class="ms-1" />
|
||||||
</RouterLink>
|
</RouterLink>
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ import NoDataFound from '@/components/NoDataFound.vue'
|
|||||||
// 输入参数
|
// 输入参数
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
apipath: String,
|
apipath: String,
|
||||||
|
params: Object as PropType<{ [key: string]: any }>,
|
||||||
})
|
})
|
||||||
|
|
||||||
// 判断是否有滚动条
|
// 判断是否有滚动条
|
||||||
@@ -73,7 +74,11 @@ async function fetchData({ done }: { done: any }) {
|
|||||||
else {
|
else {
|
||||||
// 加载一次
|
// 加载一次
|
||||||
// 请求API
|
// 请求API
|
||||||
currData.value = await api.get(props.apipath)
|
currData.value = await api.get(props.apipath, {
|
||||||
|
params: {
|
||||||
|
page: page.value,
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
// 标计为已请求完成
|
// 标计为已请求完成
|
||||||
isRefreshed.value = true
|
isRefreshed.value = true
|
||||||
@@ -133,7 +138,7 @@ async function fetchData({ done }: { done: any }) {
|
|||||||
<PersonCard
|
<PersonCard
|
||||||
v-for="data in dataList"
|
v-for="data in dataList"
|
||||||
:key="data.id"
|
:key="data.id"
|
||||||
:media="data"
|
:person="data"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<NoDataFound
|
<NoDataFound
|
||||||
|
|||||||
Reference in New Issue
Block a user