Browse Source

Merge branch 'gyt-feature-tianyong' of http://git.dayaedu.com/liushengqiang/orchestra-music-score into feature-pc-choose

TIANYONG 9 months ago
parent
commit
8abbbf1d47
1 changed files with 7 additions and 3 deletions
  1. 7 3
      src/pages/detail/speed.tsx

+ 7 - 3
src/pages/detail/speed.tsx

@@ -13,6 +13,7 @@ const state = reactive({
   speed: 90,
   showHint: false,
   maxSpeed: 315,
+  firstExceedEcho: false, // 第一次超出速度范围,显示的速度默认不回退到270或者45
 })
 
 export default defineComponent({
@@ -55,8 +56,11 @@ export default defineComponent({
 
     const updateSpeed = (speed: number) => {
       state.speed = speed
-      state.speed = Math.min(state.speed, 270)
-      state.speed = Math.max(state.speed, 45)
+      if (state.firstExceedEcho) {
+        state.speed = Math.min(state.speed, 270)
+        state.speed = Math.max(state.speed, 45)
+      }
+      if (!state.firstExceedEcho) state.firstExceedEcho = true
       props.updateSpeed(state.speed)
     }
 
@@ -104,8 +108,8 @@ export default defineComponent({
               buttonSize="18px"
               modelValue={state.maxSpeed - state.speed}
               onUpdate:modelValue={(speed: number) => {
-                // console.log('速度123',state.maxSpeed,speed,runtime.playIngSpeed,runtime.speed)
                 const currentSpeed = (runtime.playIngSpeed > 270 ? runtime.playIngSpeed + 45 : state.maxSpeed) - speed
+                // console.log('速度123',state.maxSpeed,speed,runtime.playIngSpeed,runtime.speed,'设置的:',currentSpeed)
                 updateSpeed(currentSpeed)
               }}
               step="1"