TIANYONG 1 рік тому
батько
коміт
9bc798d2ad

+ 1 - 0
src/page-instrument/view-detail/index.module.less

@@ -137,6 +137,7 @@
     .container {
         height: 100%;
         padding-bottom: 0 !important;
+        padding-right: 0 !important;
     }
     :global {
         #osmdCanvasPage1 {

+ 2 - 0
src/state.ts

@@ -1023,6 +1023,8 @@ const setState = (data: any, index: number) => {
   state.musicalCodeId = state.fingeringInfo?.id || 0
   state.musicalCode = musicalInstrumentCodeInfo.find(item => item.id === state.musicalCodeId)?.code || state.trackId
   ;(window as any).DYSubjectId = state.musicalCodeId
+  // 开启自定义每行显示的小节数
+  ;(window as any).customSectionAmount = true
   // 如果切换的声轨没有指法,择指法开关置灰并且不可点击
   if (!state.fingeringInfo.name && state.setting.displayFingering) {
     state.setting.displayFingering = false

+ 3 - 0
src/view/audio-list/index.tsx

@@ -10,6 +10,7 @@ import {
 } from "./midiPlayer";
 import state, { IPlayState, onEnded, onPlay } from "/src/state";
 import { api_playProgress } from "/src/helpers/communication";
+import { evaluatingData } from "/src/view/evaluating";
 
 const audioData = reactive({
 	songEle: null as unknown as HTMLAudioElement,
@@ -159,6 +160,8 @@ export default defineComponent({
 				res?.content?.totalDuration > 1000 &&
 				currentTime >= total
 			) {
+				if (evaluatingData.isAudioPlayEnd) return
+				evaluatingData.isAudioPlayEnd = true
 				onEnded();
 			}
 		};

+ 3 - 0
src/view/evaluating/index.tsx

@@ -98,6 +98,8 @@ export const evaluatingData = reactive({
 	isErrorState: false,
 	/** accompanyError,错误类型 */
 	accompanyErrorType: '',	
+	/** app播放结束状态,重新评测需要重置为 */
+	isAudioPlayEnd: false,
 });
 
 /** 点击开始评测按钮 */
@@ -312,6 +314,7 @@ export const handleStartBegin = async (preTimes?: number) => {
 	evaluatingData.resultData = {};
 	evaluatingData.backtime = 0;
 	resetPlaybackToStart();
+	evaluatingData.isAudioPlayEnd = false;
 	const res = await startEvaluating(evaluatingData.contentData);
 	if (res?.api !== "startEvaluating") {
 		Snackbar.error("请在APP端进行评测");

+ 16 - 1
src/view/music-score/index.tsx

@@ -8,6 +8,7 @@ import styles from "./index.module.less";
 import queryString from "query-string";
 import { getGradualLengthByXml } from "/src/helpers/calcSpeed";
 import { resetFormate, resetGivenFormate, setGlobalMusicSheet } from "/src/helpers/customMusicScore"
+import { setGlobalData } from "/src/utils";
 
 export const musicRenderTypeKey = "musicRenderType";
 let osmd: any = null;
@@ -21,7 +22,21 @@ const musicData = reactive({
 /** 重新计算曲谱渲染比例 */
 export const resetMusicScore = () => {
 	const contaienrWidth = document.getElementById("musicAndSelection")?.offsetWidth || 625;
-	state.musicZoom = contaienrWidth / musicData.containerWidth;
+	// state.musicZoom = contaienrWidth / musicData.containerWidth;
+	if (state.fingeringInfo?.name && state.fingeringInfo?.direction === 'vertical') {
+		if (contaienrWidth > musicData.containerWidth) {
+			setGlobalData('wrapNum', 8)
+		} else {
+			setGlobalData('wrapNum', 6)
+		}
+		musicData.showSelection = false
+		osmd.zoom = state.zoom;
+		osmd.render();
+		setTimeout(() => {
+			musicData.showSelection = true
+		}, 100);
+	}
+	
 };
 
 /** 重新渲染曲谱 */