document.addEventListener("DOMContentLoaded",()=>{function t(){function t(){window.scrollTo({top:0,behavior:"smooth"}),$(".joe_video__list-item").css("display","").html(""),o=!0,$.ajax({url:Joe.BASE_API,type:"POST",dataType:"json",data:{routeType:"maccms_list",ac:"videolist",t:a.t,pg:a.pg,wd:a.wd},success(t){if(1!==t.code)return $(".joe_video__list-item").css("display","block").html('

数据加载失败!请检查!

');if(t.data.list.length){let e="";t.data.list.forEach(t=>{e+=`\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t${t.vod_year}\n\t\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\t${t.vod_name}\n\t\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t

${t.vod_name}

\n\t\t\t\t\t\t\t\t
`}),$(".joe_video__list-item").html(e)}else $(".joe_video__list-item").css("display","block").html('

暂无数据!

');i=t.data.pagecount,e()},complete:()=>o=!1})}function e(){if(0==i)return $(".joe_video__pagination").hide();$(".joe_video__pagination").show();let t="";1!=a.pg&&(t+=`\n \t\t
  • 首页
  • \n \t\t
  • \n \n \t\t
  • \n \t\t
  • ${a.pg-1}
  • \n \t`),t+=`
  • ${a.pg}
  • `,a.pg!=i&&(t+=`\n \t\t
  • ${a.pg+1}
  • \n \t\t
  • \n \n \t\t
  • \n \t`),a.pg末页`),$(".joe_video__pagination").html(t)}let a={pg:"",t:"",wd:""},i="",o=!1;$.ajax({url:Joe.BASE_API,type:"POST",dataType:"json",data:{routeType:"maccms_list"},success(t){if(1!==t.code)return $(".joe_video__type-list").html(`
  • ${t.data}
  • `);if(!t.data.class.length)return $(".joe_video__type-list").html('
  • 暂无数据!
  • ');let e='
  • 全部
  • ';t.data.class.forEach(t=>e+=`
  • ${t.type_name}
  • `),$(".joe_video__type-list").html(e),$(".joe_video__type-list .item").first().click()}}),$(".joe_video__type-list").on("click",".item",function(){const e=$(this).attr("data-t");o||($(this).addClass("active").siblings().removeClass("active"),a.pg=1,a.t=e,a.wd="",$(".joe_video__list-search input").val(""),t())}),$(".joe_video__pagination").on("click",".joe_video__pagination-item",function(){const e=$(this).attr("data-pg");e&&!o&&(a.pg=Number(e),t())});const s=()=>{const e=$(".joe_video__list-search input").val();o||(a.pg=1,a.t="",a.wd=e,$(".joe_video__type-list .item").first().addClass("active").siblings().removeClass("active"),t())};$(".joe_video__list-search .button").on("click",s),$(".joe_video__list-search .input").on("keyup",t=>13===t.keyCode&&s())}function e(){const t=$(".joe_video__player-play").attr("data-player");$.ajax({url:Joe.BASE_API,type:"POST",dataType:"json",data:{routeType:"maccms_list",ac:"detail",ids:o},success(t){if(1!==t.code)return $(".joe_video__detail-info").html(`

    ${t.data}

    `);if(!t.data.list.length)return $(".joe_video__detail-info").html('

    数据抓取异常!请检查!

    ');const e=t.data.list[0];$(".joe_video__detail-info").html(`\n\t\t\t\t\t
    \n\t\t\t\t\t\t${e.vod_name}\n\t\t\t\t\t\t${e.vod_year}\n\t\t\t\t\t
    \n\t\t\t\t\t
    \n\t\t\t\t\t\t
    ${e.vod_name+(e.vod_remarks?" - "+e.vod_remarks:"")}
    \n\t\t\t\t\t\t
    类型:${e.vod_class||"未知"}
    \n\t\t\t\t\t\t
    主演:${e.vod_actor||"未知"}
    \n\t\t\t\t\t\t
    导演:${e.vod_director||"未知"}
    \n\t\t\t\t\t\t
    简介:${a(e)}
    \n\t\t\t\t\t
    \n\t\t\t\t`),$(".joe_video__player .joe_video__contain-title").html("正在播放:"+e.vod_name);let i=t=>{let e="",a=t.split("#");return a.forEach(t=>e+=`
  • ${t.split("$")[0]||""}
  • `),e},o=e.vod_play_from.split("$$$"),s=e.vod_play_url.split("$$$"),l=new Map;o.forEach((t,e)=>l.set(t,s[e]||[]));let d="",n=0;for(let[t,e]of l)n++,d+=`\n\t\t\t\t\t\t
    \n\t\t\t\t\t\t\t
    播放线路 ${n}
    \n\t\t\t\t\t\t\t\n\t\t\t\t\t\t
    \n\t\t\t\t\t`;$(".joe_video__player").after(d),$(".joe_video__source").first().find(".joe_video__source-list .item").first().click()}}),$(document).on("click",".joe_video__source-list .item",function(){$(".joe_video__source-list .item").removeClass("active"),$(this).addClass("active");const e=$(this).attr("data-src")||$(this).html();$(".joe_video__player-play").attr({src:t+e});const a=$(".joe_video__player").offset().top-$(".joe_header").height()-15;window.scrollTo({top:a,behavior:"smooth"})})}function a(t){return t.vod_content?t.vod_content.replace(/<[^>]+>/g,""):t.vod_blurb?t.vod_blurb.replace(/<[^>]+>/g,""):"暂无简介"}const i=new URLSearchParams(window.location.search),o=i.get("vod_id");o?e():t()});