TIANYONG hace 9 meses
padre
commit
1529127cb8
Se han modificado 2 ficheros con 10 adiciones y 3 borrados
  1. 2 2
      src/pages/detail/runtime.ts
  2. 8 1
      src/subpages/colexiu/buttons/evaluating.tsx

+ 2 - 2
src/pages/detail/runtime.ts

@@ -402,7 +402,7 @@ export const initSetPlayRate = () => {
 const dynamicShowPlaySpeed = (index: number) => {
   const item: any = detailState.times[index];
 
-  if (item && modelType.value === "practice" && state.playState === "play" && item.measureSpeed ) {
+  if (item && state.playState === "play" && item.measureSpeed ) {
     state.playIngSpeed = Math.floor(state.basePlayRate * item.measureSpeed)
   }
 }
@@ -1049,7 +1049,7 @@ export const setAudioInit = () => {
     const time = res?.content.currentTime / 1000
     const diffTime = res?.content?.currentTime - preAppAudioPlayTime;
     preAppAudioPlayTime = res?.content?.currentTime
-    console.log('app返回的mp3进度',time)
+    // console.log('app返回的mp3进度',time)
     if (diffTime < 0) {
       console.log('进度返回异常','本次时间比上次慢',diffTime,'当前播放时间:',res?.content?.currentTime)
       return

+ 8 - 1
src/subpages/colexiu/buttons/evaluating.tsx

@@ -344,7 +344,14 @@ const formatTimes = () => {
       (n: any) => n.NoteToGraphicalNoteObjectId == detailState.section[1].NoteToGraphicalNoteObjectId
     )
     if (startIndex > 1) {
-      preTime = detailState.times[startIndex-1].time * 1000
+      // 预备小节的小节数
+      const preMeasureNum = detailState.times[startIndex-1].measureNumberPrinted;
+      // 预备小节的第一个音符的索引
+      let preNoteNum = startIndex-1;
+      while (preMeasureNum === detailState.times[preNoteNum].measureNumberPrinted && preNoteNum >= 1 && preMeasureNum === detailState.times[preNoteNum-1].measureNumberPrinted) {
+        preNoteNum -= 1;
+      }
+      preTime = detailState.times[preNoteNum].time * 1000
     }
     times = detailState.times.filter((n: any, index: number) => {
       return index >= startIndex && index <= endIndex