import{d as h,u as y,k as I,h as C,l as u,m as L,a as t,I as l,q as j,v as x,w as k,j as c,E as w,x as A}from"./vendor.3506a68e.js";/* empty css               *//* empty css               *//* empty css              *//* empty css               */import{I as S,c as E,d as q}from"./icon_level3.5b194074.js";import{I as B}from"./icon_teacher.cb128c00.js";import{r as f}from"./index.9e4b607f.js";const R="_headImg_1nt71_1",D="_tabs_1nt71_4",N="_tabContent_1nt71_27",T="_itemContent_1nt71_33",V="_item_1nt71_33",M="_left_1nt71_46",U="_center_1nt71_52",H="_right_1nt71_56",O="_fraction_1nt71_60",$="_time_1nt71_66",F="_user_1nt71_77",P="_userContent_1nt71_80",z="_name_1nt71_85",G="_tag_1nt71_90",J="_times_1nt71_98";var e={headImg:R,tabs:D,tabContent:N,itemContent:T,item:V,left:M,center:U,right:H,fraction:O,time:$,user:F,userContent:P,name:z,tag:G,times:J},K="./assets/icon-emtry.76ea3a6a.png";function Q(o){return typeof o=="function"||Object.prototype.toString.call(o)==="[object Object]"&&!A(o)}var nt=h({name:"leaderboard",setup(){const o=y();I();const r=C({tabIndex:0,musicList:[]}),p=async()=>{try{const{data:{activityMusicVoList:a,shareUrl:n,subjectUrl:s}}=await f.post(`/api-student/open/activity/info/${o.query.id}`);Array.isArray(a)&&(r.musicList=a.map(i=>(i.rankingList=[],i))),d.value=s}catch{}},m=async()=>{try{const{data:a}=await f.get("/api-student/open/activityEvaluationRecord/queryRankingList",{params:{activityPlanId:o.query.id,activityEvaluationId:r.musicList[r.tabIndex].evaluationId,limit:10}});Array.isArray(a.rankingList)&&(r.musicList[r.tabIndex].rankingList=a.rankingList)}catch{}},d=u(),v=u(!1),_=u(100);L(async()=>{await p(),await m()});const g=u();return()=>{let a;return t("div",{class:e.leaderboard},[t("div",{class:e.container},[t("div",{class:e.headImg,ref:g},[t(l,{width:"100%",fit:"cover",src:d.value,onLoad:n=>{j(()=>{var s;v.value=!0,_.value=((s=g.value)==null?void 0:s.offsetHeight)||100})},onError:n=>{console.log(n)}},null)]),v.value&&t(x,{active:r.tabIndex,"onUpdate:active":n=>r.tabIndex=n,class:e.tabs,animated:!0,swipeable:!0,titleInactiveColor:"rgba(153,152,155,1)",titleActiveColor:"#fff",onChange:n=>m()},Q(a=r.musicList.map(n=>t(k,{title:n.musicSheetName},{default:()=>[t("div",{class:[e.tabContent,"van-safe-area-bottom"],style:{height:`calc(100vh - ${_.value}px)`}},[t("div",{class:e.itemContent},[t("div",{class:e.item},[t("div",{class:e.left},[c("\u6392\u540D")]),t("div",{class:e.center},[c("\u6635\u79F0")]),t("div",{class:e.right},[c("\u8BC4\u5206")])]),n.rankingList.map((s,i)=>{const b=(i+1).toString().padStart(2,"0");return t("div",{class:e.item},[t("div",{class:e.left},[i==0&&t(l,{src:S},null),i==1&&t(l,{src:E},null),i==2&&t(l,{src:q},null),i!=0&&i!=1&&i!=2&&b]),t("div",{class:e.center},[t(l,{width:"38px",height:"38px",fit:"cover",round:!0,src:s.userAvatar||B},null),t("div",{class:e.user},[t("div",{class:e.userContent},[t("span",{class:e.name},[s.username]),t("span",{class:e.tag},[s.userSubject])]),t("div",{class:e.times},[s.joinDate])])]),t("div",{class:e.right},[t("div",{class:e.fraction},[s.score,c("\u5206")]),t("div",{class:e.time},[c("\u7B2C "),s.times,c(" \u6B21\u8BC4\u6D4B")])])])}),!n.rankingList.length&&t(w,{image:K,description:"\u8BE5\u66F2\u76EE\u6682\u65E0\u6392\u540D\u5594\uFF5E"},null)])])]})))?a:{default:()=>[a]})])])}}});export{nt as default};
