v-fixed25:最新港剧10部+年份优先排序+查看更多带香港剧筛选条件(筛选页URL参数初始化)
This commit is contained in:
1 parent
11e31aba31
commit
d38b6264fe
4 files changed
+25
-4
No files matched your search
@@ -2,6 +2,12 @@
|
||||
|
||||
格式参考本机发版惯例:按日期分条,`🐛修复` / `✨新功能`。
|
||||
|
||||
## 2026-10-26 → v-fixed25
|
||||
|
||||
- ✨ **首页「最新港剧」改为 10 部**(原 5 部)
|
||||
- 🐛 **排序修正**:按 `vod_year` 年份新者优先、同年按 `vod_time` 更新时间倒序——2026 新剧排最前(此前源站刚收录的老剧会因收录时间顶到前面)
|
||||
- ✨ **「查看更多」带筛选条件**:跳转 `/filter?t=香港剧` 筛选页且自动选中「香港剧」分类直接出结果(295 条);筛选页新增 URL 参数初始化(t/area/year 均支持),并修复其被聚合模式初始化 effect 清空的问题(延时函数式 setState 绕过)
|
||||
|
||||
## 2026-10-26 → v-fixed24
|
||||
|
||||
- ✨ **恢复顶部导航「直播」入口**(桌面导航 + 移动端底部导航,点击直达 /live)
|
||||
|
||||
@@ -3,7 +3,7 @@ version: '3.8'
|
||||
services:
|
||||
# KatelyaTV 应用服务
|
||||
katelyatv:
|
||||
image: katelyatv:fixed24
|
||||
image: katelyatv:fixed25
|
||||
container_name: katelyatv
|
||||
ports:
|
||||
- "3030:3000"
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[923],{3747:function(e,t,a){Promise.resolve().then(a.bind(a,805))},805:function(e,t,a){"use strict";a.r(t),a.d(t,{default:function(){return v}});var l=a(4393),r=a(5538);let s=(0,a(4123).Z)("RotateCcw",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]);var o=a(4908),n=a(6402),i=a(6501);let c=[{label:"全部",value:""},{label:"香港",value:"香港"},{label:"大陆",value:"大陆"},{label:"台湾",value:"台湾"},{label:"美国",value:"美国"},{label:"日本",value:"日本"},{label:"韩国",value:"韩国"},{label:"泰国",value:"泰国"},{label:"英国",value:"英国"},{label:"法国",value:"法国"}],u=[{label:"全部",value:""},{label:"电影",value:"电影"},{label:"电视剧",value:"电视剧"},{label:"连续剧",value:"连续剧"},{label:"综艺",value:"综艺"},{label:"动漫",value:"动漫"},{label:"动作片",value:"动作片"},{label:"喜剧片",value:"喜剧片"},{label:"爱情片",value:"爱情片"},{label:"科幻片",value:"科幻片"},{label:"恐怖片",value:"恐怖片"},{label:"剧情片",value:"剧情片"},{label:"战争片",value:"战争片"},{label:"国产剧",value:"国产剧"},{label:"香港剧",value:"香港剧"},{label:"台湾剧",value:"台湾剧"},{label:"欧美剧",value:"欧美剧"},{label:"韩国剧",value:"韩国剧"},{label:"日本剧",value:"日本剧"},{label:"泰国剧",value:"泰国剧"},{label:"海外剧",value:"海外剧"},{label:"大陆综艺",value:"大陆综艺"},{label:"港台综艺",value:"港台综艺"},{label:"日韩综艺",value:"日韩综艺"},{label:"欧美综艺",value:"欧美综艺"},{label:"国产动漫",value:"国产动漫"},{label:"日韩动漫",value:"日韩动漫"},{label:"欧美动漫",value:"欧美动漫"},{label:"港台动漫",value:"港台动漫"},{label:"记录片",value:"记录片"},{label:"短剧",value:"短剧"}],d=function(){let e=[{label:"全部",value:""}],t=new Date().getFullYear();for(let a=t;a>=t-15;a--)e.push({label:"".concat(a),value:"".concat(a)});return e}();function h(e){let{label:t,options:a,value:r,onChange:s}=e;return(0,l.jsxs)("div",{className:"flex flex-col sm:flex-row sm:items-center gap-2",children:[(0,l.jsx)("span",{className:"text-xs sm:text-sm font-medium text-gray-600 dark:text-gray-400 min-w-[48px]",children:t}),(0,l.jsx)("div",{className:"flex flex-wrap gap-2",children:a.map(e=>{let t=r===e.value;return(0,l.jsx)("button",{onClick:()=>s(e.value),className:"px-3 py-1.5 text-xs sm:text-sm font-medium rounded-full transition-all duration-200 whitespace-nowrap ".concat(t?"bg-purple-500 text-white shadow-sm":"bg-gray-200/60 text-gray-700 hover:bg-gray-300/60 dark:bg-gray-700/60 dark:text-gray-300 dark:hover:bg-gray-600/60"),children:e.label},e.value||"all")})})]})}function p(){let[e,t]=(0,o.useState)([]),[a,p]=(0,o.useState)("all"),[v,x]=(0,o.useState)([]),[g,m]=(0,o.useState)(function(){try{return new URLSearchParams(location.search).get("t")||""}catch(e){return""}}()),[b,f]=(0,o.useState)(function(){try{return new URLSearchParams(location.search).get("area")||""}catch(e){return""}}()),[y,w]=(0,o.useState)(function(){try{return new URLSearchParams(location.search).get("year")||""}catch(e){return""}}()),[k,j]=(0,o.useState)([]),[N,C]=(0,o.useState)(!1),[S,_]=(0,o.useState)(!1),[P,R]=(0,o.useState)(1),[E,D]=(0,o.useState)(!0),[Z,I]=(0,o.useState)(""),L=(0,o.useRef)(null),q=(0,o.useRef)(null),z=(0,o.useRef)(0),H="all"===a;(0,o.useEffect)(()=>{try{var q=new URLSearchParams(location.search),t=q.get("t"),ar=q.get("area"),yr=q.get("year");if(t||ar||yr){var tries=0,id=setInterval(function(){tries++;try{var g0=t,gm=0;if(t){m(function(pv){return pv||t})}if(ar)f(function(pv){return pv||ar});if(yr){w(function(pv){return pv||yr})}}catch(e){}if(tries>=1){clearInterval(id)}},60)}}catch(e){}},[]);(0,o.useEffect)(()=>{(async()=>{try{var e;let a=await fetch("/api/filter?action=sources"),l=await a.json();(null===(e=l.sources)||void 0===e?void 0:e.length)&&(t(l.sources),p("all"))}catch(e){I("加载资源站列表失败")}})()},[]),(0,o.useEffect)(()=>{if(H){x([]),m("");return}a&&(async()=>{try{x([]),m("");let e=await fetch("/api/filter?action=classes&source=".concat(encodeURIComponent(a))),t=await e.json();Array.isArray(t.classes)&&x(t.classes)}catch(e){}})()},[a,H]);let M=(0,o.useCallback)(async(e,t)=>{if(!a)return;let l=++z.current;t?(C(!0),I("")):_(!0);try{let r=new URLSearchParams({action:"browse",source:a,pg:String(e)});H?g&&r.set("cat",g):g&&r.set("t",g),b&&r.set("area",b),y&&r.set("year",y);let s=await fetch("/api/filter?".concat(r.toString())),o=await s.json();if(l!==z.current)return;if(o.error){I(o.error);return}let n=Array.isArray(o.list)?o.list:[];j(e=>{let a=t?n:[...e,...n],s=new Set;return a.filter(x=>{let k=x.title+"|"+x.year;return!s.has(k)&&(s.add(k),!0)})}),R(o.next_pg||e+1),D(!!o.has_more&&n.length>0)}catch(e){l===z.current&&I("加载失败,请稍后重试")}finally{l===z.current&&(C(!1),_(!1))}},[a,g,b,y,H])Line truncated
|
||||
@@ -24,12 +24,17 @@ COMPONENT = r'''var __HKDrama__=function(){var R=o,useState=R.useState,useEffect
|
||||
var st=useState([]),d=st[0],setD=st[1];
|
||||
var img=(window.RUNTIME_CONFIG&&window.RUNTIME_CONFIG.IMAGE_PROXY)||"";
|
||||
useEffect(function(){
|
||||
fetch("/api/tvbox/all?ac=videolist&t=902&pg=1&by=time").then(function(r){return r.json()}).then(function(j){setD(((j&&j.list)||[]).slice(0,5))}).catch(function(){})},[]);
|
||||
fetch("/api/tvbox/all?ac=videolist&t=902&pg=1&by=time").then(function(r){return r.json()}).then(function(j){
|
||||
var arr=((j&&j.list)||[]).slice();
|
||||
arr.sort(function(a,b){var ya=parseInt(a.vod_year)||0,yb=parseInt(b.vod_year)||0;
|
||||
if(yb!==ya)return yb-ya;
|
||||
return String(b.vod_time||"").localeCompare(String(a.vod_time||""))});
|
||||
setD(arr.slice(0,10))}).catch(function(){})},[]);
|
||||
if(!d.length)return null;
|
||||
return(0,s.jsxs)("section",{className:"mb-8",children:[
|
||||
(0,s.jsxs)("div",{className:"mb-4 flex items-center justify-between",children:[
|
||||
(0,s.jsx)("h2",{className:"text-xl font-bold text-gray-800 dark:text-gray-200",children:"最新港剧"}),
|
||||
(0,s.jsxs)(i.default,{href:"/douban?type=tv",className:"flex items-center text-sm text-gray-500 hover:text-purple-700 dark:text-gray-400 dark:hover:text-purple-300 transition-colors",children:["查看更多",(0,s.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"lucide lucide-chevron-right w-4 h-4 ml-1",children:(0,s.jsx)("path",{d:"m9 18 6-6-6-6"})})]})
|
||||
(0,s.jsxs)(i.default,{href:"/filter?t=%E9%A6%99%E6%B8%AF%E5%89%A7",className:"flex items-center text-sm text-gray-500 hover:text-purple-700 dark:text-gray-400 dark:hover:text-purple-300 transition-colors",children:["查看更多",(0,s.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"lucide lucide-chevron-right w-4 h-4 ml-1",children:(0,s.jsx)("path",{d:"m9 18 6-6-6-6"})})]})
|
||||
]}),
|
||||
(0,s.jsx)("div",{className:"grid grid-cols-2 sm:grid-cols-3 md:grid-cols-4 lg:grid-cols-5 gap-4 relative",children:d.map(function(v){
|
||||
var key=String(v.vod_id||""),sep=key.indexOf(":"),ks=sep>0?key.slice(0,sep):"",kid=sep>0?key.slice(sep+1):key;
|
||||
@@ -45,7 +50,16 @@ v.vod_remarks?(0,s.jsx)("span",{className:"absolute bottom-1 right-1 px-1.5 py-0
|
||||
|
||||
# ---- 1) page chunk:组件定义 + 使用点 ----
|
||||
pc = read(PC)
|
||||
if "__HKDrama__" not in pc:
|
||||
ST = "var __HKDrama__="
|
||||
END = "var s=a(4393)"
|
||||
if ST in pc and END in pc:
|
||||
a0 = pc.find(ST); b0 = pc.find(END, a0)
|
||||
assert b0 > a0, "old comp bounds"
|
||||
pc = pc[:a0] + COMPONENT.strip() + pc[b0:]
|
||||
check(pc, "page chunk (re)")
|
||||
write(PC, pc)
|
||||
print("HKDrama replaced")
|
||||
elif "__HKDrama__" not in pc:
|
||||
anchor = 'a.d(t,{default:function(){return j}});'
|
||||
assert pc.count(anchor)==1, "def anchor"
|
||||
pc = pc.replace(anchor, anchor + COMPONENT, 1)
|
||||
|
||||
Reference in new issue
Block a user