import{_ as r,a as l,b as u,c as d,d as g,e as _,f as h,g as m,h as b,i as p,j as f,k as y,l as v,s}from"./index.module.1e3f21b8.js";import{_ as C,c as k,d as I}from"./icon_level3.5bff162c.js";import{d as S,y as E,x as L,f as w,u as F,n as j,j as t,X as V,z as a,B,Z as N}from"./index.3bfa6a0e.js";import{C as M}from"./index.645e7ddc.js";import{a as H,b as P}from"./index.b1671445.js";import{C as A}from"./index.79997a38.js";import{C as D}from"./index.85c8c2f7.js";import{I as n}from"./index.0fd5538f.js";import"./index.4a8093e5.js";function T(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Object]"&&!N(e)}const x=e=>{const i=`./images/${e}`;return{"./images/icon-lv.png":r,"./images/icon_arrow_left.png":l,"./images/icon_arrow_right.png":u,"./images/icon_close.png":d,"./images/icon_king.png":g,"./images/icon_level.png":C,"./images/icon_level2.png":k,"./images/icon_level3.png":I,"./images/icon_music.png":_,"./images/icon_no_level.png":h,"./images/icon_score.png":m,"./images/icon_subject.png":b,"./images/icon_time.png":p,"./images/star_bg.png":f,"./images/title_bg.png":y,"./images/wx_bg.png":v}[i].default};var K=S({name:"track-song",data(){const e=this.$route.query;console.log(e);const i=e.subjectName||"";return{id:e.id,subjectId:e.subjectId,background:"rgba(55, 205, 177, 0)",headColor:"#fff",height:"auto",backIconColor:"white",title:i+"\u66F2\u76EE\u8BC4\u6D4B",behaviorId:E(),musicList:[],rankingScore:0,hiddenProperty:null,evaluationDifficulty:""}},async mounted(){H(document,"scroll",()=>{const{y:i}=P();i.value>52?(this.headColor="#000",this.background="#fff",this.backIconColor="black"):(this.background="transparent",this.headColor="#fff",this.backIconColor="white")}),await this.getMusicInfo(),this.hiddenProperty="hidden"in document?"hidden":"webkitHidden"in document?"webkitHidden":"mozHidden"in document?"mozHidden":null;const e=this.hiddenProperty.replace(/hidden/i,"visibilitychange");document.addEventListener(e,this.onVisibilityChange)},unmounted(){if(this.hiddenProperty){const e=this.hiddenProperty.replace(/hidden/i,"visibilitychange");document.removeEventListener(e,this.onVisibilityChange)}},methods:{onVisibilityChange(){document[this.hiddenProperty]||this.getMusicInfo()},async getMusicInfo(){try{const{data:e}=await L.post("/api-student/open/activity/info/"+this.id),o=(e.activityMusicVoList||[]).filter(c=>c.subjectId==this.subjectId);this.musicList=o,this.rankingScore=e.rankingScore||0,this.evaluationDifficulty=e.evaluationDifficulty}catch{}},onOpenMusic(e){try{const i=w(),o=F.stringifyUrl({url:location.origin+"/accompany",query:{id:e.musicSheetId,behaviorId:this.behaviorId,client:i.isTeacher?"teacher":"student",setting:JSON.stringify({mode:"EVALUATING",resets:["SPEED"],difficulty:e.evaluationDifficulty||this.evaluationDifficulty,feeType:"FREE",submitData:{evaluationId:e.evaluationId}})}});console.log(o,"url"),j({api:"openAccompanyWebView",content:{url:o,orientation:0,isHideTitle:!0,statusBarTextColor:!1,isOpenLight:!0}})}catch{}}},computed:{allScore(){const e=this.musicList||[];let i=0;return e.forEach(o=>{i+=o.score}),i},calcScore(){const e=this.allScore,i=this.rankingScore;return Number(i-e)}},render(){let e;return t("div",{class:s.trackSong},[t("div",{ref:"headers"},[t(M,{title:this.title,background:this.background,border:!1,color:this.headColor,backIconColor:this.backIconColor,onHeaderBack:()=>{this.$nextTick(()=>{const{height:i}=V(this.$refs.headers);this.height=i})}},{default:()=>[t("div",{class:s.trackScore},[t("div",{class:s.trackCountScore},[a("\u6211\u7684\u603B\u5206 "),t("span",null,[this.allScore])]),t("div",{class:s.trackIf},[this.calcScore<=0?"\u606D\u559C\u60A8\u5DF2\u8FBE\u5230\u83B7\u5956\u5206\u6570\uFF01":`\u8DDD\u79BB\u8981\u6C42\u5206\u6570\u8FD8\u6709${this.calcScore}\u5206\uFF0C\u7EE7\u7EED\u52A0\u6CB9\uFF01`]),t(n,{class:s.trackImg,src:x("icon_score.png")},null)])]})]),t("div",{class:s.bg},null),t(D,{class:s.cellGroup},T(e=this.musicList.map(i=>t(A,{center:!0},{icon:()=>t(n,{src:i.musicImage,class:s.musicPic},null),title:()=>t("div",{class:s.musicName},[i.musicSheetName]),label:()=>i.score?t("div",{class:[s.labelClass,s.labelScore]},[a("\u6211\u7684\u8BC4\u5206\uFF1A"),i.score]):t("div",{class:s.labelClass},[a("\u6682\u65E0\u8BC4\u5206\uFF0C\u5FEB\u6765\u6311\u6218\u5427\uFF5E")]),value:()=>t("div",{class:s.valueClass},[t(B,{type:"primary",size:"small",round:!0,color:"linear-gradient(180deg, #FFA200 0%, #FF6900 100%)",onClick:()=>{this.onOpenMusic(i)}},{default:()=>[a("\u7ACB\u523B\u6311\u6218")]})])})))?e:{default:()=>[e]})])}});export{K as default,x as getAssetsHomeFile};
