|
@@ -8,7 +8,7 @@ import store from "store";
|
|
|
import { formateTimes } from "../../helpers/formateMusic";
|
|
|
import { setCustomGradual, setCustomNoteRealValue } from "/src/helpers/customMusicScore"
|
|
|
import { initSmoothAnimation, smoothAnimationState, destroySmoothAnimation, moveSmoothAnimationByPlayTime } from "../view-detail/smoothAnimation";
|
|
|
-import { api_playProgress } from "/src/helpers/communication";
|
|
|
+import { api_playProgress, api_cloudLoading } from "/src/helpers/communication";
|
|
|
|
|
|
export default defineComponent({
|
|
|
name: "simple-detail",
|
|
@@ -29,10 +29,19 @@ export default defineComponent({
|
|
|
state.playState = 'play';
|
|
|
setStep();
|
|
|
}
|
|
|
+ // 暂停播放
|
|
|
if (res?.data?.api === "api_paused") {
|
|
|
console.log('暂停播放')
|
|
|
state.playState = 'paused';
|
|
|
}
|
|
|
+ // 暂停状态下,拖动进度
|
|
|
+ if (res?.data?.api === "api_updateProgress") {
|
|
|
+ console.log('拖动的进度')
|
|
|
+ if (state.playState === 'paused') {
|
|
|
+ detailData.currentTime = res?.data?.data ? res?.data?.data : detailData.currentTime;
|
|
|
+ handlePlaying();
|
|
|
+ }
|
|
|
+ }
|
|
|
// 播放进度
|
|
|
if (res?.data?.api === "api_playProgress") {
|
|
|
if (res?.data.data) {
|
|
@@ -89,8 +98,8 @@ export default defineComponent({
|
|
|
// 一行谱创建 动画
|
|
|
initSmoothAnimation();
|
|
|
//destroySmoothAnimation();
|
|
|
- smoothAnimationState.isShow.value = false;
|
|
|
- state.playState = 'play';
|
|
|
+ //smoothAnimationState.isShow.value = false;
|
|
|
+ api_cloudLoading();
|
|
|
console.log('渲染完成',svgHeight)
|
|
|
window.parent.postMessage(
|
|
|
{
|
|
@@ -99,19 +108,21 @@ export default defineComponent({
|
|
|
},
|
|
|
"*"
|
|
|
);
|
|
|
+ // state.playState = 'play';
|
|
|
// setStep();
|
|
|
};
|
|
|
/**
|
|
|
* 播放一直触发的事件
|
|
|
*/
|
|
|
const handlePlaying = () => {
|
|
|
+ //detailData.currentTime += 0.03
|
|
|
const currentTime = detailData.currentTime;
|
|
|
// console.log('👀~播放进度',currentTime)
|
|
|
let item = getNote(currentTime);
|
|
|
if (item) {
|
|
|
gotoNext(item);
|
|
|
}
|
|
|
- state.activeNoteIndex = item.i
|
|
|
+ state.activeNoteIndex = item?.i || 0
|
|
|
// 一行谱,需要滚动小节
|
|
|
if (state.isSingleLine) {
|
|
|
moveSmoothAnimationByPlayTime(currentTime)
|