import{k as M,s as $,m as H,N as O}from"./App.4a38a252.js";import{P as Q}from"./playAll.e0426393.js";import{_ as U}from"./FolderMediaCard.30913eeb.js";import{F as X}from"./FolderMediaCardSkeleton.477a263b.js";import{N as Y,aW as Z,l as m,u as J,am as K,B as S,Q as ee,m as ae,R as C,o as t,c,V as p,W as D,a as d,X as _,ak as b,a0 as k,Y as w,Z as B,a1 as se,a3 as te,ab as oe,dG as le,j as z}from"./index.2e2ba873.js";import{an as A}from"./MoreFeedback.7a64cae1.js";import{f as re,h as ne,i as ie}from"./space.c7d09bd2.js";import{L as E}from"./index.f1458219.js";import"./btn_devtools.210a42a8.js";import"./plugin-vue_export-helper.21dcd24c.js";import"./index.53c6cc19.js";import"./style.488e5a30.js";import"./modulepreload-polyfill.b7f2da20.js";import"./ico_max_exit.795e9ef8.js";import"./index.36d4c5c3.js";import"./isUdf.1a76b9f4.js";import"./ico_pin.548219aa.js";/* empty css               */import"./theme-map.83df99de.js";const ce={class:"season_details h_100"},ue={class:"i_wrapper mt_xxl"},me={class:"season_details--header flex_start items_start"},_e={class:"season_details--header-info"},de={class:"b_text mt_xs text_ellipsis"},pe={class:"b_text text3 fs_5"},ve=te(" \u64AD\u653E\u5168\u90E8 "),fe=d("span",{class:"gamepad-cursor"},null,-1),he={class:"season_details--content mt_xxl"},ge={key:2,class:"row gutter_md"},ye={key:3,class:"row gutter_md"},xe={key:0,class:"flex_center mt_x50 mb_x50"},Ge=Y({__name:"SeasonDetails",setup(be){const N=Z(),n=m({}),o=m([]),v=m(1),f=m(20),y=m(0),l=m(!1),h=m(!1),P=J(),L=K(),r=S(()=>{const{mid:e,type:i,season_id:g,series_id:u,name:s,cover:a}=P.query;return{mid:e,type:i,season_id:g,series_id:u,name:s,cover:a}}),V=S(()=>{let e="";return r.value.type==="season"?n.value.ptime&&(e=E(n.value.ptime*1e3)):n.value.mtime&&(e=E(n.value.mtime*1e3)),e||"--"}),q=S(()=>o.value.every(e=>e.isCheese));M(".season_details--scroller");const W=()=>N.flashPageCursors();ee(o,()=>N.flashPageCursors(200));const T=()=>{if(l.value)return;l.value=!0,h.value=!1;const{mid:e,type:i,season_id:g,series_id:u}=r.value;i==="season"?re({mid:e,season_id:g,reverse:!1,pn:v.value,ps:f.value}).then(s=>{var a;y.value=((a=s.page)==null?void 0:a.total)||0,n.value=s.meta||{},o.value=(s.archives||[]).map(x=>A(x)),l.value=!1}).catch(s=>{console.error(s),l.value=!1,h.value=!0}):Promise.all([ne(u),ie({mid:e,series_id:u,sort:"desc",pn:v.value,ps:f.value})]).then(([s,a])=>{var x;y.value=((x=a.page)==null?void 0:x.total)||0,n.value=s.meta||{},o.value=(a.archives||[]).map(j=>A(j)),l.value=!1}).catch(s=>{console.error(s),l.value=!1,h.value=!0})},F=()=>{v.value=1,o.value=[],z.emit("requestScrollToTop"),T()},I=()=>{o.value=[],z.emit("requestScrollToTop"),T()},R=()=>{setTimeout(()=>I(),200)},G=()=>{const{type:e}=r.value;oe({type:"ugc",fromSpmid:"main.space-seasons-series.0.0.pv",mediaList:{bizType:e==="season"?8:5,bizId:e==="season"?r.value.season_id:r.value.series_id,bizTitle:r.value.name}})};return ae(()=>{const{mid:e,type:i}=P.query;if(!e||!i){L.replace({name:"HomeRecommends"});return}F()}),(e,i)=>{const g=C("v-button"),u=C("bili-video-card"),s=C("v-pagenation");return t(),c("div",ce,[p($,{class:"season_details--scroller page_scroller h_100",onScroll:W},{default:D(()=>[d("div",ue,[d("div",me,[_(r).cover?(t(),b(U,{key:1,class:"season_details--header-card mr_sm",src:_(r).cover},null,8,["src"])):(t(),b(X,{key:0,class:"season_details--header-card mr_sm"})),d("div",_e,[d("h4",de,k(n.value.name||"--"),1),d("p",pe,k(_(r).type==="season"?"\u5408\u96C6 \xB7 ":"")+k(n.value.total||0)+"\u4E2A\u89C6\u9891 \xB7 "+k(_(V))+"\u66F4\u65B0 ",1),p(g,{class:"mt_md p_relative",type:"pink",disabled:!o.value.length||_(q),onClick:G},{default:D(()=>[p(_(Q),{class:"mt_n2"}),ve,fe]),_:1},8,["disabled"])])]),d("div",he,[!h.value&&!l.value&&!o.value.length?(t(),b(H,{key:0})):h.value&&!l.value&&!o.value.length?(t(),b(O,{key:1})):l.value&&!o.value.length?(t(),c("div",ge,[(t(!0),c(w,null,B(f.value,a=>(t(),c("div",{class:"col_3 col_sm_1_5 mb_xxl",key:a},[p(u,{"img-lazy":"eager","disable-frame":"","disable-scale":"",skeleton:!0,scrollWrap:".season_details--scroller"})]))),128))])):(t(),c("div",ye,[(t(!0),c(w,null,B(o.value,a=>(t(),c("div",{class:"col_3 col_sm_1_5 mb_xxl",key:a.aid},[p(u,{info:a,"img-lazy":"eager","disable-frame":"","disable-scale":"",iid:"pc_app_space_seasons",scrollWrap:".season_details--scroller"},null,8,["info"])]))),128))]))]),y.value>f.value?(t(),c("div",xe,[p(s,{theme:"pink",pageNum:v.value,"onUpdate:pageNum":i[0]||(i[0]=a=>v.value=a),"page-size":f.value,total:y.value,"show-extend-btn":!1,"show-jump-info":!1,"btn-extra-render":_(le),onPageChange:R},null,8,["pageNum","page-size","total","btn-extra-render"])])):se("",!0)])]),_:1})])}}});export{Ge as default};
