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:i.t,pg:i.pg,wd:i.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('

暂无数据!

');a=t.data.pagecount,e()},complete:()=>o=!1})}function e(){if(0==a)return $(".joe_video__pagination").hide();$(".joe_video__pagination").show();let t="";1!=i.pg&&(t+=`\n \t\t
  • 首页
  • \n \t\t
  • \n \n \t\t
  • \n \t\t
  • ${i.pg-1}
  • \n \t`),t+=`
  • ${i.pg}
  • `,i.pg!=a&&(t+=`\n \t\t
  • ${i.pg+1}
  • \n \t\t
  • \n \n \t\t
  • \n \t`),i.pg末页`),$(".joe_video__pagination").html(t)}let i={pg:"",t:"",wd:""},a="",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"),i.pg=1,i.t=e,i.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&&(i.pg=Number(e),t())});const s=()=>{const e=$(".joe_video__list-search input").val();o||(i.pg=1,i.t="",i.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
    简介:${i(e)}
    \n\t\t\t\t\t
    \n\t\t\t\t`),$(".joe_video__player .joe_video__contain-title").html("正在播放:"+e.vod_name);let a=t=>{let e="",i=t.split("#");return i.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 i=$(".joe_video__player").offset().top-$(".joe_header").height()-15;window.scrollTo({top:i,behavior:"smooth"})})}function i(t){return t.vod_content?t.vod_content.replace(/<[^>]+>/g,""):t.vod_blurb?t.vod_blurb.replace(/<[^>]+>/g,""):"暂无简介"}const a=new URLSearchParams(window.location.search),o=a.get("vod_id");o?e():t()});