document.addEventListener("DOMContentLoaded",()=>{function t(){window.scrollTo({top:0,behavior:"smooth"}),$(".joe_wallpaper__list").html(""),l=!0,$.ajax({url:Joe.BASE_API,type:"POST",dataType:"json",data:{routeType:"wallpaper_list",cid:e.cid,start:e.start,count:e.count},success(t){if(1!==t.code)return l=!1;l=!1;let e="";t.data.forEach(t=>{e+=`\n \n 壁纸\n `}),$(".joe_wallpaper__list").html(e),i=t.total,a()}})}function a(){let t="";e.start/e.count!=0&&(t+=`\n
  • 首页
  • \n
  • \n \n
  • \n
  • ${Math.ceil(e.start/e.count)}
  • \n `),t+=`
  • ${Math.ceil(e.start/e.count)+1}
  • `,e.start!=i-e.count&&(t+=`\n
  • ${Math.ceil(e.start/e.count)+2}
  • \n
  • \n \n
  • \n `),e.start末页`),$(".joe_wallpaper__pagination").html(t)}let l=!1,e={cid:-999,start:-999,count:48},i=-999;$.ajax({url:Joe.BASE_API,type:"POST",dataType:"json",data:{routeType:"wallpaper_type"},success(t){if(1!==t.code)return $(".joe_wallpaper__type-list").html('
  • 壁纸抓取失败!请联系作者!
  • ');if(!t.data.length)return $(".joe_wallpaper__type-list").html('
  • 暂无数据!
  • ');let a="";t.data.forEach(t=>a+=`
  • ${t.name}
  • `),$(".joe_wallpaper__type-list").html(a),$(".joe_wallpaper__type-list .item").first().click()}}),$(".joe_wallpaper__type-list").on("click",".item",function(){const a=$(this).attr("data-cid");l||($(this).addClass("active").siblings().removeClass("active"),e.cid=a,e.start=0,t())}),$(".joe_wallpaper__pagination").on("click",".joe_wallpaper__pagination-item",function(){const a=$(this).attr("data-start");a&&!l&&(e.start=Number(a),t())})});