Browse Source

feat: 速度临时处理

TIANYONG 1 year ago
parent
commit
2f26764a1d
2 changed files with 7 additions and 2 deletions
  1. 2 1
      src/subpages/colexiu/index.d.ts
  2. 5 1
      src/subpages/colexiu/uses/use-app.ts

+ 2 - 1
src/subpages/colexiu/index.d.ts

@@ -63,7 +63,8 @@ export type MusicSheelDetail = {
   /** 后台设置的播放速度 */
   playSpeed?: number | string
   /** 曲谱类型 */
-  musicSheetType?: string
+  musicSheetType?: string,
+  musicSheetCategoriesId?: number | string
 }
 
 export type ShaeetStatusType = 'loading' | 'error' | 'success'

+ 5 - 1
src/subpages/colexiu/uses/use-app.ts

@@ -91,7 +91,11 @@ export const useMp3s = async (detail: MusicSheelDetail) => {
   }
   detailState.isAppPlay = detail.audioType === 'MIDI'
   // 如果后台有速度
-  if (detail.playSpeed && detail.playSpeed !== "") {
+  const isSpecialSong= !classids.includes(detail.musicSheetCategoriesId) 
+  if (!isSpecialSong) {
+    detailState.playSpeed = detail.playSpeed ? parseFloat(String(detail.playSpeed)) : 100;
+    detailState.baseSpeed = detailState.playSpeed
+  } else if (detail.playSpeed && detail.playSpeed !== "") {
     // detailState.playSpeed = detail.playSpeed ? parseFloat(String(detail.playSpeed)) : 100;
     // detailState.baseSpeed = detailState.playSpeed
     detailState.temporarySpeed = detail.playSpeed ? parseFloat(String(detail.playSpeed)) : 90;