Prechádzať zdrojové kódy

feat: 延迟检测修改

TIANYONG 11 mesiacov pred
rodič
commit
f43d5a74bb

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

@@ -1,5 +1,5 @@
 import { Transition, defineComponent, onMounted, reactive, watch, defineAsyncComponent } from "vue";
-import { connectWebsocket, evaluatingData, handleEndBegin, handleStartBegin, handleStartEvaluat, handleViewReport, startCheckDelay, checkUseEarphone } from "/src/view/evaluating";
+import { connectWebsocket, evaluatingData, handleEndBegin, handleStartBegin, handleStartEvaluat, handleViewReport, startCheckDelay, checkUseEarphone, handleCancelEvaluat } from "/src/view/evaluating";
 import Earphone from "./earphone";
 import styles from "./index.module.less";
 import SoundEffect from "./sound-effect";
@@ -256,7 +256,7 @@ export default defineComponent({
     };
 
     /** 评测结果按钮处理 */
-    const handleEvaluatResult = (type: "practise" | "tryagain" | "look" | "share" | "update") => {
+    const handleEvaluatResult = (type: "practise" | "tryagain" | "look" | "share" | "update" | "selfCancel") => {
       if (type === "update") {
         if (state.isAppPlay) {
           evaluatModel.evaluatUpdateAudio = true;
@@ -287,7 +287,11 @@ export default defineComponent({
         // 去练习
         handleStartEvaluat();
       } else if (type === "tryagain") {
-        // 再来一次
+        startBtnHandle()
+      } else if (type === "selfCancel") {
+        // 再来一次,需要手动取消评测,不生成评测记录,不显示评测结果弹窗
+        evaluatingData.oneselfCancleEvaluating = true;
+        handleCancelEvaluat();
         startBtnHandle()
       }
       resetPlaybackToStart()
@@ -389,7 +393,7 @@ export default defineComponent({
             )}
           {evaluatingData.websocketState && evaluatingData.startBegin && (
             <>
-              <img class={styles.iconBtn} src={headImg("icon_reset.png")} onClick={()=>handleEvaluatResult("tryagain")} />  
+              <img class={styles.iconBtn} src={headImg("icon_reset.png")} onClick={()=>handleEvaluatResult("selfCancel")} />  
               <img class={styles.iconBtn} src={headImg("submit.png")} onClick={() => handleEndBegin()}/> 
             </>
           )} 

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

@@ -60,7 +60,6 @@ export const headTopData = reactive({
         state.audioDone && showToast("资源加载中,请稍后");  //音频资源加载完之后才提示
         return;
       }
-
       // 如果是pc端, 评测模式暂不可用
       if (state.platform === IPlatform.PC) {
         showConfirmDialog({
@@ -71,6 +70,11 @@ export const headTopData = reactive({
         });
         return;
       }
+      // 评测模式,只有一行谱模式
+      if (!state.isSingleLine) {
+        state.isSingleLine = true
+        refreshMusicSvg()
+      }
       state.playIngSpeed = state.originSpeed;
       handleStartEvaluat();
       // 开发模式,把此处打开

BIN
src/page-instrument/view-detail/images/bg2.png


+ 8 - 2
src/view/evaluating/index.tsx

@@ -110,6 +110,7 @@ export const evaluatingData = reactive({
 	jsonLoading: false, // 延迟检测的资源加载中状态
 	jsonLoadDone: false, // 延迟检测的动画dom加载完成状态
 	hideResultModal: false, // 评测作业,如果不是完整评测,需要隐藏评测结果弹窗
+	oneselfCancleEvaluating: false, // 是否是自主取消评测,自主取消评测,不生产评测记录
 });
 
 const sendOffsetTime = async (offsetTime: number) => {
@@ -301,7 +302,11 @@ export const addMeasureScore = (measureScore: any, show = true) => {
 };
 
 const handleScoreResult = (res?: IPostMessage) => {
-	console.log('返回', res)
+	console.log('返回', res,evaluatingData.oneselfCancleEvaluating)
+	// 如果是手动取消评测,不生成评测记录
+	if (evaluatingData.oneselfCancleEvaluating) {
+		return;
+	}
 	if (res?.content) {
 		const { header, body } = res.content;
 		// 效音返回
@@ -316,7 +321,7 @@ const handleScoreResult = (res?: IPostMessage) => {
 		// 评测结束返回
 		if (header?.commond === "overall") {
 			console.log("🚀 ~ 评测返回:", res);
-			// console.log("评测结束", body);
+			console.log("评测结束", body);
 			state.isHideEvaluatReportSaveBtn = false;
 			setTimeout(() => {
 				// 评测作业,如果不是完整评测,不展示评测弹窗
@@ -419,6 +424,7 @@ export const handleStartBegin = async (preTimes?: number) => {
 		audioData.progress = 0
 		audioListStart(state.playState);
 	}
+	evaluatingData.oneselfCancleEvaluating = false;
 };
 
 /** 播放音乐 */