track-song-legacy.db28ae7e.js 5.5 KB

1
  1. !function(){function e(e,n,i,t,c,r,o){try{var a=e[r](o),s=a.value}catch(u){return void i(u)}a.done?n(s):Promise.resolve(s).then(t,c)}function n(n){return function(){var i=this,t=arguments;return new Promise((function(c,r){var o=n.apply(i,t);function a(n){e(o,c,r,a,s,"next",n)}function s(n){e(o,c,r,a,s,"throw",n)}a(void 0)}))}}System.register(["./index.module-legacy.ee18af4b.js","./icon_level3-legacy.16a3757a.js","./ResizeObserver.es-legacy.8d60aee1.js","./index-legacy.87bcd48f.js","./index-legacy.bbc2b10e.js","./index-legacy.610f0a70.js","./index-legacy.fd89cccf.js","./index-legacy.4a75d877.js"],(function(e){"use strict";var i,t,c,r,o,a,s,u,l,d,f,g,h,m,v,p,b,y,k,I,_,C,S,j,x,w,P,L,E,D,H,O,T,A;return{setters:[function(e){i=e._,t=e.a,c=e.b,r=e.c,o=e.d,a=e.e,s=e.f,u=e.g,l=e.h,d=e.i,f=e.j,g=e.k,h=e.l,m=e.s},function(e){v=e._,p=e.c,b=e.d},function(e){y=e.d,k=e.z,I=e.y,_=e.f,C=e.v,S=e.n,j=e.j,x=e.Y,w=e.A,P=e.B,L=e.$},function(e){E=e.C},function(e){D=e.a,H=e.b},function(e){O=e.C},function(e){T=e.C},function(e){A=e.I}],execute:function(){var F=e("getAssetsHomeFile",(function(e){var n="./images/".concat(e);return{"./images/icon-lv.png":i,"./images/icon_arrow_left.png":t,"./images/icon_arrow_right.png":c,"./images/icon_close.png":r,"./images/icon_king.png":o,"./images/icon_level.png":v,"./images/icon_level2.png":p,"./images/icon_level3.png":b,"./images/icon_music.png":a,"./images/icon_no_level.png":s,"./images/icon_score.png":u,"./images/icon_subject.png":l,"./images/icon_time.png":d,"./images/star_bg.png":f,"./images/title_bg.png":g,"./images/wx_bg.png":h}[n].default}));e("default",y({name:"track-song",data:function(){var e=this.$route.query;console.log(e);var n=e.subjectName||"";return{id:e.id,subjectId:e.subjectId,background:"rgba(55, 205, 177, 0)",headColor:"#fff",height:"auto",backIconColor:"white",title:n+"曲目评测",behaviorId:k(),musicList:[],rankingScore:0,hiddenProperty:null,evaluationDifficulty:""}},mounted:function(){var e=this;return n(regeneratorRuntime.mark((function n(){var i;return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return D(document,"scroll",(function(){H().y.value>52?(e.headColor="#000",e.background="#fff",e.backIconColor="black"):(e.background="transparent",e.headColor="#fff",e.backIconColor="white")})),n.next=3,e.getMusicInfo();case 3:e.hiddenProperty="hidden"in document?"hidden":"webkitHidden"in document?"webkitHidden":"mozHidden"in document?"mozHidden":null,i=e.hiddenProperty.replace(/hidden/i,"visibilitychange"),document.addEventListener(i,e.onVisibilityChange);case 6:case"end":return n.stop()}}),n)})))()},unmounted:function(){if(this.hiddenProperty){var e=this.hiddenProperty.replace(/hidden/i,"visibilitychange");document.removeEventListener(e,this.onVisibilityChange)}},methods:{onVisibilityChange:function(){document[this.hiddenProperty]||this.getMusicInfo()},getMusicInfo:function(){var e=this;return n(regeneratorRuntime.mark((function n(){var i,t,c,r;return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.prev=0,n.next=3,I.post("/api-student/open/activity/info/"+e.id);case 3:i=n.sent,t=i.data,c=t.activityMusicVoList||[],r=c.filter((function(n){return n.subjectId==e.subjectId})),e.musicList=r,e.rankingScore=t.rankingScore||0,e.evaluationDifficulty=t.evaluationDifficulty,n.next=14;break;case 12:n.prev=12,n.t0=n.catch(0);case 14:case"end":return n.stop()}}),n,null,[[0,12]])})))()},onOpenMusic:function(e){try{var n=_(),i=C.stringifyUrl({url:location.origin+"/klx-music-score/",query:{id:e.musicSheetId,behaviorId:this.behaviorId,systemType:n.isTeacher?"teacher":"student",setting:JSON.stringify({mode:"EVALUATING",resets:["SPEED"],difficulty:e.evaluationDifficulty||this.evaluationDifficulty,feeType:"FREE",submitData:{evaluationId:e.evaluationId}})}});console.log(i,"url"),S({api:"openAccompanyWebView",content:{url:i,orientation:0,isHideTitle:!0,statusBarTextColor:!1,isOpenLight:!0}})}catch(t){}}},computed:{allScore:function(){var e=this.musicList||[],n=0;return e.forEach((function(e){n+=e.score})),n},calcScore:function(){var e=this.allScore,n=this.rankingScore;return Number(n-e)}},render:function(){var e,n,i=this;return j("div",{class:m.trackSong},[j("div",{ref:"headers"},[j(E,{title:this.title,background:this.background,border:!1,color:this.headColor,backIconColor:this.backIconColor,onHeaderBack:function(){i.$nextTick((function(){var e=x(i.$refs.headers).height;i.height=e}))}},{default:function(){return[j("div",{class:m.trackScore},[j("div",{class:m.trackCountScore},[w("我的总分 "),j("span",null,[i.allScore])]),j("div",{class:m.trackIf},[i.calcScore<=0?"恭喜您已达到获奖分数!":"距离要求分数还有".concat(i.calcScore,"分,继续加油!")]),j(A,{class:m.trackImg,src:F("icon_score.png")},null)])]}})]),j("div",{class:m.bg},null),j(T,{class:m.cellGroup},(n=e=this.musicList.map((function(e){return j(O,{center:!0},{icon:function(){return j(A,{src:e.musicImage,class:m.musicPic},null)},title:function(){return j("div",{class:m.musicName},[e.musicSheetName])},label:function(){return e.score?j("div",{class:[m.labelClass,m.labelScore]},[w("我的评分:"),e.score]):j("div",{class:m.labelClass},[w("暂无评分,快来挑战吧~")])},value:function(){return j("div",{class:m.valueClass},[j(P,{type:"primary",size:"small",round:!0,color:"linear-gradient(180deg, #FFA200 0%, #FF6900 100%)",onClick:function(){i.onOpenMusic(e)}},{default:function(){return[w("立刻挑战")]}})])}})})),"function"==typeof n||"[object Object]"===Object.prototype.toString.call(n)&&!L(n)?e:{default:function(){return[e]}}))])}}))}}}))}();