修正更多推荐无数据时的显示
This commit is contained in:
+4
-23
@@ -5351,29 +5351,10 @@ function PlayPageClient() {
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* 推荐区域 */}
|
{/* 推荐区域 */}
|
||||||
{(videoDoubanId !== 0 || videoTitle) && (
|
<SmartRecommendations
|
||||||
<div className='mt-6 -mx-3 md:mx-0 md:px-4'>
|
doubanId={videoDoubanId !== 0 ? videoDoubanId : undefined}
|
||||||
<div className='bg-white/50 dark:bg-gray-800/50 backdrop-blur-sm rounded-xl border border-gray-200/50 dark:border-gray-700/50 overflow-hidden'>
|
videoTitle={videoTitle}
|
||||||
{/* 标题 */}
|
/>
|
||||||
<div className='px-3 md:px-6 py-4 border-b border-gray-200 dark:border-gray-700'>
|
|
||||||
<h3 className='text-lg font-semibold text-gray-900 dark:text-white flex items-center gap-2'>
|
|
||||||
<svg className='w-5 h-5' fill='currentColor' viewBox='0 0 24 24'>
|
|
||||||
<path d='M12 2l3.09 6.26L22 9.27l-5 4.87 1.18 6.88L12 17.77l-6.18 3.25L7 14.14 2 9.27l6.91-1.01L12 2z'/>
|
|
||||||
</svg>
|
|
||||||
更多推荐
|
|
||||||
</h3>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
{/* 推荐内容 */}
|
|
||||||
<div className='px-3 pt-3 md:px-6 md:pt-6'>
|
|
||||||
<SmartRecommendations
|
|
||||||
doubanId={videoDoubanId !== 0 ? videoDoubanId : undefined}
|
|
||||||
videoTitle={videoTitle}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
)}
|
|
||||||
|
|
||||||
{/* 豆瓣评论区域 */}
|
{/* 豆瓣评论区域 */}
|
||||||
{videoDoubanId !== 0 && enableComments && (
|
{videoDoubanId !== 0 && enableComments && (
|
||||||
|
|||||||
@@ -238,35 +238,44 @@ export default function SmartRecommendations({
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (error) {
|
if (error || recommendations.length === 0) {
|
||||||
return (
|
|
||||||
<div className='text-center py-8 text-gray-500 dark:text-gray-400'>
|
|
||||||
{error}
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (recommendations.length === 0) {
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<ScrollableRow scrollDistance={600} bottomPadding='pb-2'>
|
<div className='mt-6 -mx-3 md:mx-0 md:px-4'>
|
||||||
{recommendations.map((rec, index) => (
|
<div className='bg-white/50 dark:bg-gray-800/50 backdrop-blur-sm rounded-xl border border-gray-200/50 dark:border-gray-700/50 overflow-hidden'>
|
||||||
<div
|
{/* 标题 */}
|
||||||
key={rec.doubanId || rec.tmdbId || index}
|
<div className='px-3 md:px-6 py-4 border-b border-gray-200 dark:border-gray-700'>
|
||||||
className='min-w-[96px] w-24 sm:min-w-[140px] sm:w-[140px]'
|
<h3 className='text-lg font-semibold text-gray-900 dark:text-white flex items-center gap-2'>
|
||||||
>
|
<svg className='w-5 h-5' fill='currentColor' viewBox='0 0 24 24'>
|
||||||
<VideoCard
|
<path d='M12 2l3.09 6.26L22 9.27l-5 4.87 1.18 6.88L12 17.77l-6.18 3.25L7 14.14 2 9.27l6.91-1.01L12 2z'/>
|
||||||
title={rec.title}
|
</svg>
|
||||||
poster={rec.poster}
|
更多推荐
|
||||||
rate={rec.rating}
|
</h3>
|
||||||
douban_id={rec.doubanId ? parseInt(rec.doubanId) : undefined}
|
|
||||||
tmdb_id={rec.tmdbId}
|
|
||||||
from={rec.doubanId ? 'douban' : 'tmdb'}
|
|
||||||
/>
|
|
||||||
</div>
|
</div>
|
||||||
))}
|
|
||||||
</ScrollableRow>
|
{/* 推荐内容 */}
|
||||||
|
<div className='px-3 pt-3 md:px-6 md:pt-6'>
|
||||||
|
<ScrollableRow scrollDistance={600} bottomPadding='pb-2'>
|
||||||
|
{recommendations.map((rec, index) => (
|
||||||
|
<div
|
||||||
|
key={rec.doubanId || rec.tmdbId || index}
|
||||||
|
className='min-w-[96px] w-24 sm:min-w-[140px] sm:w-[140px]'
|
||||||
|
>
|
||||||
|
<VideoCard
|
||||||
|
title={rec.title}
|
||||||
|
poster={rec.poster}
|
||||||
|
rate={rec.rating}
|
||||||
|
douban_id={rec.doubanId ? parseInt(rec.doubanId) : undefined}
|
||||||
|
tmdb_id={rec.tmdbId}
|
||||||
|
from={rec.doubanId ? 'douban' : 'tmdb'}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
))}
|
||||||
|
</ScrollableRow>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user