PageSourceSearch

https://www.hakkaradio.org.tw/_nuxt/DpB8TpkY.js

js hakkaradio.org.tw collected 2026-10-02 11:05:48 UTC 4,450 bytes, 1 lines download raw bytes

1import{_ as E}from"./BLbKje2D.js";import{d as I,x as M,u as z,y as F,o as J,w as U,f as G,j as o,k as a,t as m,l as s,F as g,r as $,m as p,n as O,v as j,a as T,g as R,s as H,E as K,i,D as Q,q as u,p as f,B as A,J as W,P as X,_ as Y}from"./BS7LkE0P.js";import{_ as Z}from"./BVT3q34S.js";import{_ as tt}from"./BWyMP1SS.js";import{u as et}from"./C_v3COKX.js";const st={class:"container"},at={key:0,class:"searching"},it={key:0,class:"no-result"},ot={key:0},nt={class:"audio-list"},lt={class:"audio-list-item"},rt={class:"audio-list-item-info"},ct=["data-src"],ut=["onClick"],dt={class:"audio-list-item-title-tag"},_t={class:"audio-list-item-dj-time"},mt={class:"audio-list-item-time"},pt={key:0},gt={class:"audio-list-item-dj-time"},ft={class:"audio-list-item-time"},ht={key:0},vt={key:1},yt={class:"list"},kt={class:"item"},$t={key:2},At={class:"list"},wt={class:"item"},Dt=I({__name:"search",async setup(xt){let h,w;const D=M(),{gtag:L}=et(),x=z(),d=j(()=>x.query?.q?.toString()||""),k=j(()=>+(x.query?.page||1)),_=H({}),{data:n,error:b,pending:q}=([h,w]=F(async()=>T(async()=>{{const c=document.querySelector("header form button");c&&c.classList.add("loading")}const t=await $fetch.raw(R("/api/program/searchDjPPA"),{params:{q:d.value,page:k.value}}),e=t.headers.get("x-page"),r=e?JSON.parse(e):{current:1,last:1,total_item_count:1};{const c=document.querySelector("header form button");c&&c.classList.remove("loading")}return{list:t._data,page:r}},{watch:[d,k]},"$ofAGLsfaJk")),h=await h,w(),h),S=t=>{const e=Math.floor(t/60),r=Math.floor(t%60);return`${e} 分 ${r} 秒`},C=(t,e)=>{if(!e)return null;const r=new Audio;r.src=e,r.addEventListener("loadedmetadata",()=>{_.value[t]=r.duration})},P=()=>
1{n.value?.list?.Audio&&n.value.list.Audio.forEach((t,e)=>{C(e,t.file)})};J(()=>{P()}),U(n,()=>{_.value={},P()});const N=async t=>{D.update({isShow:!0,isLive:!1,isSubLive:!1,id:t.id,programID:t.program_id,title:t.name,dj:[t.Dj],image:t.image,src:t.file,srt:[],link:`/program/play/id/${t.program_id}/audioId/${t.id}`,startAt:0,currentAudioDatetime:t.file_datetime,nextAudio:null,nextAudioFetching:!1});let e=t.subtitle;if(e){const r=await $fetch(`/utils/srt?url=${e}`),v=new X().fromSrt(r);D.update({srt:v})}L("event","play_audio",{id:t.id,name:t.name})};return G({title:d.value+" | 搜尋結果 | 講客廣播電臺",ogTitle:d.value+" | 搜尋結果 | 講客廣播電臺"}),(t,e)=>{const r=E,c=W,v=Z,B=tt,V=K("lazy-load");return i(),o("div",st,[a("h1",null,"'"+m(s(d))+"' 的搜尋結果如下:",1),s(q)?(i(),o("div",at,[...e[0]||(e[0]=[a("p",null,"搜尋中...",-1)])])):(i(),o(g,{key:1},[s(b)||!s(n)||s(n)&&!s(n).list?(i(),o("div",it,[...e[1]||(e[1]=[a("p",null,"查無資訊",-1)])])):(i(),o(g,{key:1},[s(n)?.list?.Audio?(i(),o("section",ot,[e[2]||(e[2]=a("h2",null,"快訊",-1)),a("div",nt,[(i(!0),o(g,null,$(s(n).list.Audio,(l,y)=>(i(),o("div",lt,[a("div",rt,[a("figure",null,[Q(a("img",{"data-src":`/utils/image?url=${l?.image}`,alt:""},null,8,ct),[[V]]),a("div",{class:"play-btn",onClick:St=>N(l)},null,8,ut)]),a("div",dt,[u(r,{class:"audio-list-item-title",to:`/program/play/id/${l.program_id}/audioId/${l.id}`},{default:f(()=>[A(m(l?.name||"--"),1)]),_:2},1032,["to"]),a("div",_t,[a("div",mt,[A(m(l?.file_datetime)+"・",1),u(c,null,{default:f(()=>[s(_)[y]?(i(),o("span",pt,m(S(s(_)[y])),1)):p("",!0)]),_:2},1024)])])])]),a("div",gt,[a("div",ft,[A(m(l?.file_datetime)+"・",1),u(c,null,{default:f(()=>[s(_)[y]?(i(),o("span",ht,m(S(s(_)[y])),1)):p("",!0)]),_:2},1024)])])]))),256))])])):p("",!0),s(n)?.list?.Dj?(i(),o("section",vt,[e[3]||(e[3]=a("h2",null,"主持人",-1)),a("div",yt,[(i(!0),o(g,null,$(s(n).list.Dj,l=>(i(),o("div",kt,[u(r,{to:`/dj/view/id/${l.id}`},{default:f(()=>[u(v,{img:`/utils/image?url=${l.image}`,title:l.name,circle:""},null,8,["img","title"])]),_:2},1032,["to"])]))),256))])])):p("",!0),s(n)?.list?.Program?(i(),o("section",$t,[e[4]||(e[4]=a("h2",null,"節目",-1)),a("div",At,[(i(!0),o(g,null,$(s(n).list.Program,l=>(i(),o("div",wt,[u(r,{to:`/program/view/id/${l.id}/page/1`},{default:f(()=>[u(v,{img:`/utils/image?url=${l.image}`,title:l.name},null,8,["img","title"])]),_:2},1032,["to"])]))),256))])])):p("",!0),s(n)?.page&&s(n)?.page.last>1?(i(),O(B,{key:3,linkUrl:`/search?q=${s(d)}&page=[page]`,currPage:s(k),"total-items":s(n).page.total_item_count,"items-per-page":16},null,8,["linkUrl","currPage","total-items"])):p("",!0)],64))],64))])}}}),Ct=Y(Dt,[["__scopeId","data-v-aec512c2"]]);export{Ct as default};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.