Explorar o código

Merge branch 'feature-tianyong-newVersion' of http://git.dayaedu.com/liushengqiang/music-score into hqyDevNewVersion

黄琪勇 hai 11 meses
pai
achega
00029af022

+ 5 - 0
src/helpers/customMusicScore.ts

@@ -559,6 +559,11 @@ export const resetFormate = () => {
 				const bbox = stave?.getBBox() || {};
 				const rect = `<rect class="vf-custom-bg" x="${bbox.x}" y="${bbox.y}" width="${bbox.width}" height="${bbox.height}" fill="#609FCF" />`
 				const rectBottom = `<rect class="vf-custom-bot" x="${bbox.x}" y="${bbox.y+bbox.height}" width="${bbox.width}" height="7.5" fill="#2B70A5" />`
+				// const filterDom = `<defs>
+				// 						<filter id="shadow">
+				// 						<feDropShadow dx="5" dy="5" stdDeviation="3" flood-color="black" />
+				// 						</filter>
+				// 					</defs>`
 				const customG = `<g>${rect}${rectBottom}</g>`
 				try {
 					if (list.length) {

+ 1 - 1
src/helpers/formateMusic.ts

@@ -1163,7 +1163,7 @@ export const formateTimes = (osmd: OpenSheetMusicDisplay) => {
 				if (["2670"].includes(state.cbsExamSongId)) {
 					// fixtime -= _firstMeasureRealValue * formatBeatUnit(beatUnit) * (60 / beatSpeed);
 				} else {
-					if (difftime > 0) {
+					if (difftime > 0 && !state.isEvxml) {
 						fixtime += difftime;
 						state.fixtime = fixtime;
 					}

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

@@ -59,7 +59,7 @@ export default defineComponent({
         behaviorId: getBehaviorId(), // 行为id
         sourceTime: getAudioDuration(), // 音频时长
         partIndex: state.partIndex, // 音轨
-        speed: evaluatSpeed, // 速度
+        speed: evaluatingData.evaluatSpeed || evaluatSpeed, // 速度
         practiceSource: query.workRecord ? "LESSON_TRAINING" : "EVALUATION", // 练习来源
         score: evaluatingData.resultData.score, // 分数
         clientType: storeData.user.clientType, // 客户端类型
@@ -75,6 +75,7 @@ export default defineComponent({
       if (res?.code === 200) {
         evaluatingData.resultData.recordId = res.data;
       }
+      evaluatingData.needReplayEvaluat = evaluatingData.oneselfCancleEvaluating ? true : false;
       data.saveLoading = false;
     };
 

+ 6 - 2
src/page-instrument/evaluat-model/index.tsx

@@ -268,6 +268,7 @@ export default defineComponent({
       calculateInfo = formatTimes();
       // 评测的速度,如果是选段,则选选段开头小节的速度
       const evaluatSpeed = state.sectionStatus && state.section.length === 2 && state.section[0].measureSpeed ? state.section[0].measureSpeed * state.basePlayRate : state.speed;
+      evaluatingData.evaluatSpeed = evaluatSpeed;
       const content = {
         musicXmlInfos: calculateInfo.datas,
         subjectId: state.musicalCode,
@@ -331,6 +332,8 @@ export default defineComponent({
         evaluatingData.oneselfCancleEvaluating = true;
         // handleCancelEvaluat();
         handleEndEvaluat(true, 'selfCancel');
+        evaluatingData.isBeginMask = true;
+        state.playState = "paused";
       }
       resetPlaybackToStart();
       evaluatingData.resulstMode = false;
@@ -369,6 +372,7 @@ export default defineComponent({
     };
 
     const startBtnHandle = async () => {
+      evaluatingData.needReplayEvaluat = false;
       // 选段未完成时,清除选段状态
       if (state.sectionStatus && state.section.length < 2) {
         clearSelection();
@@ -447,7 +451,7 @@ export default defineComponent({
 
     // 手动取消评测,需要自动再次评测
     watch(
-      () => evaluatingData.hideResultModal,
+      () => evaluatingData.needReplayEvaluat,
       (val) => {
         if (val && evaluatingData.oneselfCancleEvaluating) {
           setTimeout(() => {
@@ -461,7 +465,7 @@ export default defineComponent({
       // 如果打开了延迟检测开关,需要先发送开始检测的消息
       const delayData = await api_getDeviceDelay();
       console.log('设备的延迟值',delayData.content?.value)
-      if (state.setting.soundEffect || (delayData && delayData.content?.value < 0)) {
+      if (state.setting.soundEffect || (delayData && delayData.content?.value <= 0)) {
         await api_startDelayCheck({});
       } else {
         evaluatingData.checkEnd = true;

+ 1 - 1
src/page-instrument/header-top/index.tsx

@@ -846,7 +846,7 @@ export default defineComponent({
           <div class={styles.btnWrap}>
             <img style={{ display: state.playState === "play" ? "none" : "" }} class={styles.iconBtn} src={headImg("icon_play.png")} />
             <img style={{ display: state.playState === "play" ? "" : "none" }} class={styles.iconBtn} src={headImg("icon_pause.png")} />
-            <Circle style={{ opacity: state.playState === "play" ? 1 : 0 }} class={styles.progress} stroke-width={80} currentRate={state.playProgress} rate={100} color="#FFED78" layer-color="rgba(0,0,0,0)" />
+            <Circle style={{ opacity: state.playState === "play" ? 1 : 0 }} class={styles.progress} stroke-width={60} stroke-linecap={"square"} currentRate={state.playProgress} rate={100} color="#FFED78" layer-color="rgba(0,0,0,0)" />
           </div>
         </div>
 

+ 2 - 1
src/page-instrument/view-evaluat-report/component/share-top/index.tsx

@@ -22,6 +22,7 @@ import audioBga1 from "./image/leftCloud.json";
 import audioBga2 from "./image/rightCloud.json";
 import { EvaluatingReportDriver } from "/src/page-instrument/custom-plugins/guide-driver";
 
+// 音准、节奏、完整度
 type IItemType = "intonation" | "cadence" | "integrity";
 
 export default defineComponent({
@@ -347,7 +348,7 @@ export default defineComponent({
                     </>
                   )}
 
-                  {(itemType.value === "intonation" || itemType.value === "integrity") && (
+                  {itemType.value === "integrity" && (
                     <div>
                       <Note fill="#A5CBFF" />
                       <span>时值不足</span>

+ 11 - 9
src/page-instrument/view-evaluat-report/index.tsx

@@ -25,7 +25,7 @@ const colorsClass: any = {
   LATE: styles.cadence_slow, // 节奏慢
   HIGH: styles.intonation_high, // 音准高
   LOW: styles.intonation_low, // 音准低
-  DURATION_INSUFFICIENT: styles.integrity_wrong, // 完整性(时值)不足
+  SHORT: styles.integrity_wrong, // 完整性(时值)不足
 };
 
 // const colorsClass: any = {
@@ -240,22 +240,24 @@ export default defineComponent({
       let include = ["RIGHT", "WRONG", "NOT_PLAYED"];
       if (scoreData.itemType === "intonation") {
         // 音准
-        include.push(...["HIGH", "LOW", "DURATION_INSUFFICIENT"]);
+        include.push(...["HIGH", "LOW"]);
       } else if (scoreData.itemType === "cadence") {
         // 节奏
         include.push(...["EARLY", "LATE"]);
       } else if (scoreData.itemType === "integrity") {
         // 完整性
-        include = ["DURATION_INSUFFICIENT", "RIGHT", "NOT_PLAYED"];
+        include = ["SHORT", "NORMAL", "NOT_PLAYED"];
       }
       if (scoreData.itemType === "cadence") {
         return detailData.musicalNotesPlayStats.filter((item: any) => include.includes(item.rhythmicAssessment.result));
-      } else {
+      } else if (scoreData.itemType === "integrity") {
+        return detailData.musicalNotesPlayStats.filter((item: any) => include.includes(item.integrityAssessment.result));
+      } else  {
         return detailData.musicalNotesPlayStats.filter((item: any) => {
           let result = item.pitchAssessment.result;
-          if (scoreData.itemType === "integrity") {
-            result = result === "HIGH" || result === "LOW" || result === "WRONG" ? "RIGHT" : result;
-          }
+          // if (scoreData.itemType === "integrity") {
+          //   result = result === "HIGH" || result === "LOW" || result === "WRONG" ? "RIGHT" : result;
+          // }
           return include.includes(result);
         });
       }
@@ -274,7 +276,7 @@ export default defineComponent({
           useedid.value.push(active.id);
           const svgEl = document.getElementById("vf-" + active.id);
           const stemEl = document.getElementById("vf-" + active.id + "-stem");
-          let errType = scoreData.itemType === "cadence" ? note.rhythmicAssessment.result : note.pitchAssessment.result;
+          let errType = scoreData.itemType === "cadence" ? note.rhythmicAssessment.result : scoreData.itemType === "integrity" ? note.integrityAssessment.result : note.pitchAssessment.result;
           // console.log(1111222,errType)
           /**
            * 新版小酷AI不需要在当前的音符复制出来一个音符,所以注释掉isNeedCopyElement和copySvg
@@ -380,7 +382,7 @@ export default defineComponent({
             svgEl?.classList.add(colorsClass.rhythmic[note.rhythmicAssessment.result]);
             break;
           case "integrity":
-            svgEl?.classList.add(colorsClass.pitch[note.pitchAssessment.result]);
+            svgEl?.classList.add(colorsClass.pitch[note.integrityAssessment.result]);
             break;
           default:
             break;

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

@@ -226,6 +226,7 @@ export default defineComponent({
 		// 监听评测曲谱音频播放进度,返回
 		const progress = (res: any) => {
 			const currentTime = res?.currentTime || res?.content?.currentTime;
+			console.log('app进度时间',currentTime)
 			const total = res?.totalDuration || res?.content?.totalDuration;
 			const time = currentTime / 1000;
 			audioData.progress = time;

+ 4 - 1
src/view/evaluating/index.tsx

@@ -110,6 +110,8 @@ export const evaluatingData = reactive({
 	isBeginMask: false, // 倒计时和系统节拍器时候的遮罩,防止用户点击,
   recordingTime: 0, // 调用startRecording的时间 
   endEvaluatingTime: 0, // 调用endEvaluating的时间 
+  evaluatSpeed: 0, // 评测记录的速度
+  needReplayEvaluat: false, // 手动取消评测,需要自动开始评测
 });
 
 const sendOffsetTime = async (offsetTime: number) => {
@@ -369,7 +371,8 @@ export const handleStartBegin = async (preTimes?: number) => {
 		return;
 	}
 	if (res?.content?.reson) {
-		showToast(res.content?.des);
+    // #10984,APP端会有弹窗提示,不需要再次提示
+		// showToast(res.content?.des);
 		evaluatingData.startBegin = false;
 		return;
 	}

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

@@ -123,7 +123,7 @@ export default defineComponent({
 				osmd.EngravingRules.BreathMarkDistance = 0.1; 
 				osmd.EngravingRules.PageBottomMargin = 0;
 			} else {
-				osmd.EngravingRules.PageTopMargin = state.isEvaluatReport && storeData.isApp ? 24 : state.isEvaluatReport ? 7 : 3; // 顶部间距
+				osmd.EngravingRules.PageTopMargin = state.isEvaluatReport && storeData.isApp ? 10 : state.isEvaluatReport ? 7 : 3; // 顶部间距
 				osmd.EngravingRules.PageTopMarginNarrow = 3;
 				osmd.EngravingRules.PageLeftMargin = 2;
 				osmd.EngravingRules.PageRightMargin = 2;