fixed85-94: filter分页/搜索分页/直播页返回与静音/动漫分类入口
Docker Build & Test / build (push) Canceled after 0s
Docker Build & Test / test (push) Canceled after 0s
Build & Push Docker image / build-and-push (linux/amd64) (push) Canceled after 0s
Build & Push Docker image / build-and-push (linux/arm/v7) (push) Canceled after 0s
Build & Push Docker image / build-and-push (linux/arm64) (push) Canceled after 0s
Build & Push Docker image / merge-images (push) Canceled after 0s
Docker Build & Test / build (push) Canceled after 0s
Docker Build & Test / test (push) Canceled after 0s
Build & Push Docker image / build-and-push (linux/amd64) (push) Canceled after 0s
Build & Push Docker image / build-and-push (linux/arm/v7) (push) Canceled after 0s
Build & Push Docker image / build-and-push (linux/arm64) (push) Canceled after 0s
Build & Push Docker image / merge-images (push) Canceled after 0s
This commit is contained in:
1 parent
395a8fd3f5
commit
421328c6cb
8 files changed
+61
-39
No files matched your search
+1
-1
@@ -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=fixed78
|
||||
ENV NEXT_PUBLIC_SITE_VERSION=fixed94
|
||||
|
||||
# 从构建器中复制 standalone 输出
|
||||
COPY --from=builder --chown=nextjs:nodejs /app/.next/standalone ./
|
||||
|
||||
+2
-2
@@ -163,7 +163,7 @@ select{background:#171b24;color:#e5e7eb;border:1px solid #2a3140;border-radius:6
|
||||
.sec{font-size:13px;color:#6b7280;margin:2px 0 8px}
|
||||
.empty{color:#6b7280;font-size:13px;padding:20px 0;text-align:center}
|
||||
</style></head><body>
|
||||
<div class="hd"><a href="/" >‹</a><h1>电视直播 · 港澳台</h1><span style="flex:1"></span><a class="ghLink" href="https://gitea.88531.cn/jinghui/katelyatv" target="_blank" rel="noopener">⭐ 开源地址</a><button class="tvboxBtn" id="tvboxBtn">📺 TVBOX接入</button>
|
||||
<div class="hd"><a href="/" target="_top" >‹</a><h1>电视直播 · 港澳台</h1><span style="flex:1"></span><a class="ghLink" href="https://gitea.88531.cn/jinghui/katelyatv" target="_blank" rel="noopener">⭐ 开源地址</a><button class="tvboxBtn" id="tvboxBtn">📺 TVBOX接入</button>
|
||||
<div class="tvboxPop" id="tvboxPop">
|
||||
<div class="tvboxPopTitle">TVBox / 影视仓 · 接入直播</div>
|
||||
<div class="tvboxRow"><span class="tvboxLbl">配置地址(含直播,推荐)</span><code id="tbCfg">—</code><button id="tbCfgCopy">复制</button></div>
|
||||
@@ -306,7 +306,7 @@ function loadChs(retry){fetch(API+'channels').then(function(r){return r.json()})
|
||||
grid.appendChild(h);grid.appendChild(box);
|
||||
});
|
||||
var DEF=chs.find(function(c){return c.id==='5'})||chs.find(function(c){return (c.name||'').indexOf('翡翠')>=0})||chs[0];
|
||||
if(DEF){pick(DEF.id,1)}
|
||||
if(DEF){pick(DEF.id,0)}
|
||||
}).catch(function(){if(retry<3){grid.innerHTML='<div class="empty">加载中…</div>';setTimeout(function(){loadChs(retry+1)},3000)}else{grid.innerHTML='<div class="empty">加载失败,请刷新</div>'}})}
|
||||
loadChs(0);
|
||||
</script></body></html>`;
|
||||
|
||||
@@ -27,12 +27,14 @@ function DoubanPageClient() {
|
||||
const debounceTimeoutRef = useRef<NodeJS.Timeout | null>(null);
|
||||
|
||||
const type = searchParams.get('type') || 'movie';
|
||||
const catParam = searchParams.get('cat') || '';
|
||||
|
||||
// 选择器状态 - 完全独立,不依赖URL参数
|
||||
const [primarySelection, setPrimarySelection] = useState<string>(() => {
|
||||
return type === 'movie' ? '热门' : '';
|
||||
});
|
||||
const [secondarySelection, setSecondarySelection] = useState<string>(() => {
|
||||
if (catParam) return catParam;
|
||||
if (type === 'movie') return '全部';
|
||||
if (type === 'tv') return 'tv';
|
||||
if (type === 'show') return 'show';
|
||||
@@ -53,17 +55,17 @@ function DoubanPageClient() {
|
||||
useEffect(() => {
|
||||
setSelectorsReady(false);
|
||||
setLoading(true); // 立即显示loading状态
|
||||
}, [type]);
|
||||
}, [type, catParam]);
|
||||
|
||||
// 当type变化时重置选择器状态
|
||||
useEffect(() => {
|
||||
// 批量更新选择器状态
|
||||
if (type === 'movie') {
|
||||
setPrimarySelection('热门');
|
||||
setSecondarySelection('全部');
|
||||
setSecondarySelection(catParam || '全部');
|
||||
} else if (type === 'tv') {
|
||||
setPrimarySelection('');
|
||||
setSecondarySelection('tv');
|
||||
setSecondarySelection(catParam || 'tv');
|
||||
} else if (type === 'show') {
|
||||
setPrimarySelection('');
|
||||
setSecondarySelection('show');
|
||||
@@ -78,7 +80,7 @@ function DoubanPageClient() {
|
||||
}, 50);
|
||||
|
||||
return () => clearTimeout(timer);
|
||||
}, [type]);
|
||||
}, [type, catParam]);
|
||||
|
||||
// 生成骨架屏数据
|
||||
const skeletonData = Array.from({ length: 25 }, (_, index) => index);
|
||||
|
||||
+11
-17
@@ -231,21 +231,13 @@ function FilterClient() {
|
||||
load(1, true);
|
||||
}, [source, cat, area, year]);
|
||||
|
||||
// 触底加载更多
|
||||
useEffect(() => {
|
||||
const el = loadingRef.current;
|
||||
if (!el) return;
|
||||
const ob = new IntersectionObserver(
|
||||
(es) => {
|
||||
if (es[0]?.isIntersecting && hasMore && !refreshing && !loadingMore) {
|
||||
load(nextPg, false);
|
||||
}
|
||||
},
|
||||
{ rootMargin: '400px' }
|
||||
);
|
||||
ob.observe(el);
|
||||
return () => ob.disconnect();
|
||||
}, [hasMore, refreshing, loadingMore, nextPg, load]);
|
||||
// 分页:上一页/下一页
|
||||
const goPage = (pg: number) => {
|
||||
if (pg < 1) return;
|
||||
setItems([]);
|
||||
setNextPg(pg);
|
||||
load(pg, true);
|
||||
};
|
||||
|
||||
const resetAll = () => {
|
||||
setCat('');
|
||||
@@ -327,8 +319,10 @@ function FilterClient() {
|
||||
})}
|
||||
</div>
|
||||
)}
|
||||
<div ref={loadingRef} className='py-6 text-center text-sm text-gray-500 dark:text-gray-400'>
|
||||
{loadingMore ? '加载中…' : hasMore && items.length > 0 ? '下拉加载更多' : items.length > 0 ? '已加载全部内容' : ''}
|
||||
<div className='py-6 flex items-center justify-center gap-3 text-sm'>
|
||||
<button onClick={() => goPage(nextPg - 2)} disabled={nextPg <= 2} className='px-3 py-1.5 rounded bg-gray-200/60 dark:bg-gray-700/60 disabled:opacity-40'>上一页</button>
|
||||
<span className='text-gray-500 dark:text-gray-400'>第 {Math.max(1, nextPg - 1)} 页</span>
|
||||
<button onClick={() => goPage(nextPg)} disabled={!hasMore} className='px-3 py-1.5 rounded bg-gray-200/60 dark:bg-gray-700/60 disabled:opacity-40'>下一页</button>
|
||||
</div>
|
||||
</div>
|
||||
</PageLayout>
|
||||
|
||||
+12
-12
@@ -7,18 +7,18 @@ export default function LivePage() {
|
||||
<>
|
||||
<TopRightButtons variant='float' />
|
||||
<iframe
|
||||
src='/api/tvbox?live=page'
|
||||
title='港澳台电视直播'
|
||||
allow='autoplay; fullscreen; encrypted-media'
|
||||
allowFullScreen
|
||||
style={{
|
||||
width: '100%',
|
||||
height: 'calc(100vh - 64px)',
|
||||
minHeight: 480,
|
||||
border: 'none',
|
||||
display: 'block',
|
||||
background: '#0f1115',
|
||||
}}
|
||||
src='/api/tvbox?live=page'
|
||||
title='港澳台电视直播'
|
||||
allow='autoplay; fullscreen; encrypted-media'
|
||||
allowFullScreen
|
||||
style={{
|
||||
width: '100%',
|
||||
height: 'calc(100vh - 64px)',
|
||||
minHeight: 480,
|
||||
border: 'none',
|
||||
display: 'block',
|
||||
background: '#0f1115',
|
||||
}}
|
||||
/>
|
||||
</>
|
||||
);
|
||||
|
||||
@@ -39,6 +39,8 @@ function SearchPageClient() {
|
||||
|
||||
// 分组标签页状态
|
||||
const [activeTab, setActiveTab] = useState<'regular' | 'adult'>('regular');
|
||||
const [searchPage, setSearchPage] = useState(1);
|
||||
const PAGE_SIZE = 50;
|
||||
|
||||
// 获取默认聚合设置:只读取用户本地设置,默认为 true
|
||||
const getDefaultAggregate = () => {
|
||||
@@ -357,6 +359,11 @@ function SearchPageClient() {
|
||||
: groupedResults.regular;
|
||||
}
|
||||
|
||||
const totalPages = Math.max(1, Math.ceil(displayResults.length / PAGE_SIZE));
|
||||
const page = Math.min(searchPage, totalPages);
|
||||
const pagedResults = displayResults.slice((page - 1) * PAGE_SIZE, page * PAGE_SIZE);
|
||||
displayResults = pagedResults;
|
||||
|
||||
// 聚合显示模式
|
||||
if (viewMode === 'agg') {
|
||||
const aggregated = aggregateResults(displayResults);
|
||||
@@ -406,6 +413,13 @@ function SearchPageClient() {
|
||||
未找到相关结果
|
||||
</div>
|
||||
)}
|
||||
{searchResults.length > 0 && (
|
||||
<div className='col-span-full flex items-center justify-center gap-3 py-6 text-sm'>
|
||||
<button onClick={() => setSearchPage((p) => Math.max(1, p - 1))} disabled={searchPage <= 1} className='px-3 py-1.5 rounded bg-gray-200/60 dark:bg-gray-700/60 disabled:opacity-40'>上一页</button>
|
||||
<span className='text-gray-500 dark:text-gray-400'>第 {searchPage} / {Math.max(1, Math.ceil(searchResults.length / 50))} 页</span>
|
||||
<button onClick={() => setSearchPage((p) => p + 1)} disabled={searchPage >= Math.ceil(searchResults.length / 50)} className='px-3 py-1.5 rounded bg-gray-200/60 dark:bg-gray-700/60 disabled:opacity-40'>下一页</button>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
</section>
|
||||
) : searchHistory.length > 0 ? (
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
'use client';
|
||||
|
||||
import { Clover, Film, Filter, Home, Radio, Search, Tv } from 'lucide-react';
|
||||
import { Clover, Film, Filter, Home, Radio, Search, Sparkles, Tv } from 'lucide-react';
|
||||
import Link from 'next/link';
|
||||
import { usePathname } from 'next/navigation';
|
||||
|
||||
@@ -30,6 +30,11 @@ const MobileBottomNav = ({ activePath }: MobileBottomNavProps) => {
|
||||
label: '剧集',
|
||||
href: '/douban?type=tv',
|
||||
},
|
||||
{
|
||||
icon: Sparkles,
|
||||
label: '动漫',
|
||||
href: '/douban?type=tv&cat=tv_animation',
|
||||
},
|
||||
{
|
||||
icon: Clover,
|
||||
label: '综艺',
|
||||
@@ -50,6 +55,7 @@ const MobileBottomNav = ({ activePath }: MobileBottomNavProps) => {
|
||||
const isActive = (href: string) => {
|
||||
if (href === '/filter') return currentActive.startsWith('/filter');
|
||||
const typeMatch = href.match(/type=([^&]+)/)?.[1];
|
||||
const catMatch = href.match(/cat=([^&]+)/)?.[1];
|
||||
|
||||
// 解码URL以进行正确的比较
|
||||
const decodedActive = decodeURIComponent(currentActive);
|
||||
@@ -58,7 +64,8 @@ const MobileBottomNav = ({ activePath }: MobileBottomNavProps) => {
|
||||
return (
|
||||
decodedActive === decodedItemHref ||
|
||||
(decodedActive.startsWith('/douban') &&
|
||||
decodedActive.includes(`type=${typeMatch}`))
|
||||
decodedActive.includes(`type=${typeMatch}`) &&
|
||||
(catMatch ? decodedActive.includes(`cat=${catMatch}`) : !decodedActive.includes('cat=')))
|
||||
);
|
||||
};
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { Clover, Film, Filter, Home, Play, Radio, Search, Tv } from 'lucide-react';
|
||||
import { Clover, Film, Filter, Home, Play, Radio, Search, Sparkles, Tv } from 'lucide-react';
|
||||
import Link from 'next/link';
|
||||
import { usePathname, useRouter, useSearchParams } from 'next/navigation';
|
||||
import { useCallback, useEffect, useState } from 'react';
|
||||
@@ -66,6 +66,11 @@ const TopNavbar = ({ activePath = '/' }: { activePath?: string }) => {
|
||||
label: '剧集',
|
||||
href: '/douban?type=tv',
|
||||
},
|
||||
{
|
||||
icon: Sparkles,
|
||||
label: '动漫',
|
||||
href: '/douban?type=tv&cat=tv_animation',
|
||||
},
|
||||
{
|
||||
icon: Clover,
|
||||
label: '综艺',
|
||||
|
||||
Reference in new issue
Block a user