Browse Source

feat: 速度显示逻辑1.2

TIANYONG 9 months ago
parent
commit
cae36ed0dd

+ 11 - 0
src/pages/detail/runtime.ts

@@ -302,6 +302,17 @@ export const changeAllMode = () => {
   }
 }
 
+// 重置播放倍率
+export const resetBaseRate = () => {
+  const currentItem: any = detailState.times[0];
+  const currentSpeed = currentItem?.measureSpeed ? currentItem.measureSpeed : detailState.baseSpeed;
+  state.speed = currentSpeed
+  state.playIngSpeed = currentSpeed
+  state.activeIndex = 0
+  state.basePlayRate = 1;
+  changeSpeed(currentSpeed)
+}
+
 export const changeSpeed = (speed: number, isSave: boolean = true) => {
   // console.log('速度设置',speed,isSave)
   // const route: any = router.currentRoute.value

+ 1 - 0
src/subpages/colexiu/buttons/index.tsx

@@ -258,6 +258,7 @@ export default defineComponent({
                     runtime.evaluatingStatus = false
                     evaluatStopPlay()
                   }
+                  RuntimeUtils.resetBaseRate();
                   modelType.value = 'init'
                 }}
               >

+ 2 - 7
src/subpages/colexiu/buttons/player.tsx

@@ -14,13 +14,8 @@ export default defineComponent({
     const [wiredStatus] = useWiredHeadsetCheck()
 
     const reset = () => {
-      const currentItem: any = detailState.times[0];
-      const currentSpeed = currentItem?.measureSpeed ? currentItem.measureSpeed : detailState.baseSpeed;
-      runtime.speed = currentSpeed
-      runtime.playIngSpeed = currentSpeed
-      runtime.activeIndex = 0
-      runtime.basePlayRate = 1;
-      RuntimeUtils.changeSpeed(currentSpeed)
+      // 重置播放倍率
+      RuntimeUtils.resetBaseRate();
       if (detailState.activeTick > -1) {
         return
       }