瀏覽代碼

fix: #9402 bug修复

TIANYONG 1 年之前
父節點
當前提交
6a857e8daf

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

@@ -62,8 +62,12 @@ export default defineComponent({
 
 		watch(() => evaluatingData.resulstMode, (val) => {
 			// # 9402,评测异常操作:都改为不生成评测记录
-			if (val && !evaluatingData.isErrorState) {
-				handleAddRecord();
+			if (val) {
+				setTimeout(() => {
+					if (!evaluatingData.isErrorState) {
+						handleAddRecord();
+					}
+				}, 0);
 			}
 		})
 		return () => (

+ 12 - 4
src/page-instrument/evaluat-model/index.tsx

@@ -276,7 +276,6 @@ export default defineComponent({
       }
       resetPlaybackToStart()
       evaluatingData.resulstMode = false;
-      evaluatingData.isErrorState = false;
     };
 
     /** 上传音视频 */
@@ -317,6 +316,11 @@ export default defineComponent({
       if (res?.checked) {
         handleConnect();
         handleStartBegin(calculateInfo.firstNoteTime);
+        if (evaluatingData.isErrorState = true) {
+          evaluatingData.isErrorState = false;
+          evaluatingData.resulstMode = false;
+        }
+        
       }
     }
     onMounted(() => {
@@ -391,9 +395,13 @@ export default defineComponent({
 					/>
 				</Popup> */}
 
-        <Popup teleport="body" closeOnClickOverlay={false} class={["popup-custom", "van-scale"]} transition="van-scale" v-model:show={evaluatingData.resulstMode}>
-          <EvaluatResult onClose={handleEvaluatResult} />
-        </Popup>
+        {
+          !evaluatingData.isErrorState && 
+          <Popup teleport="body" closeOnClickOverlay={false} class={["popup-custom", "van-scale"]} transition="van-scale" v-model:show={evaluatingData.resulstMode}>
+            <EvaluatResult onClose={handleEvaluatResult} />
+          </Popup>    
+        }
+
         <Popup teleport="body" closeOnClickOverlay={false} class={["popup-custom", "van-scale"]} transition="van-scale" v-model:show={evaluatModel.evaluatUpdateAudio}>
           <EvaluatAudio onClose={hanldeUpdateVideoAndAudio} />
         </Popup>

+ 8 - 4
src/page-instrument/view-evaluat-report/index.tsx

@@ -1,7 +1,7 @@
 import { Skeleton } from "vant";
 import { defineComponent, onBeforeMount, onBeforeUnmount, onMounted, reactive, Transition } from "vue";
 import { formateTimes } from "../../helpers/formateMusic";
-import state, { isRhythmicExercises, getMusicDetail } from "../../state";
+import state, { isRhythmicExercises, getMusicDetail, EnumMusicRenderType } from "../../state";
 import { setGlobalData } from "../../utils";
 import MusicScore, { resetMusicScore } from "../../view/music-score";
 import styles from "./index.module.less";
@@ -21,9 +21,9 @@ const colorsClass: any = {
 	RIGHT: styles.right,
 	WRONG: styles.wrong,
 	NOT_PLAY: styles.notPlay,
-	CADENCE_WRONG: styles.cadence_wrong,
-	INTONATION_WRONG: styles.intonation_wrong,
-	INTEGRITY_WRONG: styles.integrity_wrong,
+	CADENCE_WRONG: styles.cadence_wrong, // 节奏(快慢)
+	INTONATION_WRONG: styles.intonation_wrong, // 音准(高低)
+	INTEGRITY_WRONG: styles.integrity_wrong, // 完成度
 };
 
 export default defineComponent({
@@ -149,6 +149,10 @@ export default defineComponent({
 			scoreData.score = res.data?.score;
 			scoreData.videoFilePath = res.data?.videoFilePath || res.data?.recordFilePath;
 			await getMusicDetail(resultData.musicalNotesPlayStats?.examSongId);
+			// 从练习记录进入评测报告,默认显示五线谱
+			if (!query.musicRenderType) {
+				state.musicRenderType = EnumMusicRenderType.staff
+			}
 			detailData.isLoading = false;
 			// Promise.all([
 			// 	getMusicSheetDetail(resultData.musicalNotesPlayStats?.examSongId),

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

@@ -531,6 +531,7 @@ const handleAccompanyError = (res?: IPostMessage) => {
 				evaluatingData.socketErrorStatus = 0
 				evaluatingData.socketErrorPop = type === "socketError" ? true : false
 				evaluatingData.isErrorState = true
+				resetPlaybackToStart();
 				break;	
 			case "recordError":
 				// 录音异常