Browse Source

fix: 选段bug修复

TIANYONG 1 year ago
parent
commit
f5a399ff8f
2 changed files with 13 additions and 12 deletions
  1. 12 11
      src/pages/detail/helpers.ts
  2. 1 1
      src/subpages/colexiu/index.module.less

+ 12 - 11
src/pages/detail/helpers.ts

@@ -843,18 +843,19 @@ export const getNoteByMeasuresSlursStart = (note: any) => {
 }
 
 export const getActtiveNoteByTimes = (evt: MouseEvent) => {
-  const el = (evt.target as HTMLDivElement)?.dataset
-  // console.log(state)
+	const el = (evt.target as HTMLDivElement)?.dataset;
+	// console.log(state)
 
-  const data: any = {}
-  for (const time of state.times) {
-    if (time.id) {
-      data[time.id] = time
-    }
-  }
-  const activeNote = data[el.id || '']
-  return activeNote
-}
+	const data: any = {};
+	for (const time of state.times) {
+		if (time.id && !data[time.id]) {
+			data[time.id] = time;
+		}
+	}
+	const activeNote = data[el.id || ""];
+	// state.timesById = data
+	return activeNote;
+};
 
 const getPrevHasSourceNote = (note: any) => {
   const indexOf = Math.max(state.times.indexOf(note) - 1, 0)

+ 1 - 1
src/subpages/colexiu/index.module.less

@@ -23,7 +23,7 @@
 }
 :global(.eyeProtection) {
   :global(.fingering) {
-    background: var(--eye-background-color);
+    // background: var(--eye-background-color);
   }
   .musicSheet {
     background: var(--eye-background-color) !important;