document.addEventListener("DOMContentLoaded",()=>{function a(){function a(){$.ajax({url:"/usr/themes/Joe/assets/json/joe.live.json",dataType:"json",success(a){const e=a[n.index];$(".joe_live__type-title .text").html(e.name);let t='
  • 全部
  • ';e.list.forEach(a=>t+=`
  • ${a.name}
  • `),$(".joe_live__type-list").html(t),$(".joe_live__type-list .item").first().click()}})}function e(){window.scrollTo({top:0,behavior:"smooth"}),n.isLoading=!0,$(".joe_live__list").html(""),$.ajax({url:Joe.BASE_API,type:"POST",dataType:"json",data:{routeType:"huya_list",page:n.page,gameId:n.gameId},success(a){if(1!==a.code)return;let e="";a.data.datas.forEach(a=>{e+=`\n \n
    \n ${a.recommendTagName}\n ${a.introduction}\n
    \n
    \n
    \n \n ${a.nick}\n
    \n
    ${a.nick}
    \n

    ${a.introduction}

    \n
    \n \n ${i(a.totalCount)}\n ${a.gameFullName}\n
    \n
    \n
    \n `}),$(".joe_live__list").html(e),n.totalPage=a.data.totalPage,t()},complete:()=>n.isLoading=!1})}function t(){let a="";1!=n.page&&(a+=`\n \t\t
  • 首页
  • \n \t\t
  • \n \n \t\t
  • \n \t\t
  • ${n.page-1}
  • \n \t`),a+=`
  • ${n.page}
  • `,n.page!=n.totalPage&&(a+=`\n \t\t
  • ${n.page+1}
  • \n \t\t
  • \n \n \t\t
  • \n \t`),n.page末页`),$(".joe_live__pagination").html(a)}function i(a=0){return a>=1e4?Math.round(a/1e3)/10+"万":a}let n={page:1,gameId:"",index:0,isLoading:!1,totalPage:0};$(".joe_live__type-title .icon").on("click",function(){n.isLoading||(3===n.index&&(n.index=0),n.index++,a())}),$(".joe_live__type-list").on("click",".item",function(){n.isLoading||($(this).addClass("active").siblings().removeClass("active"),n.page=1,n.gameId=$(this).attr("data-gameId"),e())}),a(),$(".joe_live__pagination").on("click",".joe_live__pagination-item",function(){const a=$(this).attr("data-page");a&&!n.isLoading&&(n.page=Number(a),e())})}const e=new URLSearchParams(window.location.search);e.get("profileRoom")||a()});