diff --git a/src/api/types.ts b/src/api/types.ts index 87d155b1..c7c149e1 100644 --- a/src/api/types.ts +++ b/src/api/types.ts @@ -192,6 +192,29 @@ export interface MediaInfo { // 详情页面 detail_link?: string + // 其它TMDB属性 + adult?: boolean + created_by?: string[] + episode_run_time?: string[] + genres?: string[] + first_air_date?: string + homepage?: string + languages?: string[] + last_air_date?: string + networks?: string[] + number_of_episodes?: number + number_of_seasons?: number + origin_countryv: string[] + original_name?: string + production_companies?: string[] + production_countries?: string[] + spoken_languages?: string[] + status?: string + tagline?: string + vote_count?: number + popularity?: number + runtime?: number + next_episode_to_air?: string } // TMDB季信息 @@ -253,6 +276,27 @@ export interface TmdbEpisode { guest_stars: Object[] } +// TMDB人特信息 +export interface TmdbPerson { + // ID + id: number + + // 名称 + name: string + + // 角色 + character: string + + // 图片 + profile_path: string + + // 性别 + gender: number + + // 原名 + original_name: string +} + // 站点 export interface Site { diff --git a/src/assets/images/misc/person.png b/src/assets/images/misc/person.png new file mode 100644 index 00000000..7127aa86 Binary files /dev/null and b/src/assets/images/misc/person.png differ diff --git a/src/components/cards/MediaCard.vue b/src/components/cards/MediaCard.vue index 3789563d..c40735ee 100644 --- a/src/components/cards/MediaCard.vue +++ b/src/components/cards/MediaCard.vue @@ -91,7 +91,7 @@ async function handleAddSubscribe() { } else if (props.media?.type === '电视剧') { // 豆瓣电视剧,只会有一季 - const season = props.media?.season || 1 + const season = props.media?.season ?? 1 // 添加订阅 addSubscribe(season) } @@ -371,7 +371,7 @@ const seasonsHeaders = [ const getImgUrl: Ref = computed(() => { if (imageLoadError.value) return noImage - const url = props.media?.poster_path || noImage + const url = props.media?.poster_path ?? noImage // 如果地址中包含douban则使用中转代理 if (url.includes('doubanio.com')) return `${import.meta.env.VITE_API_BASE_URL}douban/img/${encodeURIComponent(url)}` diff --git a/src/components/cards/PersonCard.vue b/src/components/cards/PersonCard.vue new file mode 100644 index 00000000..88e488e0 --- /dev/null +++ b/src/components/cards/PersonCard.vue @@ -0,0 +1,62 @@ + + + + + diff --git a/src/pages/browse.vue b/src/pages/browse.vue index 24bf2d52..7c84145b 100644 --- a/src/pages/browse.vue +++ b/src/pages/browse.vue @@ -3,7 +3,8 @@ import MediaCardListView from '@/views/discover/MediaCardListView.vue' // 输入参数 const props = defineProps({ - type: Array as PropType | PropType, + // API路径 + paths: Array as PropType | PropType, }) // 路由参数 @@ -23,26 +24,27 @@ const titles: { [key: string]: any } = { tv_weekly_global: '全球剧集榜', movie_top250: '电影TOP250', }, + credits: '演员阵容', media: { search: '搜索', }, } // 计算API路径 -function getApiPath(types: string[] | string) { - if (Array.isArray(types)) - return types.join('/') +function getApiPath(paths: string[] | string) { + if (Array.isArray(paths)) + return paths.join('/') else - return types + return paths } // 面包屑标题 -function getTitle(types: string[] | string, title: any = '') { - if (Array.isArray(types)) { +function getTitle(paths: string[] | string, title: any = '') { + if (Array.isArray(paths)) { if (title) - return [titles[types[0]][types[1]], title] + return [titles[paths[0]][paths[1]], title] - return ['推荐', titles[types[0]][types[1]]] + return ['推荐', titles[paths[0]][paths[1]]] } else { return ['发现'] @@ -52,9 +54,9 @@ function getTitle(types: string[] | string, title: any = '') {