index-legacy.a081028f.js 9.7 KB

1
  1. !function(){function e(e,t,n,r,i,a,c){try{var s=e[a](c),l=s.value}catch(o){return void n(o)}s.done?t(l):Promise.resolve(l).then(r,i)}function t(t){return function(){var n=this,r=arguments;return new Promise((function(i,a){var c=t.apply(n,r);function s(t){e(c,i,a,s,l,"next",t)}function l(t){e(c,i,a,s,l,"throw",t)}s(void 0)}))}}var n=document.createElement("style");n.innerHTML="._headImg_1lc9z_1{display:flex}._tabs_1lc9z_4{margin-top:-1.12rem}._tabs_1lc9z_4 .van-tabs__wrap{height:1.12rem}._tabs_1lc9z_4 .van-tabs__nav{background:rgba(0,0,0,.68)!important;backdrop-filter:blur(.48rem);-webkit-backdrop-filter:blur(.48rem)}._tabs_1lc9z_4 .van-tabs__line{background-color:transparent!important;height:0;width:0;border:.21333rem solid transparent;border-bottom-color:#fff;border-radius:0}._tabs_1lc9z_4 .van-empty__image{width:2.66667rem;height:3.04rem}._tabContent_1lc9z_27{position:relative;padding:.32rem .58667rem .32rem .32rem;box-sizing:border-box;overflow-y:auto;width:calc(100vw + .26667rem)}._tabContent_1lc9z_27._hasUser_1lc9z_35{padding-bottom:2.13333rem}._itemContent_1lc9z_38{padding:.32rem;border-radius:.32rem;background-color:#fff;min-height:100%;box-sizing:border-box}._item_1lc9z_38{display:flex;padding:.26667rem 0;box-sizing:border-box;align-items:center}._item_1lc9z_38 ._left_1lc9z_51{width:.85333rem;margin:0 .56rem 0 .05333rem;text-align:center;font-weight:700}._item_1lc9z_38 ._center_1lc9z_57{display:flex;align-items:center}._item_1lc9z_38 ._right_1lc9z_61{margin-left:auto;text-align:right}._item_1lc9z_38 ._right_1lc9z_61 ._fraction_1lc9z_65{font-size:.37333rem;font-weight:600;color:#fa6400;margin-bottom:.10667rem}._item_1lc9z_38 ._right_1lc9z_61 ._time_1lc9z_71{font-size:.32rem;color:#999}._item_1lc9z_38:first-child{padding-top:0;border-bottom:.02667rem solid #eee}._item_1lc9z_38:last-child{padding-bottom:0}._item_1lc9z_38 ._user_1lc9z_82{margin-left:.16rem}._item_1lc9z_38 ._user_1lc9z_82 ._userContent_1lc9z_85{display:flex;align-items:center;margin-bottom:.10667rem}._item_1lc9z_38 ._user_1lc9z_82 ._name_1lc9z_90{font-size:.4rem;color:#333;margin-right:.16rem;max-width:2rem;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}._item_1lc9z_38 ._user_1lc9z_82 ._tag_1lc9z_99{font-size:.32rem;background-color:#ffe2b2;color:#ff8c00;border-radius:.10667rem;margin-right:.10667rem;padding:.02667rem .05333rem}._item_1lc9z_38 ._user_1lc9z_82 ._times_1lc9z_107{font-size:.32rem;color:#999}._activeUser_1lc9z_111{--van-cell-line-height: .53333rem;position:absolute;left:0;bottom:0;width:100%;box-sizing:border-box;box-shadow:0 -.21333rem .32rem #ebedf0;background-color:#fff}._activeUser_1lc9z_111 .van-cell__title{font-weight:700}._activeUser_1lc9z_111 .van-cell__label{font-weight:400}._activeUser_1lc9z_111 .van-cell__value{flex:initial;margin-left:.21333rem}._activeUser_1lc9z_111 ._avator_1lc9z_131{width:1.28rem;height:1.28rem;margin-right:.32rem}._activeUser_1lc9z_111 ._btn_1lc9z_136{padding:.10667rem .26667rem;border:none;background:linear-gradient(180deg,#ffa200 0%,#ff6900 100%);border-radius:.42667rem}._activeUser_1lc9z_111 ._num_1lc9z_142{font-size:.37333rem;font-weight:700;color:#fa6400}\n",document.head.appendChild(n),System.register(["./ResizeObserver.es-legacy.44b91b4c.js","./index-legacy.c8c5bc4e.js","./index-legacy.4be048cf.js","./index-legacy.3ccba950.js","./index-legacy.9d5cae73.js","./index-legacy.cf09c997.js","./icon_level3-legacy.16a3757a.js","./icon_teacher-legacy.42ba77b1.js","./use-id-legacy.ef8b5e97.js","./use-tab-status-legacy.d7434e0b.js","./use-refs-legacy.d925b49f.js"],(function(e){"use strict";var n,r,i,a,c,s,l,o,u,_,d,m,f,v,g,b,h,p,z,x,y,k,w;return{setters:[function(e){n=e.d,r=e.P,i=e.Q,a=e.S,c=e.U,s=e.V,l=e.W,o=e.g,u=e.j,_=e.X,d=e.Y,m=e.A,f=e.Z,v=e.$,g=e.y},function(e){b=e.C},function(e){h=e.I},function(){},function(){},function(e){p=e.T,z=e.a},function(e){x=e.I,y=e.a,k=e.b},function(e){w=e.i},function(){},function(){},function(){}],execute:function(){var I={headImg:"_headImg_1lc9z_1",tabs:"_tabs_1lc9z_4",tabContent:"_tabContent_1lc9z_27",hasUser:"_hasUser_1lc9z_35",itemContent:"_itemContent_1lc9z_38",item:"_item_1lc9z_38",left:"_left_1lc9z_51",center:"_center_1lc9z_57",right:"_right_1lc9z_61",fraction:"_fraction_1lc9z_65",time:"_time_1lc9z_71",user:"_user_1lc9z_82",userContent:"_userContent_1lc9z_85",name:"_name_1lc9z_90",tag:"_tag_1lc9z_99",times:"_times_1lc9z_107",activeUser:"_activeUser_1lc9z_111",avator:"_avator_1lc9z_131",btn:"_btn_1lc9z_136",num:"_num_1lc9z_142"};e("default",n({name:"leaderboard",setup:function(){var e=r();i();var n=a({tabIndex:0,musicList:[],isSignup:!1,isChallenge:!1,rankingMethod:"",score:0}),j=function(){var r=t(regeneratorRuntime.mark((function t(){var r,i,a;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,g.post("/api-student/open/activity/info/".concat(e.query.id));case 3:r=t.sent,i=r.data,n.rankingMethod=i.rankingMethod,a="TOTAL_SCORE"===i.rankingMethod?i.subjectInfos:i.activityMusicVoList,Array.isArray(a)&&(n.musicList=a.map((function(e){return e.rankingList=[],e})),n.isChallenge=!!a.filter((function(e){return e.join})).length),L.value=i.subjectUrl,n.isSignup=!!i.join,t.next=14;break;case 12:t.prev=12,t.t0=t.catch(0);case 14:case"end":return t.stop()}}),t,null,[[0,12]])})));return function(){return r.apply(this,arguments)}}(),C=function(){var r=t(regeneratorRuntime.mark((function t(){var r,i;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,g.get("/api-student/open/activityEvaluationRecord/queryRankingList",{params:{activityPlanId:e.query.id,activityEvaluationId:"TOTAL_SCORE"===n.rankingMethod?n.musicList[n.tabIndex].subjectId:n.musicList[n.tabIndex].evaluationId,limit:10}});case 3:r=t.sent,i=r.data,Array.isArray(i.rankingList)&&(n.musicList[n.tabIndex].rankingList=i.rankingList),i.userActivityRankingVo&&(n.score=i.userActivityRankingVo.score),t.next=11;break;case 9:t.prev=9,t.t0=t.catch(0);case 11:case"end":return t.stop()}}),t,null,[[0,9]])})));return function(){return r.apply(this,arguments)}}(),L=c(),U=c(!1),R=c(100);s(t(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,j();case 2:return e.next=4,C();case 4:case"end":return e.stop()}}),e)}))));var S=l((function(){var e,t;if(!n.musicList[n.tabIndex])return{};var r=o.user.data;if(!r.userId)return{};var i=n.musicList[n.tabIndex],a=null==i||null===(e=i.rankingList)||void 0===e?void 0:e.find((function(e){return e.userId==r.userId})),c=null==i||null===(t=i.rankingList)||void 0===t?void 0:t.findIndex((function(e){return e.userId==r.userId}));return c=c>-1?c+1:0,{join:i.join,score:(null==a?void 0:a.score)||0,isTop:!!a,heardUrl:r.heardUrl,username:r.username,userId:r.userId,step:c}})),A=c(),T=c();return function(){var e,t;return u("div",{class:I.leaderboard},[u("div",{class:I.container},[u("div",{class:I.headImg,ref:A},[u(h,{width:"100%",fit:"cover",src:L.value,onLoad:function(e){_((function(){var e=d(A).height;U.value=!0,R.value=e||100}))},onError:function(e){console.log(e)}},null)]),U.value&&u(p,{active:n.tabIndex,"onUpdate:active":function(e){return n.tabIndex=e},class:I.tabs,animated:!0,swipeable:!0,titleInactiveColor:"rgba(153,152,155,1)",titleActiveColor:"#fff",onChange:function(e){return C()}},(t=e=n.musicList.map((function(e){return u(z,{title:"TOTAL_SCORE"===n.rankingMethod?e.subjectName:e.musicSheetName},{default:function(){return[u("div",{class:[I.tabContent,!S.value.userId||n.isSignup&&n.isChallenge&&!S.value.join?null:I.hasUser],style:{height:"calc(100vh - ".concat(R.value,"px)")}},[u("div",{class:I.itemContent},[u("div",{class:I.item},[u("div",{class:I.left},[m("排名")]),u("div",{class:I.center},[m("昵称")]),u("div",{class:I.right},[m("评分")])]),e.rankingList.map((function(e,t){var r=(t+1).toString().padStart(2,"0");return u("div",{class:I.item},[u("div",{class:I.left},[0==t&&u(h,{src:x},null),1==t&&u(h,{src:y},null),2==t&&u(h,{src:k},null),0!=t&&1!=t&&2!=t&&r]),u("div",{class:I.center},[u(h,{width:"38px",height:"38px",fit:"cover",round:!0,src:e.userAvatar||w},null),u("div",{class:I.user},[u("div",{class:I.userContent},[u("span",{class:I.name},[e.username]),u("span",{class:I.tag},[e.userSubject])]),u("div",{class:I.times},[e.joinDate])])]),u("div",{class:I.right},[u("div",{class:I.fraction},[e.score,m("分")]),"TOTAL_SCORE"!==n.rankingMethod&&u("div",{class:I.time},[m("第 "),e.times,m(" 次评测")])])])})),!e.rankingList.length&&u(f,{image:"./assets/icon-emtry.76ea3a6a.png",description:"该".concat("TOTAL_SCORE"===n.rankingMethod?"声部":"曲目","暂无排名喔~")},null)]),u("div",{class:"van-safe-area-bottom"},null)])]}})})),"function"==typeof t||"[object Object]"===Object.prototype.toString.call(t)&&!v(t)?e:{default:function(){return[e]}})),S.value.userId&&(n.isSignup?n.isChallenge?S.value.join?u("div",{ref:T,class:[I.activeUser,"van-safe-area-bottom"]},[u(b,{center:!0,title:S.value.username},{icon:function(){return u(h,{class:I.avator,fit:"cover",round:!0,src:S.value.heardUrl||w},null)},label:function(){return S.value.isTop?u("div",null,[m("您的评测已上榜! 当前排名"),u("span",{style:{color:"#FA6400"}},[" ",S.value.step])]):u("div",null,[m("您的评测暂未上榜,快去挑战吧!")])},value:function(){if(S.value.score||n.score)return u("span",{class:I.num},[S.value.score||n.score,m("分")])}})]):null:u("div",{ref:T,class:[I.activeUser,"van-safe-area-bottom"]},[u(b,{center:!0,title:S.value.username,label:"您尚未评测哦!"},{icon:function(){return u(h,{class:I.avator,fit:"cover",round:!0,src:S.value.heardUrl||w},null)}})]):u("div",{ref:T,class:[I.activeUser,"van-safe-area-bottom"]},[u(b,{center:!0,title:S.value.username,label:"您尚未报名参赛"},{icon:function(){return u(h,{class:I.avator,fit:"cover",round:!0,src:S.value.heardUrl||w},null)}})]))])])}}}))}}}))}();