test.vue 43 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571
  1. <template>
  2. <div class="test">
  3. <Header @confirmExit="confirmExit" @setMusic="setMusic"></Header>
  4. <div class="main">
  5. <div class="main-left">
  6. <div class="main-left-top">
  7. <div class="top-left" @click="getChooseStudent">
  8. <div class="top-left-center">
  9. <div class="pic" :class="{ 'pic2': faceCheckStu.student_id }" v-if="faceCheckStu.student_id">
  10. <img :src="faceCheckStu.face_pic || faceCheckStu.logo_url" />
  11. </div>
  12. <div class="pic" v-else>
  13. <img src="@/assets/images/test/profilePicture.png" />
  14. </div>
  15. <div class="name" :class="{ 'name2': faceCheckStu.student_id }">
  16. {{ faceCheckStu.student_id ? faceCheckStu.name : "虚位以待" }}
  17. </div>
  18. </div>
  19. </div>
  20. <div class="top-right">
  21. <Transition :enter-active-class="proxy?.animate.dialog.enter" :leave-active-class="proxy?.animate.dialog.leave">
  22. <div class="time" v-show="needStart && [42].includes(examState) && !['basketballv1', 'footballv1'].includes(parameter.project)">
  23. {{
  24. time.countdownNum
  25. }}
  26. </div>
  27. </Transition>
  28. <div class="tips" v-if="examState == 41">
  29. <img v-if="parameter.gesture" src="@/assets/images/test/ready1.png" />
  30. <img v-if="!parameter.gesture" src="@/assets/images/test/ready2.png" />
  31. </div>
  32. <div
  33. class="complete"
  34. :class="{ 'complete2': needStart && [42].includes(examState) }"
  35. v-if="faceCheckStu.student_id && time.ready <= 0 && examState != 43 && examState != 41"
  36. >
  37. <div class="scoreBox">
  38. <div class="score" v-if="currentResultObj?.count && currentResultObj.count>=0">{{ currentResultObj.count }}</div>
  39. <div class="prompt" v-if="currentResultObj?.count && currentResultObj.count==0 && examState == 42">请开始测试</div>
  40. <div class="unit" v-if="!['basketballv1', 'footballv1'].includes(parameter.project) && currentResultObj.count && !needStart">
  41. {{ unit }}
  42. </div>
  43. </div>
  44. <div class="fractionViolation">
  45. <div class="fraction">
  46. <div class="lable">得分:</div>
  47. <div class="value">{{ currentResultObj.score || "" }}</div>
  48. </div>
  49. <div class="violation">
  50. <div class="lable">
  51. {{ ['jumprope', 'jumpingjack', 'highknees'].includes(parameter.project) ? '中断' : '犯规'
  52. }}
  53. </div>
  54. <div class="value">{{ currentResultObj.back_num || 0 }}</div>
  55. </div>
  56. </div>
  57. </div>
  58. <div class="foulBox" v-if="examState == 42 && backReason.length">
  59. <Transition :enter-active-class="proxy?.animate.mask.enter" :leave-active-class="proxy?.animate.mask.leave">
  60. <div class="foul" v-show="backReasonStr ? true : false">
  61. <div class="lable">!</div>
  62. <div class="value">{{ backReasonStr }}</div>
  63. </div>
  64. </Transition>
  65. </div>
  66. <div v-show="examState == 43 && time.ready">
  67. <div class="readyBox">
  68. <div class="value" :class="{ 'transparent': time.ready > 5 }">{{ time.ready }}</div>
  69. <div class="lable">倒计时</div>
  70. </div>
  71. </div>
  72. <div v-show="examState == 43 && faceCheckStu.student_id && !time.ready && readyState">
  73. <div class="readyBoxBefore">
  74. <div class="item" v-if="parameter.handcontroller">
  75. <div><img src="@/assets/images/test/jushou.png" /></div>
  76. <div class="lable">
  77. <div>请举左手开始</div>
  78. </div>
  79. </div>
  80. <div class="item" v-else>
  81. <div><img src="@/assets/images/test/bujushou.png" /></div>
  82. <div class="lable">
  83. <div>请点击开始</div>
  84. </div>
  85. </div>
  86. </div>
  87. </div>
  88. <div v-show="examState == 43 && !faceCheckStu.student_id">
  89. <div class="btn btn2" @click="getChooseStudent">点击重新识别</div>
  90. </div>
  91. <div class="btn" @click="getReady" v-if="needStart && examState == 43 && faceCheckStu.student_id && !time.ready && readyState">开 始</div>
  92. <!-- <div v-if="needStart"> -->
  93. <!-- <div class="btn" @click="getOpenOneTestAndStartFace" v-if="examState < 41">开始识别</div> -->
  94. <!-- <div class="btn" @click="getStopFace" v-if="examState == 41 && !parameter.gesture">停止人脸识别</div> -->
  95. <!-- <div class="btn" @click="getStartOneTest" v-if="examState == 43">开始测试</div> -->
  96. <!-- <div @click="getRetestFace" v-if="examState == 43 || examState == 42">重新识别</div> -->
  97. <!-- </div> -->
  98. <!-- <div>当前状态:({{ examState == 3 ? "初始化完成" : examState == 40 ? "创建测试" : examState == 41 ? "正在人脸识别":examState == 43 ? "停止人脸识别" : examState == 42 ? "正在测试" : "请初始化" }})</div> -->
  99. <!-- <div @click="getAgain" v-if="examState == 42 || showTestAgain">再测一次</div> -->
  100. </div>
  101. <i></i>
  102. </div>
  103. <div class="main-left-bottom">
  104. <div class="bottom-left">
  105. <div class="tips"><img src="/src/assets/images/test/tips.png" /></div>
  106. <div class="pic"><img :src="'static/images/tips/' + parameter.project + '.png'" /></div>
  107. </div>
  108. <div class="bottom-right" v-html="dic.projectNote[parameter.project]"></div>
  109. </div>
  110. </div>
  111. <div class="main-right">
  112. <ReportList ref="reportListRef" :parameter="parameter" :showQRCode="true" />
  113. </div>
  114. </div>
  115. <FaceWindow ref="faceWindowRef" :faceCheckStu="faceCheckStu" :gesture="parameter.gesture" />
  116. <ChooseStudent ref="chooseStudentRef" @returnData="returnStudent" />
  117. <JumpRopeGame ref="gameContainer" v-if="['test'].includes(parameter.project) && (!readyState || [42].includes(examState))" />
  118. <div class="close" @click="confirmExit"></div>
  119. </div>
  120. </template>
  121. <script setup name="TrainTest" lang="ts">
  122. import useAppStore from '@/store/modules/app';
  123. import { useWs } from '@/utils/trainWs';
  124. // import { initWs, examEnds, openOneTest, startFace, stopFace, faceConfirmOnly, startOneTest, finishOneTest, closeOneTest, suspendFaceRecognitionChannels, resumeFaceRecognitionChannels } from '@/utils/ws'
  125. import { initSpeech, speckText, playMusic, controlMusic, speckCancel, chineseNumber } from '@/utils/speech';
  126. import { useWebSocket } from '@/utils/handWs';
  127. import dayjs from 'dayjs';
  128. import dataDictionary from '@/utils/dataDictionary';
  129. const { handWs, startDevice, startHand, stateHand } = useWebSocket();
  130. const {
  131. initWs,
  132. examEnds,
  133. openOneTest,
  134. startFace,
  135. stopFace,
  136. faceConfirmOnly,
  137. startOneTest,
  138. finishOneTest,
  139. closeOneTest,
  140. suspendFaceRecognitionChannels,
  141. resumeFaceRecognitionChannels
  142. } = useWs();
  143. const { proxy } = getCurrentInstance() as any;
  144. const router = useRouter();
  145. const route = useRoute();
  146. const faceWindowRef = ref();
  147. const chooseStudentRef = ref();
  148. const reportListRef = ref();
  149. const gameContainer = ref();
  150. const myInfo: any = localStorage.getItem('userInfo');
  151. const dic: any = dataDictionary;
  152. const data = reactive<any>({
  153. timerManager: {}, //计时器管理
  154. parameter: {}, //参数
  155. time: {
  156. testTime: 60, //时长
  157. countdownNum: 0, //计时
  158. ready: 0, //预备
  159. exit: 0 //退出倒计时
  160. },
  161. userInfo: {}, //用户信息
  162. examState: 0, //当前状态
  163. resultId: null, //测试ID
  164. currentResultObj: {}, //成绩
  165. faceCheckStu: {}, //人脸信息
  166. unit: '', //单位
  167. backReason: [], //犯规项
  168. backReasonStr: '', //犯规提示
  169. needStart: false, //是否需要按钮
  170. showTestAgain: false, //再测一次按钮
  171. readyState: true, //倒计时按钮状态
  172. exitStatus: 0, //退出响应次数
  173. sid: null, //WS的id
  174. deviceInfo: {}, //设备信息
  175. musicList: [], //音乐列表
  176. });
  177. const {
  178. timerManager,
  179. parameter,
  180. time,
  181. userInfo,
  182. examState,
  183. resultId,
  184. faceCheckStu,
  185. currentResultObj,
  186. unit,
  187. backReason,
  188. backReasonStr,
  189. needStart,
  190. showTestAgain,
  191. readyState,
  192. exitStatus,
  193. sid,
  194. deviceInfo,
  195. musicList
  196. } = toRefs(data);
  197. /**
  198. * 接收消息
  199. */
  200. const getMessage = (e: any) => {
  201. //console.log("WS响应:", e)
  202. //获取sid
  203. if (e.cmd === 'mySid') {
  204. console.log('e.data.sid', e.data.sid);
  205. sid.value = e.data.sid;
  206. }
  207. //实时状态
  208. if (e.cmd === 'exam_status') {
  209. examState.value = e.data;
  210. }
  211. //工作站状态
  212. if (e.cmd === 'init_result') {
  213. }
  214. //测试违规
  215. if (e.cmd === 'warning_result') {
  216. console.log('eeeeeeeeeee', e);
  217. if ((e.status + '')[0] === '2') {
  218. proxy?.$modal.msgError(e.data.message);
  219. speckText(e.data.message);
  220. }
  221. }
  222. //后端播报语音
  223. if (e.cmd === 'return_audio_msg') {
  224. if (e.data.message) {
  225. proxy?.$modal.msgError(e.data.message);
  226. speckText(e.data.message);
  227. }
  228. }
  229. //错误提示
  230. if (e.cmd === 'info_result') {
  231. proxy?.$modal.msgError(e.data.message);
  232. }
  233. //错误提示
  234. if (e.cmd === 'error_result') {
  235. proxy?.$modal.msgError(e.data.message);
  236. }
  237. //测试中违规提示
  238. if (e.cmd === 'warning_notify') {
  239. let message = e.data?.message;
  240. if (message) {
  241. proxy?.$modal.msgError(message);
  242. speckText(message);
  243. }
  244. if (message == '工作站已断开!') {
  245. getExit();
  246. }
  247. }
  248. //断线状态
  249. if (e.cmd === 'disconnect_request') {
  250. let message = e.data.message;
  251. if (message) {
  252. proxy?.$modal.msgError(`${message}`);
  253. speckText(message);
  254. }
  255. getExit();
  256. }
  257. //状态变更
  258. if (e.cmd === 'set_exam_state') {
  259. examState.value = e.data;
  260. if (e.data === 3) {
  261. initProject();
  262. }
  263. if (e.data === 40) {
  264. cleanData();
  265. }
  266. if (e.data == 41) {
  267. getFaceWindow(true);
  268. }
  269. if (e.data == 43) {
  270. }
  271. if (e.data == 42) {
  272. getClearTimer('readyTimer');
  273. time.value.ready = 0;
  274. }
  275. }
  276. //新建测试后返回信息,获取result_id
  277. if (e.cmd === 'open_one_test_ack') {
  278. resultId.value = e.data.result_id;
  279. }
  280. //人脸识别状态
  281. if (e.cmd === 'face_check_result') {
  282. let myData = e.data[0] || e.data;
  283. returnStudent(myData);
  284. }
  285. //测试结束结果
  286. if (e.cmd === 'oneresult') {
  287. if (e.data.length) {
  288. let data = e.data[0];
  289. getAchievement(data);
  290. }
  291. }
  292. //结果生成完成(视频图片)
  293. if (e.cmd === 'static_urls_finished') {
  294. }
  295. //选择学生或测试结束后返回的数据
  296. if (e.cmd === 'result_info') {
  297. }
  298. };
  299. /**
  300. * 开始识别
  301. */
  302. const getOpenOneTestAndStartFace = async () => {
  303. if (examState.value > 3) {
  304. await closeOneTest();
  305. }
  306. await openOneTest();
  307. await startFace();
  308. };
  309. /**
  310. * 停止人脸识别
  311. */
  312. const getStopFace = async () => {
  313. // 旧版识别成功直接43了这里先屏蔽
  314. // if (examState.value != 41) {
  315. // return false;
  316. // }
  317. getClearTimer('face');
  318. if (needStart.value) {
  319. let txt = parameter.value.handcontroller ? ',请举左手开始测试' : ',请准备';
  320. speckText(faceCheckStu.value.name + txt);
  321. }
  322. if (examState.value == 41) {
  323. await stopFace();
  324. }
  325. if (faceCheckStu.value.student_id) {
  326. getFaceConfirmOnly();
  327. }
  328. };
  329. /**
  330. * 确定人脸信息
  331. */
  332. const getFaceConfirmOnly = (data?: any) => {
  333. if (data) {
  334. faceCheckStu.value = data;
  335. }
  336. faceConfirmOnly(
  337. {
  338. result_id: resultId.value,
  339. student_id: faceCheckStu.value.student_id,
  340. gender: faceCheckStu.value.gender
  341. },
  342. () => {
  343. faceWindowRef.value?.close();
  344. //不需要按钮的自动进入下一步
  345. if (needStart.value == false) {
  346. getStartOneTest();
  347. }
  348. }
  349. );
  350. };
  351. /**
  352. * 重新识别
  353. */
  354. const getRetestFace = () => {
  355. proxy?.$modal
  356. .confirm('确定重新识别吗?')
  357. .then(() => {
  358. cleanData();
  359. if (needStart.value == false) {
  360. //自动流程项目重新识别直接返回3
  361. closeOneTest();
  362. } else {
  363. //手动流程项目重新识别43返回41,42返回3
  364. if (examState.value == 43) {
  365. startFace();
  366. } else if (examState.value == 42) {
  367. finishOneTest();
  368. } else {
  369. closeOneTest();
  370. }
  371. }
  372. })
  373. .finally(() => {});
  374. };
  375. /**
  376. * 开始测试
  377. */
  378. const getStartOneTest = () => {
  379. if (examState.value != 43 || !faceCheckStu.value.student_id) {
  380. return false;
  381. }
  382. if (!faceCheckStu.value.student_id) {
  383. proxy?.$modal.msgWarning('请选择人员!');
  384. return false;
  385. }
  386. startOneTest(null, () => {
  387. //显示再测一次按钮
  388. showTestAgain.value = true;
  389. //停止播报;
  390. speckCancel();
  391. //计时项目才开
  392. if (needStart.value == true) {
  393. speckText('哨声');
  394. if (parameter.value.music && musicList.value.length) {
  395. let obj = musicList.value.find((item: any) => {
  396. return item.id == parameter.value.music;
  397. });
  398. if (obj != undefined) {
  399. playMusic(obj.url);
  400. }
  401. }
  402. //时间为0的为正计时,大于0的为倒计时
  403. if (time.value.testTime == 0) {
  404. getCounting('+');
  405. } else {
  406. getCounting('-');
  407. }
  408. } else {
  409. speckText(faceCheckStu.value.name + ',请开始测试');
  410. }
  411. });
  412. };
  413. /**
  414. * 再测一次
  415. */
  416. const getAgain = async () => {
  417. let txt = '是否再测一次?';
  418. await proxy?.$modal.confirm(txt);
  419. getClearTimer();
  420. //预存测试人员
  421. let student = JSON.parse(JSON.stringify(faceCheckStu.value));
  422. //测试中
  423. if (examState.value == 42) {
  424. await finishOneTest();
  425. }
  426. //其他状态
  427. if (examState.value > 3) {
  428. await closeOneTest();
  429. }
  430. //重新走一次流程
  431. await openOneTest();
  432. await startFace();
  433. await stopFace();
  434. getFaceConfirmOnly(student);
  435. };
  436. /**
  437. * 确认退出
  438. */
  439. const confirmExit = () => {
  440. let handcontroller_id = parameter.value.handcontroller;
  441. proxy?.$modal
  442. .confirm(handcontroller_id ? `请保持两秒确认退出` : `确定退出吗?`)
  443. .then(() => {
  444. getExit();
  445. })
  446. .finally(() => {});
  447. };
  448. /**
  449. * 退出
  450. */
  451. const getExit = () => {
  452. getClearTimer(); //清除计时器
  453. examEnds(); //通知工作站关闭
  454. speckCancel(); //停止播报
  455. window.onbeforeunload = null; //移除事件处理器
  456. let handcontroller_id = parameter.value.handcontroller;
  457. if (handcontroller_id) {
  458. router.push({ path: '/gesture' });
  459. } else {
  460. if (parameter.value.taskId) {
  461. router.push({ path: '/test' });
  462. } else {
  463. router.push({ path: '/' });
  464. }
  465. }
  466. };
  467. /**
  468. * 清空定时任务
  469. */
  470. const getClearTimer = (data?: any) => {
  471. if (data) {
  472. //清除指定
  473. clearInterval(timerManager.value[data]);
  474. timerManager.value[data] = null;
  475. } else {
  476. //清除全部
  477. for (let key in timerManager.value) {
  478. if (timerManager.value.hasOwnProperty(key)) {
  479. clearInterval(timerManager.value[key]);
  480. timerManager.value[key] = null;
  481. }
  482. }
  483. }
  484. };
  485. /**
  486. * 选择学生
  487. */
  488. const getChooseStudent = () => {
  489. if (examState.value < 41) {
  490. proxy?.$modal.msgWarning('请等待');
  491. }
  492. if (examState.value == 41) {
  493. stopFace();
  494. chooseStudentRef.value.open();
  495. //然后定时自动关闭
  496. setTimeout(() => {
  497. faceWindowRef.value.close();
  498. }, 3000);
  499. }
  500. if (examState.value == 43) {
  501. getRetestFace();
  502. }
  503. if (examState.value == 42) {
  504. getRetestFace();
  505. // proxy?.$modal.msgWarning(`正在测试请结束后再操作,当前状态:${examState.value}`);
  506. // return false;
  507. }
  508. };
  509. /**
  510. * 返回被选学生
  511. */
  512. const returnStudent = (data: any) => {
  513. speckCancel();
  514. chooseStudentRef.value.close();
  515. faceCheckStu.value = data;
  516. faceWindowRef.value.open();
  517. //然后定时自动关闭
  518. setTimeout(() => {
  519. faceWindowRef.value.close();
  520. }, 1000);
  521. getStopFace();
  522. };
  523. /**
  524. * 清除历史记录
  525. */
  526. const cleanData = () => {
  527. time.value.countdownNum = time.value.testTime;
  528. showTestAgain.value = false;
  529. faceCheckStu.value = {};
  530. currentResultObj.value = {};
  531. backReason.value = [];
  532. };
  533. /**
  534. * 自动初始化项目
  535. */
  536. const initProject = () => {
  537. //停止计时
  538. getClearTimer('countdownTimer');
  539. //恢复倒计时按钮状态
  540. readyState.value = true;
  541. //自动项目定时进入下一步
  542. let time = 0;
  543. //控制新建测试的时间,第一次快,之后就慢
  544. if (!faceCheckStu.value.student_id) {
  545. time = 1000;
  546. } else {
  547. time = 6000;
  548. }
  549. setTimeout(() => {
  550. //再加一个判断以免和再测一次冲突
  551. if (examState.value == 3) {
  552. getOpenOneTestAndStartFace();
  553. }
  554. }, time);
  555. };
  556. /**
  557. * 倒计时
  558. */
  559. const getCounting = (type: string) => {
  560. timerManager.value.countdownTimer = setInterval(() => {
  561. //正计时
  562. if (type == '+') {
  563. time.value.countdownNum++;
  564. }
  565. //倒计时
  566. if (type == '-') {
  567. if (time.value.countdownNum <= 0) {
  568. getClearTimer('countdownTimer');
  569. } else {
  570. time.value.countdownNum--;
  571. }
  572. }
  573. }, 1000);
  574. };
  575. /**
  576. * 人脸窗口
  577. */
  578. const getFaceWindow = (data: boolean, num: number = 0) => {
  579. let total = num + 1; //叠加三次后不再播放
  580. let txt = parameter.value.gesture === true ? '请举右手看摄像头人脸识别' : '请看摄像头进行人脸识别';
  581. speckText(txt);
  582. //data=true为弹出框,data=false为不要弹出框
  583. if (data) {
  584. faceWindowRef.value.open();
  585. //然后定时自动关闭
  586. setTimeout(() => {
  587. if (examState.value == 41 && faceWindowRef.value?.faceState == true) {
  588. faceWindowRef.value.close();
  589. }
  590. }, 3000);
  591. }
  592. //定时检查如果一直停留在人脸识别就提示
  593. let timeout = 16000;
  594. timerManager.value.face = setInterval(() => {
  595. getClearTimer('face');
  596. if (examState.value == 41 && total < 3) {
  597. getFaceWindow(false, total);
  598. }
  599. }, timeout);
  600. };
  601. /**
  602. * 成绩
  603. */
  604. const getAchievement = (data: any) => {
  605. //console.log("成绩", data);
  606. let type = parameter.value.project;
  607. let result = data?.[dic.typeResultKey[type]] || 0;
  608. let count = null;
  609. if (['trijump', 'solidball', 'shotput', 'longjump'].includes(type)) {
  610. count = (Math.round(result) / 100).toFixed(2);
  611. } else if (['basketballv1', 'footballv1'].includes(type)) {
  612. count = proxy?.$utils.runTime(result, true, 1);
  613. } else {
  614. count = result;
  615. }
  616. data.count = count || 0;
  617. data.score = data.score || '0';
  618. currentResultObj.value = data;
  619. //违规处理
  620. let arr = backReason.value;
  621. if (['situp', 'pullup', 'sidepullup', 'jumprope', 'jumpingjack', 'highknees', 'jump', 'longjump', 'verticaljump'].indexOf(type) > -1) {
  622. if (['pullup', 'situp', 'jumprope', 'jumpingjack', 'highknees'].indexOf(type) > -1) {
  623. currentResultObj.value.back_num = data?.all_failed_num;
  624. }
  625. if (type === 'sidepullup') {
  626. currentResultObj.value.back_num = data?.['0']?.hip_failed_num;
  627. }
  628. if (['jump', 'longjump', 'verticaljump'].includes(type)) {
  629. if (data?.startline_check == 0) {
  630. let txt = '踩线违规';
  631. speckText(txt);
  632. arr.push(txt);
  633. }
  634. if (data?.singleleg_jump_check == 0) {
  635. let txt = '单脚跳违规';
  636. speckText(txt);
  637. arr.push(txt);
  638. }
  639. if (data?.outside_check == 0) {
  640. let txt = '跳出测试区违规';
  641. speckText(txt);
  642. arr.push(txt);
  643. }
  644. }
  645. if (data?.elbow_check == false) {
  646. let txt = '肘部违规';
  647. speckText(txt);
  648. arr.push(txt);
  649. }
  650. if (['situp', 'pullup'].indexOf(type) > -1 && data?.knee_check === false) {
  651. let txt = '腿部违规';
  652. speckText(txt);
  653. if (!arr.includes(txt)) {
  654. }
  655. arr.push(txt);
  656. }
  657. if (['situp'].indexOf(type) > -1 && data?.hand_check === false) {
  658. let txt = '手部违规';
  659. speckText(txt);
  660. if (!arr.includes(txt)) {
  661. }
  662. arr.push(txt);
  663. }
  664. if (['pullup'].indexOf(type) > -1 && data?.['0']?.elbow_check === false) {
  665. let txt = '手部违规';
  666. speckText(txt);
  667. if (!arr.includes(txt)) {
  668. }
  669. arr.push(txt);
  670. }
  671. if (['situp'].indexOf(type) > -1 && data?.['0']?.back_check === false) {
  672. let txt = '背部违规';
  673. speckText(txt);
  674. if (!arr.includes(txt)) {
  675. }
  676. arr.push(txt);
  677. }
  678. if (['sidepullup', 'situp'].indexOf(type) > -1 && data?.['0']?.hip_check === false) {
  679. let txt = '臀部违规';
  680. speckText(txt);
  681. if (!arr.includes(txt)) {
  682. }
  683. arr.push(txt);
  684. }
  685. }
  686. backReason.value = arr;
  687. if (data.isfinish) {
  688. if (['jump'].includes(type) && backReason.value.length) {
  689. speckText('请重新测试');
  690. return false;
  691. }
  692. if (['basketballv1', 'footballv1'].includes(type)) {
  693. speckText(
  694. faceCheckStu?.value.name +
  695. '成绩为' +
  696. (chineseNumber(proxy?.$utils.runTime(data?.[dic.typeResultKey[type]], false, 0, 1)) || 0) +
  697. ',请下一位准备!' || ''
  698. );
  699. } else {
  700. speckText(faceCheckStu?.value.name + '成绩为' + (chineseNumber(count) || 0) + unit.value + ',请下一位准备!' || '');
  701. }
  702. reportListRef.value.getIniReportList();
  703. faceWindowRef.value.open();
  704. //然后定时自动关闭
  705. setTimeout(() => {
  706. faceWindowRef.value.close('right');
  707. }, 1000);
  708. }
  709. };
  710. /**
  711. * 准备开始
  712. */
  713. const getReady = () => {
  714. if (needStart.value && examState.value == 43 && !time.value.ready && readyState.value) {
  715. if (time.value.ready) {
  716. return false;
  717. }
  718. speckCancel();
  719. readyState.value = false;
  720. time.value.ready = 6;
  721. timerManager.value.readyTimer = setInterval(() => {
  722. time.value.ready--;
  723. if (time.value.ready <= 0) {
  724. getClearTimer('readyTimer');
  725. getStartOneTest();
  726. } else {
  727. speckText(time.value.ready);
  728. }
  729. }, 1000);
  730. }
  731. };
  732. /**
  733. * 获取音乐
  734. */
  735. const getMusic = async () => {
  736. const list: any = useAppStore().getMusic();
  737. if (list.length) {
  738. musicList.value = list;
  739. } else {
  740. await proxy?.$http.train.musicList().then((res: any) => {
  741. if (res.data.length > 0) {
  742. let myList: any = res.data;
  743. musicList.value = myList;
  744. useAppStore().setMusic(myList);
  745. }
  746. });
  747. }
  748. };
  749. /**
  750. * 设置音乐
  751. */
  752. const setMusic = async (data:any) => {
  753. //console.log("data",data)
  754. parameter.value.music = data;
  755. };
  756. /**
  757. * 获取设备项目
  758. */
  759. const getDevice = async () => {
  760. let deviceid = localStorage.getItem('deviceid') || '';
  761. if (deviceid) {
  762. startDevice({ deviceid: deviceid });
  763. } else {
  764. proxy?.$modal.msgError(`缺少设备信息请重新登录!`);
  765. await proxy?.$http.common.logout({}).then((res: any) => {});
  766. proxy?.$modal?.closeLoading();
  767. //清空缓存
  768. // localStorage.clear();
  769. localStorage.removeItem('token');
  770. localStorage.removeItem('userInfo');
  771. //跳转
  772. router.push({ path: '/login/qrcode' });
  773. }
  774. };
  775. /**
  776. * 加载手势WS
  777. */
  778. const initHand = () => {
  779. handWs((e: any) => {
  780. if (router.currentRoute.value.path != '/train/test' || parameter.value.handcontroller == undefined || examState.value == 0) {
  781. return false;
  782. }
  783. console.log('eeeee', e);
  784. if (e?.wksid) {
  785. //获取设备项目
  786. getDevice();
  787. }
  788. //接收设备信息
  789. if (e?.device_info) {
  790. deviceInfo.value = e.device_info;
  791. let handcontroller_id = deviceInfo.value.handcontroller_id;
  792. stateHand(handcontroller_id);
  793. }
  794. //获取手势状态
  795. if (e?.cmd == 'get_handcontroller_state' && e?.state == 0) {
  796. let handcontroller_id = deviceInfo.value.handcontroller_id;
  797. startHand(handcontroller_id);
  798. }
  799. //刷新
  800. if (e?.data?.result == 'refresh') {
  801. getExit();
  802. //刷新
  803. window.location.reload();
  804. }
  805. //没初始化完成不监听手势动作
  806. if (examState.value == 0) {
  807. return false;
  808. }
  809. //左滑动
  810. // if (e?.data?.result == "next_item") {
  811. // proxy?.$modal.msgSuccess('手势指令:左滑动');
  812. // if(examState.value == 43 && time.value.ready){
  813. // return false;
  814. // }
  815. // if (examState.value == 43 || examState.value == 42) {
  816. // speckCancel();//停止播报
  817. // if (needStart.value == false) {
  818. // //自动流程项目重新识别直接返回3
  819. // closeOneTest();
  820. // } else {
  821. // //手动流程项目重新识别43返回41,42返回3
  822. // if (examState.value == 43) {
  823. // cleanData();
  824. // startFace();
  825. // } else {
  826. // closeOneTest();
  827. // }
  828. // }
  829. // }
  830. // }
  831. //举左手
  832. if (e?.data?.result == 'left_hand') {
  833. //proxy?.$modal.msgSuccess('手势指令:举左手');
  834. //举左手确认退出
  835. // if (exitStatus.value) {
  836. // exitStatus.value = 0;
  837. // //确认退出
  838. // let keyEvent: any = null;
  839. // keyEvent = new KeyboardEvent('keydown', {
  840. // key: 'Enter', // 键值
  841. // code: 'Enter', // 键盘代码
  842. // keyCode: 13, // 旧的键盘代码
  843. // which: 13, // 新的键盘代码
  844. // shiftKey: false, // 是否按下Shift键
  845. // ctrlKey: false, // 是否按下Ctrl键
  846. // metaKey: false, // 是否按下Meta键(Win键或Command键)
  847. // bubbles: true, // 事件是否冒泡
  848. // cancelable: true // 是否可以取消事件的默认行为
  849. // });
  850. // document.activeElement?.dispatchEvent(keyEvent);
  851. // return false;
  852. // }
  853. //开始识别
  854. if (needStart.value && examState.value < 41) {
  855. getOpenOneTestAndStartFace();
  856. return false;
  857. }
  858. //停止人脸识别
  859. // if (needStart.value && examState.value == 41) {
  860. // getStopFace();
  861. // }
  862. //开始测试
  863. if (examState.value == 43) {
  864. if (needStart.value) {
  865. getReady();
  866. } else {
  867. getStartOneTest();
  868. }
  869. return false;
  870. }
  871. }
  872. //退出
  873. // if (e?.data?.result == "exit") {
  874. // proxy?.$modal.msgSuccess('手势指令:交叉手');
  875. // // console.log("exitStatus.value", exitStatus.value)
  876. // if (exitStatus.value == 0) {
  877. // speckText("请保持两秒确认退出");
  878. // //第一次才弹出
  879. // confirmExit();
  880. // setTimeout(() => {
  881. // let keyEvent: any = null;
  882. // let myKey = null;
  883. // //如果交叉手两秒后返回超过4次就确认退出
  884. // if (exitStatus.value >= 4) {
  885. // myKey = 'Enter';
  886. // } else {
  887. // myKey = 'Esc';
  888. // }
  889. // if (myKey == 'Esc') {
  890. // keyEvent = new KeyboardEvent('keydown', {
  891. // key: 'Escape', // 键值
  892. // code: 'Escape', // 键盘代码
  893. // keyCode: 27, // 旧的键盘代码
  894. // which: 27, // 新的键盘代码
  895. // shiftKey: false, // 是否按下Shift键
  896. // ctrlKey: false, // 是否按下Ctrl键
  897. // metaKey: false, // 是否按下Meta键(Win键或Command键)
  898. // bubbles: true, // 事件是否冒泡
  899. // cancelable: true // 是否可以取消事件的默认行为
  900. // });
  901. // exitStatus.value = 0;
  902. // }
  903. // if (myKey == 'Enter') {
  904. // keyEvent = new KeyboardEvent('keydown', {
  905. // key: 'Enter', // 键值
  906. // code: 'Enter', // 键盘代码
  907. // keyCode: 13, // 旧的键盘代码
  908. // which: 13, // 新的键盘代码
  909. // shiftKey: false, // 是否按下Shift键
  910. // ctrlKey: false, // 是否按下Ctrl键
  911. // metaKey: false, // 是否按下Meta键(Win键或Command键)
  912. // bubbles: true, // 事件是否冒泡
  913. // cancelable: true // 是否可以取消事件的默认行为
  914. // });
  915. // }
  916. // document.activeElement?.dispatchEvent(keyEvent);
  917. // }, 2500)
  918. // }
  919. // exitStatus.value = exitStatus.value + 1
  920. // }
  921. // if (e?.data?.result == "exit") {
  922. // console.log("exitStatus.value", exitStatus.value)
  923. // if (exitStatus.value == 0) {
  924. // exitStatus.value = 1
  925. // speckText("请5秒内举左手确认退出");
  926. // //第一次才弹出
  927. // confirmExit();
  928. // time.value.exit = 6;
  929. // timerManager.value.exitTimer = setInterval(() => {
  930. // time.value.exit--;
  931. // console.log("取消倒计时", time.value.exit)
  932. // proxy?.$modal.msgWarning(`取消倒计时:${time.value.exit}`)
  933. // if (time.value.exit == 0) {
  934. // exitStatus.value = 0;
  935. // getClearTimer("exitTimer");
  936. // let keyEvent: any = null;
  937. // keyEvent = new KeyboardEvent('keydown', {
  938. // key: 'Escape', // 键值
  939. // code: 'Escape', // 键盘代码
  940. // keyCode: 27, // 旧的键盘代码
  941. // which: 27, // 新的键盘代码
  942. // shiftKey: false, // 是否按下Shift键
  943. // ctrlKey: false, // 是否按下Ctrl键
  944. // metaKey: false, // 是否按下Meta键(Win键或Command键)
  945. // bubbles: true, // 事件是否冒泡
  946. // cancelable: true // 是否可以取消事件的默认行为
  947. // });
  948. // document.activeElement?.dispatchEvent(keyEvent);
  949. // }
  950. // }, 1000);
  951. // }
  952. // }
  953. });
  954. };
  955. /**
  956. * 输出犯规
  957. */
  958. watch(
  959. () => backReason.value.length,
  960. (v) => {
  961. backReasonStr.value = backReason.value[backReason.value.length - 1];
  962. setTimeout(() => {
  963. backReasonStr.value = '';
  964. }, 1500);
  965. },
  966. { immediate: true }
  967. );
  968. /**
  969. * 播报时间
  970. */
  971. watch(
  972. () => time.value.countdownNum,
  973. (newData) => {
  974. if (examState.value != 42) {
  975. return false;
  976. }
  977. if (newData >= 30 && newData < time.value.testTime) {
  978. if (newData % 30 == 0) {
  979. speckText(`还有${newData}秒`);
  980. }
  981. }
  982. if (newData == 10) {
  983. speckText('还有10秒');
  984. }
  985. if (newData <= 5) {
  986. speckText(newData);
  987. }
  988. if (newData == 0) {
  989. speckText('哨声');
  990. }
  991. },
  992. { immediate: true }
  993. );
  994. /**
  995. * 成绩整数播报
  996. */
  997. watch(
  998. () => currentResultObj.value,
  999. (newData: any, oldData: any) => {
  1000. if (examState.value != 42 || newData.count <= 0) {
  1001. return false;
  1002. }
  1003. let project = parameter.value.project;
  1004. //引体向上比较慢所以都播报
  1005. if (['pullup'].includes(project) && newData.count > 0 && oldData.back_num == oldData.back_num) {
  1006. speckText(newData.count);
  1007. }
  1008. if (
  1009. ['situp', 'sidepullup', 'jumprope', 'jumpingjack', 'highknees'].includes(project) &&
  1010. newData.count > 0 &&
  1011. newData.count % 10 == 0 &&
  1012. oldData.back_num == oldData.back_num
  1013. ) {
  1014. speckText(newData.count);
  1015. }
  1016. },
  1017. { immediate: true }
  1018. );
  1019. /**
  1020. * 播报时间
  1021. */
  1022. watch(
  1023. () => currentResultObj.value.count,
  1024. (newData) => {
  1025. if (newData > 0 && ['jumprope'].includes(parameter.value.project)) {
  1026. //let frameRate = 12;
  1027. //gameContainer.value.sports(frameRate);
  1028. }
  1029. },
  1030. { immediate: true }
  1031. );
  1032. /**
  1033. * 时间转换
  1034. */
  1035. // const countdownNumFormat = computed(() => {
  1036. // return time.value.countdownNum;
  1037. // //return proxy?.$utils.timeFormat(time.value.countdownNum);
  1038. // });
  1039. onBeforeMount(() => {
  1040. parameter.value = route.query;
  1041. let project = parameter.value.project;
  1042. let area = parameter.value.area;
  1043. parameter.value.examId = `${project}_${area}`; //项目+区
  1044. if (parameter.value.time) {
  1045. time.value.testTime = parameter.value.time;
  1046. }
  1047. time.value.countdownNum = time.value.testTime;
  1048. userInfo.value = JSON.parse(myInfo);
  1049. unit.value = dic.unit[project];
  1050. if (parameter.value.gesture == 'true') {
  1051. parameter.value.gesture = true;
  1052. } else {
  1053. parameter.value.gesture = false;
  1054. }
  1055. //需要开始按钮的项目
  1056. let myList = ['situp', 'jumprope', 'jumpingjack', 'highknees', 'footballv1', 'basketballv1', 'pingpong'];
  1057. if (myList.includes(project)) {
  1058. needStart.value = true;
  1059. }
  1060. //加载WS
  1061. initWs({ parameter: parameter.value, testTime: time.value.testTime }, (data: any) => {
  1062. getMessage(data);
  1063. });
  1064. //初始化语音
  1065. initSpeech();
  1066. //初始化手势
  1067. initHand();
  1068. //加载音乐
  1069. getMusic();
  1070. //刷新关闭
  1071. window.onbeforeunload = function (e) {
  1072. var confirmationMessage = '刷新/关闭页面将会关闭页面,是否确认退出页面?';
  1073. (e || window.event).returnValue = confirmationMessage; // 兼容 Gecko + IE
  1074. let bUrl = import.meta.env.VITE_APP_BASE_API;
  1075. let classId = parameter.value.classes;
  1076. let project = parameter.value.project;
  1077. let area = parameter.value.area;
  1078. let examId = `${project}_${area}`;
  1079. let mySid = sid.value;
  1080. let token: any = localStorage.getItem('token');
  1081. let formData = new FormData();
  1082. formData.append('exam_id', examId);
  1083. formData.append('class_id', classId);
  1084. formData.append('token', token);
  1085. formData.append('sid', mySid);
  1086. navigator.sendBeacon(bUrl + '/exam/close_exam', formData);
  1087. return confirmationMessage; // 兼容 Gecko + Webkit, Safari, Chrome
  1088. };
  1089. });
  1090. onBeforeUnmount(() => {
  1091. getExit();
  1092. });
  1093. </script>
  1094. <style lang="scss" scoped>
  1095. $topPadding: 5.19rem;
  1096. $waiPadding: 6.51rem;
  1097. .main {
  1098. width: calc(100% - ($waiPadding * 2));
  1099. height: 78vh;
  1100. padding-top: 10rem;
  1101. margin: 0 auto;
  1102. display: flex;
  1103. justify-content: space-between;
  1104. overflow: hidden;
  1105. .main-left {
  1106. width: 71.5%;
  1107. display: flex;
  1108. flex-direction: column;
  1109. justify-content: space-between;
  1110. .main-left-top {
  1111. display: flex;
  1112. justify-content: space-between;
  1113. height: 55.8%;
  1114. position: relative;
  1115. .top-left {
  1116. width: 37.4%;
  1117. height: 100%;
  1118. border-radius: 1.6rem;
  1119. background: radial-gradient(122% 126% at 97% 6%, #35ffc6 0%, #00ffe8 100%);
  1120. text-align: center;
  1121. display: flex;
  1122. align-items: center;
  1123. justify-content: center;
  1124. cursor: pointer;
  1125. .top-left-center {
  1126. .pic {
  1127. width: 22.3vh;
  1128. height: 22.3vh;
  1129. border-radius: 50%;
  1130. display: flex;
  1131. justify-content: center;
  1132. align-items: center;
  1133. overflow: hidden;
  1134. margin: 0 auto 2vh auto;
  1135. img {
  1136. width: 100%;
  1137. }
  1138. }
  1139. .pic2 {
  1140. box-sizing: border-box;
  1141. border: 0.44rem solid rgba(26, 41, 58, 0.6315);
  1142. }
  1143. .name {
  1144. width: 100%;
  1145. color: #1a293a;
  1146. font-size: 2.21rem;
  1147. }
  1148. .name2 {
  1149. padding: 0 0.3rem;
  1150. border-radius: 1.1rem;
  1151. background: radial-gradient(96% 96% at 2% 32%, #ffffff 0%, #fcfdfd 54%, #e1e4e7 100%);
  1152. box-shadow: inset 0px 1px 0px 2px rgba(255, 255, 255, 0.9046), inset 0px 3px 6px 0px rgba(0, 0, 0, 0.0851);
  1153. }
  1154. }
  1155. }
  1156. .top-right {
  1157. width: 62%;
  1158. height: 100%;
  1159. border-radius: 1.6rem;
  1160. opacity: 1;
  1161. background: #ffffff;
  1162. box-sizing: border-box;
  1163. border: 0.55rem solid #13ed84;
  1164. display: flex;
  1165. align-items: center;
  1166. justify-content: center;
  1167. flex-direction: column;
  1168. position: relative;
  1169. .time {
  1170. width: 28vh;
  1171. height: 28vh;
  1172. line-height: 28vh;
  1173. border-radius: 50%;
  1174. color: #ff9402;
  1175. font-size: 11vh;
  1176. text-align: center;
  1177. background-image: url('@/assets/images/test/time.png');
  1178. background-position: center;
  1179. background-repeat: no-repeat;
  1180. background-size: 100% 100%;
  1181. position: absolute;
  1182. right: -1.5vh;
  1183. top: -11vh;
  1184. font-family: 'Saira-BlackItalic';
  1185. }
  1186. .tips {
  1187. display: flex;
  1188. justify-content: center;
  1189. align-items: center;
  1190. height: 100%;
  1191. img {
  1192. max-height: 80%;
  1193. max-height: 80%;
  1194. }
  1195. }
  1196. .complete {
  1197. width: 100%;
  1198. display: flex;
  1199. justify-content: center;
  1200. flex-direction: column;
  1201. .scoreBox {
  1202. height: 10vh;
  1203. color: #1a293a;
  1204. display: flex;
  1205. align-items: center;
  1206. justify-content: center;
  1207. margin-bottom: 5vh;
  1208. .score {
  1209. font-size: 8.5rem;
  1210. line-height: 8.5rem;
  1211. font-family: 'Saira-BlackItalic';
  1212. }
  1213. .prompt {
  1214. font-size: 3.5rem;
  1215. line-height: 3.5rem;
  1216. }
  1217. .unit {
  1218. font-size: 2rem;
  1219. margin-left: 10px;
  1220. }
  1221. }
  1222. .fractionViolation {
  1223. height: 10vh;
  1224. display: flex;
  1225. align-items: center;
  1226. justify-content: center;
  1227. .fraction {
  1228. height: 10vh;
  1229. line-height: 10vh;
  1230. border-radius: 5vh;
  1231. display: flex;
  1232. align-items: center;
  1233. padding: 0 6%;
  1234. background: linear-gradient(138deg, #38536c 21%, #1a293a 75%);
  1235. box-shadow: inset 0px 1px 13px 0px rgba(255, 255, 255, 0.9452);
  1236. .lable {
  1237. font-size: 4vh;
  1238. color: #13ed84;
  1239. }
  1240. .value {
  1241. font-size: 7vh;
  1242. color: #00ffe8;
  1243. font-family: 'Saira-BlackItalic';
  1244. min-width: 7vh;
  1245. }
  1246. }
  1247. .violation {
  1248. height: 6.1vh;
  1249. line-height: 6.1vh;
  1250. border-radius: 4vh;
  1251. border: 0.25rem solid #ed7905;
  1252. display: flex;
  1253. align-items: center;
  1254. margin-left: 11px;
  1255. padding: 3px;
  1256. box-sizing: content-box;
  1257. .lable {
  1258. font-size: 1.2rem;
  1259. color: #ffffff;
  1260. width: 6.1vh;
  1261. height: 6.1vh;
  1262. line-height: 6.1vh;
  1263. background: #ed7905;
  1264. border-radius: 50%;
  1265. text-align: center;
  1266. }
  1267. .value {
  1268. margin-left: 1.5vh;
  1269. font-size: 3.2rem;
  1270. color: #ed7905;
  1271. font-family: 'Saira-BlackItalic';
  1272. min-width: 6vh;
  1273. }
  1274. }
  1275. }
  1276. }
  1277. .complete2 {
  1278. padding-left: 20%;
  1279. padding-top: 5vh;
  1280. .scoreBox {
  1281. margin-bottom: 3vh;
  1282. justify-content: left;
  1283. }
  1284. .fractionViolation {
  1285. justify-content: left;
  1286. .fraction {
  1287. padding: 0 8%;
  1288. }
  1289. }
  1290. }
  1291. .foulBox {
  1292. height: calc(4.2vh + 0.5rem + 6px);
  1293. overflow: hidden;
  1294. display: flex;
  1295. align-items: center;
  1296. justify-content: center;
  1297. padding-top: 3vh;
  1298. .foul {
  1299. height: 4.2vh;
  1300. line-height: 4.2vh;
  1301. border-radius: 3vh;
  1302. border: 0.25rem solid #ed7905;
  1303. display: flex;
  1304. align-items: center;
  1305. margin-left: 11px;
  1306. padding: 3px;
  1307. box-sizing: content-box;
  1308. .lable {
  1309. font-size: 2rem;
  1310. color: #ffffff;
  1311. width: 4.2vh;
  1312. height: 4.2vh;
  1313. line-height: 4.2vh;
  1314. background: #ed7905;
  1315. border-radius: 50%;
  1316. text-align: center;
  1317. }
  1318. .value {
  1319. margin-left: 1.5vh;
  1320. font-size: 2rem;
  1321. color: #ed7905;
  1322. font-family: 'Saira-BlackItalic';
  1323. min-width: 6vh;
  1324. padding: 0 10px;
  1325. }
  1326. }
  1327. }
  1328. .readyBoxBefore {
  1329. display: flex;
  1330. justify-content: center;
  1331. font-size: 2.5rem;
  1332. color: #1a293a;
  1333. padding-top: 4vh;
  1334. line-height: 0;
  1335. margin-bottom: 2vh;
  1336. .item {
  1337. display: flex;
  1338. justify-content: center;
  1339. .lable {
  1340. display: flex;
  1341. align-items: center;
  1342. margin-left: 10px;
  1343. }
  1344. }
  1345. img {
  1346. height: 20vh;
  1347. }
  1348. }
  1349. .readyBox {
  1350. text-align: center;
  1351. color: #1a293a;
  1352. .value {
  1353. font-size: 8.5rem;
  1354. line-height: 8.5rem;
  1355. font-family: 'Saira-BlackItalic';
  1356. }
  1357. .lable {
  1358. font-size: 3.5rem;
  1359. }
  1360. .transparent {
  1361. opacity: 0;
  1362. }
  1363. }
  1364. .btn {
  1365. font-size: 2.21rem;
  1366. color: #ffffff;
  1367. text-align: center;
  1368. width: 50%;
  1369. line-height: 8vh;
  1370. line-height: 8vh;
  1371. border-radius: 15px;
  1372. opacity: 1;
  1373. background: radial-gradient(159% 126% at 5% 93%, #f99f02 0%, #ed7905 100%);
  1374. box-shadow: 3px 6px 4px 1px rgba(0, 0, 0, 0.1874), inset 0px 1px 0px 2px rgba(255, 255, 255, 0.3);
  1375. cursor: pointer;
  1376. }
  1377. .btn2 {
  1378. width: auto;
  1379. padding: 0 10px;
  1380. }
  1381. .exitBtn {
  1382. color: #ffffff;
  1383. background: radial-gradient(159% 126% at 5% 93%, #931b1b 0%, #ec5624 0%, #ff6860 76%);
  1384. box-shadow: 3px 6px 4px 1px rgba(0, 0, 0, 0.1874), inset 0px 1px 0px 2px rgba(255, 255, 255, 0.5577);
  1385. &:hover {
  1386. background: #ec5624;
  1387. }
  1388. }
  1389. }
  1390. i {
  1391. width: 4vw;
  1392. height: 4vw;
  1393. display: block;
  1394. position: absolute;
  1395. top: 50%;
  1396. left: 37.5%;
  1397. margin-top: calc(4vw * -0.5);
  1398. margin-left: calc(4vw * -0.5);
  1399. background-image: url('@/assets/images/test/yuan.png');
  1400. background-position: center;
  1401. background-repeat: no-repeat;
  1402. background-size: 100% 100%;
  1403. border-radius: 50%;
  1404. flex-shrink: 0;
  1405. transition: all 0.5s;
  1406. }
  1407. }
  1408. .main-left-bottom {
  1409. display: flex;
  1410. justify-content: space-between;
  1411. height: calc(100% - 55.8% - 3vh);
  1412. overflow: hidden;
  1413. .bottom-left {
  1414. width: 58%;
  1415. padding-right: 1rem;
  1416. display: flex;
  1417. flex-direction: column;
  1418. .tips {
  1419. height: 2.8vh;
  1420. img {
  1421. height: 100%;
  1422. }
  1423. }
  1424. .pic {
  1425. text-align: center;
  1426. width: 100%;
  1427. height: 100%;
  1428. display: flex;
  1429. justify-content: center;
  1430. overflow: hidden;
  1431. img {
  1432. max-width: 100%;
  1433. max-height: 100%;
  1434. }
  1435. }
  1436. }
  1437. .bottom-right {
  1438. width: 41%;
  1439. height: 100%;
  1440. overflow-y: scroll;
  1441. color: #f9f9f9;
  1442. font-size: 1.1rem;
  1443. line-height: 1.6rem;
  1444. &::-webkit-scrollbar {
  1445. width: 10px;
  1446. }
  1447. &::-webkit-scrollbar-thumb {
  1448. border-width: 2px;
  1449. border-radius: 4px;
  1450. border-style: dashed;
  1451. border-color: transparent;
  1452. background-color: rgba(26, 62, 78, 0.9);
  1453. background-clip: padding-box;
  1454. }
  1455. &::-webkit-scrollbar-button:hover {
  1456. border-radius: 6px;
  1457. background: rgba(26, 62, 78, 1);
  1458. }
  1459. }
  1460. }
  1461. }
  1462. .main-right {
  1463. width: 27%;
  1464. border-radius: 1.6rem;
  1465. background: linear-gradient(29deg, #092941 -82%, #2a484b 94%);
  1466. box-shadow: inset 0px 1px 0px 2px rgba(255, 255, 255, 0.4);
  1467. display: flex;
  1468. flex-direction: column;
  1469. overflow: hidden;
  1470. }
  1471. }
  1472. .close {
  1473. position: absolute;
  1474. // right: calc($waiPadding - 3.2rem);
  1475. left: auto;
  1476. right: calc($topPadding / 2 - 3.2rem / 4);
  1477. top: auto;
  1478. bottom: calc($topPadding / 2 - 3.2rem / 4);
  1479. }
  1480. </style>