diff --git a/Dockerfile b/Dockerfile index dcf3e1d..ea26d50 100644 --- a/Dockerfile +++ b/Dockerfile @@ -51,7 +51,7 @@ ENV NODE_ENV=production ENV HOSTNAME=0.0.0.0 ENV PORT=3000 ENV DOCKER_ENV=true -ENV NEXT_PUBLIC_SITE_VERSION=fixed69 +ENV NEXT_PUBLIC_SITE_VERSION=fixed70 # 从构建器中复制 standalone 输出 COPY --from=builder --chown=nextjs:nodejs /app/.next/standalone ./ diff --git a/src/components/HkDramaRow.tsx b/src/components/HkDramaRow.tsx index cf14bb3..74fa4e6 100644 --- a/src/components/HkDramaRow.tsx +++ b/src/components/HkDramaRow.tsx @@ -12,8 +12,11 @@ type VodItem = { vod_time?: string; }; +const SHOW_COUNT = 10; + export default function HkDramaRow() { const [items, setItems] = useState([]); + const [loading, setLoading] = useState(true); useEffect(() => { fetch('/api/tvbox/all?ac=videolist&t=902&pg=1&by=time') @@ -28,12 +31,14 @@ export default function HkDramaRow() { 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 (
@@ -49,7 +54,17 @@ export default function HkDramaRow() {
- {items.map((v) => { + {loading + ? // 加载中显示10个占位,与热门电影/剧集同时出现,避免后半拍跳动 + Array.from({ length: SHOW_COUNT }).map((_, index) => ( +
+
+
+
+
+
+ )) + : items.map((v) => { const key = String(v.vod_id || ''); const sep = key.indexOf(':'); const ks = sep > 0 ? key.slice(0, sep) : ''; diff --git a/src/components/TopRightButtons.tsx b/src/components/TopRightButtons.tsx index 4e18f3b..3031005 100644 --- a/src/components/TopRightButtons.tsx +++ b/src/components/TopRightButtons.tsx @@ -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' title='米视TV 当前版本' > - v{process.env.NEXT_PUBLIC_SITE_VERSION || 'fixed69'} + v{process.env.NEXT_PUBLIC_SITE_VERSION || 'fixed70'}