lex hai 1 ano
pai
achega
3e742eef74

+ 98 - 1
src/page-instrument/custom-plugins/guide-driver/index.less

@@ -1,3 +1,8 @@
+.driver-overlay,
+.driver-popover {
+  pointer-events: auto !important;
+}
+
 .popoverClass .driver-popover-next-btn {
   width: 100px;
   height: 34px;
@@ -31,6 +36,11 @@
   background: url('./images/btn-close.png') no-repeat center;
   background-size: contain;
   color: transparent;
+
+  &:hover,
+  &:focus {
+    color: transparent;
+  }
 }
 
 .popoverClass {
@@ -45,7 +55,6 @@
   background-size: contain;
 
   .driver-popover-next-btn {
-
     bottom: 17px;
     left: 16px;
   }
@@ -210,4 +219,92 @@
     text-align: center;
     margin-left: 14px;
   }
+}
+
+
+.popoverClassF1 {
+  width: 257px;
+  height: 247px;
+  background: url("./images/follow/f1.png") no-repeat center;
+  background-size: contain;
+
+  .driver-popover-next-btn {
+    bottom: 17px;
+    left: 16px;
+  }
+}
+
+.popoverClassE1 {
+  width: 257px;
+  height: 247px;
+  background: url("./images/evaluating/e1.png") no-repeat center;
+  background-size: contain;
+
+  .driver-popover-next-btn {
+    bottom: 17px;
+    left: 16px;
+  }
+}
+
+.popoverClassER1 {
+  width: 257px;
+  height: 178px;
+  background: url("./images/evaluating/r1.png") no-repeat center;
+  background-size: contain;
+
+  .driver-popover-next-btn {
+    bottom: -27px;
+    right: 16px;
+  }
+}
+
+.popoverClassER2 {
+  width: 261px;
+  height: 226px;
+  background: url("./images/evaluating/r2.png") no-repeat center;
+  background-size: contain;
+
+  .driver-popover-next-btn {
+    bottom: 14px;
+    right: 15px;
+  }
+}
+
+.popoverClassER3 {
+  width: 261px;
+  height: 249px;
+  background: url("./images/evaluating/r3.png") no-repeat center;
+  background-size: contain;
+
+  .driver-popover-next-btn {
+    bottom: 15px;
+    left: 17px;
+  }
+}
+
+.popoverClassER4 {
+  width: 327px;
+  height: 246px;
+  background: url("./images/evaluating/r4.png") no-repeat center;
+  background-size: contain;
+
+  &.popoverClose {
+
+    .driver-popover-navigation-btns {
+      position: absolute;
+      bottom: 15px;
+      left: 17px;
+      justify-content: flex-end;
+    }
+
+    .driver-popover-next-btn {
+      position: relative;
+      top: 0;
+      right: 0;
+    }
+
+    .driver-popover-prev-btn {
+      margin-left: 14px;
+    }
+  }
 }

+ 187 - 37
src/page-instrument/custom-plugins/guide-driver/index.tsx

@@ -46,11 +46,14 @@ export const PractiseDriver = defineComponent({
       },
     };
 
-    const driverObj = driver({
+    const driverOptions: Config = {
       showProgress: false,
       allowClose: false,
       popoverOffset: 3,
       disableActiveInteraction: true,
+      onCloseClick: () => {
+        onDriverClose();
+      },
       steps: [
         {
           element: ".driver-1",
@@ -63,11 +66,19 @@ export const PractiseDriver = defineComponent({
             nextBtnText: "下一步1/9",
             showButtons: ["next", "close"],
             onPopoverRender: (popover: PopoverDOM, options: { config: Config; state: State }) => {
+              // console.log(popover, "popover", popover.wrapper, options.state.activeElement, options.state.__overlaySvg);
               options.config.stageRadius = 1000;
               options.config.stagePadding = 0;
-            },
-            onCloseClick: () => {
-              onDriverClose();
+
+              // popover.wrapper.addEventListener("click", (e) => {
+              //   e.stopPropagation;
+              //   console.log("12121212");
+              //   // driverObj.drive(1);
+              // });
+
+              // document.querySelector(".popoverClass1")?.addEventListener("click", () => {
+              //   console.log("11111");
+              // });
             },
           },
         },
@@ -84,9 +95,6 @@ export const PractiseDriver = defineComponent({
             onPopoverRender: (popover: PopoverDOM, options: { config: Config; state: State }) => {
               driverInitialPosition(popover, options);
             },
-            onCloseClick: () => {
-              onDriverClose();
-            },
           },
         },
         {
@@ -102,9 +110,6 @@ export const PractiseDriver = defineComponent({
             onPopoverRender: (popover: PopoverDOM, options: { config: Config; state: State }) => {
               driverInitialPosition(popover, options);
             },
-            onCloseClick: () => {
-              onDriverClose();
-            },
           },
         },
         {
@@ -120,9 +125,6 @@ export const PractiseDriver = defineComponent({
             onPopoverRender: (popover: PopoverDOM, options: { config: Config; state: State }) => {
               driverInitialPosition(popover, options);
             },
-            onCloseClick: () => {
-              onDriverClose();
-            },
           },
         },
         {
@@ -138,9 +140,6 @@ export const PractiseDriver = defineComponent({
             onPopoverRender: (popover: PopoverDOM, options: { config: Config; state: State }) => {
               driverInitialPosition(popover, options);
             },
-            onCloseClick: () => {
-              onDriverClose();
-            },
           },
         },
         {
@@ -156,9 +155,6 @@ export const PractiseDriver = defineComponent({
             onPopoverRender: (popover: PopoverDOM, options: { config: Config; state: State }) => {
               driverInitialPosition(popover, options);
             },
-            onCloseClick: () => {
-              onDriverClose();
-            },
           },
         },
         instrumentDirection,
@@ -180,9 +176,6 @@ export const PractiseDriver = defineComponent({
                 popover.wrapper.style.marginLeft = (rect?.width || 0) / 2 - 4 + "px";
               } catch {}
             },
-            onCloseClick: () => {
-              onDriverClose();
-            },
           },
         },
         {
@@ -210,13 +203,12 @@ export const PractiseDriver = defineComponent({
             onNextClick: () => {
               onDriverClose();
             },
-            onCloseClick: () => {
-              onDriverClose();
-            },
           },
         },
       ],
-    });
+    };
+
+    let driverObj: any;
 
     const guideInfo = ref({} as any);
     const getAllGuidance = async () => {
@@ -232,8 +224,9 @@ export const PractiseDriver = defineComponent({
           }
         }
         if (!(guideInfo.value && guideInfo.value.practiseDriver)) {
+          driverObj = driver(driverOptions);
           nextTick(() => {
-            driverObj.drive(5);
+            driverObj.drive(0);
           });
         }
       } catch (e) {
@@ -272,7 +265,7 @@ export const FollowDriver = defineComponent({
       } catch {}
     };
 
-    const driverObj = driver({
+    const driverOptions: Config = {
       showProgress: false,
       allowClose: false,
       popoverOffset: 3,
@@ -283,7 +276,7 @@ export const FollowDriver = defineComponent({
           popover: {
             title: "",
             description: "",
-            popoverClass: "popoverClass popoverClass1",
+            popoverClass: "popoverClass popoverClassF1",
             align: "end",
             side: "top",
             nextBtnText: "下一步1/3",
@@ -341,7 +334,9 @@ export const FollowDriver = defineComponent({
           },
         },
       ],
-    });
+    };
+
+    let driverObj: any;
 
     const guideInfo = ref({} as any);
     const getAllGuidance = async () => {
@@ -357,6 +352,7 @@ export const FollowDriver = defineComponent({
           }
         }
         if (!(guideInfo.value && guideInfo.value.followDriver)) {
+          driverObj = driver(driverOptions);
           nextTick(() => {
             driverObj.drive(0);
           });
@@ -397,18 +393,18 @@ export const EvaluatingDriver = defineComponent({
       } catch {}
     };
 
-    const driverObj = driver({
+    const driverOptions: Config = {
       showProgress: false,
       allowClose: false,
       popoverOffset: 3,
       disableActiveInteraction: true,
       steps: [
         {
-          element: ".follow-1",
+          element: ".evaluting-1",
           popover: {
             title: "",
             description: "",
-            popoverClass: "popoverClass popoverClass1",
+            popoverClass: "popoverClass popoverClassE1",
             align: "end",
             side: "top",
             nextBtnText: "下一步1/3",
@@ -466,7 +462,8 @@ export const EvaluatingDriver = defineComponent({
           },
         },
       ],
-    });
+    };
+    let driverObj: any;
 
     const guideInfo = ref({} as any);
     const getAllGuidance = async () => {
@@ -481,10 +478,13 @@ export const EvaluatingDriver = defineComponent({
             guideInfo.value = {};
           }
         }
-        if (!(guideInfo.value && guideInfo.value.followDriver)) {
+        if (!(guideInfo.value && guideInfo.value.evaluatingDriver)) {
+          driverObj = driver(driverOptions);
           nextTick(() => {
             driverObj.drive(0);
           });
+        } else {
+          driverObj.destroy();
         }
       } catch (e) {
         console.log(e);
@@ -496,9 +496,159 @@ export const EvaluatingDriver = defineComponent({
     // 结束关闭弹窗
     const onDriverClose = () => {
       if (!guideInfo.value) {
-        guideInfo.value = { followDriver: true };
+        guideInfo.value = { evaluatingDriver: true };
       } else {
-        guideInfo.value.followDriver = true;
+        guideInfo.value.evaluatingDriver = true;
+      }
+      endGuide(guideInfo.value);
+      driverObj?.destroy();
+    };
+
+    return () => <div></div>;
+  },
+});
+
+// 评测模式 - 结果弹窗
+export const EvaluatingResultDriver = defineComponent({
+  name: "EvaluatingResultDriver",
+  setup() {
+    // 初始化部分引导位置
+    const driverInitialPosition = (popover: PopoverDOM, options: { config: Config; state: State }, position = 1) => {
+      options.config.stageRadius = 1000;
+      options.config.stagePadding = 0;
+      try {
+        const rect = options.state.activeElement?.getBoundingClientRect();
+        popover.wrapper.style.marginLeft = ((rect?.width || 0) / 2) * position + 4 + "px";
+      } catch {}
+    };
+
+    const driverOptions: Config = {
+      showProgress: false,
+      allowClose: false,
+      popoverOffset: 3,
+      disableActiveInteraction: true,
+      steps: [
+        {
+          element: ".evaluting-result-1",
+          popover: {
+            title: "",
+            description: "",
+            popoverClass: "popoverClass popoverClassER1",
+            align: "start",
+            side: "right",
+            nextBtnText: "下一步1/4",
+            showButtons: ["next", "close"],
+            onPopoverRender: (popover: PopoverDOM, options: { config: Config; state: State }) => {
+              options.config.stageRadius = 12;
+              options.config.stagePadding = 10;
+            },
+            onCloseClick: () => {
+              onDriverClose();
+            },
+          },
+        },
+        {
+          element: ".evaluting-result-2",
+          popover: {
+            title: "",
+            description: "",
+            popoverClass: "popoverClass popoverClassER2",
+            align: "start",
+            side: "top",
+            nextBtnText: "下一步2/4",
+            showButtons: ["next", "close"],
+            onPopoverRender: (popover: PopoverDOM, options: { config: Config; state: State }) => {
+              options.config.stageRadius = 1000;
+              options.config.stagePadding = 0;
+              try {
+                const rect = options.state.activeElement?.getBoundingClientRect();
+                popover.wrapper.style.marginLeft = (rect?.width || 0) / 2 - 4 + "px";
+              } catch {}
+            },
+            onCloseClick: () => {
+              onDriverClose();
+            },
+          },
+        },
+        {
+          element: ".evaluting-result-3",
+          popover: {
+            title: "",
+            description: "",
+            popoverClass: "popoverClass popoverClassER3",
+            align: "end",
+            side: "top",
+            nextBtnText: "下一步3/4",
+            showButtons: ["next", "close"],
+            onPopoverRender: (popover: PopoverDOM, options: { config: Config; state: State }) => {
+              driverInitialPosition(popover, options, -1);
+            },
+            onCloseClick: () => {
+              onDriverClose();
+            },
+          },
+        },
+        {
+          element: ".evaluting-result-4",
+          popover: {
+            title: "",
+            description: "",
+            popoverClass: "popoverClass popoverClassER4 popoverClose",
+            align: "end",
+            side: "top",
+            prevBtnText: "再看一遍",
+            doneBtnText: "完成",
+            showButtons: ["next", "previous", "close"],
+            onPopoverRender: (popover: PopoverDOM, options: { config: Config; state: State }) => {
+              driverInitialPosition(popover, options, -1);
+            },
+            onPrevClick: () => {
+              driverObj.drive(0);
+            },
+            onNextClick: () => {
+              onDriverClose();
+            },
+            onCloseClick: () => {
+              onDriverClose();
+            },
+          },
+        },
+      ],
+    };
+    let driverObj: any;
+
+    const guideInfo = ref({} as any);
+    const getAllGuidance = async () => {
+      try {
+        if (state.guideInfo) {
+          guideInfo.value = state.guideInfo;
+        } else {
+          const res = await getGuidance({ guideTag: "guideInfo" });
+          if (res.data) {
+            guideInfo.value = JSON.parse(res.data?.guideValue) || null;
+          } else {
+            guideInfo.value = {};
+          }
+        }
+        if (!(guideInfo.value && guideInfo.value.evaluatingResultDriver)) {
+          driverObj = driver(driverOptions);
+          nextTick(() => {
+            driverObj.drive(0);
+          });
+        }
+      } catch (e) {
+        console.log(e);
+      }
+    };
+
+    getAllGuidance();
+
+    // 结束关闭弹窗
+    const onDriverClose = () => {
+      if (!guideInfo.value) {
+        guideInfo.value = { evaluatingResultDriver: true };
+      } else {
+        guideInfo.value.evaluatingResultDriver = true;
       }
       endGuide(guideInfo.value);
       driverObj.destroy();

+ 37 - 16
src/page-instrument/evaluat-model/evaluat-result/index.module.less

@@ -66,9 +66,11 @@
     flex-direction: column;
     justify-content: space-between;
     margin-top: 59px;
-    &.fractionPercussion{
+
+    &.fractionPercussion {
         height: 195px;
     }
+
     .bg {
         position: absolute;
         left: 0;
@@ -93,6 +95,11 @@
             margin-top: -11px;
         }
 
+        .scoreSection {
+            display: flex;
+            align-items: flex-end;
+        }
+
         .text {
             margin-left: 32px;
             position: relative;
@@ -107,10 +114,12 @@
             z-index: 1;
             line-height: 1;
             white-space: nowrap;
+
             &.badgeText {
                 margin-left: 6px;
             }
-            .level{
+
+            .level {
                 margin-left: 4px;
                 padding: 0 6px;
                 display: flex;
@@ -122,7 +131,8 @@
                 font-weight: 400;
                 font-size: 12px;
                 color: #8A541E;
-                & > span{
+
+                &>span {
                     margin: -2px 4px 0;
                 }
             }
@@ -151,35 +161,40 @@
     padding: 0 30px;
     font-weight: 400;
     font-size: 14px;
-    color: rgba(0,0,0,0.5);
+    color: rgba(0, 0, 0, 0.5);
     line-height: 20px;
 }
 
 .ctrls {
     display: flex;
-    justify-content:space-between;
+    justify-content: space-between;
     align-items: center;
     margin: 0 27px 14px;
+
     .ctrlsBtn {
         width: 107px;
         height: 39px;
     }
 }
-:global{
+
+:global {
     .savePopoverClose {
-        &.van-popover{
-            --van-popover-dark-background:rgba(0,0,0,0.7);
+        &.van-popover {
+            --van-popover-dark-background: rgba(0, 0, 0, 0.7);
         }
+
         .popoverClose {
             display: flex;
             align-items: center;
             padding: 9px 12px;
-            >div{
+
+            >div {
                 font-weight: 500;
                 font-size: 14px;
                 color: #FFFFFF;
                 line-height: 20px;
             }
+
             >img {
                 margin-left: 16px;
                 width: 12px;
@@ -188,6 +203,7 @@
         }
     }
 }
+
 .detail {
     display: flex;
     align-items: center;
@@ -195,7 +211,7 @@
     box-shadow: 0px 1px 5px 0px #EFE3C2;
     border-radius: 14px;
     margin: 0 20px;
-    padding: 12px 0;    
+    padding: 12px 0;
     padding: 10px 0;
 }
 
@@ -205,26 +221,31 @@
     flex-direction: column;
     justify-content: center;
     align-items: center;
-    &:nth-child(2){
+
+    &:nth-child(2) {
         border-left: 1px solid #F2F2F2;
         border-right: 1px solid #F2F2F2;
     }
-    &>div:nth-child(1){
+
+    &>div:nth-child(1) {
         display: flex;
         align-items: center;
-        >span{
+
+        >span {
             font-weight: 500;
             font-size: 14px;
             color: #1A1A1A;
             line-height: 20px;
             margin-left: 4px;
         }
-        >img{
+
+        >img {
             width: 16px;
             height: 16px;
         }
     }
-    &>div{
+
+    &>div {
         margin-top: 6px;
         font-weight: 500;
         font-size: 18px;
@@ -256,7 +277,7 @@
     }
 }
 
-.disablued{
+.disablued {
     pointer-events: none;
     opacity: .5;
 }

+ 161 - 176
src/page-instrument/evaluat-model/evaluat-result/index.tsx

@@ -1,17 +1,17 @@
 import { defineComponent, onMounted, reactive, watch } from "vue";
-import { Popover } from "vant"
+import { Popover } from "vant";
 import styles from "./index.module.less";
 import state from "/src/state";
 import icon1 from "../icons/1.png";
 import { storeData } from "/src/store";
 import { evaluatingData } from "/src/view/evaluating";
 import iconBack from "/src/page-instrument/header-top/image/icon-back.png";
-import bg1Img from "./img/bg1.png"
-import bg2Img from "./img/bg2.png"
-import ckzpImg from "./img/ckzp.png"
-import bczpImg from "./img/bczp.png"
-import bczpJzImg from "./img/bczpJz.png"
-import zlycImg from "./img/zlyc.png"
+import bg1Img from "./img/bg1.png";
+import bg2Img from "./img/bg2.png";
+import ckzpImg from "./img/ckzp.png";
+import bczpImg from "./img/bczp.png";
+import bczpJzImg from "./img/bczpJz.png";
+import zlycImg from "./img/zlyc.png";
 import iconBadge from "./img/icon-badge.png";
 import icon_expression0 from "./img/icon_expression0.png";
 import icon_expression1 from "./img/icon_expression1.png";
@@ -26,178 +26,163 @@ import { getQuery } from "/src/utils/queryString";
 import { browser, getBehaviorId } from "/src/utils";
 import { api_musicPracticeRecordSave } from "../../api";
 import { getAudioDuration } from "/src/view/audio-list";
-import { debounce } from "/src/utils"
+import { debounce } from "/src/utils";
 
 export default defineComponent({
-	name: "evaluatResult",
-	emits: ["close"],
-	setup(props, { emit }) {
-		const query = getQuery();
-		const data = reactive({
-			saveLoading: true,
-			showPopover: true
-		});
-		const level: any = {
-			BEGINNER: "入门级",
-			ADVANCED: "进阶级",
-			PERFORMER: "大师级",
-		}; 
-		/** 添加评测记录 */
-		const handleAddRecord = async () => {
-			console.log("结束", evaluatingData.resultData);
-			/** 生成评测记录的时候,记录当前评测的谱面类型,用于评测报告默认展示的谱面类型 */
-			evaluatingData.resultData.scoreData.musicType = state.musicRenderType;
-			const body = {
-				deviceType: browser().android ? "ANDROID" : "IOS", // 设备类型
-				intonation: evaluatingData.resultData.intonation, // 音准
-				cadence: evaluatingData.resultData.cadence, // 节奏
-				integrity: evaluatingData.resultData.integrity, // 完成度
-				scoreData: JSON.stringify(evaluatingData.resultData.scoreData), // 评测数据
-				behaviorId: getBehaviorId(), // 行为id
-				sourceTime: getAudioDuration(), // 音频时长
-				partIndex: state.partIndex, // 音轨
-				speed: state.speed, // 速度
-				practiceSource: query.workRecord ? "LESSON_TRAINING" : "EVALUATION", // 练习来源
-				score: evaluatingData.resultData.score, // 分数
-				clientType: storeData.user.clientType, // 客户端类型
-				musicSheetId: state.examSongId, // 乐谱id
-				feature: "EVALUATION", // 特征
-				playTime: evaluatingData.resultData.playTime / 1000, // 播放时长
-				heardLevel: state.setting.evaluationDifficulty, // 听力等级
-				recordFilePath: evaluatingData.resultData.url, // 录音文件路径
-			};
-			data.saveLoading = true;
-			const res = await api_musicPracticeRecordSave(body);
-			if (res?.code === 200){
-				evaluatingData.resultData.recordId = res.data
-			}
-			data.saveLoading = false;
-		};
+  name: "evaluatResult",
+  emits: ["close"],
+  setup(props, { emit }) {
+    const query = getQuery();
+    const data = reactive({
+      saveLoading: true,
+      showPopover: true,
+    });
+    const level: any = {
+      BEGINNER: "入门级",
+      ADVANCED: "进阶级",
+      PERFORMER: "大师级",
+    };
+    /** 添加评测记录 */
+    const handleAddRecord = async () => {
+      console.log("结束", evaluatingData.resultData);
+      /** 生成评测记录的时候,记录当前评测的谱面类型,用于评测报告默认展示的谱面类型 */
+      evaluatingData.resultData.scoreData.musicType = state.musicRenderType;
+      const body = {
+        deviceType: browser().android ? "ANDROID" : "IOS", // 设备类型
+        intonation: evaluatingData.resultData.intonation, // 音准
+        cadence: evaluatingData.resultData.cadence, // 节奏
+        integrity: evaluatingData.resultData.integrity, // 完成度
+        scoreData: JSON.stringify(evaluatingData.resultData.scoreData), // 评测数据
+        behaviorId: getBehaviorId(), // 行为id
+        sourceTime: getAudioDuration(), // 音频时长
+        partIndex: state.partIndex, // 音轨
+        speed: state.speed, // 速度
+        practiceSource: query.workRecord ? "LESSON_TRAINING" : "EVALUATION", // 练习来源
+        score: evaluatingData.resultData.score, // 分数
+        clientType: storeData.user.clientType, // 客户端类型
+        musicSheetId: state.examSongId, // 乐谱id
+        feature: "EVALUATION", // 特征
+        playTime: evaluatingData.resultData.playTime / 1000, // 播放时长
+        heardLevel: state.setting.evaluationDifficulty, // 听力等级
+        recordFilePath: evaluatingData.resultData.url, // 录音文件路径
+      };
+      data.saveLoading = true;
+      const res = await api_musicPracticeRecordSave(body);
+      if (res?.code === 200) {
+        evaluatingData.resultData.recordId = res.data;
+      }
+      data.saveLoading = false;
+    };
 
-		const saveResult = () => {
-			emit("close", "update")
-		}
+    const saveResult = () => {
+      emit("close", "update");
+    };
 
-		onMounted(() => {
-			if (!evaluatingData.isErrorState) {
-				handleAddRecord();
-			}
-			// console.log('评测等级',evaluatingData.resultData.leve)
-		});
+    onMounted(() => {
+      if (!evaluatingData.isErrorState) {
+        handleAddRecord();
+      }
+      // console.log('评测等级',evaluatingData.resultData.leve)
+    });
 
-		watch(() => evaluatingData.resulstMode, (val) => {
-			// # 9402,评测异常操作:都改为不生成评测记录
-			if (val) {
-				setTimeout(() => {
-					if (!evaluatingData.isErrorState) {
-						handleAddRecord();
-					}
-				}, 0);
-			}
-		})
-		return () => (
-			<>
-			{
-				!evaluatingData.hideResultModal && 
-				<div class={styles.evaluatResult}>
-					<div class={styles.closeBtn} onClick={() => emit("close")}>
-						<img src={iconBack} />
-					</div>
-					<div class={[styles.fraction, state.isPercussion && styles.fractionPercussion]}>
-						<img class={styles.bg} src={state.isPercussion ? bg2Img : bg1Img} />
-						<div class={styles.top}>
-							{evaluatingData.resultData.score > 79 && (
-								<img class={styles.badge} src={iconBadge} />
-							)}
-							<div class={[styles.text, evaluatingData.resultData.score > 79 && styles.badgeText]}>
-								<div class={styles.num}>{evaluatingData.resultData.score}</div>
-								<div class={styles.score}>分</div>
-								<div class={styles.level}>
-									<div>{level[evaluatingData.resultData.heardLevel]}</div>
-									<span>|</span>
-									<div>速度{evaluatingData.resultData.speed}</div>
-								</div>
-							</div>
-							<img
-								style={{ display: evaluatingData.resultData.leve === 0 ? "" : "none" }}
-								class={styles.rightBadge}
-								src={icon_expression0}
-							/>
-							<img
-								style={{ display: evaluatingData.resultData.leve === 1 ? "" : "none" }}
-								class={styles.rightBadge}
-								src={icon_expression1}
-							/>
-							<img
-								style={{ display: evaluatingData.resultData.leve === 2 ? "" : "none" }}
-								class={styles.rightBadge}
-								src={icon_expression2}
-							/>
-							<img
-								style={{ display: evaluatingData.resultData.leve === 3 ? "" : "none" }}
-								class={styles.rightBadge}
-								src={icon_expression3}
-							/>
-							<img
-								style={{ display: evaluatingData.resultData.leve === 4 ? "" : "none" }}
-								class={styles.rightBadge}
-								src={icon_expression4}
-							/>
-						</div>
-						{!state.isPercussion && <div class={styles.detail}>
-								<div class={styles.progressitem}>
-									<div>
-										<img src={yzImg} />
-										<span>音准</span>
-									</div>
-									<div>{evaluatingData.resultData.intonation}分</div>
-								</div>
-								<div class={styles.progressitem}>
-									<div>
-										<img src={jzImg} />
-										<span>节奏</span>
-									</div>
-									<div>{evaluatingData.resultData.cadence}分</div>
-								</div>
-								<div class={styles.progressitem}>
-									<div>
-										<img src={wzxImg} />
-										<span>完成度</span>
-									</div>
-									<div>{evaluatingData.resultData.integrity}分</div>
-								</div>
-							</div>
-						}
-						<div class={styles.tips}>{evaluatingData.resultData.clxtip}</div>
-						<div class={styles.ctrls}>
-							<img
-								src={zlycImg}
-								class={styles.ctrlsBtn}
-								onClick={() => emit("close", "tryagain")}
-							/>
-							{
-								!state.isHideEvaluatReportSaveBtn && evaluatingData.resultData.recordId ? <img src={bczpImg} class={styles.ctrlsBtn} onClick={debounce(saveResult,300)} /> :  
-								<Popover class={"savePopoverClose"} placement={"top"} v-model:show={data.showPopover} v-slots={{
-										reference : ()=> <img src={bczpJzImg} class={styles.ctrlsBtn} />
-									}} theme="dark">
-									<div class={"popoverClose"}>
-										<div>该曲目暂不支持保存作品噢~</div>
-										<img src={closeImg} onClick={() => {
-											data.showPopover = false
-										}} />
-									</div>
-								</Popover>
-							}
-							<img
-								src={ckzpImg}
-								class={[styles.ctrlsBtn, data.saveLoading ? styles.disablued : ""]}
-								onClick={() => emit("close", "look")}
-							/>
-						</div>
-					</div>
-				</div>				
-			}
-			</>
-		);
-	},
+    watch(
+      () => evaluatingData.resulstMode,
+      (val) => {
+        // # 9402,评测异常操作:都改为不生成评测记录
+        if (val) {
+          setTimeout(() => {
+            if (!evaluatingData.isErrorState) {
+              handleAddRecord();
+            }
+          }, 0);
+        }
+      }
+    );
+    return () => (
+      <>
+        {!evaluatingData.hideResultModal && (
+          <div class={styles.evaluatResult}>
+            <div class={styles.closeBtn} onClick={() => emit("close")}>
+              <img src={iconBack} />
+            </div>
+            <div class={[styles.fraction, state.isPercussion && styles.fractionPercussion]}>
+              <img class={styles.bg} src={state.isPercussion ? bg2Img : bg1Img} />
+              <div class={styles.top}>
+                {evaluatingData.resultData.score > 79 && <img class={styles.badge} src={iconBadge} />}
+                <div class={[styles.text, evaluatingData.resultData.score > 79 && styles.badgeText]}>
+                  <div class={[styles.scoreSection, "evaluting-result-1"]}>
+                    <div class={styles.num}>{evaluatingData.resultData.score}00</div>
+                    <div class={styles.score}>分</div>
+                    <div class={styles.level}>
+                      <div>{level[evaluatingData.resultData.heardLevel]}</div>
+                      <span>|</span>
+                      <div>速度{evaluatingData.resultData.speed}</div>
+                    </div>
+                  </div>
+                </div>
+                <img style={{ display: evaluatingData.resultData.leve === 0 ? "" : "none" }} class={styles.rightBadge} src={icon_expression0} />
+                <img style={{ display: evaluatingData.resultData.leve === 1 ? "" : "none" }} class={styles.rightBadge} src={icon_expression1} />
+                <img style={{ display: evaluatingData.resultData.leve === 2 ? "" : "none" }} class={styles.rightBadge} src={icon_expression2} />
+                <img style={{ display: evaluatingData.resultData.leve === 3 ? "" : "none" }} class={styles.rightBadge} src={icon_expression3} />
+                <img style={{ display: evaluatingData.resultData.leve === 4 ? "" : "none" }} class={styles.rightBadge} src={icon_expression4} />
+              </div>
+              {!state.isPercussion && (
+                <div class={styles.detail}>
+                  <div class={styles.progressitem}>
+                    <div>
+                      <img src={yzImg} />
+                      <span>音准</span>
+                    </div>
+                    <div>{evaluatingData.resultData.intonation}分</div>
+                  </div>
+                  <div class={styles.progressitem}>
+                    <div>
+                      <img src={jzImg} />
+                      <span>节奏</span>
+                    </div>
+                    <div>{evaluatingData.resultData.cadence}分</div>
+                  </div>
+                  <div class={styles.progressitem}>
+                    <div>
+                      <img src={wzxImg} />
+                      <span>完成度</span>
+                    </div>
+                    <div>{evaluatingData.resultData.integrity}分</div>
+                  </div>
+                </div>
+              )}
+              <div class={styles.tips}>{evaluatingData.resultData.clxtip}</div>
+              <div class={styles.ctrls}>
+                <img src={zlycImg} class={[styles.ctrlsBtn, "evaluting-result-2"]} onClick={() => emit("close", "tryagain")} />
+                {!state.isHideEvaluatReportSaveBtn && evaluatingData.resultData.recordId ? (
+                  <img src={bczpImg} class={[styles.ctrlsBtn, "evaluting-result-3"]} onClick={debounce(saveResult, 300)} />
+                ) : (
+                  <Popover
+                    class={"savePopoverClose"}
+                    placement={"top"}
+                    v-model:show={data.showPopover}
+                    v-slots={{
+                      reference: () => <img src={bczpJzImg} class={[styles.ctrlsBtn, "evaluting-result-3"]} />,
+                    }}
+                    theme="dark"
+                  >
+                    <div class={"popoverClose"}>
+                      <div>该曲目暂不支持保存作品噢~</div>
+                      <img
+                        src={closeImg}
+                        onClick={() => {
+                          data.showPopover = false;
+                        }}
+                      />
+                    </div>
+                  </Popover>
+                )}
+                <img src={ckzpImg} class={[styles.ctrlsBtn, "evaluting-result-4", data.saveLoading ? styles.disablued : ""]} onClick={() => emit("close", "look")} />
+              </div>
+            </div>
+          </div>
+        )}
+      </>
+    );
+  },
 });

+ 65 - 68
src/page-instrument/evaluat-model/index.tsx

@@ -22,11 +22,9 @@ import { api_musicPracticeRecordVideoUpload } from "../api";
 // import DelayCheck from "./delay-check";
 import { headTopData } from "../header-top/index";
 import { getQuery } from "/src/utils/queryString";
-import Countdown from "./countdown"
+import Countdown from "./countdown";
 
-const DelayCheck = defineAsyncComponent(() =>
-  import('./delay-check')
-)
+const DelayCheck = defineAsyncComponent(() => import("./delay-check"));
 
 // frequency 频率, amplitude 振幅, decibels 分贝
 type TCriteria = "frequency" | "amplitude" | "decibels";
@@ -36,8 +34,8 @@ type TCriteria = "frequency" | "amplitude" | "decibels";
  * 评测模式时,应该传节拍器时长
  * 阶段评测时,判断是否从第一小节开始,并且曲子本身含有节拍器,需要传节拍器时长,否则传0
  */
-let actualBeatLength = 0
-let calculateInfo: any = {}
+let actualBeatLength = 0;
+let calculateInfo: any = {};
 
 export default defineComponent({
   name: "evaluat-model",
@@ -61,7 +59,7 @@ export default defineComponent({
         handleRessetState();
         headTopData.modeType = "init";
       }
-    }
+    };
     /**
      * 执行检测
      */
@@ -125,46 +123,42 @@ export default defineComponent({
 
     /** 生成评测曲谱数据 */
     const formatTimes = () => {
-      let starTime = 0
+      let starTime = 0;
       let ListenMode = false;
       let dontEvaluatingMode = false;
       let skip = false;
       const datas = [];
-      let selectTimes = state.times
-      let unitTestIdx = 0
-			let preTime = 0
-			let preTimes = []
+      let selectTimes = state.times;
+      let unitTestIdx = 0;
+      let preTime = 0;
+      let preTimes = [];
       // 系统节拍器时长
-      actualBeatLength = Math.round(state.times[0].fixtime * 1000 / 1)
+      actualBeatLength = Math.round((state.times[0].fixtime * 1000) / 1);
       // 如果是阶段评测,选取该阶段的times
-			if (state.isSelectMeasureMode && state.section.length) {
-				const startIndex = state.times.findIndex(
-				  (n: any) => n.noteId == state.section[0].noteId
-				)
-				let endIndex = state.times.findIndex(
-				  (n: any) => n.noteId == state.section[1].noteId
-				)
-        endIndex = endIndex < state.section[1].i ? state.section[1].i : endIndex
+      if (state.isSelectMeasureMode && state.section.length) {
+        const startIndex = state.times.findIndex((n: any) => n.noteId == state.section[0].noteId);
+        let endIndex = state.times.findIndex((n: any) => n.noteId == state.section[1].noteId);
+        endIndex = endIndex < state.section[1].i ? state.section[1].i : endIndex;
         if (startIndex > 1) {
-					// firstNoteTime应该取预备小节的第一个音符的开始播放的时间
-					const idx = startIndex - 1 - (state.times[startIndex-1].si)
-					preTime = state.times[idx] ? state.times[idx].time * 1000 : 0
-				}
-        actualBeatLength = startIndex == 0 && state.isOpenMetronome ? actualBeatLength : 0
-				selectTimes = state.times.filter((n: any, index: number) => {
-				  return index >= startIndex && index <= endIndex
-				})
+          // firstNoteTime应该取预备小节的第一个音符的开始播放的时间
+          const idx = startIndex - 1 - state.times[startIndex - 1].si;
+          preTime = state.times[idx] ? state.times[idx].time * 1000 : 0;
+        }
+        actualBeatLength = startIndex == 0 && state.isOpenMetronome ? actualBeatLength : 0;
+        selectTimes = state.times.filter((n: any, index: number) => {
+          return index >= startIndex && index <= endIndex;
+        });
         preTimes = state.times.filter((n: any, index: number) => {
-					return index < startIndex
-				})				
-				unitTestIdx = startIndex
-        starTime = selectTimes[0].sourceRelativeTime || selectTimes[0].relativeTime
-			}	
-			// 阶段评测beatLength需要加上预备小节的持续时长
-			actualBeatLength = preTimes.length ? actualBeatLength + preTimes[preTimes.length - 1].relaMeasureLength * 1000 : actualBeatLength				
-			let firstNoteTime = unitTestIdx > 1 ? preTime : 0
-			let measureIndex = -1
-			let recordMeasure = -1
+          return index < startIndex;
+        });
+        unitTestIdx = startIndex;
+        starTime = selectTimes[0].sourceRelativeTime || selectTimes[0].relativeTime;
+      }
+      // 阶段评测beatLength需要加上预备小节的持续时长
+      actualBeatLength = preTimes.length ? actualBeatLength + preTimes[preTimes.length - 1].relaMeasureLength * 1000 : actualBeatLength;
+      let firstNoteTime = unitTestIdx > 1 ? preTime : 0;
+      let measureIndex = -1;
+      let recordMeasure = -1;
 
       for (let index = 0; index < selectTimes.length; index++) {
         const item = selectTimes[index];
@@ -201,9 +195,9 @@ export default defineComponent({
         // console.log("skip", skip)
         // console.log(end,start,rate,noteRate, '评测')
         if (note.measureOpenIndex != recordMeasure) {
-					measureIndex++
-					recordMeasure = note.measureOpenIndex
-				}
+          measureIndex++;
+          recordMeasure = note.measureOpenIndex;
+        }
         const data = {
           timeStamp: (start * 1000) / rate,
           duration: ((end * 1000) / rate - (start * 1000) / rate) * noteRate,
@@ -220,18 +214,18 @@ export default defineComponent({
         };
         datas.push(data);
       }
-			return {
-				datas,
-				firstNoteTime
-			}
+      return {
+        datas,
+        firstNoteTime,
+      };
     };
     /** 连接websocket */
     const handleConnect = async () => {
       const behaviorId = localStorage.getItem("behaviorId") || localStorage.getItem("BEHAVIORID") || undefined;
       let rate = state.speed / state.originSpeed;
       rate = parseFloat(rate.toFixed(2));
-      console.log('速度比例',rate,'速度',state.speed)
-      calculateInfo = formatTimes()
+      console.log("速度比例", rate, "速度", state.speed);
+      calculateInfo = formatTimes();
       const content = {
         musicXmlInfos: calculateInfo.datas,
         subjectId: state.musicalCode,
@@ -260,7 +254,7 @@ export default defineComponent({
       if (type === "update") {
         if (state.isAppPlay) {
           evaluatModel.evaluatUpdateAudio = true;
-          resetPlaybackToStart()
+          resetPlaybackToStart();
           return;
         } else if (evaluatingData.resultData?.recordIdStr || evaluatingData.resultData?.recordId) {
           let rate = state.speed / state.originSpeed;
@@ -287,14 +281,14 @@ export default defineComponent({
         // 去练习
         handleStartEvaluat();
       } else if (type === "tryagain") {
-        startBtnHandle()
+        startBtnHandle();
       } else if (type === "selfCancel") {
         // 再来一次,需要手动取消评测,不生成评测记录,不显示评测结果弹窗
         evaluatingData.oneselfCancleEvaluating = true;
         handleCancelEvaluat();
-        startBtnHandle()
+        startBtnHandle();
       }
-      resetPlaybackToStart()
+      resetPlaybackToStart();
       evaluatingData.resulstMode = false;
     };
 
@@ -343,11 +337,11 @@ export default defineComponent({
         await new Promise<void>((resolve) => {
           setTimeout(() => {
             closeToast();
-            evaluatingData.isErrorState =false
+            evaluatingData.isErrorState = false;
             // console.log('异常流程2')
-            resolve()
+            resolve();
           }, 1000);
-        })
+        });
       }
       // console.log('异常流程3')
       // 检测APP端socket状态
@@ -359,9 +353,8 @@ export default defineComponent({
           evaluatingData.isErrorState = false;
           evaluatingData.resulstMode = false;
         }
-        
       }
-    }
+    };
     onMounted(() => {
       evaluatingData.isDisabledPlayMusic = true;
       handlePerformDetection();
@@ -386,17 +379,20 @@ export default defineComponent({
         </Transition> */}
         <div class={styles.operatingBtn}>
           {evaluatingData.websocketState && !evaluatingData.startBegin && evaluatingData.checkEnd && (
-              <img class={styles.iconBtn} src={headImg("icon_play.png")} 
+            <img
+              class={[styles.iconBtn, "evaluting-1"]}
+              src={headImg("icon_play.png")}
               onClick={() => {
-                startBtnHandle()
-              }} />
-            )}
+                startBtnHandle();
+              }}
+            />
+          )}
           {evaluatingData.websocketState && evaluatingData.startBegin && (
             <>
-              <img class={styles.iconBtn} src={headImg("icon_reset.png")} onClick={()=>handleEvaluatResult("selfCancel")} />  
-              <img class={styles.iconBtn} src={headImg("submit.png")} onClick={() => handleEndBegin()}/> 
+              <img class={styles.iconBtn} src={headImg("icon_reset.png")} onClick={() => handleEvaluatResult("selfCancel")} />
+              <img class={styles.iconBtn} src={headImg("submit.png")} onClick={() => handleEndBegin()} />
             </>
-          )} 
+          )}
         </div>
         {/* <div style={{ display: !evaluatingData.startBegin && !evaluatingData.soundEffectMode ? "" : "none" }} class={styles.dialogueBox} key="start">
           <div class={styles.dialogue}>
@@ -456,12 +452,13 @@ export default defineComponent({
 				</Popup> */}
 
         {/* 评测作业,非完整评测不显示评测结果弹窗 */}
-        {
-          evaluatingData.hideResultModal ? <EvaluatResult onClose={handleEvaluatResult} /> :
+        {evaluatingData.hideResultModal ? (
+          <EvaluatResult onClose={handleEvaluatResult} />
+        ) : (
           <Popup teleport="body" closeOnClickOverlay={false} class={["popup-custom", "van-scale"]} transition="van-scale" v-model:show={evaluatingData.resulstMode}>
             <EvaluatResult onClose={handleEvaluatResult} />
-          </Popup>    
-        }
+          </Popup>
+        )}
 
         <Popup teleport="body" closeOnClickOverlay={false} class={["popup-custom", "van-scale"]} transition="van-scale" v-model:show={evaluatModel.evaluatUpdateAudio}>
           <EvaluatAudio onClose={hanldeUpdateVideoAndAudio} />

+ 6 - 2
src/page-instrument/header-top/index.tsx

@@ -31,7 +31,7 @@ import { getGuidance, setGuidance } from "../custom-plugins/guide-page/api";
 import ModeView from "./modeView";
 import { smoothAnimationState } from "../view-detail/smoothAnimation";
 import { isMusicList, musicListShow } from "../component/the-music-list";
-import { FollowDriver, PractiseDriver } from "../custom-plugins/guide-driver";
+import { EvaluatingDriver, EvaluatingResultDriver, FollowDriver, PractiseDriver } from "../custom-plugins/guide-driver";
 
 /** 头部数据和方法 */
 export const headTopData = reactive({
@@ -79,7 +79,7 @@ export const headTopData = reactive({
       state.playIngSpeed = state.originSpeed;
       handleStartEvaluat();
       // 开发模式,把此处打开
-      // state.modeType = "evaluating"
+      state.modeType = "evaluating";
       // evaluatingData.rendered = true;
       // evaluatingData.soundEffectMode = true;
     } else if (value === "follow") {
@@ -836,6 +836,10 @@ export default defineComponent({
         {state.modeType === "practise" && !query.isCbs && state.audioDone && !state.isVip && <PractiseDriver />}
         {/* 跟练模式功能引导 加载音频完成 不是会员 */}
         {state.modeType === "follow" && !query.isCbs && state.audioDone && !state.isVip && <FollowDriver />}
+        {/* 评测模式功能引导 加载音频完成 不是会员 */}
+        {state.modeType === "evaluating" && !evaluatingData.earphoneMode && !query.isCbs && state.audioDone && !state.isVip && <EvaluatingDriver />}
+        {/* 评测模式-结果弹窗 功能引导 加载音频完成 不是会员 */}
+        {state.modeType === "evaluating" && evaluatingData.resulstMode && !evaluatingData.earphoneMode && !query.isCbs && state.audioDone && !state.isVip && <EvaluatingResultDriver />}
       </>
     );
   },

+ 6 - 5
src/state.ts

@@ -1348,11 +1348,12 @@ const setState = (data: any, index: number) => {
   const track = data.code || data.track;
   state.track = track ? track.replace(/ /g, "").toLocaleLowerCase() : "";
   // 能否评测,根据当前声轨有无伴奏判断
-  if (state.isAppPlay) {
-    state.enableEvaluation = state.midiUrl ? true : false
-  } else {
-    state.enableEvaluation = state.accompany ? true : false
-  }
+  // if (state.isAppPlay) {
+  //   state.enableEvaluation = state.midiUrl ? true : false
+  // } else {
+  //   state.enableEvaluation = state.accompany ? true : false
+  // }
+  state.enableEvaluation = true
   state.isConcert = data.musicSheetType === "CONCERT" ? true : false;
   // multiTracksSelection 返回为空,默认代表全部分轨
   state.canSelectTracks = data.multiTracksSelection === "null" || data.multiTracksSelection === "" || data.multiTracksSelection === null ? [] : data.multiTracksSelection?.split(',');

+ 645 - 663
src/view/evaluating/index.tsx

@@ -4,43 +4,36 @@ import { closeToast, showLoadingToast, showToast, Popup } from "vant";
 import { defineComponent, onMounted, onUnmounted, reactive, ref, watch } from "vue";
 import { getLeveByScore, getLeveByScoreMeasure, IEvaluatings } from "./evaluatResult";
 import {
-	cancelEvaluating,
-	endEvaluating,
-	endSoundCheck,
-	getEarphone,
-	api_proxyServiceMessage,
-	removeResult,
-	sendResult,
-	startEvaluating,
-	startSoundCheck,
-	api_openWebView,
-	api_startRecording,
-	api_startRecordingCb,
-	api_stopRecording,
-	api_recordStartTime,
-	api_remove_recordStartTime,
-	api_startCapture,
-	api_endCapture,
-	api_getDeviceDelay,
-	hideComplexButton,
-	api_checkSocketStatus,
-	addAccompanyError,
-	removeAccompanyError,
-	addSocketStatus,
-	removeSocketStatus,
-	api_disconnectSocket,
-	api_midiMicDelay,
-	api_cloudSetCurrentTime,
-	api_cloudChangeSpeed,
+  cancelEvaluating,
+  endEvaluating,
+  endSoundCheck,
+  getEarphone,
+  api_proxyServiceMessage,
+  removeResult,
+  sendResult,
+  startEvaluating,
+  startSoundCheck,
+  api_openWebView,
+  api_startRecording,
+  api_startRecordingCb,
+  api_stopRecording,
+  api_recordStartTime,
+  api_remove_recordStartTime,
+  api_startCapture,
+  api_endCapture,
+  api_getDeviceDelay,
+  hideComplexButton,
+  api_checkSocketStatus,
+  addAccompanyError,
+  removeAccompanyError,
+  addSocketStatus,
+  removeSocketStatus,
+  api_disconnectSocket,
+  api_midiMicDelay,
+  api_cloudSetCurrentTime,
+  api_cloudChangeSpeed,
 } from "/src/helpers/communication";
-import state, {
-	IPlayState,
-	clearSelection,
-	handleStopPlay,
-	onPlay,
-	resetPlaybackToStart,
-	togglePlay,
-} from "/src/state";
+import state, { IPlayState, clearSelection, handleStopPlay, onPlay, resetPlaybackToStart, togglePlay } from "/src/state";
 import { IPostMessage } from "/src/utils/native-message";
 import { usePageVisibility } from "@vant/use";
 import { browser } from "/src/utils";
@@ -48,430 +41,426 @@ import { getAudioCurrentTime, toggleMutePlayAudio, audioListStart, audioData } f
 import { handleStartTick, closeTick } from "../tick";
 import AbnormalPop from "../abnormal-pop";
 import { storeData } from "../../store";
-import icon_bg from '../abnormal-pop/icon_bg.svg'
-import icon_close from '../abnormal-pop/icon_close.svg'
-import icon_btn from '../abnormal-pop/icon_btn.svg'
-import icon_success from '../abnormal-pop/icon_success.svg'
-import { data } from '../../page-instrument/custom-plugins/work-index'
-import { startCountdown } from "/src/page-instrument/evaluat-model/countdown"
+import icon_bg from "../abnormal-pop/icon_bg.svg";
+import icon_close from "../abnormal-pop/icon_close.svg";
+import icon_btn from "../abnormal-pop/icon_btn.svg";
+import icon_success from "../abnormal-pop/icon_success.svg";
+import { data } from "../../page-instrument/custom-plugins/work-index";
+import { startCountdown } from "/src/page-instrument/evaluat-model/countdown";
 
 const browserInfo = browser();
 
-let socketStartTime = 0
+let socketStartTime = 0;
 
 export const popImgs = {
-	icon_bg,
-	icon_close,
-	icon_btn,
-	icon_success
-}
+  icon_bg,
+  icon_close,
+  icon_btn,
+  icon_success,
+};
 
 export const evaluatingData = reactive({
-	/** 评测数据 */
-	contentData: {} as any,
-	/** 评测模块是否加载完成 */
-	rendered: false,
-	earphone: false, // 是否插入耳机
-	soundEffect: false, // 是否效音
-	soundEffectFrequency: 0, // 效音频率
-	checkStep: 0, // 执行步骤
-	checkEnd: false, // 检测结束
-	earphoneMode: false, // 耳机弹窗
-	soundEffectMode: false, // 效音弹窗
-	websocketState: false, // websocket连接状态
-	/**是否开始播放 */
-	startBegin: false, // 开始
-	backtime: 0, // 延迟时间
-	/** 已经评测的数据 */
-	evaluatings: {} as IEvaluatings,
-	/** 评测结果 */
-	resultData: {} as any,
-	/** 评测结果弹窗 */
-	resulstMode: false,
-	/** 是否是完整评测 */
-	isComplete: false,
-	/**  */
-	isDisabledPlayMusic: false,
-	/** socket异常状态弹窗 */
-	socketErrorPop: false,
-	/** 异常提示 */
-	errorContents: '',
-	/** socket异常状态弹窗的状态值 */
-	socketErrorStatus: 0,
-	/** 延迟检测,socket状态异常 */
-	delayCheckSocketError: false,
-	/** 异常状态,不生成评测记录,不调用保存接口 */
-	isErrorState: false,
-	/** accompanyError,错误类型 */
-	accompanyErrorType: '',	
-	/** app播放结束状态,重新评测需要重置为 */
-	isAudioPlayEnd: false,
-	preloadJson: true, // 预加载延迟检测的资源
-	jsonLoading: false, // 延迟检测的资源加载中状态
-	jsonLoadDone: false, // 延迟检测的动画dom加载完成状态
-	hideResultModal: false, // 评测作业,如果不是完整评测,需要隐藏评测结果弹窗
-	oneselfCancleEvaluating: false, // 是否是自主取消评测,自主取消评测,不生产评测记录
+  /** 评测数据 */
+  contentData: {} as any,
+  /** 评测模块是否加载完成 */
+  rendered: false,
+  earphone: false, // 是否插入耳机
+  soundEffect: false, // 是否效音
+  soundEffectFrequency: 0, // 效音频率
+  checkStep: 0, // 执行步骤
+  checkEnd: false, // 检测结束
+  earphoneMode: false, // 耳机弹窗
+  soundEffectMode: false, // 效音弹窗
+  websocketState: false, // websocket连接状态
+  /**是否开始播放 */
+  startBegin: false, // 开始
+  backtime: 0, // 延迟时间
+  /** 已经评测的数据 */
+  evaluatings: {} as IEvaluatings,
+  /** 评测结果 */
+  resultData: {} as any,
+  /** 评测结果弹窗 */
+  resulstMode: false,
+  /** 是否是完整评测 */
+  isComplete: false,
+  /**  */
+  isDisabledPlayMusic: false,
+  /** socket异常状态弹窗 */
+  socketErrorPop: false,
+  /** 异常提示 */
+  errorContents: "",
+  /** socket异常状态弹窗的状态值 */
+  socketErrorStatus: 0,
+  /** 延迟检测,socket状态异常 */
+  delayCheckSocketError: false,
+  /** 异常状态,不生成评测记录,不调用保存接口 */
+  isErrorState: false,
+  /** accompanyError,错误类型 */
+  accompanyErrorType: "",
+  /** app播放结束状态,重新评测需要重置为 */
+  isAudioPlayEnd: false,
+  preloadJson: true, // 预加载延迟检测的资源
+  jsonLoading: false, // 延迟检测的资源加载中状态
+  jsonLoadDone: false, // 延迟检测的动画dom加载完成状态
+  hideResultModal: false, // 评测作业,如果不是完整评测,需要隐藏评测结果弹窗
+  oneselfCancleEvaluating: false, // 是否是自主取消评测,自主取消评测,不生产评测记录
 });
 
 const sendOffsetTime = async (offsetTime: number) => {
-	const delayData = await api_getDeviceDelay();
-	api_midiMicDelay({
-		header: {
-			commond: 'audioPlayStart',
-			type: 'SOUND_COMPARE',
-		  },
-		  body: {
-			offsetTime,
-			micDelay: delayData?.content?.value
-		  },
-	})
-  }
+  const delayData = await api_getDeviceDelay();
+  api_midiMicDelay({
+    header: {
+      commond: "audioPlayStart",
+      type: "SOUND_COMPARE",
+    },
+    body: {
+      offsetTime,
+      micDelay: delayData?.content?.value,
+    },
+  });
+};
 
 /** 点击开始评测按钮 */
 export const handleStartEvaluat = async () => {
-	if (state.modeType === "evaluating") {
-		handleCancelEvaluat();
-	} else {
-		if (state.platform !== 'PC') {
-			// 评测前先检查APP端的websocket状态
-			const res = await api_checkSocketStatus();
-			if (res?.content?.status === "connected") {
-				handleStopPlay();
-			} else {
-				// socket未连接
-				// evaluatingData.socketErrorPop = true
-			}
-		} else {
-			handleStopPlay();
-		}
-	}
-	state.modeType = state.modeType === "evaluating" ? "practise" : "evaluating";
-	if (state.modeType !== "evaluating") {
-		// 切换到练习模式,卸载评测模块
-		evaluatingData.rendered = false;
-	}
+  if (state.modeType === "evaluating") {
+    handleCancelEvaluat();
+  } else {
+    if (state.platform !== "PC") {
+      // 评测前先检查APP端的websocket状态
+      const res = await api_checkSocketStatus();
+      if (res?.content?.status === "connected") {
+        handleStopPlay();
+      } else {
+        // socket未连接
+        // evaluatingData.socketErrorPop = true
+      }
+    } else {
+      handleStopPlay();
+    }
+  }
+  state.modeType = state.modeType === "evaluating" ? "practise" : "evaluating";
+  if (state.modeType !== "evaluating") {
+    // 切换到练习模式,卸载评测模块
+    evaluatingData.rendered = false;
+  }
 };
 
 /** 开始评测 & 延迟检测开始按钮 */
 export const startCheckDelay = async () => {
-	// 评测前先检查APP端的websocket状态
-	const res = await api_checkSocketStatus();
-	if (res?.content?.status === "connected") {
-		// 
-		return new Promise((resolve) => {
-			resolve({checked: true})
-		});
-	} else {
-		/** 
-		 * socket未连接,记录此时的时间,以便于和收到socket成功链接,进行对比,对比时间小于500ms时,则连接中的状态默认显示500ms持续时间
-		 * 
-		 * */ 
-		socketStartTime = +new Date()
-		evaluatingData.socketErrorPop = true
-		evaluatingData.socketErrorStatus = 1
-		return new Promise((resolve) => {
-			resolve({checked: false})
-		});
-	}
-}
+  // 评测前先检查APP端的websocket状态
+  const res = await api_checkSocketStatus();
+  if (res?.content?.status === "connected") {
+    //
+    return new Promise((resolve) => {
+      resolve({ checked: true });
+    });
+  } else {
+    /**
+     * socket未连接,记录此时的时间,以便于和收到socket成功链接,进行对比,对比时间小于500ms时,则连接中的状态默认显示500ms持续时间
+     *
+     * */
+    socketStartTime = +new Date();
+    evaluatingData.socketErrorPop = true;
+    evaluatingData.socketErrorStatus = 1;
+    return new Promise((resolve) => {
+      resolve({ checked: false });
+    });
+  }
+};
 
 const check_currentTime = () => {
-	let preTime = 0;
-	// 选段评测模式
-	if (state.isSelectMeasureMode) {
-		preTime = state.section[0].time * 1000;
-	}
-	const currentTime = getAudioCurrentTime() * 1000 - preTime;
-	// console.log('播放进度music', currentTime, 'preTime:' + preTime)
-
-	if (currentTime >= 500) {
-		sendEvaluatingOffsetTime(500);
-		return;
-	}
-	setTimeout(() => {
-		check_currentTime();
-	}, 10);
+  let preTime = 0;
+  // 选段评测模式
+  if (state.isSelectMeasureMode) {
+    preTime = state.section[0].time * 1000;
+  }
+  const currentTime = getAudioCurrentTime() * 1000 - preTime;
+  // console.log('播放进度music', currentTime, 'preTime:' + preTime)
+
+  if (currentTime >= 500) {
+    sendEvaluatingOffsetTime(500);
+    return;
+  }
+  setTimeout(() => {
+    check_currentTime();
+  }, 10);
 };
 
 /** 开始播放发送延迟时间 */
 export const sendEvaluatingOffsetTime = async (currentTime: number) => {
-	// 没有开始时间点, 不处理
-	if (!evaluatingData.backtime) return;
-	const nowTime = Date.now();
-	const delayTime = nowTime - evaluatingData.backtime - currentTime;
-	console.error("真正播放延迟", delayTime, "currentTime:", currentTime);
-	await api_proxyServiceMessage({
-		header: {
-			commond: "audioPlayStart",
-			type: "SOUND_COMPARE",
-		},
-		body: {
-			offsetTime: delayTime < 0 ? 0 : delayTime,
-			micDelay: 0,
-		},
-	});
+  // 没有开始时间点, 不处理
+  if (!evaluatingData.backtime) return;
+  const nowTime = Date.now();
+  const delayTime = nowTime - evaluatingData.backtime - currentTime;
+  console.error("真正播放延迟", delayTime, "currentTime:", currentTime);
+  await api_proxyServiceMessage({
+    header: {
+      commond: "audioPlayStart",
+      type: "SOUND_COMPARE",
+    },
+    body: {
+      offsetTime: delayTime < 0 ? 0 : delayTime,
+      micDelay: 0,
+    },
+  });
 };
 
 /** 检测耳机 */
 export const checkUseEarphone = async () => {
-	const res = await getEarphone();
-	return res?.content?.checkIsWired || false;
+  const res = await getEarphone();
+  return res?.content?.checkIsWired || false;
 };
 
 /**
  * 开始录音
  */
 const handleStartSoundCheck = () => {
-	startSoundCheck();
+  startSoundCheck();
 };
 /** 结束录音 */
 export const handleEndSoundCheck = () => {
-	endSoundCheck();
+  endSoundCheck();
 };
 
 /** 连接websocket */
 export const connectWebsocket = async (content: any) => {
-	evaluatingData.contentData = content;
-	evaluatingData.websocketState = true;
+  evaluatingData.contentData = content;
+  evaluatingData.websocketState = true;
 };
 
 /**
  * 执行检测
  */
 export const handlePerformDetection = async () => {
-	// 检测完成不检测了
-	if (evaluatingData.checkEnd) return;
-	// 延迟检测
-	if (evaluatingData.checkStep === 0) {
-		evaluatingData.checkStep = 5;
-		// 没有设备延迟数据 或 开启了效音 显示检测组件,并持续检测耳机状态
-		if (state.setting.soundEffect) {
-			evaluatingData.soundEffectMode = true;
-			return;
-		}
-		const delayTime = await api_getDeviceDelay();
-		console.log("🚀 ~ delayTime:", delayTime);
-		if (!delayTime) {
-			evaluatingData.soundEffectMode = true;
-			return;
-		}
-		handlePerformDetection();
-		return;
-	}
-	// 检测耳机
-	if ((evaluatingData.checkStep = 5)) {
-		evaluatingData.checkStep = 10;
-		const erji = await checkUseEarphone();
-		if (!erji) {
-			evaluatingData.earphoneMode = true;
-			return;
-		}
-		handlePerformDetection();
-		return;
-	}
-	// 效音
-	// if (evaluatingData.checkStep === 7) {
-	// 	// 是否需要开启效音
-	// 	evaluatingData.checkStep = 10;
-	// 	if (state.setting.soundEffect && !state.isPercussion) {
-	// 		evaluatingData.soundEffectMode = true;
-	// 		handleStartSoundCheck();
-	// 		return
-	// 	}
-	// 	handlePerformDetection();
-	// 	return;
-	// }
-	// 效验完成
-	if (evaluatingData.checkStep === 10) {
-		evaluatingData.checkEnd = true;
-	}
+  // 检测完成不检测了
+  if (evaluatingData.checkEnd) return;
+  // 延迟检测
+  if (evaluatingData.checkStep === 0) {
+    evaluatingData.checkStep = 5;
+    // 没有设备延迟数据 或 开启了效音 显示检测组件,并持续检测耳机状态
+    if (state.setting.soundEffect) {
+      evaluatingData.soundEffectMode = true;
+      return;
+    }
+    const delayTime = await api_getDeviceDelay();
+    console.log("🚀 ~ delayTime:", delayTime);
+    if (!delayTime) {
+      evaluatingData.soundEffectMode = true;
+      return;
+    }
+    handlePerformDetection();
+    return;
+  }
+  // 检测耳机
+  if ((evaluatingData.checkStep = 5)) {
+    evaluatingData.checkStep = 10;
+    const erji = await checkUseEarphone();
+    if (!erji) {
+      evaluatingData.earphoneMode = true;
+      return;
+    }
+    handlePerformDetection();
+    return;
+  }
+  // 效音
+  // if (evaluatingData.checkStep === 7) {
+  // 	// 是否需要开启效音
+  // 	evaluatingData.checkStep = 10;
+  // 	if (state.setting.soundEffect && !state.isPercussion) {
+  // 		evaluatingData.soundEffectMode = true;
+  // 		handleStartSoundCheck();
+  // 		return
+  // 	}
+  // 	handlePerformDetection();
+  // 	return;
+  // }
+  // 效验完成
+  if (evaluatingData.checkStep === 10) {
+    evaluatingData.checkEnd = true;
+  }
 };
 
 /** 记录小节分数 */
 export const addMeasureScore = (measureScore: any, show = true) => {
-	// #8720 bug修复
-	for(let idx in evaluatingData.evaluatings) {
-		evaluatingData.evaluatings[idx].show = false
-	}
-	evaluatingData.evaluatings[measureScore.measureRenderIndex] = {
-		...measureScore,
-		leve: getLeveByScoreMeasure(measureScore.score),
-		show,
-	};
-	// console.log("🚀 ~ measureScore:", evaluatingData.evaluatings)
+  // #8720 bug修复
+  for (let idx in evaluatingData.evaluatings) {
+    evaluatingData.evaluatings[idx].show = false;
+  }
+  evaluatingData.evaluatings[measureScore.measureRenderIndex] = {
+    ...measureScore,
+    leve: getLeveByScoreMeasure(measureScore.score),
+    show,
+  };
+  // console.log("🚀 ~ measureScore:", evaluatingData.evaluatings)
 };
 
 const handleScoreResult = (res?: IPostMessage) => {
-	console.log('返回', res,evaluatingData.oneselfCancleEvaluating)
-	// 如果是手动取消评测,不生成评测记录
-	if (evaluatingData.oneselfCancleEvaluating) {
-		return;
-	}
-	if (res?.content) {
-		const { header, body } = res.content;
-		// 效音返回
-		if (header.commond === "checking") {
-			evaluatingData.soundEffectFrequency = body.frequency;
-		}
-		// 小节评分返回
-		if (header?.commond === "measureScore") {
-			console.log("🚀 ~ 评测返回:", res);
-			addMeasureScore(body);
-		}
-		// 评测结束返回
-		if (header?.commond === "overall") {
-			console.log("🚀 ~ 评测返回:", res);
-			console.log("评测结束", body);
-			state.isHideEvaluatReportSaveBtn = false;
-			setTimeout(() => {
-				// 评测作业,如果不是完整评测,不展示评测弹窗
-				if (data.trainingType === 'EVALUATION' && !evaluatingData.isComplete) {
-					evaluatingData.hideResultModal = true;
-				} else {
-					evaluatingData.hideResultModal = false;
-				}
-				evaluatingData.resulstMode = evaluatingData.isErrorState ? false : true
-			}, 200);
-			evaluatingData.resultData = {
-				...body,
-				...getLeveByScore(body.score),
-			};
-			// console.log("🚀 ~ evaluatingData.resultData:", evaluatingData.resultData)
-			closeToast();
-		}
-	}
+  console.log("返回", res, evaluatingData.oneselfCancleEvaluating);
+  // 如果是手动取消评测,不生成评测记录
+  if (evaluatingData.oneselfCancleEvaluating) {
+    return;
+  }
+  if (res?.content) {
+    const { header, body } = res.content;
+    // 效音返回
+    if (header.commond === "checking") {
+      evaluatingData.soundEffectFrequency = body.frequency;
+    }
+    // 小节评分返回
+    if (header?.commond === "measureScore") {
+      console.log("🚀 ~ 评测返回:", res);
+      addMeasureScore(body);
+    }
+    // 评测结束返回
+    if (header?.commond === "overall") {
+      console.log("🚀 ~ 评测返回:", res);
+      console.log("评测结束", body);
+      state.isHideEvaluatReportSaveBtn = false;
+      setTimeout(() => {
+        // 评测作业,如果不是完整评测,不展示评测弹窗
+        if (data.trainingType === "EVALUATION" && !evaluatingData.isComplete) {
+          evaluatingData.hideResultModal = true;
+        } else {
+          evaluatingData.hideResultModal = false;
+        }
+        evaluatingData.resulstMode = evaluatingData.isErrorState ? false : true;
+      }, 200);
+      evaluatingData.resultData = {
+        ...body,
+        ...getLeveByScore(body.score),
+      };
+      // console.log("🚀 ~ evaluatingData.resultData:", evaluatingData.resultData)
+      closeToast();
+    }
+  }
 };
 
 /** 开始评测 */
 export const handleStartBegin = async (preTimes?: number) => {
-	if (state.isAppPlay) {
-		await api_cloudSetCurrentTime({
-			currentTime: 0,
-			songID: state.examSongId,
-		})
-	}
-	evaluatingData.isComplete = false;
-	evaluatingData.evaluatings = {};
-	evaluatingData.resultData = {};
-	evaluatingData.backtime = 0;
-	resetPlaybackToStart();
-	evaluatingData.isAudioPlayEnd = false;
-	const res = await startEvaluating(evaluatingData.contentData);
-	if (res?.api !== "startEvaluating") {
-		Snackbar.error("请在APP端进行评测");
-		evaluatingData.startBegin = false;
-		return;
-	}
-	if (res?.content?.reson) {
-		showToast(res.content?.des);
-		evaluatingData.startBegin = false;
-		return;
-	}
-	evaluatingData.startBegin = true;
-	if (evaluatingData.isDisabledPlayMusic) {
-		// 先播放倒计时
-		await startCountdown()
-		state.playState = state.playState === "paused" ? "play" : "paused";
-		// 设置为开始播放时, 如果需要节拍,先播放节拍器
-		if (state.playState === "play" && (state.playType==="play"&&state.needTick)||(state.playType==="sing"&&state.needSingTick)) {
-			// 如果是系统节拍器 等系统节拍器播完了再播,如果是mp3节拍器 直接播
-			if((state.playType==="play" && !state.isOpenMetronome)||(state.playType==="sing" && !state.isSingOpenMetronome)){
-				const tickend = await handleStartTick();
-				console.log("🚀 ~ tickend:", tickend)
-				// 节拍器返回false, 取消播放
-				if (!tickend) {
-					state.playState = "paused";
-					evaluatingData.startBegin = false;
-					return;
-				}
-			}else{
-				handleStartTick()
-			}
-		}
-		onPlay();
-	}
-	if (evaluatingData.isErrorState) return
-	//开始录音
-	// await api_startRecording({
-	// 	accompanimentState: state.setting.enableAccompaniment ? 1 : 0,
-	// 	firstNoteTime: preTimes || 0,
-	// });
-	let rate = state.speed / state.originSpeed;
-	rate = parseFloat(rate.toFixed(2));
-	await api_startRecordingCb({
-		accompanimentState: state.setting.enableAccompaniment ? 1 : 0,
-		firstNoteTime: preTimes || 0,
-		speedRate: rate, // 播放倍率
-	}, () => {
-		if (state.isAppPlay) {
-			setTimeout(() => {
-				sendOffsetTime(0)
-			}, 300);
-		}
-	})
-	// 如果开启了摄像头, 开启录制视频
-	if (state.setting.camera) {
-		console.log("开始录制视频");
-		await api_startCapture();
-	}
-	// 如果是midi音频评测,需要调用cloudPlay
-	if (state.isAppPlay) {
-		await api_cloudChangeSpeed({
-			speed: state.originSpeed,
-			originalSpeed: state.originSpeed,
-			songID: state.examSongId,
-		});
-		audioData.progress = 0
-		audioListStart(state.playState);
-	}
-	evaluatingData.oneselfCancleEvaluating = false;
+  if (state.isAppPlay) {
+    await api_cloudSetCurrentTime({
+      currentTime: 0,
+      songID: state.examSongId,
+    });
+  }
+  evaluatingData.isComplete = false;
+  evaluatingData.evaluatings = {};
+  evaluatingData.resultData = {};
+  evaluatingData.backtime = 0;
+  resetPlaybackToStart();
+  evaluatingData.isAudioPlayEnd = false;
+  const res = await startEvaluating(evaluatingData.contentData);
+  if (res?.api !== "startEvaluating") {
+    Snackbar.error("请在APP端进行评测");
+    evaluatingData.startBegin = false;
+    return;
+  }
+  if (res?.content?.reson) {
+    showToast(res.content?.des);
+    evaluatingData.startBegin = false;
+    return;
+  }
+  evaluatingData.startBegin = true;
+  if (evaluatingData.isDisabledPlayMusic) {
+    // 先播放倒计时
+    await startCountdown();
+    state.playState = state.playState === "paused" ? "play" : "paused";
+    // 设置为开始播放时, 如果需要节拍,先播放节拍器
+    if ((state.playState === "play" && state.playType === "play" && state.needTick) || (state.playType === "sing" && state.needSingTick)) {
+      // 如果是系统节拍器 等系统节拍器播完了再播,如果是mp3节拍器 直接播
+      if ((state.playType === "play" && !state.isOpenMetronome) || (state.playType === "sing" && !state.isSingOpenMetronome)) {
+        const tickend = await handleStartTick();
+        console.log("🚀 ~ tickend:", tickend);
+        // 节拍器返回false, 取消播放
+        if (!tickend) {
+          state.playState = "paused";
+          evaluatingData.startBegin = false;
+          return;
+        }
+      } else {
+        handleStartTick();
+      }
+    }
+    onPlay();
+  }
+  if (evaluatingData.isErrorState) return;
+  //开始录音
+  // await api_startRecording({
+  // 	accompanimentState: state.setting.enableAccompaniment ? 1 : 0,
+  // 	firstNoteTime: preTimes || 0,
+  // });
+  let rate = state.speed / state.originSpeed;
+  rate = parseFloat(rate.toFixed(2));
+  await api_startRecordingCb(
+    {
+      accompanimentState: state.setting.enableAccompaniment ? 1 : 0,
+      firstNoteTime: preTimes || 0,
+      speedRate: rate, // 播放倍率
+    },
+    () => {
+      if (state.isAppPlay) {
+        setTimeout(() => {
+          sendOffsetTime(0);
+        }, 300);
+      }
+    }
+  );
+  // 如果开启了摄像头, 开启录制视频
+  if (state.setting.camera) {
+    console.log("开始录制视频");
+    await api_startCapture();
+  }
+  // 如果是midi音频评测,需要调用cloudPlay
+  if (state.isAppPlay) {
+    await api_cloudChangeSpeed({
+      speed: state.originSpeed,
+      originalSpeed: state.originSpeed,
+      songID: state.examSongId,
+    });
+    audioData.progress = 0;
+    audioListStart(state.playState);
+  }
+  evaluatingData.oneselfCancleEvaluating = false;
 };
 
 /** 播放音乐 */
 const playMusic = async () => {
-	const playState = await togglePlay("play");
-	// 取消播放,停止播放
-	if (!playState) {
-		evaluatingData.startBegin = false;
-		handleCancelEvaluat();
-		return;
-	}
-	// 检测播放进度, 计算延迟
-	check_currentTime();
-
-	// 如果开启了摄像头, 开启录制视频
-	if (state.setting.camera) {
-		console.log("开始录制视频");
-		api_startCapture();
-	}
+  const playState = await togglePlay("play");
+  // 取消播放,停止播放
+  if (!playState) {
+    evaluatingData.startBegin = false;
+    handleCancelEvaluat();
+    return;
+  }
+  // 检测播放进度, 计算延迟
+  check_currentTime();
+
+  // 如果开启了摄像头, 开启录制视频
+  if (state.setting.camera) {
+    console.log("开始录制视频");
+    api_startCapture();
+  }
 };
 
 let _audio: HTMLAudioElement;
 
 /** 录音开始,记录开始时间点 */
 const recordStartTimePoint = async (res?: IPostMessage) => {
-	console.error("开始录音");
-	// 没有开始评测,不处理
-	if (!evaluatingData.startBegin) return;
-	let inteveral = res?.content?.inteveral || 0;
-	if (browserInfo.ios) {
-		inteveral *= 1000;
-	}
-	evaluatingData.backtime = inteveral || Date.now();
-	console.log(
-		"🚀 ~ 开始时间点:",
-		evaluatingData.backtime,
-		"已经录的时间:",
-		Date.now() - inteveral,
-		"记录时间点:",
-		Date.now()
-	);
-	// 是否禁播
-	if (evaluatingData.isDisabledPlayMusic) {
-		return;
-	}
-	// 开始播放
-	playMusic();
+  console.error("开始录音");
+  // 没有开始评测,不处理
+  if (!evaluatingData.startBegin) return;
+  let inteveral = res?.content?.inteveral || 0;
+  if (browserInfo.ios) {
+    inteveral *= 1000;
+  }
+  evaluatingData.backtime = inteveral || Date.now();
+  console.log("🚀 ~ 开始时间点:", evaluatingData.backtime, "已经录的时间:", Date.now() - inteveral, "记录时间点:", Date.now());
+  // 是否禁播
+  if (evaluatingData.isDisabledPlayMusic) {
+    return;
+  }
+  // 开始播放
+  playMusic();
 };
 
 /**
@@ -480,309 +469,302 @@ const recordStartTimePoint = async (res?: IPostMessage) => {
  * @returns
  */
 export const handleEndEvaluat = (isComplete = false) => {
-	// 没有开始评测 , 不是评测模式 , 不评分
-	if (!evaluatingData.startBegin || state.modeType !== "evaluating") return;
-	// 结束录音
-	// api_stopRecording();
-	// 结束评测
-	console.log('评测结束1')
-	endEvaluating({
-		musicScoreId: state.examSongId,
-	});
-	// 评测作业如果不是完整评测,给出提示
-    if (!isComplete && data.trainingType === 'EVALUATION') {
-		showToast({
-			message: "完整演奏结束才算作业分数!",
-		});
-	} else {
-		showLoadingToast({
-			message: "评分中",
-			duration: 0,
-			overlay: true,
-			overlayClass: styles.scoreMode,
-		});
-	}
-	setTimeout(() => {
-		evaluatingData.startBegin = false;
-	}, 500);
-	evaluatingData.isComplete = isComplete;
-	// 如果开启了摄像头, 结束录制视频
-	if (state.setting.camera) {
-		console.log("结束录制视频");
-		api_endCapture();
-	}
+  // 没有开始评测 , 不是评测模式 , 不评分
+  if (!evaluatingData.startBegin || state.modeType !== "evaluating") return;
+  // 结束录音
+  // api_stopRecording();
+  // 结束评测
+  console.log("评测结束1");
+  endEvaluating({
+    musicScoreId: state.examSongId,
+  });
+  // 评测作业如果不是完整评测,给出提示
+  if (!isComplete && data.trainingType === "EVALUATION") {
+    showToast({
+      message: "完整演奏结束才算作业分数!",
+    });
+  } else {
+    showLoadingToast({
+      message: "评分中",
+      duration: 0,
+      overlay: true,
+      overlayClass: styles.scoreMode,
+    });
+  }
+  setTimeout(() => {
+    evaluatingData.startBegin = false;
+  }, 500);
+  evaluatingData.isComplete = isComplete;
+  // 如果开启了摄像头, 结束录制视频
+  if (state.setting.camera) {
+    console.log("结束录制视频");
+    api_endCapture();
+  }
 };
 
 /**
  * 结束评测(手动结束评测)
  */
 export const handleEndBegin = () => {
-	handleEndEvaluat();
-	handleStopPlay();
+  handleEndEvaluat();
+  handleStopPlay();
 };
 
 /**
  * 取消评测
  */
 export const handleCancelEvaluat = (cancelType?: string) => {
-	evaluatingData.evaluatings = {};
-	evaluatingData.startBegin = false;
-	// 关闭提示
-	closeToast();
-	// 取消记录
-	api_proxyServiceMessage({
-		header: {
-			commond: "recordCancel",
-			type: "SOUND_COMPARE",
-			status: 200,
-		},
-	});
-	/**
-	 * 异常状态是取消评测(cancelEvaluating),正常结束时结束评测(endEvaluating)
-	 */
-	// if (cancelType === "cancel") {
-	// 	// 取消评测
-	// 	cancelEvaluating();
-	// } else {
-	// 	endEvaluating({
-	// 		musicScoreId: state.examSongId,
-	// 	});
-	// }
-	
-	cancelEvaluating();
-	// 停止播放
-	handleStopPlay();
-	console.log('评测结束2')
-	endEvaluating({
-		musicScoreId: state.examSongId,
-	});
-	// 如果开启了摄像头, 结束录制视频
-	if (state.setting.camera) {
-		console.log("结束录制视频");
-		api_endCapture();
-	}
+  evaluatingData.evaluatings = {};
+  evaluatingData.startBegin = false;
+  // 关闭提示
+  closeToast();
+  // 取消记录
+  api_proxyServiceMessage({
+    header: {
+      commond: "recordCancel",
+      type: "SOUND_COMPARE",
+      status: 200,
+    },
+  });
+  /**
+   * 异常状态是取消评测(cancelEvaluating),正常结束时结束评测(endEvaluating)
+   */
+  // if (cancelType === "cancel") {
+  // 	// 取消评测
+  // 	cancelEvaluating();
+  // } else {
+  // 	endEvaluating({
+  // 		musicScoreId: state.examSongId,
+  // 	});
+  // }
+
+  cancelEvaluating();
+  // 停止播放
+  handleStopPlay();
+  console.log("评测结束2");
+  endEvaluating({
+    musicScoreId: state.examSongId,
+  });
+  // 如果开启了摄像头, 结束录制视频
+  if (state.setting.camera) {
+    console.log("结束录制视频");
+    api_endCapture();
+  }
 };
 
 /** 查看报告 */
-export const handleViewReport = (
-	key: "recordId" | "recordIdStr",
-	type: "gym" | "colexiu" | "orchestra" | "instrument"
-) => {
-	const id = evaluatingData.resultData?.[key] || "";
-	let url = "";
-	switch (type) {
-		case "gym":
-			url = location.origin + location.pathname + "#/report/" + id;
-			break;
-		case "orchestra":
-			url = location.origin + location.pathname + "report-share.html?id=" + id;
-			break;
-		case "instrument":
-			url = location.origin + location.pathname + "#/evaluat-report?id=" + id + "&musicRenderType=" + state.musicRenderType;
-			break;
-		default:
-			url = location.origin + location.pathname + "report-share.html?id=" + id;
-			break;
-	}
-	api_openWebView({
-		url,
-		orientation: 0,
-		isHideTitle: true, // 此处兼容安卓,意思为隐藏全部头部
-		statusBarTextColor: false,
-		isOpenLight: true,
-		c_orientation: 0,
-	});
+export const handleViewReport = (key: "recordId" | "recordIdStr", type: "gym" | "colexiu" | "orchestra" | "instrument") => {
+  const id = evaluatingData.resultData?.[key] || "";
+  let url = "";
+  switch (type) {
+    case "gym":
+      url = location.origin + location.pathname + "#/report/" + id;
+      break;
+    case "orchestra":
+      url = location.origin + location.pathname + "report-share.html?id=" + id;
+      break;
+    case "instrument":
+      url = location.origin + location.pathname + "#/evaluat-report?id=" + id + "&musicRenderType=" + state.musicRenderType;
+      break;
+    default:
+      url = location.origin + location.pathname + "report-share.html?id=" + id;
+      break;
+  }
+  api_openWebView({
+    url,
+    orientation: 0,
+    isHideTitle: true, // 此处兼容安卓,意思为隐藏全部头部
+    statusBarTextColor: false,
+    isOpenLight: true,
+    c_orientation: 0,
+  });
 };
 
 // 隐藏存演奏按钮
 const handleComplexButton = (res?: IPostMessage) => {
-	console.log('监听是否隐藏保存按钮', res)
-	if (res?.content) {
-		const { header, body } = res.content;
-		state.isHideEvaluatReportSaveBtn = true
-	}
+  console.log("监听是否隐藏保存按钮", res);
+  if (res?.content) {
+    const { header, body } = res.content;
+    state.isHideEvaluatReportSaveBtn = true;
+  }
 };
 
 // 检测到APP发送的异常信息
 const handleAccompanyError = (res?: IPostMessage) => {
-	console.log('异常信息返回', res)
-	if (res?.content) {
-		const { type, reson } = res.content;
-		switch (type) {
-			case "enterBackground":
-				// App退到后台
-			case "playError":
-				// 播放异常
-			case "socketError":
-				// socket连接断开,评测中,则取消评测
-				// 延迟检测中
-				if (evaluatingData.soundEffectMode) {
-					evaluatingData.socketErrorStatus = 0
-					evaluatingData.delayCheckSocketError = true
-					evaluatingData.socketErrorPop = type === "socketError" ? true : false
-					evaluatingData.accompanyErrorType = type
-					// api_checkSocketStatus()
-					return
-				}
-				// 评测中
-				if (state.modeType === "evaluating" && evaluatingData.startBegin) {
-					handleCancelEvaluat('cancel');
-				}
-				// 关闭节拍器
-				closeTick()
-				evaluatingData.socketErrorStatus = 0
-				evaluatingData.socketErrorPop = type === "socketError" ? true : false
-				evaluatingData.isErrorState = true
-				evaluatingData.accompanyErrorType = type
-				resetPlaybackToStart();
-				break;	
-			case "recordError":
-				// 录音异常
-				break;											
-			default:
-				break;
-		}
-	}
+  console.log("异常信息返回", res);
+  if (res?.content) {
+    const { type, reson } = res.content;
+    switch (type) {
+      case "enterBackground":
+      // App退到后台
+      case "playError":
+      // 播放异常
+      case "socketError":
+        // socket连接断开,评测中,则取消评测
+        // 延迟检测中
+        if (evaluatingData.soundEffectMode) {
+          evaluatingData.socketErrorStatus = 0;
+          evaluatingData.delayCheckSocketError = true;
+          evaluatingData.socketErrorPop = type === "socketError" ? true : false;
+          evaluatingData.accompanyErrorType = type;
+          // api_checkSocketStatus()
+          return;
+        }
+        // 评测中
+        if (state.modeType === "evaluating" && evaluatingData.startBegin) {
+          handleCancelEvaluat("cancel");
+        }
+        // 关闭节拍器
+        closeTick();
+        evaluatingData.socketErrorStatus = 0;
+        evaluatingData.socketErrorPop = type === "socketError" ? true : false;
+        evaluatingData.isErrorState = true;
+        evaluatingData.accompanyErrorType = type;
+        resetPlaybackToStart();
+        break;
+      case "recordError":
+        // 录音异常
+        break;
+      default:
+        break;
+    }
+  }
 };
 
 // 监测socket状态,是否已经成功连接
 const handleSocketStatus = (res?: IPostMessage) => {
-	if (res?.content?.status === "connected") {
-		const currentTime = +new Date()
-		evaluatingData.delayCheckSocketError = false
-		const diffTime = currentTime - socketStartTime
-		if (diffTime < 1000) {
-			const remainingTime = 1000 - diffTime
-			console.log(remainingTime,99999)
-			setTimeout(() => {
-				evaluatingData.socketErrorStatus = 2
-			}, remainingTime);
-		}
-	}
-}
+  if (res?.content?.status === "connected") {
+    const currentTime = +new Date();
+    evaluatingData.delayCheckSocketError = false;
+    const diffTime = currentTime - socketStartTime;
+    if (diffTime < 1000) {
+      const remainingTime = 1000 - diffTime;
+      console.log(remainingTime, 99999);
+      setTimeout(() => {
+        evaluatingData.socketErrorStatus = 2;
+      }, remainingTime);
+    }
+  }
+};
 
 // 评测出现异常,再试一次
 const hanldeConfirmPop = async () => {
-	api_checkSocketStatus();
-	evaluatingData.socketErrorStatus = 1
-	socketStartTime = +new Date()
-}
+  api_checkSocketStatus();
+  evaluatingData.socketErrorStatus = 1;
+  socketStartTime = +new Date();
+};
 
 // 关闭异常弹窗
 const hanldeClosePop = () => {
-	evaluatingData.socketErrorPop = false
-	evaluatingData.socketErrorStatus = 0
-}
+  evaluatingData.socketErrorPop = false;
+  evaluatingData.socketErrorStatus = 0;
+};
 
 export default defineComponent({
-	name: "evaluating",
-	setup() {
-		const pageVisibility = usePageVisibility();
-		// 需要记录的数据
-		const record_old_data = reactive({
-			/** 指法 */
-			finger: false,
-			/** 原音伴奏 */
-			play_mode: "" as IPlayState,
-			/** 评测是否要伴奏 */
-			enableAccompaniment: true,
-		});
-		/** 记录状态 */
-		const hanlde_record = () => {
-			// 取消指法
-			record_old_data.finger = state.setting.displayFingering;
-			state.setting.displayFingering = false;
-			// 切换为伴奏
-			record_old_data.play_mode = state.playSource;
-			record_old_data.enableAccompaniment = state.setting.enableAccompaniment;
-			// 如果关闭伴奏,评测静音
-			if (!record_old_data.enableAccompaniment) {
-				console.log("关闭伴奏");
-				toggleMutePlayAudio(record_old_data.play_mode === "music" ? "music" : record_old_data.play_mode === "background" ? "background" : "mingSong", true);
-			}
-		};
-		/** 还原状态 */
-		const handle_reduction = () => {
-			// 还原指法
-			state.setting.displayFingering = record_old_data.finger;
-			state.playSource = record_old_data.play_mode;
-
-			// 如果关闭伴奏, 结束评测取消静音
-			if (!record_old_data.enableAccompaniment) {
-				toggleMutePlayAudio(record_old_data.play_mode === "music" ? "music" : record_old_data.play_mode === "background" ? "background" : "mingSong", false);
-			}
-		};
-
-		watch(pageVisibility, (value) => {
-			if (value == "hidden" && evaluatingData.startBegin) {
-				// handleEndBegin();
-			}
-		});
-		watch(
-			() => evaluatingData.socketErrorStatus,
-			() => {
-				if (evaluatingData.socketErrorStatus === 2) {
-					setTimeout(() => {
-						evaluatingData.socketErrorPop = false
-						// evaluatingData.socketErrorStatus = 0
-					}, 1000);
-				}
-			}
-		);
-		onMounted(() => {
-			resetPlaybackToStart();
-			hanlde_record();
-			evaluatingData.resultData = {};
-
-			// evaluatingData.resulstMode = true;
-			// evaluatingData.resultData = {...getLeveByScore(10), score: 10, intonation: 10, cadence: 30, integrity: 40}
-			// console.log("🚀 ~ evaluatingData.resultData:", evaluatingData.resultData)
-
-			evaluatingData.evaluatings = {};
-			evaluatingData.soundEffectFrequency = 0;
-			evaluatingData.checkStep = 0;
-			evaluatingData.rendered = true;
-			sendResult(handleScoreResult);
-			hideComplexButton(handleComplexButton, true);
-			api_recordStartTime(recordStartTimePoint);
-			addAccompanyError(handleAccompanyError);
-			addSocketStatus(handleSocketStatus);
-			// 不是选段模式评测, 就清空已选段
-			if (!state.isSelectMeasureMode) {
-				clearSelection();
-			}
-			console.log("加载评测模块成功");
-		});
-		onUnmounted(() => {
-			evaluatingData.checkEnd = false;
-			evaluatingData.rendered = false;
-			resetPlaybackToStart();
-			removeResult(handleScoreResult);
-			hideComplexButton(() => {}, false);
-			api_remove_recordStartTime(recordStartTimePoint);
-			handle_reduction();
-			removeAccompanyError(handleAccompanyError);
-			removeSocketStatus(handleSocketStatus);
-			api_disconnectSocket();
-			console.log("卸载评测模块成功");
-		});
-		return () => (
-			<div>
-				{/** 预加载一下断网需要用到的图片 */}
-				<div class={styles.hiddenPop}>
-					<img src={popImgs.icon_bg} />
-					<img src={popImgs.icon_btn} />
-					<img src={popImgs.icon_success} />
-					<img src={popImgs.icon_close} />
-				</div>
-				<Popup teleport="body" closeOnClickOverlay={false} class={["popup-custom", "van-scale"]} transition="van-scale" v-model:show={evaluatingData.socketErrorPop}>
-					<AbnormalPop 
-						onConfirm={hanldeConfirmPop}
-						onClose={hanldeClosePop} 
-					/>
-				</Popup>
-
-			</div>
-		);
-	},
+  name: "evaluating",
+  setup() {
+    const pageVisibility = usePageVisibility();
+    // 需要记录的数据
+    const record_old_data = reactive({
+      /** 指法 */
+      finger: false,
+      /** 原音伴奏 */
+      play_mode: "" as IPlayState,
+      /** 评测是否要伴奏 */
+      enableAccompaniment: true,
+    });
+    /** 记录状态 */
+    const hanlde_record = () => {
+      // 取消指法
+      record_old_data.finger = state.setting.displayFingering;
+      state.setting.displayFingering = false;
+      // 切换为伴奏
+      record_old_data.play_mode = state.playSource;
+      record_old_data.enableAccompaniment = state.setting.enableAccompaniment;
+      // 如果关闭伴奏,评测静音
+      if (!record_old_data.enableAccompaniment) {
+        console.log("关闭伴奏");
+        toggleMutePlayAudio(record_old_data.play_mode === "music" ? "music" : record_old_data.play_mode === "background" ? "background" : "mingSong", true);
+      }
+    };
+    /** 还原状态 */
+    const handle_reduction = () => {
+      // 还原指法
+      state.setting.displayFingering = record_old_data.finger;
+      state.playSource = record_old_data.play_mode;
+
+      // 如果关闭伴奏, 结束评测取消静音
+      if (!record_old_data.enableAccompaniment) {
+        toggleMutePlayAudio(record_old_data.play_mode === "music" ? "music" : record_old_data.play_mode === "background" ? "background" : "mingSong", false);
+      }
+    };
+
+    watch(pageVisibility, (value) => {
+      if (value == "hidden" && evaluatingData.startBegin) {
+        // handleEndBegin();
+      }
+    });
+    watch(
+      () => evaluatingData.socketErrorStatus,
+      () => {
+        if (evaluatingData.socketErrorStatus === 2) {
+          setTimeout(() => {
+            evaluatingData.socketErrorPop = false;
+            // evaluatingData.socketErrorStatus = 0
+          }, 1000);
+        }
+      }
+    );
+    onMounted(() => {
+      resetPlaybackToStart();
+      hanlde_record();
+      evaluatingData.resultData = {};
+
+      // evaluatingData.resulstMode = true;
+      // evaluatingData.resultData = {...getLeveByScore(10), score: 10, intonation: 10, cadence: 30, integrity: 40}
+      // console.log("🚀 ~ evaluatingData.resultData:", evaluatingData.resultData)
+
+      evaluatingData.evaluatings = {};
+      evaluatingData.soundEffectFrequency = 0;
+      evaluatingData.checkStep = 0;
+      evaluatingData.rendered = true;
+      sendResult(handleScoreResult);
+      hideComplexButton(handleComplexButton, true);
+      api_recordStartTime(recordStartTimePoint);
+      addAccompanyError(handleAccompanyError);
+      addSocketStatus(handleSocketStatus);
+      // 不是选段模式评测, 就清空已选段
+      if (!state.isSelectMeasureMode) {
+        clearSelection();
+      }
+      console.log("加载评测模块成功");
+    });
+    onUnmounted(() => {
+      evaluatingData.checkEnd = false;
+      evaluatingData.rendered = false;
+      resetPlaybackToStart();
+      removeResult(handleScoreResult);
+      hideComplexButton(() => {}, false);
+      api_remove_recordStartTime(recordStartTimePoint);
+      handle_reduction();
+      removeAccompanyError(handleAccompanyError);
+      removeSocketStatus(handleSocketStatus);
+      api_disconnectSocket();
+      console.log("卸载评测模块成功");
+    });
+    return () => (
+      <div>
+        {/** 预加载一下断网需要用到的图片 */}
+        <div class={styles.hiddenPop}>
+          <img src={popImgs.icon_bg} />
+          <img src={popImgs.icon_btn} />
+          <img src={popImgs.icon_success} />
+          <img src={popImgs.icon_close} />
+        </div>
+        <Popup teleport="body" closeOnClickOverlay={false} class={["popup-custom", "van-scale"]} transition="van-scale" v-model:show={evaluatingData.socketErrorPop}>
+          <AbnormalPop onConfirm={hanldeConfirmPop} onClose={hanldeClosePop} />
+        </Popup>
+      </div>
+    );
+  },
 });