Browse Source

feat: 右上角速度逻辑修改

TIANYONG 8 months ago
parent
commit
944b262e33

+ 6 - 3
src/pages/detail/runtime.ts

@@ -413,7 +413,10 @@ export const initSetPlayRate = () => {
 const dynamicShowPlaySpeed = (index: number) => {
   const item: any = detailState.times[index];
 
-  if (item && state.playState === "play" && item.measureSpeed ) {
+  // if (item && state.playState === "play" && item.measureSpeed ) {
+  //   state.playIngSpeed = Math.floor(state.basePlayRate * item.measureSpeed)
+  // }
+  if (item && item.measureSpeed ) {
     state.playIngSpeed = Math.floor(state.basePlayRate * item.measureSpeed)
   }
 }
@@ -1184,8 +1187,8 @@ export const noteClick = (evt: MouseEvent) => {
   console.log('点击音符',activeNote)
   if (activeNote) {
     const time = activeNote.sourceStartTime || activeNote.time
-    // 点击音符,动态设置右上角的速度
-    if (activeNote.measureSpeed) {
+    // 点击音符,动态设置右上角的速度,非选段模式
+    if (activeNote.measureSpeed && detailState.section.length < 2) {
       state.speed = Math.floor(state.basePlayRate * activeNote.measureSpeed)
       state.playIngSpeed = state.speed
     }

+ 5 - 6
src/pages/detail/section-box/index.tsx

@@ -99,15 +99,14 @@ export default defineComponent({
         if (sectionLength === 1) {
           const note = getNoteBySlursStart(activeNote, true, 'end')
           state.section.push(state.times[note.i - note.si + note.noteLength - 1])
+          // 选段状态需要重置播放倍率为1
+          runtime.basePlayRate = 1;
+          const currentItem: any = state.section[0];
+          const currentSpeed = currentItem?.measureSpeed ? currentItem.measureSpeed : state.activeSpeed;
+          changeSpeed(currentSpeed)
         }
       }
       if (state.section.length === 2) {
-        // 选段状态需要重置播放倍率为1
-        runtime.basePlayRate = 1;
-        const currentItem: any = state.section[0];
-        const currentSpeed = currentItem?.measureSpeed ? currentItem.measureSpeed : state.activeSpeed;
-        changeSpeed(currentSpeed)
-        
         Toast.clear()
         setSettionBackground()
       }

+ 2 - 1
src/subpages/colexiu/popups/evaluating/index.module.less

@@ -290,11 +290,12 @@
     padding: 8Px 12Px;
     position: absolute;
     left: 50%;
-    top: 42Px;
+    top: 46Px;
     transform: translateX(-60%);
     z-index: 1;
     color: #fff;
     width: max-content;
+    word-break: keep-all;
     > i {
       width: 12Px;
       height: 12Px;