Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2e8ee2eb64 |
No files matched your search
+1
-1
@@ -51,7 +51,7 @@ ENV NODE_ENV=production
|
|||||||
ENV HOSTNAME=0.0.0.0
|
ENV HOSTNAME=0.0.0.0
|
||||||
ENV PORT=3000
|
ENV PORT=3000
|
||||||
ENV DOCKER_ENV=true
|
ENV DOCKER_ENV=true
|
||||||
ENV NEXT_PUBLIC_SITE_VERSION=fixed69
|
ENV NEXT_PUBLIC_SITE_VERSION=fixed70
|
||||||
|
|
||||||
# 从构建器中复制 standalone 输出
|
# 从构建器中复制 standalone 输出
|
||||||
COPY --from=builder --chown=nextjs:nodejs /app/.next/standalone ./
|
COPY --from=builder --chown=nextjs:nodejs /app/.next/standalone ./
|
||||||
|
|||||||
@@ -12,8 +12,11 @@ type VodItem = {
|
|||||||
vod_time?: string;
|
vod_time?: string;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const SHOW_COUNT = 10;
|
||||||
|
|
||||||
export default function HkDramaRow() {
|
export default function HkDramaRow() {
|
||||||
const [items, setItems] = useState<VodItem[]>([]);
|
const [items, setItems] = useState<VodItem[]>([]);
|
||||||
|
const [loading, setLoading] = useState(true);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
fetch('/api/tvbox/all?ac=videolist&t=902&pg=1&by=time')
|
fetch('/api/tvbox/all?ac=videolist&t=902&pg=1&by=time')
|
||||||
@@ -28,12 +31,14 @@ export default function HkDramaRow() {
|
|||||||
String(a.vod_time || '')
|
String(a.vod_time || '')
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
setItems(arr.slice(0, 5));
|
setItems(arr.slice(0, SHOW_COUNT));
|
||||||
})
|
})
|
||||||
.catch(() => {});
|
.catch(() => {})
|
||||||
|
.finally(() => setLoading(false));
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
if (!items.length) return null;
|
// 加载失败且无数据时不占位;加载中显示骨架占位,与其它栏目同时出现
|
||||||
|
if (!loading && !items.length) return null;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<section className='mb-8'>
|
<section className='mb-8'>
|
||||||
@@ -49,7 +54,17 @@ export default function HkDramaRow() {
|
|||||||
</Link>
|
</Link>
|
||||||
</div>
|
</div>
|
||||||
<div className='grid grid-cols-2 sm:grid-cols-3 md:grid-cols-4 lg:grid-cols-5 gap-4 relative'>
|
<div className='grid grid-cols-2 sm:grid-cols-3 md:grid-cols-4 lg:grid-cols-5 gap-4 relative'>
|
||||||
{items.map((v) => {
|
{loading
|
||||||
|
? // 加载中显示10个占位,与热门电影/剧集同时出现,避免后半拍跳动
|
||||||
|
Array.from({ length: SHOW_COUNT }).map((_, index) => (
|
||||||
|
<div key={index} className='w-full'>
|
||||||
|
<div className='relative aspect-[2/3] w-full overflow-hidden rounded-lg bg-purple-200 animate-pulse dark:bg-purple-800'>
|
||||||
|
<div className='absolute inset-0 bg-purple-300 dark:bg-purple-700'></div>
|
||||||
|
</div>
|
||||||
|
<div className='mt-2 h-4 bg-purple-200 rounded animate-pulse dark:bg-purple-800'></div>
|
||||||
|
</div>
|
||||||
|
))
|
||||||
|
: items.map((v) => {
|
||||||
const key = String(v.vod_id || '');
|
const key = String(v.vod_id || '');
|
||||||
const sep = key.indexOf(':');
|
const sep = key.indexOf(':');
|
||||||
const ks = sep > 0 ? key.slice(0, sep) : '';
|
const ks = sep > 0 ? key.slice(0, sep) : '';
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ export default function TopRightButtons({ variant = 'bar' }: TopRightButtonsProp
|
|||||||
className='hidden lg:inline-flex shrink-0 items-center select-none rounded-lg px-2 py-1.5 text-xs font-bold tracking-wide text-purple-600 dark:text-purple-400 bg-purple-500/10 border border-purple-500/20'
|
className='hidden lg:inline-flex shrink-0 items-center select-none rounded-lg px-2 py-1.5 text-xs font-bold tracking-wide text-purple-600 dark:text-purple-400 bg-purple-500/10 border border-purple-500/20'
|
||||||
title='米视TV 当前版本'
|
title='米视TV 当前版本'
|
||||||
>
|
>
|
||||||
v{process.env.NEXT_PUBLIC_SITE_VERSION || 'fixed69'}
|
v{process.env.NEXT_PUBLIC_SITE_VERSION || 'fixed70'}
|
||||||
</span>
|
</span>
|
||||||
<HubBell />
|
<HubBell />
|
||||||
<TvboxButton />
|
<TvboxButton />
|
||||||
|
|||||||
Reference in new issue
Block a user