1 line
7.4 KiB
JavaScript
1 line
7.4 KiB
JavaScript
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('<p class="error">数据加载失败!请检查!</p>');if(t.data.list.length){let e="";t.data.list.forEach(t=>{e+=`\n\t\t\t\t\t\t\t\t<a class="item animated bounceIn" href="${window.location.href+"?vod_id="+t.vod_id}" target="_blank" rel="noopener noreferrer nofollow">\n\t\t\t\t\t\t\t\t\t<i class="year" style="display: ${t.vod_year&&0!=t.vod_year?"block":"none"}">${t.vod_year}</i>\n\t\t\t\t\t\t\t\t\t<div class="thumb">\n\t\t\t\t\t\t\t\t\t\t<img width="100%" height="100%" class="pic lazyload" src="${Joe.LAZY_LOAD}" data-src="${t.vod_pic}" alt="${t.vod_name}">\n\t\t\t\t\t\t\t\t\t</div> \n\t\t\t\t\t\t\t\t\t<p class="title">${t.vod_name}</p>\n\t\t\t\t\t\t\t\t</a>`}),$(".joe_video__list-item").html(e)}else $(".joe_video__list-item").css("display","block").html('<p class="error">暂无数据!</p>');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<li class="joe_video__pagination-item" data-pg="1">首页</li>\n \t\t<li class="joe_video__pagination-item" data-pg="${i.pg-1}">\n <svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" width="12" height="12"><path d="M822.272 146.944l-396.8 396.8c-19.456 19.456-51.2 19.456-70.656 0-18.944-19.456-18.944-51.2 0-70.656l396.8-396.8c19.456-19.456 51.2-19.456 70.656 0 18.944 19.456 18.944 45.056 0 70.656z"/><path d="M745.472 940.544l-396.8-396.8c-19.456-19.456-19.456-51.2 0-70.656 19.456-19.456 51.2-19.456 70.656 0l403.456 390.144c19.456 25.6 19.456 51.2 0 76.8-26.112 19.968-51.712 19.968-77.312.512zm-564.224-63.488c0-3.584 0-7.68.512-11.264h-.512v-714.24h.512c-.512-3.584-.512-7.168-.512-11.264 0-43.008 21.504-78.336 48.128-78.336s48.128 34.816 48.128 78.336c0 3.584 0 7.68-.512 11.264h.512v714.24h-.512c.512 3.584.512 7.168.512 11.264 0 43.008-21.504 78.336-48.128 78.336s-48.128-35.328-48.128-78.336z"/></svg>\n \t\t</li>\n \t\t<li class="joe_video__pagination-item" data-pg="${i.pg-1}">${i.pg-1}</li>\n \t`),t+=`<li class="joe_video__pagination-item active">${i.pg}</li>`,i.pg!=a&&(t+=`\n \t\t<li class="joe_video__pagination-item" data-pg="${i.pg+1}">${i.pg+1}</li>\n \t\t<li class="joe_video__pagination-item" data-pg="${i.pg+1}">\n <svg class="next" viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" width="12" height="12"><path d="M822.272 146.944l-396.8 396.8c-19.456 19.456-51.2 19.456-70.656 0-18.944-19.456-18.944-51.2 0-70.656l396.8-396.8c19.456-19.456 51.2-19.456 70.656 0 18.944 19.456 18.944 45.056 0 70.656z"/><path d="M745.472 940.544l-396.8-396.8c-19.456-19.456-19.456-51.2 0-70.656 19.456-19.456 51.2-19.456 70.656 0l403.456 390.144c19.456 25.6 19.456 51.2 0 76.8-26.112 19.968-51.712 19.968-77.312.512zm-564.224-63.488c0-3.584 0-7.68.512-11.264h-.512v-714.24h.512c-.512-3.584-.512-7.168-.512-11.264 0-43.008 21.504-78.336 48.128-78.336s48.128 34.816 48.128 78.336c0 3.584 0 7.68-.512 11.264h.512v714.24h-.512c.512 3.584.512 7.168.512 11.264 0 43.008-21.504 78.336-48.128 78.336s-48.128-35.328-48.128-78.336z"/></svg>\n \t\t</li>\n \t`),i.pg<a&&(t+=`<li class="joe_video__pagination-item" data-pg="${a}">末页</li>`),$(".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(`<li class="error">${t.data}</li>`);if(!t.data.class.length)return $(".joe_video__type-list").html('<li class="error">暂无数据!</li>');let e='<li class="item" data-t="">全部</li>';t.data.class.forEach(t=>e+=`<li class="item animated swing" data-t="${t.type_id}">${t.type_name}</li>`),$(".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(`<p class="error">${t.data}</p>`);if(!t.data.list.length)return $(".joe_video__detail-info").html('<p class="error">数据抓取异常!请检查!</p>');const e=t.data.list[0];$(".joe_video__detail-info").html(`\n\t\t\t\t\t<div class="thumbnail">\n\t\t\t\t\t\t<img width="100%" height="100%" class="pic lazyload" src="${Joe.LAZY_LOAD}" data-src="${e.vod_pic}" alt="${e.vod_name}">\n\t\t\t\t\t\t<i class="year" style="display: ${e.vod_year&&0!=e.vod_year?"block":"none"}">${e.vod_year}</i>\n\t\t\t\t\t</div>\n\t\t\t\t\t<dl class="description">\n\t\t\t\t\t\t<dt>${e.vod_name+(e.vod_remarks?" - "+e.vod_remarks:"")}</dt>\n\t\t\t\t\t\t<dd><span class="muted">类型:</span><span class="text">${e.vod_class||"未知"}</span></dd>\n\t\t\t\t\t\t<dd><span class="muted">主演:</span><span class="text">${e.vod_actor||"未知"}</span></dd>\n\t\t\t\t\t\t<dd><span class="muted">导演:</span><span class="text">${e.vod_director||"未知"}</span></dd>\n\t\t\t\t\t\t<dd><span class="muted">简介:</span><span class="text">${i(e)}</span></dd>\n\t\t\t\t\t</dl>\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+=`<li data-src="${t.split("$")[1]||""}" class="item">${t.split("$")[0]||""}</li>`),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<div class="joe_video__source joe_video__contain">\n\t\t\t\t\t\t\t<div class="joe_video__contain-title">播放线路 ${n}</div>\n\t\t\t\t\t\t\t<ul class="joe_video__source-list">${a(e)}</ul>\n\t\t\t\t\t\t</div>\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()}); |