square.vue 43 KB

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