1 |
- System.register(["./index-legacy-3da2803a.js"],(function(e,i){"use strict";var t,n,a,o,s,r,d,l,u,m,c,v,p,g,_,h,b,S,x,f,w,y,z,M,T=document.createElement("style");return T.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(T),{setters:[e=>{t=e.d,n=e.g,a=e.n,o=e.c,s=e.m,r=e.bK,d=e.ad,l=e.h,u=e.at,m=e.bL,c=e.bM,v=e.$,p=e.U,g=e.bN,_=e.bO,h=e.aB,b=e.aE,S=e.bP,x=e.bQ,f=e.aF,w=e.bR,y=e.bS,z=e.bT,M=e.bU}],execute:function(){const i="_detail_zs6vu_12",T="_mask_zs6vu_20",I="_container_zs6vu_26";e("default",t({name:"simple-detail",setup(){const e=n(),t=a({isLoading:!0,currentTime:0,totalTime:0}),L=e=>{var i,n,a,o;let r={};try{r="string"==typeof(null==e?void 0:e.data)?JSON.parse(e.data):e.data}catch(g){console.error("parse_error: Invalid JSON data received")}var d,l,u;if("api_play"===(null===(i=r)||void 0===i?void 0:i.api)&&(console.log("h5开始播放"),s.playState="play",C()),"api_paused"===(null===(n=r)||void 0===n?void 0:n.api)&&(console.log("暂停播放"),s.playState="paused"),"api_updateProgress"===(null===(a=r)||void 0===a?void 0:a.api)&&(console.log("拖动的进度"),"paused"===s.playState&&(t.currentTime=null!==(d=null===(l=r)||void 0===l||null===(u=l.content)||void 0===u?void 0:u.currentTime)&&void 0!==d?d:t.currentTime,s.activeNoteIndex=0,s.activeMeasureIndex=s.times[0].MeasureNumberXML,P(!0))),"api_playProgress"===(null===(o=r)||void 0===o?void 0:o.api)){var v,p;const e=null===(v=r)||void 0===v||null===(p=v.content)||void 0===p?void 0:p.currentTime;if(e){if(e<t.currentTime){s.activeNoteIndex=0;let i=m(e)||s.times[0];i.i===s.activeNoteIndex&&(s.activeMeasureIndex=i.MeasureNumberXML),e<=s.times[0].fixtime&&c(!0)}t.currentTime=e}}};o((async()=>{const i=e.id||"";s.isSimplePage=!0,await r(i,"open"),t.isLoading=!1,s.isSingleLine=!0,window.addEventListener("message",L)})),d((()=>{s.isSimplePage=!1,window.removeEventListener("message",L)}));const N=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=(v.get("speeds")||{})[s.examSongId]||s.speed||e.bpm||e.Sheet.userStartTempoInBPM;n&&p(n),g(),_(),s.times=h(e),console.log("🚀 ~ state.times:",s.times,s),b((()=>{s.activeMeasureIndex=s.times[0].MeasureNumberXML,M()})),S(s.times),x(),f(),console.log("渲染完成",t),window.parent.postMessage({api:"api_musicPage",height:t},"*"),w({height:t})},P=e=>{const i=t.currentTime;let n=m(i)||s.times[0];n&&y(n,e),s.activeNoteIndex=(null==n?void 0:n.i)||0,s.isSingleLine&&z(i)},C=()=>{if("play"!==s.playState)return void console.log("暂停播放");let e=Date.now();requestAnimationFrame((()=>{Date.now()-e<16.7?(P(),C()):setTimeout((()=>{P(),C()}),16.7)}))};return()=>l("div",{class:i},[l("div",{class:T},null),l("div",{id:"scrollContainer",class:[I,"hideCursor"]},[!t.isLoading&&l(u,{onRendered:N,musicColor:"#FFFFFF"},null)])])}}))}}}));
|