index-legacy-d224d78c.js 3.3 KB

1
  1. System.register(["./index-legacy-fe26530b.js"],(function(e,t){"use strict";var n,i,o,a,l,r,s,d,c,u,p,m,g,h,v,_,S,b,y,w,T,f,j,x=document.createElement("style");return x.textContent="._skeleton_1jzuh_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_1jzuh_12{width:100vw;height:auto;overflow:hidden;--header-height: 1.65333rem;background:transparent}._detail_1jzuh_12 ._container_1jzuh_19{margin:0;border-radius:.26667rem}._detail_1jzuh_12 #osmdCanvasPage1{position:relative!important}._detail_1jzuh_12 #musicAndSelection{height:initial!important;max-height:initial!important}._detail_1jzuh_12 .smoothAnimationBox{height:0!important;overflow:hidden}\n",document.head.appendChild(x),{setters:[e=>{n=e.d,i=e.g,o=e.n,a=e.c,l=e.m,r=e.bF,s=e.bG,d=e.b3,c=e.ae,u=e.h,p=e.av,m=e.a0,g=e.V,h=e.bH,v=e.bI,_=e.aD,S=e.bJ,b=e.bK,y=e.aH,w=e.bL,T=e.bM,f=e.bN,j=e.bO}],execute:function(){const t="_detail_1jzuh_12",x="_container_1jzuh_19";e("default",n({name:"simple-detail",setup(){const e=i(),n=o({isLoading:!0,currentTime:0,totalTime:0}),z=e=>{try{const t=JSON.parse(e.data);console.log("Received data:",t)}catch(d){console.error("parse_error: Invalid JSON data received")}console.log("h5消息",e);const t=e.data?e.data:e;var i,o,a,r,s;"api_play"===(null==t?void 0:t.api)&&(console.log("h5开始播放"),l.playState="play",P()),"api_paused"===(null==t?void 0:t.api)&&(console.log("暂停播放"),l.playState="paused"),"api_updateProgress"===(null==t?void 0:t.api)&&(console.log("拖动的进度"),"paused"===l.playState&&(n.currentTime=null!=t&&null!==(i=t.content)&&void 0!==i&&i.currentTime?null==t||null===(o=t.content)||void 0===o?void 0:o.currentTime:n.currentTime,L())),"api_playProgress"===(null==t?void 0:t.api)&&(console.log("播放进度",e),null!=t&&null!==(a=t.content)&&void 0!==a&&a.currentTime&&((null==t||null===(r=t.content)||void 0===r?void 0:r.currentTime)<n.currentTime&&(l.activeNoteIndex=0),n.currentTime=null==t||null===(s=t.content)||void 0===s?void 0:s.currentTime))},I=e=>{console.log("app开始播放","消息对象",e),l.playState="play",P()},C=e=>{console.log("app切到后台","消息对象",e)};a((async()=>{const t=e.id||"";l.isSimplePage=!0,await r(t,"open"),n.isLoading=!1,l.isSingleLine=!0,window.addEventListener("message",z),s(I),d(C)})),c((()=>{l.isSimplePage=!1,window.removeEventListener("message",z)}));const F=async e=>{var t;const n=null===(t=document.getElementById("scrollContainer"))||void 0===t?void 0:t.getBoundingClientRect().height;l.osmd=e,0===l.originSpeed&&(l.originSpeed=l.speed=e.bpm||e.Sheet.userStartTempoInBPM||100);const i=(m.get("speeds")||{})[l.examSongId]||l.speed||e.bpm||e.Sheet.userStartTempoInBPM;i&&g(i),h(),v(),l.times=_(e),console.log("🚀 ~ state.times:",l.times,l.subjectId,l),S(l.times),b(),y(),console.log("渲染完成",n),window.parent.postMessage({api:"api_musicPage",height:n},"*"),w({height:n})},L=()=>{const e=n.currentTime;let t=T(e);t&&f(t),l.activeNoteIndex=(null==t?void 0:t.i)||0,l.isSingleLine&&j(e)},P=()=>{if("play"!==l.playState)return void console.log("暂停播放");let e=Date.now();requestAnimationFrame((()=>{Date.now()-e<16.7?(L(),P()):setTimeout((()=>{L(),P()}),16.7)}))};return()=>u("div",{class:t},[u("div",{id:"scrollContainer",class:[x,"hideCursor"]},[!n.isLoading&&u(p,{onRendered:F,musicColor:"#FFFFFF"},null)])])}}))}}}));