index.tsx 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596
  1. import { Transition, defineComponent, onMounted, reactive, watch, defineAsyncComponent, computed, onUnmounted } from "vue";
  2. import { connectWebsocket, evaluatingData, handleEndBegin, handleStartBegin, handleStartEvaluat, handleViewReport, startCheckDelay, checkUseEarphone, handleCancelEvaluat, checkMinInterval, handleEndEvaluat } from "/src/view/evaluating";
  3. import Earphone from "./earphone";
  4. import styles from "./index.module.less";
  5. import SoundEffect from "./sound-effect";
  6. import state, { handleRessetState, resetPlaybackToStart, musicalInstrumentCodeInfo, clearSelection, initSetPlayRate } from "/src/state";
  7. import { storeData } from "/src/store";
  8. import { browser } from "/src/utils";
  9. import { getNoteByMeasuresSlursStart } from "/src/helpers/formateMusic";
  10. import { Icon, Popup, showToast, closeToast, showLoadingToast } from "vant";
  11. import EvaluatResult from "./evaluat-result";
  12. import EvaluatAudio from "./evaluat-audio";
  13. import { api_getDeviceDelay, api_openAdjustRecording, api_proxyServiceMessage, api_videoUpdate, getEarphone, api_back, api_startDelayCheck, api_cancelDelayCheck, api_remove_cancelDelayCheck, api_closeDelayCheck, api_finishDelayCheck, api_retryEvaluating, api_remove_finishDelayCheck } from "/src/helpers/communication";
  14. import EvaluatShare from "./evaluat-share";
  15. import { Vue3Lottie } from "vue3-lottie";
  16. import startData from "./data/start.json";
  17. import startingData from "./data/starting.json";
  18. import iconTastBg from "./icons/task-bg.svg";
  19. import iconEvaluat from "./icons/evaluating.json";
  20. import { headImg } from "/src/page-instrument/header-top/image";
  21. import { api_musicPracticeRecordVideoUpload } from "../api";
  22. import { headTopData } from "../header-top/index";
  23. import { getQuery } from "/src/utils/queryString";
  24. import Countdown from "./countdown";
  25. import { IPostMessage } from "/src/utils/native-message";
  26. // const DelayCheck = defineAsyncComponent(() =>
  27. // import('./delay-check')
  28. // )
  29. // frequency 频率, amplitude 振幅, decibels 分贝
  30. type TCriteria = "frequency" | "amplitude" | "decibels";
  31. /**
  32. * 节拍器时长
  33. * 评测模式时,应该传节拍器时长
  34. * 阶段评测时,判断是否从第一小节开始,并且曲子本身含有节拍器,需要传节拍器时长,否则传0
  35. */
  36. let actualBeatLength = 0;
  37. let calculateInfo: any = {};
  38. let checkErjiTimer: any = null
  39. export const reCheckDelay = () => {
  40. headTopData.settingMode = false
  41. state.setting.soundEffect = false
  42. api_startDelayCheck({});
  43. }
  44. export default defineComponent({
  45. name: "evaluat-model",
  46. setup() {
  47. const query = getQuery();
  48. const evaluatModel = reactive({
  49. tips: true,
  50. evaluatUpdateAudio: false,
  51. isSaveVideo: state.setting.camera && state.setting.saveToAlbum,
  52. shareMode: false,
  53. });
  54. /**
  55. * 检测返回
  56. */
  57. const handleDelayBack = () => {
  58. if (query.workRecord) {
  59. evaluatingData.soundEffectMode = false;
  60. api_back();
  61. } else {
  62. evaluatingData.soundEffectMode = false;
  63. // handleRessetState();
  64. // headTopData.modeType = "init";
  65. }
  66. };
  67. /**
  68. * 执行检测
  69. */
  70. const handlePerformDetection = async () => {
  71. console.log(evaluatingData.checkStep, evaluatingData, "检测123");
  72. // 检测完成不检测了
  73. if (evaluatingData.checkEnd) return;
  74. // 延迟检测
  75. if (evaluatingData.checkStep === 0) {
  76. evaluatingData.checkStep = 10;
  77. // 没有设备延迟数据 或 开启了效音 显示检测组件,并持续检测耳机状态
  78. if (state.setting.soundEffect) {
  79. evaluatingData.soundEffectMode = true;
  80. return;
  81. }
  82. // 判断只有开始了设备检测之后才去调用api
  83. if (state.setting.soundEffect) {
  84. const delayData = await api_getDeviceDelay();
  85. // console.log("🚀 ~ delayTime:", delayData);
  86. if (delayData && delayData.content?.value < 0) {
  87. evaluatingData.soundEffectMode = true;
  88. return;
  89. }
  90. }
  91. handlePerformDetection();
  92. return;
  93. }
  94. // 效验完成
  95. if (evaluatingData.checkStep === 10) {
  96. const erji = await checkUseEarphone();
  97. if (!erji) {
  98. evaluatingData.earphoneMode = true;
  99. }
  100. evaluatingData.checkEnd = true;
  101. console.log("检测结束,生成数据");
  102. handleConnect();
  103. }
  104. };
  105. const browserInfo = browser();
  106. /** 是否是节奏练习 */
  107. const isRhythmicExercises = () => {
  108. const examSongName = state.examSongName || "";
  109. return examSongName.indexOf("节奏练习") > -1;
  110. };
  111. /** 获取评测标准 */
  112. const getEvaluationCriteria = () => {
  113. let criteria: TCriteria = "frequency";
  114. // 声部打击乐
  115. if ([23, 113, 121].includes(state.subjectId)) {
  116. criteria = "amplitude";
  117. } else if (isRhythmicExercises()) {
  118. // 分类为节奏练习
  119. criteria = "decibels";
  120. }
  121. return criteria;
  122. };
  123. /** 校验耳机状态 */
  124. const checkEarphoneStatus = async (type?: string) => {
  125. clearTimeout(checkErjiTimer);
  126. checkErjiTimer = null;
  127. if (type !== "start") {
  128. // const erji = await checkUseEarphone();
  129. const res = await getEarphone();
  130. const erji = res?.content?.checkIsWired || false;
  131. console.log("耳机状态111", res);
  132. evaluatingData.earphoneMode = true;
  133. evaluatingData.earPhoneType = res?.content?.type || "";
  134. if (evaluatingData.earPhoneType === "有线耳机") {
  135. clearTimeout(checkErjiTimer);
  136. checkErjiTimer = null;
  137. setTimeout(() => {
  138. evaluatingData.earphoneMode = false;
  139. }, 3000);
  140. } else {
  141. // 如果没有佩戴有限耳机,需要持续检测耳机状态
  142. checkErjiTimer = setTimeout(() => {
  143. checkEarphoneStatus();
  144. }, 1000);
  145. }
  146. }
  147. console.log("检测结束,生成数据", evaluatingData.websocketState, evaluatingData.startBegin, evaluatingData.checkEnd);
  148. handleConnect();
  149. };
  150. /** 生成评测曲谱数据 */
  151. const formatTimes = () => {
  152. console.log('评测111')
  153. let starTime = 0;
  154. let ListenMode = false;
  155. let dontEvaluatingMode = false;
  156. let skip = false;
  157. const datas = [];
  158. let selectTimes = state.times;
  159. let unitTestIdx = 0;
  160. let preTime = 0;
  161. let preTimes = [];
  162. // 系统节拍器时长
  163. actualBeatLength = Math.round((state.times[0].fixtime * 1000) / 1);
  164. // 如果是阶段评测,选取该阶段的times
  165. if (state.isSelectMeasureMode && state.section.length) {
  166. const startIndex = state.times.findIndex((n: any) => n.noteId == state.section[0].noteId);
  167. let endIndex = state.times.findIndex((n: any) => n.noteId == state.section[1].noteId);
  168. endIndex = endIndex < state.section[1].i ? state.section[1].i : endIndex;
  169. if (startIndex > 1) {
  170. // firstNoteTime应该取预备小节的第一个音符的开始播放的时间
  171. const idx = startIndex - 1 - state.times[startIndex - 1].si;
  172. preTime = state.times[idx] ? state.times[idx].time * 1000 : 0;
  173. }
  174. actualBeatLength = startIndex == 0 && state.isOpenMetronome ? actualBeatLength : 0;
  175. selectTimes = state.times.filter((n: any, index: number) => {
  176. return index >= startIndex && index <= endIndex;
  177. });
  178. preTimes = state.times.filter((n: any, index: number) => {
  179. return index < startIndex;
  180. });
  181. unitTestIdx = startIndex;
  182. starTime = selectTimes[0].sourceRelativeTime || selectTimes[0].relativeTime;
  183. }
  184. // 阶段评测beatLength需要加上预备小节的持续时长
  185. actualBeatLength = preTimes.length ? actualBeatLength + preTimes[preTimes.length - 1].relaMeasureLength * 1000 : actualBeatLength;
  186. // 如果是弱起,并且预备小节是第一节
  187. if (state.section.length && state.sectionFirst && state.sectionFirst.measureListIndex == 0) {
  188. actualBeatLength = actualBeatLength < Math.round((state.times[0].fixtime * 1000) / 1) ? Math.round((state.times[0].fixtime * 1000) / 1) : actualBeatLength;
  189. }
  190. let firstNoteTime = unitTestIdx > 1 ? preTime : 0;
  191. let measureIndex = -1;
  192. let recordMeasure = -1;
  193. for (let index = 0; index < selectTimes.length; index++) {
  194. const item = selectTimes[index];
  195. const note = getNoteByMeasuresSlursStart(item);
  196. // #8701 bug: 评测模式,是以曲谱本身的速度进行评测,所以rate取1,不需要转换
  197. // const rate = state.speed / state.originSpeed;
  198. const rate = state.basePlayRate * state.originAudioPlayRate; // 播放倍率
  199. // const difftime = item.difftime;
  200. const difftime = 0;
  201. const start = difftime + (item.sourceRelativeTime || item.relativeTime) - starTime;
  202. const end = difftime + (item.sourceRelaEndtime || item.relaEndtime) - starTime;
  203. const isStaccato = note.noteElement.voiceEntry.isStaccato();
  204. const noteRate = isStaccato ? 0.5 : 1;
  205. if (note.formatLyricsEntries.contains("Play") || note.formatLyricsEntries.contains("Play...")) {
  206. ListenMode = false;
  207. }
  208. if (note.formatLyricsEntries.contains("Listen")) {
  209. ListenMode = true;
  210. }
  211. if (note.formatLyricsEntries.contains("纯律结束")) {
  212. dontEvaluatingMode = false;
  213. }
  214. if (note.formatLyricsEntries.contains("纯律")) {
  215. dontEvaluatingMode = true;
  216. }
  217. const nextNote = selectTimes[index + 1];
  218. // console.log("noteinfo", note.noteElement.isRestFlag && !!note.stave && !!nextNote)
  219. if (skip && (note.stave || !item.noteElement.isRestFlag || (nextNote && !nextNote.noteElement.isRestFlag))) {
  220. skip = false;
  221. }
  222. if (note.noteElement.isRestFlag && !!note.stave && !!nextNote && nextNote.noteElement.isRestFlag) {
  223. skip = true;
  224. }
  225. // console.log(note.measureOpenIndex, item.measureOpenIndex, note);
  226. // console.log("skip", skip)
  227. // console.log(end,start,rate,noteRate, '评测')
  228. if (note.measureOpenIndex != recordMeasure) {
  229. measureIndex++;
  230. recordMeasure = note.measureOpenIndex;
  231. }
  232. // 是否是需要延续、不停顿演奏的音符
  233. let isTenutoSound = false;
  234. if (item?.noteElement?.tie && item.noteElement.tie?.StartNote) {
  235. const startId = item.noteElement.tie?.StartNote?.NoteToGraphicalNoteObjectId
  236. isTenutoSound = item.NoteToGraphicalNoteObjectId === startId ? false : true
  237. }
  238. const data = {
  239. timeStamp: (start * 1000) / rate,
  240. duration: ((end * 1000) / rate - (start * 1000) / rate) * noteRate,
  241. frequency: item.frequency,
  242. nextFrequency: item.nextFrequency,
  243. prevFrequency: item.prevFrequency,
  244. // 重复的情况index会自然累加,render的index是谱面渲染的index
  245. measureIndex: measureIndex,
  246. measureRenderIndex: item.measureListIndex,
  247. // item.MeasureNumberXML >= 1 ? item.MeasureNumberXML - 1 : note.noteElement.sourceMeasure.measureListIndex,
  248. dontEvaluating: item.hasGraceNote || ListenMode || dontEvaluatingMode || !!item?.voiceEntry?.ornamentContainer || !!item.noteElement?.speedInfo?.startWord?.includes('rit.') || item.skipMode,
  249. musicalNotesIndex: index,
  250. denominator: note.noteElement?.Length.denominator,
  251. // isOrnament: !!note?.voiceEntry?.ornamentContainer,
  252. isTenutoSound,
  253. isStaccato: item?.voiceEntry?.isStaccato, // 是否是重音
  254. };
  255. datas.push(data);
  256. }
  257. return {
  258. datas,
  259. firstNoteTime,
  260. };
  261. };
  262. /** 连接websocket */
  263. const handleConnect = async () => {
  264. const behaviorId = localStorage.getItem("behaviorId") || localStorage.getItem("BEHAVIORID") || undefined;
  265. // let rate = state.speed / state.originSpeed;
  266. const rate = state.basePlayRate * state.originAudioPlayRate; // 播放倍率
  267. // rate = parseFloat(rate.toFixed(2));
  268. console.log("速度比例", rate, "速度", state.speed);
  269. calculateInfo = formatTimes();
  270. // 评测的速度,如果是选段,则选选段开头小节的速度
  271. const evaluatSpeed = state.sectionStatus && state.section.length === 2 && state.section[0].measureSpeed ? state.section[0].measureSpeed * state.basePlayRate : state.speed;
  272. evaluatingData.evaluatSpeed = evaluatSpeed;
  273. const content = {
  274. musicXmlInfos: calculateInfo.datas,
  275. subjectId: state.musicalCode,
  276. detailId: state.detailId,
  277. examSongId: state.examSongId,
  278. xmlUrl: state.xmlUrl,
  279. partIndex: state.partIndex,
  280. behaviorId,
  281. platform: browserInfo.ios ? "IOS" : browserInfo.android ? "ANDROID" : "WEB",
  282. clientId: storeData.platformType === "STUDENT" ? "student" : storeData.platformType === "TEACHER" ? "teacher" : "education",
  283. hertz: state.setting.frequency,
  284. reactionTimeMs: state.setting.reactionTimeMs ? Number(state.setting.reactionTimeMs) : 0,
  285. speed: evaluatSpeed,
  286. heardLevel: state.setting.evaluationDifficulty,
  287. // beatLength: Math.round((state.fixtime * 1000) / rate),
  288. beatLength: actualBeatLength,
  289. evaluationCriteria: state.evaluationStandard,
  290. speedRate: parseFloat(rate.toFixed(2)), // 播放倍率
  291. };
  292. await connectWebsocket(content);
  293. // state.playSource = "music";
  294. };
  295. /** 评测结果按钮处理 */
  296. const handleEvaluatResult = (type: "practise" | "tryagain" | "look" | "share" | "update" | "selfCancel") => {
  297. if (type === "update") {
  298. if (state.isAppPlay) {
  299. evaluatModel.evaluatUpdateAudio = true;
  300. resetPlaybackToStart();
  301. return;
  302. } else if (evaluatingData.resultData?.recordIdStr || evaluatingData.resultData?.recordId) {
  303. const rate = state.basePlayRate * state.originAudioPlayRate; // 播放倍率
  304. // 上传云端
  305. // evaluatModel.evaluatUpdateAudio = true;
  306. api_openAdjustRecording({
  307. recordId: evaluatingData.resultData?.recordIdStr || evaluatingData.resultData?.recordId,
  308. title: state.examSongName || "曲谱演奏",
  309. coverImg: state.coverImg,
  310. speedRate: parseFloat(rate.toFixed(2)), // 播放倍率
  311. musicRenderType: state.musicRenderType,
  312. musicSheetId: state.examSongId,
  313. 'part-index': state.partIndex
  314. });
  315. return;
  316. }
  317. } else if (type === "share") {
  318. // 分享
  319. evaluatModel.shareMode = true;
  320. return;
  321. } else if (type === "look") {
  322. // 跳转
  323. handleViewReport("recordId", "instrument");
  324. return;
  325. } else if (type === "practise") {
  326. // 去练习
  327. handleStartEvaluat();
  328. } else if (type === "tryagain") {
  329. startBtnHandle();
  330. } else if (type === "selfCancel") {
  331. // 再来一次,需要手动取消评测,不生成评测记录,不显示评测结果弹窗
  332. evaluatingData.oneselfCancleEvaluating = true;
  333. // handleCancelEvaluat();
  334. handleEndEvaluat(true, 'selfCancel');
  335. evaluatingData.isBeginMask = true;
  336. state.playState = "paused";
  337. }
  338. resetPlaybackToStart();
  339. evaluatingData.resulstMode = false;
  340. };
  341. /** 上传音视频 */
  342. const hanldeUpdateVideoAndAudio = async (update = false) => {
  343. if (!update) {
  344. evaluatModel.evaluatUpdateAudio = false;
  345. return;
  346. }
  347. if (state.setting.camera && state.setting.saveToAlbum) {
  348. evaluatModel.evaluatUpdateAudio = false;
  349. api_videoUpdate((res: any) => {
  350. if (res) {
  351. if (res?.content?.type === "success") {
  352. handleSaveResult({
  353. id: evaluatingData.resultData?.recordId,
  354. videoFilePath: res?.content?.filePath,
  355. });
  356. } else if (res?.content?.type === "error") {
  357. showToast({
  358. message: res.content?.message || "上传失败",
  359. });
  360. }
  361. }
  362. });
  363. return;
  364. }
  365. evaluatModel.evaluatUpdateAudio = false;
  366. showToast("上传成功");
  367. };
  368. const handleSaveResult = async (_body: any) => {
  369. await api_musicPracticeRecordVideoUpload(_body);
  370. showToast("上传成功");
  371. };
  372. const startBtnHandle = async () => {
  373. // 如果打开了延迟检测开关,需要先发送开始检测的消息
  374. const delayData = await api_getDeviceDelay();
  375. console.log('设备的延迟值',delayData.content?.value)
  376. if (delayData && delayData.content?.value <= 0) {
  377. await api_startDelayCheck({});
  378. return;
  379. }
  380. evaluatingData.needReplayEvaluat = false;
  381. // 选段未完成时,清除选段状态
  382. if (state.sectionStatus && state.section.length < 2) {
  383. clearSelection();
  384. }
  385. // 如果是异常状态,先等待500ms再执行后续流程
  386. if (evaluatingData.isErrorState && !state.setting.soundEffect) {
  387. // console.log('异常流程1')
  388. showLoadingToast({
  389. message: "处理中",
  390. duration: 1000,
  391. overlay: true,
  392. overlayClass: styles.scoreMode,
  393. });
  394. await new Promise<void>((resolve) => {
  395. setTimeout(() => {
  396. closeToast();
  397. evaluatingData.isErrorState = false;
  398. // console.log('异常流程2')
  399. resolve();
  400. }, 1000);
  401. });
  402. }
  403. // console.log('异常流程3')
  404. initSetPlayRate();
  405. // 检测APP端socket状态
  406. const res: any = await startCheckDelay();
  407. if (res?.checked) {
  408. handleConnect();
  409. handleStartBegin(calculateInfo.firstNoteTime);
  410. if (evaluatingData.isErrorState) {
  411. evaluatingData.isErrorState = false;
  412. evaluatingData.resulstMode = false;
  413. }
  414. }
  415. };
  416. // 监听到APP取消延迟检测
  417. const handleCancelDelayCheck = async (res?: IPostMessage) => {
  418. console.log("监听取消延迟检测", res);
  419. if (res?.content) {
  420. // 关闭延迟检测页面,并返回到模式选择页面
  421. // await api_closeDelayCheck({});
  422. handleDelayBack();
  423. }
  424. };
  425. // 监听APP延迟成功的回调
  426. const handleFinishDelayCheck = async (res?: IPostMessage) => {
  427. console.log("监听延迟检测成功", res);
  428. evaluatingData.socketErrorPop = false;
  429. if (res?.content) {
  430. evaluatingData.checkEnd = true;
  431. state.setting.soundEffect = false;
  432. checkEarphoneStatus();
  433. }
  434. };
  435. // 监听重复评测消息
  436. const handRetryEvaluating = () => {
  437. handleEvaluatResult("tryagain");
  438. };
  439. const earPhonePopShow = computed(() => {
  440. return evaluatingData.earphoneMode && !state.isLoading && !state.hasDriverPop;
  441. });
  442. // watch(
  443. // () => state.setting.soundEffect,
  444. // (val) => {
  445. // if (val) {
  446. // headTopData.settingMode = false
  447. // api_startDelayCheck({});
  448. // state.setting.soundEffect = false
  449. // }
  450. // }
  451. // );
  452. // 手动取消评测,需要自动再次评测
  453. watch(
  454. () => evaluatingData.needReplayEvaluat,
  455. (val) => {
  456. if (val && evaluatingData.oneselfCancleEvaluating) {
  457. setTimeout(() => {
  458. startBtnHandle();
  459. }, 500);
  460. }
  461. }
  462. );
  463. onMounted(async () => {
  464. // 如果打开了延迟检测开关,需要先发送开始检测的消息
  465. const delayData = await api_getDeviceDelay();
  466. console.log('设备的延迟值',delayData.content?.value)
  467. if (delayData && delayData.content?.value <= 0) {
  468. await api_startDelayCheck({});
  469. } else {
  470. evaluatingData.checkEnd = true;
  471. checkEarphoneStatus();
  472. }
  473. evaluatingData.isDisabledPlayMusic = true;
  474. // handlePerformDetection();
  475. api_cancelDelayCheck(handleCancelDelayCheck);
  476. api_finishDelayCheck(handleFinishDelayCheck);
  477. api_retryEvaluating(handRetryEvaluating);
  478. });
  479. onUnmounted(() => {
  480. api_remove_finishDelayCheck(handleFinishDelayCheck);
  481. api_remove_cancelDelayCheck(handleCancelDelayCheck);
  482. clearTimeout(checkErjiTimer);
  483. checkErjiTimer = null;
  484. });
  485. return () => (
  486. <div>
  487. <div class={styles.operatingBtn}>
  488. {!evaluatingData.startBegin && (
  489. <img
  490. class={[styles.iconBtn, "evaluting-1"]}
  491. src={headImg("icon_play.png")}
  492. onClick={() => {
  493. startBtnHandle();
  494. }}
  495. />
  496. )}
  497. {evaluatingData.startBegin && (
  498. <>
  499. <img class={styles.iconBtn} src={headImg("icon_reset.png")} onClick={() => {
  500. // 校验评测最小间隔时间
  501. const currentTime = +new Date();
  502. // 开始评测和结束评测的间隔时间小于800毫秒,则不处理
  503. if (currentTime - evaluatingData.recordingTime < 800) {
  504. return;
  505. }
  506. handleEvaluatResult("selfCancel")
  507. }} />
  508. <img class={styles.iconBtn} src={headImg("submit.png")} onClick={() => {
  509. // 校验评测最小间隔时间
  510. const currentTime = +new Date();
  511. // 开始评测和结束评测的间隔时间小于800毫秒,则不处理
  512. if (currentTime - evaluatingData.recordingTime < 800) {
  513. return;
  514. }
  515. handleEndBegin()
  516. }} />
  517. </>
  518. )}
  519. </div>
  520. {/* {evaluatingData.soundEffectMode && (
  521. <DelayCheck
  522. onClose={() => {
  523. evaluatingData.soundEffectMode = false;
  524. handlePerformDetection();
  525. }}
  526. onBack={() => handleDelayBack()}
  527. />
  528. )} */}
  529. {/* 倒计时 */}
  530. <Countdown />
  531. {/* 遮罩 */}
  532. {
  533. evaluatingData.isBeginMask && <div class={styles.beginMask}></div>
  534. }
  535. <Popup teleport="body" closeOnClickOverlay={false} class={["popup-custom", "van-scale"]} transition="van-scale" v-model:show={earPhonePopShow.value}>
  536. <Earphone
  537. earphoneType={evaluatingData.earPhoneType}
  538. onClose={() => {
  539. clearTimeout(checkErjiTimer);
  540. checkErjiTimer = null;
  541. // #11035,可能刚好关闭耳机弹窗的时候,第二次又出现了弹窗
  542. setTimeout(() => {
  543. evaluatingData.earphoneMode = false;
  544. }, 0);
  545. // handlePerformDetection();
  546. checkEarphoneStatus("start");
  547. }}
  548. />
  549. </Popup>
  550. {/* 评测作业,非完整评测不显示评测结果弹窗 */}
  551. {evaluatingData.hideResultModal ? (
  552. <EvaluatResult onClose={handleEvaluatResult} />
  553. ) : (
  554. <Popup teleport="body" closeOnClickOverlay={false} class={["popup-custom", "van-scale"]} transition="van-scale" v-model:show={evaluatingData.resulstMode}>
  555. <EvaluatResult onClose={handleEvaluatResult} />
  556. </Popup>
  557. )}
  558. <Popup teleport="body" closeOnClickOverlay={false} class={["popup-custom", "van-scale"]} transition="van-scale" v-model:show={evaluatModel.evaluatUpdateAudio}>
  559. <EvaluatAudio onClose={hanldeUpdateVideoAndAudio} />
  560. </Popup>
  561. <Popup teleport="body" class={["popup-custom", "van-scale"]} transition="van-scale" v-model:show={evaluatModel.shareMode}>
  562. <EvaluatShare onClose={() => (evaluatModel.shareMode = false)} />
  563. </Popup>
  564. </div>
  565. );
  566. },
  567. });