document.addEventListener("DOMContentLoaded",()=>{function a(){function a(){$.ajax({url:"https://cdn.jsdelivr.net/gh/HaoOuBa/Joe@master/assets/json/joe.live.json",success(a){const t=a[n.index];$(".joe_live__type-title .text").html(t.name);let e='
  • 全部
  • ';t.list.forEach(a=>e+=`
  • ${a.name}
  • `),$(".joe_live__type-list").html(e),$(".joe_live__type-list .item").first().click()}})}function t(){window.scrollTo({top:0,behavior:"smooth"}),n.isLoading=!0,$(".joe_live__list").html(""),$.ajax({url:Joe.BASE_API,type:"POST",data:{routeType:"huya_list",page:n.page,gameId:n.gameId},success(a){if(1!==a.code)return;let t="";a.data.datas.forEach(a=>{t+=`\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(t),n.totalPage=a.data.totalPage,e()},complete:()=>n.isLoading=!1})}function e(){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"),t())}),a(),$(".joe_live__pagination").on("click",".joe_live__pagination-item",function(){const a=$(this).attr("data-page");a&&!n.isLoading&&(n.page=Number(a),t())})}const t=new URLSearchParams(window.location.search);t.get("profileRoom")||a()});