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