lex 1 rok temu
rodzic
commit
dab3f0b3b6

+ 1 - 2
src/views/tempo-practice/beat-tick.ts

@@ -85,9 +85,8 @@ export const handleStartBeat = async () => {
       const part = setting.scorePart[i][j];
       const params = {
         ...part,
-        ...beatDesc[part.index]
+        ...beatDesc[part.index + 1]
       };
-      // console.log(params);
       const single16th = beatData.beatLengthInMilliseconds;
       const source = beatData.source2;
       for (let g = 0; g < params.attribute.length; g++) {

+ 8 - 2
src/views/tempo-practice/index.tsx

@@ -154,7 +154,10 @@ export default defineComponent({
                             return;
                           }
                           // const obj = randomScoreElement(child.index);
-                          const obj = elementDirection('up', child.index);
+                          const obj = elementDirection(
+                            'up',
+                            Number(child.index)
+                          );
                           child.index = obj.index;
                           child.url = obj.url;
                         }}></div>
@@ -167,7 +170,10 @@ export default defineComponent({
                             return;
                           }
                           // const obj = randomScoreElement(child.index);
-                          const obj = elementDirection('down', child.index);
+                          const obj = elementDirection(
+                            'down',
+                            Number(child.index)
+                          );
                           child.index = obj.index;
                           child.url = obj.url;
                         }}></div>

+ 3 - 5
src/views/tempo-practice/setting.ts

@@ -60,7 +60,7 @@ export const randomScoreElement = (element?: string) => {
     const randomIndex = Math.floor(Math.random() * newArr.length);
     return {
       url: prefix + newArr[randomIndex] + '.png',
-      index: newArr[randomIndex]
+      index: randomIndex
     };
   } else {
     // 如果只有一个就直接返回
@@ -74,7 +74,7 @@ export const randomScoreElement = (element?: string) => {
       const randomItem = tempoList[randomIndex];
       return {
         url: prefix + randomItem + '.png',
-        index: randomItem
+        index: randomIndex
       };
     }
   }
@@ -104,10 +104,9 @@ export const elementDirection = (type: string, index: number) => {
     }
   }
 
-  console.log(ele, Number(index), type, i);
   return {
     url: prefix + ele + '.png',
-    index: Number(ele)
+    index: Number(i)
   };
 };
 
@@ -119,7 +118,6 @@ export const renderScore = () => {
   if (beatA[0] === 8) {
     beat = beat / 3;
   }
-  console.log(beat, 'beat');
   const tempBeat: any = [];
   for (let i = 0; i < barLine; i++) {
     tempBeat[i] = [];