| 1 |
- System.register(["./index-legacy-78868207.js"],(function(e,i){"use strict";var t,n,o,a,s,l,r,d,u,c,v,m,p,g,_,h,S,b,w,y,T,z,f,x=document.createElement("style");return x.textContent="._skeleton_zs6vu_1{position:fixed;left:0;top:0;width:100vw;height:100vh;padding:.53333rem .8rem;background-color:#fff;z-index:1000;--van-skeleton-paragraph-height: .8rem}._detail_zs6vu_12{width:100vw;height:auto;overflow:hidden;--header-height: 1.65333rem;background:transparent;position:relative}._detail_zs6vu_12 ._mask_zs6vu_20{position:absolute;z-index:6;width:100%;height:100%}._detail_zs6vu_12 ._container_zs6vu_26{margin:0;border-radius:.26667rem}._detail_zs6vu_12 #osmdCanvasPage1{position:relative!important}._detail_zs6vu_12 #musicAndSelection{height:initial!important;max-height:initial!important}._detail_zs6vu_12 .smoothAnimationBox{height:0!important;overflow:hidden}\n",document.head.appendChild(x),{setters:[e=>{t=e.d,n=e.g,o=e.n,a=e.c,s=e.m,l=e.bK,r=e.ad,d=e.h,u=e.at,c=e.$,v=e.U,m=e.bL,p=e.bM,g=e.aB,_=e.aE,h=e.bN,S=e.bO,b=e.aF,w=e.bP,y=e.bQ,T=e.bR,z=e.bS,f=e.bT}],execute:function(){const i="_detail_zs6vu_12",x="_mask_zs6vu_20",L="_container_zs6vu_26";e("default",t({name:"simple-detail",setup(){const e=n(),t=o({isLoading:!0,currentTime:0,totalTime:0}),P=e=>{var i,n,o,a;let l={};try{l="string"==typeof(null==e?void 0:e.data)?JSON.parse(e.data):e.data}catch(S){console.error("parse_error: Invalid JSON data received")}var r,d,u,c,v,m,p,g,_,h;"api_play"===(null===(i=l)||void 0===i?void 0:i.api)&&(console.log("h5开始播放"),s.playState="play",I()),"api_paused"===(null===(n=l)||void 0===n?void 0:n.api)&&(console.log("暂停播放"),s.playState="paused"),"api_updateProgress"===(null===(o=l)||void 0===o?void 0:o.api)&&(console.log("拖动的进度"),"paused"===s.playState&&(t.currentTime=null!==(r=l)&&void 0!==r&&null!==(d=r.content)&&void 0!==d&&d.currentTime?null===(u=l)||void 0===u||null===(c=u.content)||void 0===c?void 0:c.currentTime:t.currentTime,F(!0))),"api_playProgress"===(null===(a=l)||void 0===a?void 0:a.api)&&null!==(v=l)&&void 0!==v&&null!==(m=v.content)&&void 0!==m&&m.currentTime&&((null===(p=l)||void 0===p||null===(g=p.content)||void 0===g?void 0:g.currentTime)<t.currentTime&&(s.activeNoteIndex=0),t.currentTime=null===(_=l)||void 0===_||null===(h=_.content)||void 0===h?void 0:h.currentTime)};a((async()=>{const i=e.id||"";s.isSimplePage=!0,await l(i,"open"),t.isLoading=!1,s.isSingleLine=!0,window.addEventListener("message",P)})),r((()=>{s.isSimplePage=!1,window.removeEventListener("message",P)}));const C=async e=>{var i;const t=null===(i=document.getElementById("scrollContainer"))||void 0===i?void 0:i.getBoundingClientRect().height;s.osmd=e,0===s.originSpeed&&(s.originSpeed=s.speed=e.bpm||e.Sheet.userStartTempoInBPM||100);const n=(c.get("speeds")||{})[s.examSongId]||s.speed||e.bpm||e.Sheet.userStartTempoInBPM;n&&v(n),m(),p(),s.times=g(e),console.log("🚀 ~ state.times:",s.times,s),_((()=>{s.activeMeasureIndex=s.times[0].MeasureNumberXML,f()})),h(s.times),S(),b(),console.log("渲染完成",t),window.parent.postMessage({api:"api_musicPage",height:t},"*"),w({height:t})},F=e=>{const i=t.currentTime;let n=y(i);n&&T(n,e),s.activeNoteIndex=(null==n?void 0:n.i)||0,s.isSingleLine&&z(i)},I=()=>{if("play"!==s.playState)return void console.log("暂停播放");let e=Date.now();requestAnimationFrame((()=>{Date.now()-e<16.7?(F(),I()):setTimeout((()=>{F(),I()}),16.7)}))};return()=>d("div",{class:i},[d("div",{class:x},null),d("div",{id:"scrollContainer",class:[L,"hideCursor"]},[!t.isLoading&&d(u,{onRendered:C,musicColor:"#FFFFFF"},null)])])}}))}}}));
|