track-song-legacy.512325bb.js 5.6 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","./index-legacy.81a64bb6.js","./index-legacy.b2528a15.js","./index-legacy.44baf7f8.js","./index-legacy.207dc8c2.js","./index-legacy.a7e74731.js","./index-legacy.ca42ae97.js","./index-legacy.c610561c.js","./index-legacy.f75b8290.js","./use-height-legacy.2a153aaf.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,_,j,C,S,x,w,P,L,E,D,H,A,F,M;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.C},function(e){k=e.d,I=e.z,_=e.e,j=e.b,C=e.p,S=e.i,x=e.Y,w=e.A,P=e.B,L=e.$},function(e){E=e.u,D=e.a},function(e){H=e.C},function(e){A=e.C},function(e){F=e.I},function(e){M=e.q},function(){},function(){}],execute:function(){var N=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",k({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:I(),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 E(document,"scroll",(function(){D().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,_.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=j(),i=M.stringifyUrl({url:location.origin+"/accompany",query:{id:e.musicSheetId,behaviorId:this.behaviorId,client: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"),C({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 S("div",{class:m.trackSong},[S("div",{ref:"headers"},[S(y,{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[S("div",{class:m.trackScore},[S("div",{class:m.trackCountScore},[w("我的总分 "),S("span",null,[i.allScore])]),S("div",{class:m.trackIf},[i.calcScore<=0?"恭喜您已达到获奖分数!":"距离要求分数还有".concat(i.calcScore,"分,继续加油!")]),S(F,{class:m.trackImg,src:N("icon_score.png")},null)])]}})]),S("div",{class:m.bg},null),S(A,{class:m.cellGroup},(n=e=this.musicList.map((function(e){return S(H,{center:!0},{icon:function(){return S(F,{src:e.musicImage,class:m.musicPic},null)},title:function(){return S("div",{class:m.musicName},[e.musicSheetName])},label:function(){return e.score?S("div",{class:[m.labelClass,m.labelScore]},[w("我的评分:"),e.score]):S("div",{class:m.labelClass},[w("暂无评分,快来挑战吧~")])},value:function(){return S("div",{class:m.valueClass},[S(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]}}))])}}))}}}))}();