document.addEventListener("DOMContentLoaded",()=>{if(0!==$(".joe_index__banner .swiper-container").length){let l="horizontal";Joe.IS_MOBILE||2!==$(".joe_index__banner-recommend .item").length||(l="vertical"),new Swiper(".swiper-container",{keyboard:!1,direction:l,loop:!0,autoplay:!0,mousewheel:!0,pagination:{el:".swiper-pagination"},navigation:{nextEl:".swiper-button-next",prevEl:".swiper-button-prev"}})}{const l=l=>"default"===l.mode?`\n
\n \n \n \n \n \n \n \n \n `:"single"===l.mode?`\n \n \n \n \n \n \n \n \n \n \n `:"multiple"===l.mode?`\n \n \n \n \n ${l.image.map((e,t)=>{if(t<3)return``}).join("")}\n \n \n \n `:`\n \n \n \n \n `;let e={page:1,pageSize:12,type:"created"};const t=()=>{$(".joe_index__list .joe_list").html(""),$(".joe_load").show();let l=$('.joe_index__title-title .item[data-type="'+e.type+'"]'),t=$(".joe_index__title-title .line");l.addClass("active").siblings().removeClass("active"),t.css({left:l.position().left,width:l.width()})},i=()=>new Promise((t,i)=>{$(".joe_load").attr("loading",!0),$(".joe_load").html("loading..."),$(".joe_index__list .joe_list__loading").show(),$.ajax({url:Joe.BASE_API,type:"POST",dataType:"json",data:{routeType:"publish_list",page:e.page,pageSize:e.pageSize,type:e.type},success(e){if(0===e.data.length)return $(".joe_load").removeAttr("loading"),$(".joe_load").html("查看更多"),$(".joe_load").hide(),$(".joe_index__list .joe_list__loading").hide(),Qmsg.warning("没有更多内容了");e.data.forEach(e=>$(".joe_index__list .joe_list").append(l(e))),$(".joe_load").removeAttr("loading"),$(".joe_load").html("查看更多"),$(".joe_index__list .joe_list__loading").hide(),t(e.data.length>0?e.data.length-1:0)}})});t(),i(),$(".joe_index__title-title .item").on("click",async function(){$(this).attr("data-type")!==e.type&&(e={page:1,pageSize:12,type:$(this).attr("data-type")},t(),i())}),$(".joe_load").on("click",async function(){if($(this).attr("loading"))return;e.page++;let l=await i();l=$(".joe_index__list .joe_list .joe_list__item").length-l;const t=`.joe_index__list .joe_list .joe_list__item:nth-child(${l})`,a=$(t).offset().top-$(".joe_header").height();window.scrollTo({top:a-15,behavior:"smooth"})})}{const l=$(".joe_index__list").attr("data-wow");"off"!==l&&l&&new WOW({boxClass:"wow",animateClass:`animated ${l}`,offset:0,mobile:!0,live:!0,scrollContainer:null}).init()}});