1 |
- import{d as h,w as r,Q as D,P as N,S as g,W as Y,g as w,V as q,j as e,F as o,N as L,f as A,n as M,A as a,C,y as j}from"./ResizeObserver.es.39b48a47.js";import{T as y}from"./index.e90d2179.js";import{C as F}from"./index.970ad07b.js";import"./index.608320e9.js";import"./index.0e35d2fb.js";import{T as R,a as T}from"./index.5d4d28cc.js";import{I as m}from"./index.fcbcb027.js";import"./index.b8eefd8d.js";import{C as U}from"./index.78ed3721.js";import{C as k}from"./index.db115763.js";import{i as P}from"./isBetween.e8d58212.js";import{s as u}from"./icon_student.c3c58354.js";import"./index.dc19bc54.js";import"./use-id.b004ff17.js";import"./use-tab-status.bcc0c503.js";import"./use-refs.07204da6.js";import"./utils.eda083a9.js";const x="_rankListPage_t8t3q_1",S="_timeRange_t8t3q_38",B="_iconArrow_t8t3q_44",E="_bgImg_t8t3q_52",W="_sticky_t8t3q_60",V="_backArrow_t8t3q_65",H="_rankContainer_t8t3q_78",$="_rankLevel_t8t3q_81",O="_levelItem_t8t3q_88",Q="_levelUserImg_t8t3q_98",z="_img_t8t3q_116",G="_levelTime_t8t3q_129",J="_level1_t8t3q_135",K="_level2_t8t3q_152",X="_level3_t8t3q_163",Z="_rankList_t8t3q_1",ee="_rankTitle_t8t3q_183",se="_titleName_t8t3q_189",te="_rankItem_t8t3q_206",ae="_selfInfo_t8t3q_207",le="_active_t8t3q_215",ne="_num_t8t3q_219",ie="_userImg_t8t3q_230",re="_userName_t8t3q_239",oe="_subjectName_t8t3q_246",me="_times_t8t3q_252",ce="_rankListDay_t8t3q_279",ue="_emptyResult_t8t3q_298";var s={rankListPage:x,timeRange:S,iconArrow:B,bgImg:E,sticky:W,backArrow:V,rankContainer:H,rankLevel:$,levelItem:O,levelUserImg:Q,img:z,levelTime:G,level1:J,level2:K,level3:X,rankList:Z,rankTitle:ee,titleName:se,rankItem:te,selfInfo:ae,active:le,num:ne,userImg:ie,userName:re,subjectName:oe,times:me,rankListDay:ce,emptyResult:ue},de="./assets/time-bg.02131fc7.png",ve="./assets/day-bg.9df67bae.png",fe="./assets/time-title.4d40ddc5.png",pe="./assets/day-title.ab321456.png",p="./assets/empty-logo.7a66ef7e.png";r.extend(P);var je=h({name:"ranking-list",setup(){var _;const b=D();N();const t=g({showPopoverTime:!1,tabActive:"timeBill",firstInfo:{},secondInfo:{},threeInfo:{},myInfo:{},list:[],loading:!1,beforListShow:!0,listShow:!0}),v=Y(()=>t.tabActive==="dayBill"),I=i=>{const l=r(i).day();let c="",d="";return l===0?(c=r(i).subtract(6,"day").format("YYYY-MM-DD"),d=r(i).format("YYYY-MM-DD")):l===1?(c=r(i).format("YYYY-MM-DD"),d=r(i).add(6,"day").format("YYYY-MM-DD")):(c=r(i).subtract(l-1,"day").format("YYYY-MM-DD"),d=r(i).add(7-l,"day").format("YYYY-MM-DD")),{startTime:c,endTime:d}},n=g({...I(),studentIds:(_=w.user.data)==null?void 0:_.userId,orderType:0,page:1,rows:20}),f=async()=>{t.loading=!0;try{const{data:i}=await j.post("/api-tenant/studentMusicCompareRecord/rankingList",{data:{...n}});t.beforListShow=i.detail&&i.detail.length>0,t.myInfo=i.head||{},t.list=i.detail||[],t.firstInfo=t.list.length>0?t.list.splice(0,1)[0]:{},t.secondInfo=t.list.length>0?t.list.splice(0,1)[0]:{},t.threeInfo=t.list.length>0?t.list.splice(0,1)[0]:{},t.listShow=t.list.length>0}catch{}t.loading=!1};return q(()=>{f()}),()=>{var i;return e("div",{class:[s.rankListPage,v.value?s.rankListDay:s.rankListTime]},[e("div",{class:s.sticky},[e(y,{position:"top"},{default:()=>[e(F,{background:"transparent",isFixed:!1,border:!1,title:" ",color:"#131415"},{content:()=>e(o,null,[e(L,{name:"arrow-left",class:s.backArrow,onClick:()=>{A().isApp?M({api:"goBack"}):b.back()}},null),e(R,{lineWidth:22,lineHeight:4,shrink:!0,active:t.tabActive,"onUpdate:active":l=>t.tabActive=l,onChange:l=>{l==="dayBill"?n.orderType=2:n.orderType=0,f()}},{default:()=>[e(T,{title:"\u65F6\u957F\u699C",name:"timeBill"},null),e(T,{title:"\u5929\u6570\u699C",name:"dayBill"},null)]})])})]}),e("img",{class:s.bgImg,src:v.value?ve:de},null)]),e("div",{class:s.rankContainer},[e("div",{class:s.rankLevel},[e("div",{class:[s.levelItem,s.level2]},[t.secondInfo.userId?e(o,null,[e("div",{class:s.levelUserImg},[e(m,{class:s.img,src:t.secondInfo.avatar||u},null)]),e("h2",{class:"van-ellipsis"},[t.secondInfo.studentName]),n.orderType===2?e("p",{class:[s.levelTime,"van-ellipsis"]},[t.secondInfo.subjectName,a("-"),t.secondInfo.trainDays,a("\u5929")]):e("p",{class:[s.levelTime,"van-ellipsis"]},[t.secondInfo.subjectName,a("-"),t.secondInfo.trainTime,a("\u5206\u949F")])]):e(o,null,[e("div",{class:s.levelUserImg},[e(m,{class:s.img,src:p},null)]),e("h2",{class:"van-ellipsis"},[a("\u865A\u4F4D\u4EE5\u5F85")]),e("p",{class:[s.levelTime,"van-ellipsis"]},[a("\xA0")])])]),e("div",{class:[s.levelItem,s.level1]},[t.firstInfo.userId?e(o,null,[e("div",{class:s.levelUserImg},[e(m,{class:s.img,src:t.firstInfo.avatar||u},null)]),e("h2",{class:"van-ellipsis"},[t.firstInfo.studentName]),n.orderType===2?e("p",{class:[s.levelTime,"van-ellipsis"]},[t.firstInfo.subjectName,a("-"),t.firstInfo.trainDays,a("\u5929")]):e("p",{class:[s.levelTime,"van-ellipsis"]},[t.firstInfo.subjectName,a("-"),t.firstInfo.trainTime,a("\u5206\u949F")])]):e(o,null,[e("div",{class:s.levelUserImg},[e(m,{class:s.img,src:p},null)]),e("h2",{class:"van-ellipsis"},[a("\u865A\u4F4D\u4EE5\u5F85")]),e("p",{class:[s.levelTime,"van-ellipsis"]},[a("\xA0")])])]),e("div",{class:[s.levelItem,s.level3]},[t.threeInfo.userId?e(o,null,[e("div",{class:s.levelUserImg},[e(m,{class:s.img,src:t.threeInfo.avatar||u},null)]),e("h2",{class:"van-ellipsis"},[t.threeInfo.studentName]),n.orderType===2?e("p",{class:[s.levelTime,"van-ellipsis"]},[t.threeInfo.subjectName,a("-"),t.threeInfo.trainDays,a("\u5929")]):e("p",{class:[s.levelTime,"van-ellipsis"]},[t.threeInfo.subjectName,a("-"),t.threeInfo.trainTime,a("\u5206\u949F")])]):e(o,null,[e("div",{class:s.levelUserImg},[e(m,{class:s.img,src:p},null)]),e("h2",{class:"van-ellipsis"},[a("\u865A\u4F4D\u4EE5\u5F85")]),e("p",{class:[s.levelTime,"van-ellipsis"]},[a("\xA0")])])])]),e("div",{class:s.rankList},[e("div",{class:s.rankTitle},[e("div",{class:s.titleName},[e("img",{src:v.value?pe:fe},null)]),e("span",{class:s.timeRange,onClick:()=>t.showPopoverTime=!0},[r(n.startTime).format("YYYY-MM-DD"),a("\u81F3"),r(n.endTime).format("YYYY-MM-DD"),e("i",{class:s.iconArrow},null)])]),t.list.map(l=>e(k,{class:[s.rankItem,t.myInfo.userId===l.userId?s.active:""],border:!1,center:!0},{icon:()=>e(o,null,[e("span",{class:s.num},[l.rankNum]),e(m,{class:s.userImg,src:l.avatar||u},null)]),title:()=>e("div",{class:s.userInfo},[e("p",{class:s.userName},[l.studentName]),e("p",{class:s.subjectName},[l.subjectName])]),value:()=>n.orderType===2?e("div",{class:s.times},[e("span",null,[l.trainDays]),a("\u5929")]):e("div",{class:s.times},[e("span",null,[l.trainTime]),a("\u5206\u949F")])})),!t.loading&&!t.listShow&&e(C,{tips:"\u6682\u65E0\u6570\u636E",btnStatus:!1},null)]),(i=t.myInfo)!=null&&i.userId?e(y,{position:"bottom",varName:"--bottom-height"},{default:()=>[e(k,{class:s.selfInfo,border:!1,center:!0},{icon:()=>e(o,null,[e("span",{class:s.num},[t.myInfo.rankNum==-1?"-":t.myInfo.rankNum]),e(m,{src:t.myInfo.avatar||u,class:s.userImg},null)]),title:()=>e("div",{class:s.userInfo},[e("p",{class:s.userName},[t.myInfo.studentName]),e("p",{class:s.subjectName},[t.myInfo.subjectName])]),value:()=>n.orderType===2?e("div",{class:s.times},[e("span",null,[t.myInfo.trainDays]),a("\u5929")]):e("div",{class:s.times},[e("span",null,[t.myInfo.trainTime]),a("\u5206\u949F")])})]}):""]),e(U,{show:t.showPopoverTime,"onUpdate:show":l=>t.showPopoverTime=l,firstDayOfWeek:1,showConfirm:!1,type:"range",title:"\u5468\u671F\u9009\u62E9",maxRange:7,minDate:new Date("2023-02-27"),defaultDate:[r(n.startTime).toDate(),r(n.endTime).toDate()],style:{height:"70%"},onSelect:l=>{if(n.startTime="",n.endTime="",!r(l[0]).isBetween(r(n.startTime),r(n.endTime))){const c=I(l[0]);n.startTime=c.startTime,n.endTime=c.endTime}t.showPopoverTime=!1,f()}},null)])}}});export{je as default};
|