Browse Source

fix: 11393bug修复

TIANYONG 5 months ago
parent
commit
a36ca14940

+ 3 - 1
src/page-instrument/evaluat-model/evaluat-result/index.tsx

@@ -49,7 +49,8 @@ export default defineComponent({
       /** 生成评测记录的时候,记录当前评测的谱面类型,用于评测报告默认展示的谱面类型 */
       evaluatingData.resultData.scoreData.musicType = state.musicRenderType;
       // 评测的速度,如果是选段,则选选段开头小节的速度
-      const evaluatSpeed = state.sectionStatus && state.section.length === 2 && state.section[0].measureSpeed ? state.section[0].measureSpeed * state.basePlayRate : state.speed;      
+      const evaluatSpeed = state.sectionStatus && state.section.length === 2 && state.section[0].measureSpeed ? state.section[0].measureSpeed * state.basePlayRate : state.speed;  
+      const rate = state.basePlayRate * state.originAudioPlayRate; // 播放倍率    
       const body = {
         deviceType: browser().android ? "ANDROID" : "IOS", // 设备类型
         intonation: evaluatingData.resultData.intonation, // 音准
@@ -70,6 +71,7 @@ export default defineComponent({
         recordFilePath: evaluatingData.resultData.url, // 录音文件路径
         delFlag: evaluatingData.oneselfCancleEvaluating,
         instrumentId: state.instrumentId,
+        playRate: rate
       };
       data.saveLoading = true;
       const res = await api_musicPracticeRecordSave(body);

+ 12 - 3
src/state.ts

@@ -626,6 +626,7 @@ const autoResetPlay = () => {
   skipNotePlay(0, true);
   // 没有开启自动重播, 不是练习模式
   if (!state.setting.repeatAutoPlay) return;
+  offsetTop = 0;
   scrollViewNote();
   setTimeout(() => {
     togglePlay("play");
@@ -817,6 +818,10 @@ export const togglePlay = async (playState: "play" | "paused", isForceCLoseToast
     console.log("设置音源")
     changeSongSourceByBeat(metronomeData.disable)
   }
+  if (playState === 'play') {
+    offsetTop = 0;
+    scrollViewNote();
+  }
   // midi播放
   if (state.isAppPlay) {
     if (playState === "paused") {
@@ -1293,14 +1298,18 @@ let offsetTop = 0;
 export const scrollViewNote = () => {
   // const cursorElement = document.getElementById("cursorImg-0")!;
   const noteId = state.times[state.activeNoteIndex].id;
-  if (!noteId || state.isSingleLine) {
+  if (state.isSingleLine) {
     return;
   }
+  if (state.activeNoteIndex <= 1) {
+    offsetTop = 0;
+  }
   const domId = "vf" + noteId;
-  const cursorElement: any = document.querySelector(`[data-vf=${domId}]`)?.parentElement;
+  const cursorElement: any = noteId ? document.querySelector(`[data-vf=${domId}]`)?.parentElement : document.getElementById('restDot')?.parentElement;
   const musicAndSelection = document.getElementById(state.scrollContainer)!;
+  // offsetTop = musicAndSelection.scrollTop || offsetTop;
   const noteCenterOffsetTop = cursorElement ? cursorElement?.offsetTop + (cursorElement?.offsetHeight/2) : 0;
-  // console.log('滑动',cursorElement.offsetTop,offsetTop, cursorElement, )
+  // console.log('滑动',offsetTop, noteCenterOffsetTop)
   if (!cursorElement || !noteCenterOffsetTop || !musicAndSelection || offsetTop === noteCenterOffsetTop || Math.abs(offsetTop - noteCenterOffsetTop) < 30) return;
   offsetTop = noteCenterOffsetTop;
   if (offsetTop > 100) {

+ 1 - 1
src/view/selection/multipleRestMeasures.tsx

@@ -15,7 +15,7 @@ export default defineComponent({
          <>
             {
                state.activeMeasureIndex == props.item.MeasureNumberXML 
-                  && <div class={styles.dotWrap}>{props.item.multipleRestMeasures}</div>
+                  && <div class={styles.dotWrap} id="restDot">{props.item.multipleRestMeasures}</div>
             }
          </>
    }

+ 2 - 2
vite.config.ts

@@ -76,8 +76,8 @@ export default defineConfig({
         // target: "https://kt.colexiu.com",
         // target: "https://test.lexiaoya.cn",
         // target: "https://kt.colexiu.com",
-        target: "https://test.resource.colexiu.com", // 内容平台开发环境,内容平台开发,需在url链接上加上isCbs=true
-        // target: "https://test.kt.colexiu.com",
+        // target: "https://test.resource.colexiu.com", // 内容平台开发环境,内容平台开发,需在url链接上加上isCbs=true
+        target: "https://test.kt.colexiu.com",
         // target: "https://mec.colexiu.com",
         changeOrigin: true,
         rewrite: (path) => path.replace(/^\/instrument/, ""),