1 |
- import{d as b,f as e,v as z,U as O,n as w,l as q,e as U,h as H,k as i,m as t,F,P as D,a8 as j,as as G,g as T,o as J,ad as W,c as R,ae as L,af as V,ah as M,ag as $,ai as Q,al as Y,am as Z,an as K,ao as X,ac as ee,ap as ne,at as te,au as se}from"./index-369af630.js";import{a as ie,s as ae}from"./instrument-93b17a51.js";import{P as oe}from"./plyr.min-424cfb91.js";import"./vue3-lottie.es-65ac3410.js";import"./index-619637fd.js";import"./instruments-f42bb069.js";import"./index-631905e4.js";const le="_detail_9q9uv_5",ue="_skeleton_9q9uv_11",re="_headHeight_9q9uv_34",ce="_headHide_9q9uv_43",de="_container_9q9uv_46",pe="_musicName_9q9uv_60",me="_right_9q9uv_67",ye="_wrong_9q9uv_71",he="_notPlay_9q9uv_75",ve="_intonation_wrong_9q9uv_79",fe="_cadence_wrong_9q9uv_83",_e="_integrity_wrong_9q9uv_87",u={detail:le,skeleton:ue,headHeight:re,headHide:ce,container:de,musicName:pe,right:me,wrong:ye,notPlay:he,intonation_wrong:ve,cadence_wrong:fe,integrity_wrong:_e},ge="_headerTop_yzfyn_1",Fe="_android_yzfyn_11",we="_back_yzfyn_14",be="_disabled_yzfyn_26",Ce="_left_yzfyn_30",Ee="_center_yzfyn_34",xe="_cItem_yzfyn_39",Se="_active_yzfyn_61",Pe="_right_yzfyn_68",Be="_btn_yzfyn_72",Ie="_iconBtn_yzfyn_84",Ae="_btnWrap_yzfyn_93",Ne="_popup_yzfyn_98",ke="_audiobox_yzfyn_110",De="_videobox_yzfyn_117",Te="_demos_yzfyn_128",Re="_shiyiPopup_yzfyn_149",Le="_shiyiTitle_yzfyn_156",Me="_items_yzfyn_162",ze="_item_yzfyn_162",s={headerTop:ge,android:Fe,back:we,disabled:be,left:Ce,center:Ee,cItem:xe,active:Se,right:Pe,btn:Be,iconBtn:Ie,btnWrap:Ae,popup:Ne,audiobox:ke,videobox:De,demos:Te,shiyiPopup:Re,shiyiTitle:Le,items:Me,item:ze},Oe=""+new URL("icon-back-2cf38e60.svg",import.meta.url).href,qe=""+new URL("icon-shiyi-ba387160.svg",import.meta.url).href,Ue=""+new URL("icon-huifang-4d7bf6f9.svg",import.meta.url).href,He=""+new URL("videobg-2d19d627.png",import.meta.url).href,l=b({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=b({name:"header-top",props:{scoreData:{type:Object,default:()=>({})}},setup(h){const d=z(),{scoreData:a}=O(h),r=w({show:!1,shiyiShow:!1,isInitPlyr:!1,_plrl:null}),v={BEGINNER:"入门级",ADVANCED:"进阶级",PERFORMER:"大师级"},p=q("intonation"),f=()=>{j()},m=n=>{p.value=n},y=U(()=>{const n=(a.value.videoFilePath||"").split(".").pop();return n==="wav"||n==="mp3"||n==="m4a"?"audio":"video"}),_=()=>{r.show=!0,!r.isInitPlyr&&G(()=>{const n=y.value==="audio"?"#audioSrc":"#videoSrc";r._plrl=new oe(n,{controls:["play-large","play","progress","current-time"],fullscreen:{enabled:!1}}),r.isInitPlyr=!0})};return()=>e("div",{class:[s.headerTop,d.android&&s.android]},[e("div",{class:[s.back,!H.isApp&&s.disabled],onClick:f},[e("img",{src:Oe},null)]),e("div",{class:s.center},[e("div",{class:s.cItem},[e("div",null,[v[a.value.heardLevel]]),e("div",null,[i("难度")])]),e("div",{class:s.cItem},[e("div",null,[a.value.score,i("分")]),e("div",null,[i("评测分数")])]),t.isPercussion?null:e(F,null,[e("div",{onClick:()=>m("intonation"),class:[s.cItem,p.value==="intonation"&&s.active]},[e("div",{style:{color:"rgb(45, 199, 170)"}},[a.value.intonation,i("分")]),e("div",null,[i("音准")])]),e("div",{onClick:()=>m("cadence"),class:[s.cItem,p.value==="cadence"&&s.active]},[e("div",{style:{color:"#FF4E19"}},[a.value.cadence,i("分")]),e("div",null,[i("节奏")])]),e("div",{onClick:()=>m("integrity"),class:[s.cItem,p.value==="integrity"&&s.active]},[e("div",{style:{color:"rgb(255, 196, 89)"}},[a.value.integrity,i("分")]),e("div",null,[i("完成度")])])])]),e("div",{class:s.right},[e("div",{style:{display:a.value.videoFilePath?"":"none"},class:s.btn,onClick:_},[e("img",{class:s.iconBtn,src:Ue},null),e("span",null,[i("回放")])]),e("div",{class:s.btn,onClick:()=>r.shiyiShow=!0},[e("img",{class:s.iconBtn,src:qe},null),e("span",null,[i("释义")])])]),t.isPercussion?null:e("div",{class:s.demos},[e("div",null,[e(l,{fill:"#01C1B5"},null),e("span",null,[i("演奏正确")])]),p.value==="intonation"&&e(F,null,[e("div",null,[e(l,{fill:"rgba(1, 193, 181, .8)",shadowFill:"#FFAB25",shadow:!0,x:-2,y:0},null),e("span",null,[i("音高了")])]),e("div",null,[e(l,{fill:"rgba(1, 193, 181, .8)",shadowFill:"#FFAB25",shadow:!0,x:-1,y:-3},null),e("span",null,[i("音低了")])])]),p.value==="cadence"&&e(F,null,[e("div",null,[e(l,{fill:"rgba(1, 193, 181, .8)",shadowFill:"#FF4444",shadow:!0,x:.5,y:-1},null),e("span",null,[i("节奏过快")])]),e("div",null,[e(l,{fill:"rgba(1, 193, 181, .8)",shadowFill:"#FF4444",shadow:!0,x:-3,y:-2.5},null),e("span",null,[i("节奏慢了")])])]),p.value==="integrity"&&e("div",null,[e(l,{fill:"#CC75FF"},null),e("span",null,[i("完成度不足")])]),e("div",null,[e(l,{fill:"#000"},null),e("span",null,[i("未演奏")])])]),e(D,{teleport:"body",class:["popup-custom","van-scale",s.popup],transition:"van-scale",show:r.show,"onUpdate:show":n=>r.show=n,closeable:!0,onClose:()=>{var n;(n=r._plrl)==null||n.pause()}},{default:()=>[y.value==="audio"&&e("div",{class:s.audiobox},[e("audio",{id:"audioSrc",src:a.value.videoFilePath,controls:"false",preload:"metadata",playsinline:!0},null)]),y.value==="video"&&e("div",{class:s.videobox},[e("video",{id:"videoSrc",class:s.videoBox,src:a.value.videoFilePath,"data-poster":He,preload:"metadata",playsinline:!0},null)])]}),e(D,{show:r.shiyiShow,"onUpdate:show":n=>r.shiyiShow=n,class:"popup-custom van-scale center-closeBtn",transition:"van-scale",teleport:"body",closeable:!0},{default:()=>[e("div",{class:s.shiyiPopup},[e("div",{class:s.shiyiTitle},[i("图标释义")]),e("div",{class:s.items},[e("div",{class:s.item},[e(l,{fill:"#01C1B5"},null),e("span",null,[i("绿色音符:演奏正确")])]),e("div",{class:s.item},[e(l,{fill:"#FF4444"},null),e("span",null,[i("红色音符:错音")])]),e("div",{class:s.item},[e(l,{fill:"#CC75FF"},null),e("span",null,[i("紫色音符:完成度不足")])]),e("div",{class:s.item},[e(l,{fill:"#AEAEAE"},null),e("span",null,[i("灰色音符:未演奏")])]),e("div",{class:s.item},[e(l,{fill:"rgba(1, 193, 181, .8)",shadowFill:"#FF4444",shadow:!0,x:.5,y:-1},null),e("span",null,[i("音符重影(红色在前):节奏过快")])]),e("div",{class:s.item},[e(l,{fill:"rgba(1, 193, 181, .8)",shadowFill:"#FF4444",shadow:!0,x:-3,y:-2.5},null),e("span",null,[i("音符重影(红色在后):节奏慢了")])]),e("div",{class:s.item},[e(l,{fill:"rgba(1, 193, 181, .8)",shadowFill:"#FFAB25",shadow:!0,x:-2,y:0},null),e("span",null,[i("音符重影(黄色在上):音高了")])]),e("div",{class:s.item},[e(l,{fill:"rgba(1, 193, 181, .8)",shadowFill:"#FFAB25",shadow:!0,x:-1,y:-3},null),e("span",null,[i("音符重影(黄色在下):音低了")])])])])]})])}}),Ge={RIGHT:u.right,WRONG:u.wrong,NOT_PLAY:u.notPlay,CADENCE_WRONG:u.cadence_wrong,INTONATION_WRONG:u.intonation_wrong,INTEGRITY_WRONG:u.integrity_wrong},Ke=b({name:"music-list",setup(){const h=T(),d=w({videoFilePath:"",cadence:0,integrity:0,intonation:0,score:0,heardLevel:""}),a=w({isLoading:!0,paddingLeft:"",headerHide:!1,musicalNotesPlayStats:[],userMeasureScore:{}}),r=async()=>{const n=await Y();if(n!=null&&n.content){const{isSpecialShapedScreen:o,notchHeight:c}=n.content;o&&(a.paddingLeft="25px")}a.paddingLeft="20px"};J(()=>{T().platform!=="webTeacher"&&r(),W()});const v=n=>{const o=t.partIndex,c={...n.data,...n.data.background[o]};p(c,o),f(),a.isLoading=!1},p=(n,o)=>{if(t.scrollContainer="scrollContainer",t.detailId=n.id,t.xmlUrl=n.xmlFileUrl,t.partIndex=o,t.subjectId=n.musicSubject,t.categoriesId=n.categoriesId,t.categoriesName=n.musicTagNames,t.enableEvaluation=!!n.canEvaluate,t.examSongId=n.id+"",t.examSongName=n.musicSheetName,n.extConfigJson)try{t.extConfigJson=JSON.parse(n.extConfigJson)}catch(c){console.error("解析扩展字段错误:",c)}t.isOpenMetronome=n.mp3Type==="MP3_METRONOME",t.needTick=n.isOpenMetronome,t.isShowFingering=!!n.showFingering,t.music=n.audioFileUrl,t.accompany=n.metronomeUrl||n.metronomeUrl,t.midiUrl=n.midiUrl,t.parentCategoriesId=n.musicTag,t.playMode=n.audioType==="MP3"?"MP3":"MIDI",t.originSpeed=t.speed=n.speed,t.track=n.track,t.enableNotation=!!n.notation,t.subjectId=Z(t.subjectId,"ORCHESTRA"),t.isPercussion=t.subjectId==23||t.subjectId==113||t.subjectId==121||K(),t.fingeringInfo=X(t.subjectId)},f=()=>{t.extConfigJson.multitrack&&ee("multitrack",t.extConfigJson.multitrack)};R(async()=>{var c,C,E,x,S,P,B,I,A,N,k;const n=await ie(h.id);t.partIndex=Number((c=n==null?void 0:n.data)==null?void 0:c.partIndex);let o={};try{o=JSON.parse((C=n==null?void 0:n.data)==null?void 0:C.scoreData)}catch(g){console.error("解析评测结果:",g)}a.musicalNotesPlayStats=((E=o.musicalNotesPlayStats)==null?void 0:E.notesData)||[],a.userMeasureScore=o.userMeasureScore||{},d.heardLevel=(x=n.data)==null?void 0:x.heardLevel,d.cadence=(S=n.data)==null?void 0:S.cadence,d.integrity=(P=n.data)==null?void 0:P.integrity,d.intonation=(B=n.data)==null?void 0:B.intonation,d.score=(I=n.data)==null?void 0:I.score,d.videoFilePath=((A=n.data)==null?void 0:A.videoFilePath)||((N=n.data)==null?void 0:N.recordFilePath),Promise.all([ae((k=o.musicalNotesPlayStats)==null?void 0:k.examSongId)]).then(g=>{v(g[0])})});const m=()=>{for(const n of a.musicalNotesPlayStats){const o=t.times[n.musicalNotesIndex],c=o!=null&&o.id?document.getElementById("vf-"+(o==null?void 0:o.id)):null;c==null||c.classList.add(Ge[n.musicalErrorType])}},y=()=>{for(let n in a.userMeasureScore)se(a.userMeasureScore[n],!1)},_=n=>{t.musicRendered=!0,t.osmd=n,t.times=ne(n),console.log("🚀 ~ state.times:",t.times),m(),y(),te()};return R(()=>{window.addEventListener("resize",L)}),V(()=>{window.removeEventListener("resize",L)}),()=>e("div",{class:[u.detail,t.setting.eyeProtection&&"eyeProtection",u.shareBox],style:{paddingLeft:a.paddingLeft}},[e(M,{name:"van-fade"},{default:()=>[!t.musicRendered&&e("div",{class:u.skeleton},[e($,{class:u.skeleton,row:8},null)])]}),e("div",{class:[u.headHeight,a.headerHide&&u.headHide],onClick:n=>n.stopPropagation()},[e(M,{name:"van-slide-down"},{default:()=>[t.musicRendered&&e(je,{scoreData:d},null)]})]),e("div",{id:"scrollContainer",class:[u.container,!t.setting.displayCursor&&"hideCursor"]},[e("div",{class:u.musicName},[t.examSongName]),!a.isLoading&&e(Q,{onRendered:_},null)])])}});export{Ke as default};
|