1 |
- import{d as w,j as e,a0 as L,aj as O,V as b,r as U,s as H,N as j,S as a,U as s,O as f,a5 as D,az as G,A as J,F as V,G as W,aE as $,M as T,aF as M,aG as z,aI as R,aH as Q,aJ as Y,aM as q,aN as Z,aO as K,aP as X,aD as ee,aQ as te,aT as se,aU as ie}from"./index-2725ae47.js";import{a as ae,b as oe}from"./instrument-60f12b66.js";import{P as ne}from"./plyr.min-424cfb91.js";import"./vue3-lottie.es-890c3e19.js";import"./index-a20d6e07.js";import"./index-3f47bef0.js";import"./index-4ec119ad.js";const le="_skeleton_vbtuh_1",ue="_detail_vbtuh_12",re="_headHeight_vbtuh_24",ce="_headHide_vbtuh_33",de="_container_vbtuh_36",me="_musicName_vbtuh_50",pe="_right_vbtuh_57",he="_wrong_vbtuh_61",ve="_notPlay_vbtuh_65",_e="_intonation_wrong_vbtuh_69",ge="_cadence_wrong_vbtuh_73",ye="_integrity_wrong_vbtuh_77",l={skeleton:le,detail:ue,headHeight:re,headHide:ce,container:de,musicName:me,right:pe,wrong:he,notPlay:ve,intonation_wrong:_e,cadence_wrong:ge,integrity_wrong:ye},Fe="_headerTop_mou4y_1",fe="_android_mou4y_11",be="_back_mou4y_14",we="_disabled_mou4y_26",Ee="_left_mou4y_30",Ce="_center_mou4y_34",xe="_cItem_mou4y_39",Se="_active_mou4y_61",Pe="_right_mou4y_68",Be="_btn_mou4y_72",Ie="_iconBtn_mou4y_84",Ae="_btnWrap_mou4y_93",Ne="_popup_mou4y_98",ke="_audiobox_mou4y_110",De="_videobox_mou4y_117",Te="_demos_mou4y_128",Me="_shiyiPopup_mou4y_149",Re="_shiyiTitle_mou4y_156",Le="_items_mou4y_162",Oe="_item_mou4y_162",i={headerTop:Fe,android:fe,back:be,disabled:we,left:Ee,center:Ce,cItem:xe,active:Se,right:Pe,btn:Be,iconBtn:Ie,btnWrap:Ae,popup:Ne,audiobox:ke,videobox:De,demos:Te,shiyiPopup:Me,shiyiTitle:Re,items:Le,item:Oe},Ue=""+new URL("icon-back-2cf38e60.svg",import.meta.url).href,He=""+new URL("icon-shiyi-ba387160.svg",import.meta.url).href,je=""+new URL("icon-huifang-4d7bf6f9.svg",import.meta.url).href,Ge=""+new URL("videobg-2d19d627.png",import.meta.url).href,n=w({name:"NoteSvg",props:{fill:String,shadow:{type:Boolean,defalut:!1},shadowFill:{type:String,default:""},x:{type:Number,default:0},y:{type:Number,default:0}},render(){return e("svg",{width:"14",height:"24",viewBox:"0 0 14 24"},[e("g",{stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},[e("rect",{x:"0",y:"0",width:"14",height:"24"},null),e("g",{fill:this.fill},[this.shadow&&e("ellipse",{fill:this.shadowFill||this.fill,transform:`translate(4.685927, 18.917813) scale(-1, -1) rotate(-32.000000) translate(${this.x+-4.685927}, ${this.y+-18.917813})`,cx:"4.68592654",cy:"18.9178127",rx:"3.70078457",ry:"2.92022453"},null),e("path",{d:"M1.95251677,0.68258909 C3.68583115,-0.400505943 5.78379192,-0.169765229 6.63844331,1.1979629 C7.4930947,2.56569103 6.78079761,4.55247575 5.04748323,5.63557079 C3.85503595,6.38069455 2.49000663,6.50399819 1.47594704,6.06306368 L1.47635248,22.0768926 L0.0162402201,22.0768926 L0.0154715991,4.11169688 C-0.117424115,2.8976469 0.612367024,1.52000759 1.95251677,0.68258909 Z",transform:"scale(-1, -1) translate(-10, -23) "},null)])])])}}),Je=w({name:"header-top",props:{scoreData:{type:Object,default:()=>({})}},setup(v){const d=L(),{scoreData:o}=O(v),r=b({show:!1,shiyiShow:!1,isInitPlyr:!1,_plrl:null}),_={BEGINNER:"入门级",ADVANCED:"进阶级",PERFORMER:"大师级"},m=U("intonation"),g=()=>{G()},p=t=>{m.value=t},h=H(()=>{const t=(o.value.videoFilePath||"").split(".").pop();return t==="wav"||t==="mp3"?"audio":"video"}),y=()=>{r.show=!0,!r.isInitPlyr&&J(()=>{const t=h.value==="audio"?"#audioSrc":"#videoSrc";r._plrl=new ne(t,{controls:["play-large","play","progress","current-time"],fullscreen:{enabled:!1}}),r.isInitPlyr=!0})};return()=>e("div",{class:[i.headerTop,d.android&&i.android]},[e("div",{class:[i.back,!j.isApp&&i.disabled],onClick:g},[e("img",{src:Ue},null)]),e("div",{class:i.center},[e("div",{class:i.cItem},[e("div",null,[_[o.value.heardLevel]]),e("div",null,[a("难度")])]),e("div",{class:i.cItem},[e("div",null,[o.value.score,a("分")]),e("div",null,[a("评测分数")])]),s.isPercussion?null:e(f,null,[e("div",{onClick:()=>p("intonation"),class:[i.cItem,m.value==="intonation"&&i.active]},[e("div",{style:{color:"rgb(45, 199, 170)"}},[o.value.intonation,a("分")]),e("div",null,[a("音准")])]),e("div",{onClick:()=>p("cadence"),class:[i.cItem,m.value==="cadence"&&i.active]},[e("div",{style:{color:"#FF4E19"}},[o.value.cadence,a("分")]),e("div",null,[a("节奏")])]),e("div",{onClick:()=>p("integrity"),class:[i.cItem,m.value==="integrity"&&i.active]},[e("div",{style:{color:"rgb(255, 196, 89)"}},[o.value.integrity,a("分")]),e("div",null,[a("完成度")])])])]),e("div",{class:i.right},[e("div",{style:{display:o.value.videoFilePath?"":"none"},class:i.btn,onClick:y},[e("img",{class:i.iconBtn,src:je},null),e("span",null,[a("回放")])]),e("div",{class:i.btn,onClick:()=>r.shiyiShow=!0},[e("img",{class:i.iconBtn,src:He},null),e("span",null,[a("释义")])])]),s.isPercussion?null:e("div",{class:i.demos},[e("div",null,[e(n,{fill:"#01C1B5"},null),e("span",null,[a("演奏正确")])]),m.value==="intonation"&&e(f,null,[e("div",null,[e(n,{fill:"rgba(1, 193, 181, .8)",shadowFill:"#FFAB25",shadow:!0,x:-2,y:0},null),e("span",null,[a("音高了")])]),e("div",null,[e(n,{fill:"rgba(1, 193, 181, .8)",shadowFill:"#FFAB25",shadow:!0,x:-1,y:-3},null),e("span",null,[a("音低了")])])]),m.value==="cadence"&&e(f,null,[e("div",null,[e(n,{fill:"rgba(1, 193, 181, .8)",shadowFill:"#FF4444",shadow:!0,x:.5,y:-1},null),e("span",null,[a("节奏过快")])]),e("div",null,[e(n,{fill:"rgba(1, 193, 181, .8)",shadowFill:"#FF4444",shadow:!0,x:-3,y:-2.5},null),e("span",null,[a("节奏慢了")])])]),m.value==="integrity"&&e("div",null,[e(n,{fill:"#CC75FF"},null),e("span",null,[a("完成度不足")])]),e("div",null,[e(n,{fill:"#000"},null),e("span",null,[a("未演奏")])])]),e(D,{teleport:"body",class:["popup-custom","van-scale",i.popup],transition:"van-scale",show:r.show,"onUpdate:show":t=>r.show=t,closeable:!0,onClose:()=>{var t;(t=r._plrl)==null||t.pause()}},{default:()=>[h.value==="audio"&&e("div",{class:i.audiobox},[e("audio",{id:"audioSrc",src:o.value.videoFilePath,controls:"false",preload:"metadata",playsinline:!0},null)]),h.value==="video"&&e("div",{class:i.videobox},[e("video",{id:"videoSrc",class:i.videoBox,src:o.value.videoFilePath,"data-poster":Ge,preload:"metadata",playsinline:!0},null)])]}),e(D,{show:r.shiyiShow,"onUpdate:show":t=>r.shiyiShow=t,class:"popup-custom van-scale center-closeBtn",transition:"van-scale",teleport:"body",closeable:!0},{default:()=>[e("div",{class:i.shiyiPopup},[e("div",{class:i.shiyiTitle},[a("图标释义")]),e("div",{class:i.items},[e("div",{class:i.item},[e(n,{fill:"#01C1B5"},null),e("span",null,[a("绿色音符:演奏正确")])]),e("div",{class:i.item},[e(n,{fill:"#FF4444"},null),e("span",null,[a("红色音符:错音")])]),e("div",{class:i.item},[e(n,{fill:"#CC75FF"},null),e("span",null,[a("紫色音符:完成度不足")])]),e("div",{class:i.item},[e(n,{fill:"#AEAEAE"},null),e("span",null,[a("灰色音符:未演奏")])]),e("div",{class:i.item},[e(n,{fill:"rgba(1, 193, 181, .8)",shadowFill:"#FF4444",shadow:!0,x:.5,y:-1},null),e("span",null,[a("音符重影(红色在前):节奏过快")])]),e("div",{class:i.item},[e(n,{fill:"rgba(1, 193, 181, .8)",shadowFill:"#FF4444",shadow:!0,x:-3,y:-2.5},null),e("span",null,[a("音符重影(红色在后):节奏慢了")])]),e("div",{class:i.item},[e(n,{fill:"rgba(1, 193, 181, .8)",shadowFill:"#FFAB25",shadow:!0,x:-2,y:0},null),e("span",null,[a("音符重影(黄色在上):音高了")])]),e("div",{class:i.item},[e(n,{fill:"rgba(1, 193, 181, .8)",shadowFill:"#FFAB25",shadow:!0,x:-1,y:-3},null),e("span",null,[a("音符重影(黄色在下):音低了")])])])])]})])}}),Ve={RIGHT:l.right,WRONG:l.wrong,NOT_PLAY:l.notPlay,CADENCE_WRONG:l.cadence_wrong,INTONATION_WRONG:l.intonation_wrong,INTEGRITY_WRONG:l.integrity_wrong},Ke=w({name:"music-list",setup(){const v=V(),d=b({videoFilePath:"",cadence:0,integrity:0,intonation:0,score:0,heardLevel:""}),o=b({isLoading:!0,paddingLeft:"",headerHide:!1,musicalNotesPlayStats:[],userMeasureScore:{}}),r=async()=>{const t=await q();if(t!=null&&t.content){const{isSpecialShapedScreen:u,notchHeight:c}=t.content;u&&(o.paddingLeft="25px")}o.paddingLeft="20px"};W(()=>{r(),$()});const _=t=>{const u=s.partIndex,c={...t.data,...t.data.background[u]};m(c,u),g(),o.isLoading=!1},m=(t,u)=>{if(s.scrollContainer="scrollContainer",s.detailId=t.id,s.xmlUrl=t.xmlFileUrl,s.partIndex=u,s.subjectId=t.musicSubject,s.categoriesId=t.categoriesId,s.categoriesName=t.musicTagNames,s.enableEvaluation=!!t.canEvaluate,s.examSongId=t.id+"",s.examSongName=t.musicSheetName,t.extConfigJson)try{s.extConfigJson=JSON.parse(t.extConfigJson)}catch(c){console.error("解析扩展字段错误:",c)}s.isOpenMetronome=t.mp3Type==="MP3_METRONOME",s.needTick=t.isOpenMetronome,s.isShowFingering=!!t.showFingering,s.music=t.audioFileUrl,s.accompany=t.metronomeUrl||t.metronomeUrl,s.midiUrl=t.midiUrl,s.parentCategoriesId=t.musicTag,s.playMode=t.audioType==="MP3"?"MP3":"MIDI",s.originSpeed=s.speed=t.speed,s.track=t.track,s.enableNotation=!!t.notation,s.subjectId=Z(s.subjectId,"ORCHESTRA"),s.isPercussion=s.subjectId==23||s.subjectId==113||s.subjectId==121||K(),s.fingeringInfo=X(s.subjectId)},g=()=>{s.extConfigJson.multitrack&&ee("multitrack",s.extConfigJson.multitrack)};T(async()=>{var c,E,C,x,S,P,B,I,A,N,k;const t=await ae(v.id);s.partIndex=Number((c=t==null?void 0:t.data)==null?void 0:c.partIndex);let u={};try{u=JSON.parse((E=t==null?void 0:t.data)==null?void 0:E.scoreData)}catch(F){console.error("解析评测结果:",F)}o.musicalNotesPlayStats=((C=u.musicalNotesPlayStats)==null?void 0:C.notesData)||[],o.userMeasureScore=u.userMeasureScore||{},d.heardLevel=(x=t.data)==null?void 0:x.heardLevel,d.cadence=(S=t.data)==null?void 0:S.cadence,d.integrity=(P=t.data)==null?void 0:P.integrity,d.intonation=(B=t.data)==null?void 0:B.intonation,d.score=(I=t.data)==null?void 0:I.score,d.videoFilePath=((A=t.data)==null?void 0:A.videoFilePath)||((N=t.data)==null?void 0:N.recordFilePath),Promise.all([oe((k=u.musicalNotesPlayStats)==null?void 0:k.examSongId)]).then(F=>{_(F[0])})});const p=()=>{for(const t of o.musicalNotesPlayStats){const u=s.times[t.musicalNotesIndex],c=document.getElementById("vf-"+u.id);c==null||c.classList.add(Ve[t.musicalErrorType])}},h=()=>{for(let t in o.userMeasureScore)ie(o.userMeasureScore[t],!1)},y=t=>{s.musicRendered=!0,s.osmd=t,s.times=te(t),console.log("🚀 ~ state.times:",s.times),p(),h(),se()};return T(()=>{window.addEventListener("resize",M)}),z(()=>{window.removeEventListener("resize",M)}),()=>e("div",{class:[l.detail,s.setting.eyeProtection&&"eyeProtection",l.shareBox],style:{paddingLeft:o.paddingLeft}},[e(R,{name:"van-fade"},{default:()=>[!s.musicRendered&&e("div",{class:l.skeleton},[e(Q,{class:l.skeleton,row:8},null)])]}),e("div",{class:[l.headHeight,o.headerHide&&l.headHide],onClick:t=>t.stopPropagation()},[e(R,{name:"van-slide-down"},{default:()=>[s.musicRendered&&e(Je,{scoreData:d},null)]})]),e("div",{id:"scrollContainer",class:[l.container,!s.setting.displayCursor&&"hideCursor"]},[e("div",{class:l.musicName},[s.examSongName]),!o.isLoading&&e(Y,{onRendered:y},null)])])}});export{Ke as default};
|