multiple copy.vue 47 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833
  1. <template>
  2. <div>
  3. <Header @confirmExit="confirmExit"></Header>
  4. <Transition :enter-active-class="proxy?.animate.dialog.enter" :leave-active-class="proxy?.animate.dialog.leave">
  5. <div class="time" :class="{ 'time1': styleType == 1, 'time2': styleType == 2, 'time3': styleType == 3 }"
  6. v-show="needStart && [42].includes(examState)">{{
  7. time.countdownNum
  8. }}</div>
  9. </Transition>
  10. <div class="main">
  11. <div class="testBox"
  12. :class="{ 'testBox1': styleType == 1, 'testBox2': styleType == 2, 'testBox3': styleType == 3 }">
  13. <div class="ul"
  14. :class="{ 'overlap': (examState == 43 && time.ready) || [42].includes(examState) || (showTestAgain && ![41].includes(examState)), 'ready': [41].includes(examState), 'hands': parameter.gesture }"
  15. v-for="(items, indexs) in testListArr " :key="indexs">
  16. <MultipleItem :ref="(el: any) => { multipleItemRef(el, item.itemNumber, item.area) }"
  17. v-for="(item, index) in items" :query="parameter" :area="item.area" :key="index" @returnData="returnData"
  18. @getChooseStudent="getChooseStudent" :examState="examState" :needStart="needStart" :styleType="styleType" />
  19. </div>
  20. </div>
  21. </div>
  22. <div class="footerBtn">
  23. <template v-if="needStart">
  24. <div class="btn" @click="getAgain" v-if="examState == 42 || showTestAgain">再测一次</div>
  25. <div class="btn" @click="getOpenOneTestAndStartFace" v-if="examState < 41">开始识别</div>
  26. <div class="btn" @click="getStopFace" v-if="examState == 41">停止人脸识别</div>
  27. <div class="btn startBtn" @click="getReady" v-if="examState == 43">开始测试</div>
  28. <div class="btn" @click="getAllRetestFace" v-if="examState == 43 || examState == 42">重新识别</div>
  29. </template>
  30. <template v-else>
  31. <div class="btn startBtn" @click="getReady" v-if="examState == 43">开始测试</div>
  32. </template>
  33. <div class="btn" :class="{ testRecordBtn: showReportList }" @click="getTestRecord"
  34. v-if="![43, 42].includes(examState)">
  35. {{ showReportList ? '关闭记录' : '测试记录' }}
  36. </div>
  37. <!--测试记录开始-->
  38. <Transition :enter-active-class="proxy?.animate.mask.enter" :leave-active-class="proxy?.animate.mask.leave">
  39. <div class="mask mask2" v-show="showReportList" @click="getTestRecord"></div>
  40. </Transition>
  41. <Transition :enter-active-class="proxy?.animate.report.enter" :leave-active-class="proxy?.animate.report.leave">
  42. <div class="main-right" v-show="showReportList">
  43. <ReportList ref="reportListRef" :parameter="parameter" :showQRCode="true" />
  44. </div>
  45. </Transition>
  46. <!--测试记录结束-->
  47. </div>
  48. <!--倒计时开始-->
  49. <div>
  50. <Transition :enter-active-class="proxy?.animate.mask.enter" :leave-active-class="proxy?.animate.mask.leave">
  51. <div class="mask" v-show="examState == 43 && time.ready"></div>
  52. </Transition>
  53. <Transition :enter-active-class="proxy?.animate.face.enter" :leave-active-class="proxy?.animate.face.leave2">
  54. <div class="confirmDiaBg" v-show="examState == 43 && time.ready">
  55. <div class="confirmDiaWindow">
  56. <div class="readyBox">
  57. <div class="lable">倒计时</div>
  58. <div class="value" :class="{ 'transparent': time.ready > 5 }">{{ time.ready }}</div>
  59. </div>
  60. </div>
  61. </div>
  62. </Transition>
  63. </div>
  64. <!--倒计时结束-->
  65. <ChooseStudent ref="chooseStudentRef" @returnData="returnStudent" />
  66. </div>
  67. </template>
  68. <script setup name="Multiple" lang="ts">
  69. import { useWs } from '@/utils/trainWs';
  70. // import { initWs, examEnds, openOneTest, startFace, stopFace, faceConfirmOnly, startOneTest, finishOneTest, closeOneTest, suspendFaceRecognitionChannels, resumeFaceRecognitionChannels } from '@/utils/ws'
  71. import { initSpeech, speckText, playMusic, controlMusic, speckCancel, chineseNumber } from '@/utils/speech'
  72. import { useWebSocket } from '@/utils/handWs';
  73. const { handWs, startDevice, startHand, stateHand } = useWebSocket();
  74. const { initWs, examEnds, openOneTest, startFace, stopFace, faceConfirmOnly, startOneTest, finishOneTest, closeOneTest, suspendFaceRecognitionChannels, resumeFaceRecognitionChannels } = useWs();
  75. const { proxy } = getCurrentInstance() as any;
  76. const router = useRouter();
  77. const route = useRoute();
  78. const reportListRef = ref();
  79. const chooseStudentRef = ref();
  80. const data = reactive<any>({
  81. timerManager: {},//计时器管理
  82. parameter: {},//参数
  83. time: {
  84. testTime: 60,//时长
  85. countdownNum: 0,//计时
  86. ready: 0,//预备
  87. exit: 0,//退出倒计时
  88. },
  89. userInfo: {},//用户信息
  90. examState: 0,//当前状态
  91. needStart: false,//是否需要按钮
  92. showTestAgain: false,//再测一次按钮
  93. testList: [],//获取区列表
  94. multipleItemRefList: [],//获取区列表
  95. styleType: null,//展示样式1:1-5个,2:6-10个,3:10个以上
  96. showReportList: false,//显示隐藏测试记录
  97. exit: 0,//退出响应次数
  98. sid: null,//WS的id
  99. chooseStudentArea: '',//弹出手动选择对应的区号
  100. device_info: {},//设备信息
  101. });
  102. const { timerManager, parameter, time, userInfo, examState, needStart, showTestAgain, testList, multipleItemRefList, styleType, showReportList, exit, sid, chooseStudentArea, device_info } = toRefs(data);
  103. /**
  104. * 创建组件实例
  105. */
  106. const multipleItemRef = (el: any, index: number, area: any) => {
  107. el.area = area;
  108. multipleItemRefList.value[index - 1] = el;
  109. }
  110. /**
  111. * 开始识别
  112. */
  113. const getOpenOneTestAndStartFace = () => {
  114. cleanData();
  115. examState.value = 41;
  116. // for (let i: any = 0; i < multipleItemRefList.value.length; i++) {
  117. // multipleItemRefList.value[i].getOpenOneTestAndStartFace()
  118. // }
  119. for (let i: any = 0; i < testList.value.length; i++) {
  120. getOpenOneTestAndStartFaceList(testList.value[i])
  121. }
  122. };
  123. /**
  124. * 开始识别
  125. */
  126. const getOpenOneTestAndStartFaceList = async (data: any) => {
  127. let project: any = parameter.value.project;
  128. let area: any = data.area;
  129. let examId: string = `${project}_${area}`; //项目+区
  130. if (area == null || area == "") {
  131. return false;
  132. }
  133. console.log("examId", examId)
  134. if (examState.value > 3) {
  135. await closeOneTest(examId);
  136. }
  137. await openOneTest(examId);
  138. await startFace(examId);
  139. };
  140. /**
  141. * 停止人脸识别
  142. */
  143. const getStopFace = async () => {
  144. let flag = false;
  145. for (let i = 0; i < testList.value.length; i++) {
  146. if (testList.value[i] && testList.value[i].faceCheckStu?.student_id) {
  147. flag = true;
  148. }
  149. }
  150. if (!flag) {
  151. proxy?.$modal.msgWarning("请选择人员!");
  152. return false;
  153. }
  154. examState.value = 43;
  155. // for (let i: any = 0; i < multipleItemRefList.value.length; i++) {
  156. // multipleItemRefList.value[i].getStopFace()
  157. // }
  158. for (let i: any = 0; i < testList.value.length; i++) {
  159. getStopFaceList(testList.value[i])
  160. }
  161. };
  162. /**
  163. * 停止人脸识别
  164. */
  165. const getStopFaceList = async (data: any) => {
  166. let project: any = parameter.value.project;
  167. let area: any = data.area;
  168. let examId: string = `${project}_${area}`; //项目+区
  169. if (area == null || area == "") {
  170. return false;
  171. }
  172. // 旧版识别成功直接43了这里先屏蔽
  173. // if (examState.value != 41) {
  174. // return false;
  175. // }
  176. if (data.examState == 41) {
  177. await stopFace(examId);
  178. }
  179. if (data.faceCheckStu.student_id) {
  180. getFaceConfirmOnlyList(data);
  181. }
  182. };
  183. /**
  184. * 确定人脸信息
  185. */
  186. const getFaceConfirmOnlyList = (data?: any) => {
  187. let project: any = parameter.value.project;
  188. let area: any = data.area;
  189. let examId: string = `${project}_${area}`; //项目+区
  190. if (area == null || area == "") {
  191. return false;
  192. }
  193. faceConfirmOnly({
  194. exam_id: examId,
  195. result_id: data.resultId,
  196. student_id: data.faceCheckStu.student_id,
  197. gender: data.faceCheckStu.gender
  198. }, () => {
  199. });
  200. };
  201. /**
  202. * 开始测试
  203. */
  204. const getStartOneTest = () => {
  205. if (examState.value != 43) {
  206. return false;
  207. }
  208. let flag = false;
  209. for (let i = 0; i < testList.value.length; i++) {
  210. if (testList.value[i] && testList.value[i].faceCheckStu?.student_id) {
  211. flag = true;
  212. }
  213. }
  214. if (!flag) {
  215. proxy?.$modal.msgWarning("请选择人员!");
  216. return false;
  217. }
  218. getClearTimer("readyTimer");
  219. time.value.ready = 0;
  220. examState.value = 42;
  221. // for (let i: any = 0; i < multipleItemRefList.value.length; i++) {
  222. // if (testList.value[i].examState == 41) {
  223. // //正在识别的停止识别
  224. // multipleItemRefList.value[i].getStopFace()
  225. // }
  226. // if (testList.value[i].examState == 43) {
  227. // multipleItemRefList.value[i].getStartOneTest()
  228. // }
  229. // }
  230. for (let i: any = 0; i < testList.value.length; i++) {
  231. if (testList.value[i].examState == 41) {
  232. //正在识别的停止识别
  233. getStopFaceList(testList.value[i])
  234. }
  235. if (testList.value[i].examState == 43) {
  236. getStartOneTestList(testList.value[i])
  237. }
  238. }
  239. speckText("哨声");
  240. if (parameter.value.music) {
  241. playMusic(parameter.value.music);
  242. }
  243. //显示再测一次按钮
  244. showTestAgain.value = true;
  245. //时间为0的为正计时,大于0的为倒计时
  246. if (time.value.testTime == 0) {
  247. getCounting("+");
  248. } else {
  249. getCounting("-");
  250. }
  251. };
  252. /**
  253. * 开始测试
  254. */
  255. const getStartOneTestList = (data?:any) => {
  256. let project: any = parameter.value.project;
  257. let area: any = data.area;
  258. let examId: string = `${project}_${area}`; //项目+区
  259. if (area == null || area == "") {
  260. return false;
  261. }
  262. if (data.examState != 43 || !data.faceCheckStu.student_id) {
  263. return false;
  264. }
  265. startOneTest(examId, () => { })
  266. };
  267. /**
  268. * 再测一次
  269. */
  270. const getAgain = () => {
  271. let loading = ElLoading.service({ text: '请稍等...', background: 'rgba(0, 0, 0, 0.8)', customClass: `sports ${parameter.value.project}` });
  272. cleanData();
  273. examState.value = 41;
  274. // for (let i: any = 0; i < multipleItemRefList.value.length; i++) {
  275. // multipleItemRefList.value[i].getAgain()
  276. // }
  277. for (let i: any = 0; i < testList.value.length; i++) {
  278. getAgainList()
  279. }
  280. timerManager.value.againTimer = setInterval(() => {
  281. if (examState.value == 43) {
  282. getClearTimer("againTimer");
  283. loading?.close();
  284. }
  285. }, 300);
  286. let loadingTime = setTimeout(() => {
  287. if (examState.value <= 41) {
  288. loading?.close();
  289. clearTimeout(loadingTime);
  290. getClearTimer("againTimer");
  291. }
  292. }, 10000);
  293. };
  294. /**
  295. * 再测一次
  296. */
  297. const getAgainList = async (data?:any) => {
  298. let project: any = parameter.value.project;
  299. let area: any = data.area;
  300. let examId: string = `${project}_${area}`; //项目+区
  301. if (area == null || area == "") {
  302. return false;
  303. }
  304. //预存测试人员
  305. let student = JSON.parse(JSON.stringify(data.faceCheckStu));
  306. //测试中
  307. if (data.examState == 42) {
  308. await finishOneTest(examId);
  309. }
  310. //其他状态
  311. if (data.examState > 3) {
  312. await closeOneTest(examId);
  313. }
  314. //重新走一次流程
  315. await openOneTest(examId);
  316. await startFace(examId);
  317. await stopFace(examId);
  318. let index = testList.value.findIndex((item: any) => {
  319. return area == item.area;
  320. })
  321. multipleItemRefList.value[index]?.returnStudent(student);
  322. if (student.student_id) {
  323. getFaceConfirmOnlyList(data);
  324. }
  325. };
  326. /**
  327. * 重新识别
  328. */
  329. const getAllRetestFace = async () => {
  330. let loading = ElLoading.service({ text: '请稍等...', background: 'rgba(0, 0, 0, 0.8)', customClass: `sports ${parameter.value.project}` });
  331. showTestAgain.value = false;
  332. examState.value = 3;
  333. // for (let i: any = 0; i < multipleItemRefList.value.length; i++) {
  334. // multipleItemRefList.value[i].getAllRetestFace()
  335. // }
  336. for (let i: any = 0; i < testList.value.length; i++) {
  337. getAllRetestFaceList(data)
  338. }
  339. timerManager.value.allRetestFaceTimer = setInterval(() => {
  340. if (examState.value == 41) {
  341. getClearTimer("allRetestFaceTimer");
  342. loading?.close();
  343. }
  344. }, 300);
  345. let loadingTime = setTimeout(() => {
  346. if (examState.value <= 3) {
  347. loading?.close();
  348. clearTimeout(loadingTime);
  349. getClearTimer("allRetestFaceTimer");
  350. }
  351. }, 10000);
  352. };
  353. /**
  354. * 重新识别
  355. */
  356. const getAllRetestFaceList = async (data?:any) => {
  357. let project: any = parameter.value.project;
  358. let area: any = data.area;
  359. let examId: string = `${project}_${area}`; //项目+区
  360. if (area == null || area == "") {
  361. return false;
  362. }
  363. //测试中
  364. if (data.examState == 42) {
  365. await finishOneTest(examId);
  366. }
  367. //其他状态
  368. if (data.examState > 3) {
  369. await closeOneTest(examId);
  370. }
  371. //重新走一次流程
  372. await getOpenOneTestAndStartFace();
  373. };
  374. /**
  375. * 确认退出
  376. */
  377. const confirmExit = () => {
  378. let handcontroller_id = parameter.value.handcontroller;
  379. proxy?.$modal.confirm(handcontroller_id ? `请举左手确认退出` : `确定退出吗?`).then(() => {
  380. getExit();
  381. }).finally(() => {
  382. });
  383. };
  384. /**
  385. * 退出
  386. */
  387. const getExit = () => {
  388. getClearTimer();//清除计时器
  389. examEnds();//通知工作站关闭
  390. speckCancel();//停止播报
  391. window.onbeforeunload = null;//移除事件处理器
  392. let handcontroller_id = parameter.value.handcontroller;
  393. if (handcontroller_id) {
  394. router.push({ path: '/gesture' });//跳转
  395. } else {
  396. router.push({ path: '/' });//跳转
  397. }
  398. };
  399. /**
  400. * 清空定时任务
  401. */
  402. const getClearTimer = (data?: any) => {
  403. if (data) {
  404. //清除指定
  405. clearInterval(timerManager.value[data])
  406. timerManager.value[data] = null;
  407. } else {
  408. //清除全部
  409. for (let key in timerManager.value) {
  410. if (timerManager.value.hasOwnProperty(key)) {
  411. clearInterval(timerManager.value[key])
  412. timerManager.value[key] = null;
  413. }
  414. }
  415. }
  416. };
  417. /**
  418. * 清除历史记录
  419. */
  420. const cleanData = () => {
  421. getClearTimer("countdownTimer");
  422. time.value.countdownNum = time.value.testTime;
  423. showTestAgain.value = false;
  424. };
  425. /**
  426. * 时间转换
  427. */
  428. // const countdownNumFormat = computed(() => {
  429. // return time.value.countdownNum;
  430. // //return proxy?.$utils.timeFormat(time.value.countdownNum);
  431. // });
  432. /**
  433. * 倒计时
  434. */
  435. const getCounting = (type: string) => {
  436. timerManager.value.countdownTimer = setInterval(() => {
  437. //正计时
  438. if (type == "+") {
  439. time.value.countdownNum++;
  440. }
  441. //倒计时
  442. if (type == "-") {
  443. if (time.value.countdownNum <= 0) {
  444. getClearTimer("countdownTimer");
  445. } else {
  446. time.value.countdownNum--;
  447. }
  448. }
  449. }, 1000);
  450. };
  451. /**
  452. * 子组件选择学生
  453. */
  454. const getChooseStudent = (data: any) => {
  455. console.log("data", data)
  456. chooseStudentArea.value = data;
  457. chooseStudentRef.value.open();
  458. }
  459. /**
  460. * 返回被选学生
  461. */
  462. const returnStudent = (data: any) => {
  463. console.log("data", data)
  464. let area = chooseStudentArea.value.area;
  465. let index = testList.value.findIndex((item: any) => {
  466. return area == item.area;
  467. })
  468. // console.log("index", index)
  469. multipleItemRefList.value[index]?.returnStudent(data);
  470. };
  471. /**
  472. * 子组件返回数据
  473. */
  474. const returnData = (data: any) => {
  475. let index = testList.value.findIndex((item: any) => {
  476. return item.area == data.area;
  477. });
  478. let obj = Object.assign(testList.value[index], data);
  479. testList.value[index] = JSON.parse(JSON.stringify(obj));
  480. console.log("testList.value", testList.value)
  481. if (examState.value == 0) {
  482. let flag = false;
  483. //只监听人脸识别的区
  484. let newList = testList.value;
  485. for (let i = 0; i < newList.length; i++) {
  486. if (newList[i] && newList[i].examState == 3) {
  487. flag = true;
  488. }
  489. }
  490. if (flag) {
  491. console.log("变更状态:", 3)
  492. examState.value = 3;
  493. if (needStart.value) {
  494. let handcontroller = parameter.value.handcontroller;
  495. let ctrl = parameter.value.ctrl;
  496. if (handcontroller && ctrl) {
  497. speckText(`请${ctrl}区举左手开始识别`);
  498. } else {
  499. proxy?.$modal.msgWarning(`请点击右下角的【开始识别】`);
  500. }
  501. }
  502. }
  503. }
  504. if (examState.value == 3) {
  505. let flag = false;
  506. //只监听人脸识别的区
  507. let newList = testList.value;
  508. for (let i = 0; i < newList.length; i++) {
  509. if (newList[i] && newList[i].examState == 40) {
  510. flag = true;
  511. }
  512. }
  513. if (flag) {
  514. console.log("变更状态:", 40)
  515. examState.value = 40;
  516. }
  517. }
  518. if (examState.value == 40) {
  519. let flag = false;
  520. //只监听人脸识别的区
  521. let newList = testList.value;
  522. for (let i = 0; i < newList.length; i++) {
  523. if (newList[i] && newList[i].examState == 41) {
  524. flag = true;
  525. }
  526. }
  527. if (flag) {
  528. console.log("变更状态:", 41)
  529. examState.value = 41;
  530. let txt = parameter.value.gesture ? "请举右手看摄像头人脸识别" : "请看摄像头进行人脸识别";
  531. speckText(txt);
  532. //如果过段时候后仍在识别中就提示停止识别
  533. // setTimeout(() => {
  534. // if (examState.value == 41) {
  535. // let handcontroller = parameter.value.handcontroller;
  536. // let ctrl = parameter.value.ctrl;
  537. // if (handcontroller && ctrl) {
  538. // speckText(`各就位后请${ctrl}区举左手停止识别`);
  539. // } else {
  540. // proxy?.$modal.msgWarning(`各就位后请点击右下角的【停止人脸识别】`);
  541. // }
  542. // }
  543. // }, 15000)
  544. }
  545. }
  546. if (examState.value == 41) {
  547. let flag = false;
  548. //只监听人脸识别的区
  549. let newList = testList.value.filter((item: any) => {
  550. return item?.faceCheckStu?.student_id;
  551. })
  552. for (let i = 0; i < newList.length; i++) {
  553. if (newList[i] && newList[i].faceCheckStu?.student_id && newList[i].examState == 43) {
  554. flag = true;
  555. }
  556. }
  557. if (flag) {
  558. console.log("变更状态:", 43)
  559. examState.value = 43;
  560. cleanData();
  561. //如果过段时候后仍在识别中就提示停止识别
  562. // setTimeout(() => {
  563. // if (examState.value == 43) {
  564. // let handcontroller = parameter.value.handcontroller;
  565. // let ctrl = parameter.value.ctrl;
  566. // if (handcontroller && ctrl) {
  567. // speckText(`请${ctrl}区举左手开始测试`);
  568. // } else {
  569. // proxy?.$modal.msgWarning(`请点击右下角的【开始测试】`);
  570. // }
  571. // }
  572. // }, 10000)
  573. }
  574. }
  575. //测试完成后回退状态
  576. if (examState.value == 42) {
  577. let flag = false;
  578. //只监听人脸识别的区
  579. let newList = testList.value.filter((item: any) => {
  580. return item?.faceCheckStu?.student_id;
  581. })
  582. for (let i = 0; i < newList.length; i++) {
  583. if (newList[i] && newList[i].faceCheckStu?.student_id && newList[i].examState == 3) {
  584. flag = true;
  585. } else {
  586. return false;
  587. }
  588. }
  589. if (flag) {
  590. console.log("变更状态:", 3)
  591. examState.value = 3;
  592. }
  593. }
  594. //如果全部状态为0就退出
  595. if (examState.value >= 0) {
  596. let flag = false;
  597. //只监听人脸识别的区
  598. let newList = testList.value;
  599. for (let i = 0; i < newList.length; i++) {
  600. if (newList[i] && newList[i].examState == 0) {
  601. flag = true;
  602. } else {
  603. return false;
  604. }
  605. }
  606. if (flag) {
  607. examState.value = 0;
  608. getExit();
  609. }
  610. }
  611. };
  612. /**
  613. * 准备开始
  614. */
  615. const getReady = () => {
  616. if (examState.value != 43) {
  617. return false;
  618. }
  619. if (time.value.ready) {
  620. return false;
  621. }
  622. let flag = false;
  623. for (let i = 0; i < testList.value.length; i++) {
  624. if (testList.value[i] && testList.value[i].faceCheckStu?.student_id) {
  625. flag = true;
  626. }
  627. }
  628. if (!flag) {
  629. proxy?.$modal.msgWarning("请选择人员!");
  630. return false;
  631. }
  632. //停止播报;
  633. speckCancel()
  634. //正在识别的停止识别
  635. // for (let i: any = 0; i < multipleItemRefList.value.length; i++) {
  636. // if (testList.value[i].examState == 41) {
  637. // multipleItemRefList.value[i].getStopFace()
  638. // }
  639. // }
  640. for (let i: any = 0; i < testList.value.length; i++) {
  641. if (testList.value[i].examState == 41) {
  642. getStopFaceList((testList.value[i]))
  643. }
  644. }
  645. time.value.ready = 6;
  646. timerManager.value.readyTimer = setInterval(() => {
  647. time.value.ready--;
  648. if (time.value.ready <= 0) {
  649. getClearTimer("readyTimer");
  650. getStartOneTest();
  651. } else {
  652. speckText(time.value.ready);
  653. }
  654. }, 1000);
  655. };
  656. /**
  657. * 将测试列表转为多行
  658. */
  659. const testListArr = computed(() => {
  660. let list: any = [];
  661. let num = 0;
  662. if (styleType.value == 1) {
  663. num = 3
  664. }
  665. if (styleType.value == 2) {
  666. num = 5
  667. }
  668. if (styleType.value == 3) {
  669. num = 10
  670. }
  671. let myLength = Math.ceil(testList.value.length / num);
  672. for (let i = 0; i < myLength; i++) {
  673. list[i] = [];
  674. for (let j = 0; j < testList.value.length; j++) {
  675. if (j >= i * num && j < (i + 1) * num) {
  676. list[i].push(testList.value[j])
  677. }
  678. }
  679. }
  680. return list;
  681. });
  682. /**
  683. * 将测试列表转为多行
  684. */
  685. const getTestRecord = () => {
  686. if (showReportList.value) {
  687. showReportList.value = false;
  688. } else {
  689. reportListRef.value.getIniReportList();
  690. showReportList.value = true;
  691. }
  692. };
  693. /**
  694. * 自动填补空缺
  695. */
  696. const getAddTestList = (num: number) => {
  697. let list = parameter.value.area.split(',');
  698. let myLength = num - list.length;
  699. for (let i = 0; i < myLength; i++) {
  700. let obj = {
  701. area: "",
  702. itemNumber: list.length + (i + 1)
  703. }
  704. testList.value.push(
  705. obj
  706. )
  707. }
  708. };
  709. /**
  710. * 获取设备项目
  711. */
  712. const getDevice = async () => {
  713. let deviceid = localStorage.getItem("deviceid") || '';
  714. if (deviceid) {
  715. startDevice({ deviceid: deviceid })
  716. } else {
  717. proxy?.$modal.msgError(`缺少设备信息请重新登录!`);
  718. await proxy?.$http.common.logout({}).then((res: any) => {
  719. });
  720. proxy?.$modal?.closeLoading()
  721. //清空缓存
  722. localStorage.clear();
  723. //跳转
  724. router.push({ path: '/login/qrcode' });
  725. }
  726. };
  727. /**
  728. * 加载手势WS
  729. */
  730. const initHand = () => {
  731. handWs((e: any) => {
  732. if (router.currentRoute.value.path != '/train/multiple' || parameter.value.handcontroller == undefined) {
  733. return false;
  734. }
  735. console.log("eeeee", e)
  736. if (e?.wksid) {
  737. //获取设备项目
  738. getDevice()
  739. }
  740. //接收设备信息
  741. if (e?.device_info) {
  742. device_info.value = e.device_info;
  743. let handcontroller_id = device_info.value.handcontroller_id;
  744. stateHand(handcontroller_id);
  745. }
  746. //获取手势状态
  747. if (e?.cmd == 'get_handcontroller_state' && e?.state == 0) {
  748. let handcontroller_id = device_info.value.handcontroller_id;
  749. startHand(handcontroller_id);
  750. }
  751. //刷新
  752. if (e?.data?.result == "refresh") {
  753. getExit();
  754. //刷新
  755. window.location.reload()
  756. }
  757. //没初始化完成不监听手势动作
  758. if (examState.value == 0) {
  759. return false;
  760. }
  761. //左滑动
  762. if (e?.data?.result == "next_item") {
  763. }
  764. //举左手
  765. if (e?.data?.result == "left_hand") {
  766. //举左手确认退出
  767. // if (exit.value) {
  768. // exit.value = 0;
  769. // //确认退出
  770. // let keyEvent: any = null;
  771. // keyEvent = new KeyboardEvent('keydown', {
  772. // key: 'Enter', // 键值
  773. // code: 'Enter', // 键盘代码
  774. // keyCode: 13, // 旧的键盘代码
  775. // which: 13, // 新的键盘代码
  776. // shiftKey: false, // 是否按下Shift键
  777. // ctrlKey: false, // 是否按下Ctrl键
  778. // metaKey: false, // 是否按下Meta键(Win键或Command键)
  779. // bubbles: true, // 事件是否冒泡
  780. // cancelable: true // 是否可以取消事件的默认行为
  781. // });
  782. // document.activeElement?.dispatchEvent(keyEvent);
  783. // return false;
  784. // }
  785. //开始识别
  786. if (needStart.value && examState.value < 41) {
  787. getOpenOneTestAndStartFace();
  788. return false;
  789. }
  790. //停止人脸识别
  791. if (needStart.value && examState.value == 41) {
  792. getStopFace();
  793. return false;
  794. }
  795. //开始测试
  796. if (examState.value == 43) {
  797. getReady()
  798. return false;
  799. }
  800. }
  801. //退出
  802. if (e?.data?.result == "exit") {
  803. // console.log("exit.value", exit.value)
  804. if (exit.value == 0) {
  805. speckText("请保持两秒确认退出");
  806. //第一次才弹出
  807. confirmExit();
  808. setTimeout(() => {
  809. let keyEvent: any = null;
  810. let myKey = null;
  811. //如果交叉手两秒后返回超过4次就确认退出
  812. if (exit.value >= 4) {
  813. myKey = 'Enter';
  814. } else {
  815. myKey = 'Esc';
  816. exit.value = 0;
  817. }
  818. if (myKey == 'Esc') {
  819. keyEvent = new KeyboardEvent('keydown', {
  820. key: 'Escape', // 键值
  821. code: 'Escape', // 键盘代码
  822. keyCode: 27, // 旧的键盘代码
  823. which: 27, // 新的键盘代码
  824. shiftKey: false, // 是否按下Shift键
  825. ctrlKey: false, // 是否按下Ctrl键
  826. metaKey: false, // 是否按下Meta键(Win键或Command键)
  827. bubbles: true, // 事件是否冒泡
  828. cancelable: true // 是否可以取消事件的默认行为
  829. });
  830. }
  831. if (myKey == 'Enter') {
  832. keyEvent = new KeyboardEvent('keydown', {
  833. key: 'Enter', // 键值
  834. code: 'Enter', // 键盘代码
  835. keyCode: 13, // 旧的键盘代码
  836. which: 13, // 新的键盘代码
  837. shiftKey: false, // 是否按下Shift键
  838. ctrlKey: false, // 是否按下Ctrl键
  839. metaKey: false, // 是否按下Meta键(Win键或Command键)
  840. bubbles: true, // 事件是否冒泡
  841. cancelable: true // 是否可以取消事件的默认行为
  842. });
  843. }
  844. document.activeElement?.dispatchEvent(keyEvent);
  845. }, 2500)
  846. }
  847. exit.value = exit.value + 1
  848. }
  849. // if (e?.data?.result == "exit") {
  850. // console.log("exit.value", exit.value)
  851. // if (exit.value == 0) {
  852. // exit.value = 1
  853. // speckText("请5秒内举左手确认退出");
  854. // //第一次才弹出
  855. // confirmExit();
  856. // time.value.exit = 6;
  857. // timerManager.value.exitTimer = setInterval(() => {
  858. // time.value.exit--;
  859. // console.log("取消倒计时", time.value.exit)
  860. // proxy?.$modal.msgWarning(`取消倒计时:${time.value.exit}`)
  861. // if (time.value.exit == 0) {
  862. // exit.value = 0;
  863. // getClearTimer("exitTimer");
  864. // let keyEvent: any = null;
  865. // keyEvent = new KeyboardEvent('keydown', {
  866. // key: 'Escape', // 键值
  867. // code: 'Escape', // 键盘代码
  868. // keyCode: 27, // 旧的键盘代码
  869. // which: 27, // 新的键盘代码
  870. // shiftKey: false, // 是否按下Shift键
  871. // ctrlKey: false, // 是否按下Ctrl键
  872. // metaKey: false, // 是否按下Meta键(Win键或Command键)
  873. // bubbles: true, // 事件是否冒泡
  874. // cancelable: true // 是否可以取消事件的默认行为
  875. // });
  876. // document.activeElement?.dispatchEvent(keyEvent);
  877. // }
  878. // }, 1000);
  879. // }
  880. // }
  881. });
  882. };
  883. /**
  884. * 播报时间
  885. */
  886. watch(() => time.value.countdownNum, (newData) => {
  887. if (examState.value != 42) {
  888. return false;
  889. }
  890. if (newData >= 30) {
  891. if (newData % 30 == 0) {
  892. speckText(
  893. `还有${newData}秒`
  894. );
  895. }
  896. }
  897. if (newData == 10) {
  898. speckText("还有10秒");
  899. }
  900. if (newData <= 5) {
  901. speckText(newData);
  902. }
  903. if (newData == 0) {
  904. speckText("哨声");
  905. }
  906. }, { immediate: true });
  907. onBeforeMount(() => {
  908. parameter.value = route.query;
  909. let project = parameter.value.project;
  910. let area = parameter.value.area;
  911. if (parameter.value.time) {
  912. time.value.testTime = parameter.value.time
  913. }
  914. time.value.countdownNum = time.value.testTime;
  915. let myInfo: any = localStorage.getItem("userInfo");
  916. userInfo.value = JSON.parse(myInfo);
  917. if (parameter.value.gesture == 'true') {
  918. parameter.value.gesture = true
  919. } else {
  920. parameter.value.gesture = false
  921. }
  922. let list = area.split(',');
  923. testList.value = list.map((item: any, index: number) => {
  924. let obj = {
  925. area: item,
  926. itemNumber: index + 1
  927. }
  928. return obj;
  929. });
  930. //展示样式控制
  931. if (testList.value.length <= 5) {
  932. styleType.value = 1;
  933. //填补空缺
  934. getAddTestList(5)
  935. }
  936. if (testList.value.length > 5 && testList.value.length <= 10) {
  937. styleType.value = 2;
  938. //填补空缺
  939. getAddTestList(10)
  940. }
  941. if (testList.value.length > 10) {
  942. styleType.value = 3;
  943. }
  944. //需要开始按钮的项目
  945. let myList = ['situp', 'jumprope', 'jumpingjack', 'footballv1', 'basketballv1', 'volleyball', 'pingpong'];
  946. if (myList.includes(project) && styleType.value == 3) {
  947. needStart.value = true;
  948. }
  949. })
  950. onMounted(() => {
  951. //加载WS
  952. let project = parameter.value.project;
  953. initWs({ parameter: parameter.value, testTime: time.value.testTime, version: "v2" }, (data: any) => {
  954. //获取sid
  955. if (data.cmd === 'mySid') {
  956. console.log("data.data.sid", data.data.sid)
  957. sid.value = data.data.sid;
  958. }
  959. let index = testList.value.findIndex((item: any) => {
  960. let examId = `${project}_${item.area}`;
  961. return examId == data.exam_id;
  962. })
  963. multipleItemRefList.value[index]?.getMessage(data);
  964. });
  965. //初始化语音
  966. initSpeech();
  967. //初始化手势
  968. initHand();
  969. setTimeout(() => {
  970. //10秒还在0状态就算超时
  971. if (examState.value == 0) {
  972. getExit();
  973. }
  974. }, 10000);
  975. //刷新关闭
  976. window.onbeforeunload = function (e) {
  977. var confirmationMessage = "刷新/关闭页面将会关闭页面,是否确认退出页面?";
  978. (e || window.event).returnValue = confirmationMessage; // 兼容 Gecko + IE
  979. testList.value.forEach((item: any) => {
  980. let examId = item.exam_id;
  981. let bUrl = import.meta.env.VITE_APP_BASE_API;
  982. let classId = parameter.value.classes;
  983. let mySid = sid.value;
  984. let token: any = localStorage.getItem("token")
  985. let formData = new FormData();
  986. formData.append("exam_id", examId);
  987. formData.append("class_id", classId);
  988. formData.append("token", token);
  989. formData.append("sid", mySid);
  990. navigator.sendBeacon(bUrl + "/exam/close_exam", formData)
  991. })
  992. return confirmationMessage; // 兼容 Gecko + Webkit, Safari, Chrome
  993. };
  994. })
  995. onBeforeUnmount(() => {
  996. getExit();
  997. })
  998. </script>
  999. <style scoped lang="scss">
  1000. $waiPadding: 6.51rem;
  1001. .time {
  1002. width: 20vh;
  1003. height: 20vh;
  1004. line-height: 20vh;
  1005. border-radius: 50%;
  1006. color: #FF9402;
  1007. font-size: 8vh;
  1008. text-align: center;
  1009. background-image: url("@/assets/images/test/time.png");
  1010. background-position: center;
  1011. background-repeat: no-repeat;
  1012. background-size: 100% 100%;
  1013. position: absolute;
  1014. right: 50%;
  1015. top: -4vh;
  1016. margin-right: -10vh;
  1017. font-family: 'Saira-BlackItalic';
  1018. }
  1019. .time1 {
  1020. width: 26vh;
  1021. height: 26vh;
  1022. line-height: 26vh;
  1023. font-size: 10.3vh;
  1024. right: auto;
  1025. left: 50%;
  1026. top: 0vh;
  1027. margin-left: 8vw;
  1028. margin-right: auto;
  1029. }
  1030. .main {
  1031. width: calc(100% - ($waiPadding * 2));
  1032. height: 78vh;
  1033. padding-top: 10rem;
  1034. margin: 0 auto;
  1035. display: flex;
  1036. overflow: hidden;
  1037. flex-direction: column;
  1038. }
  1039. .mask {
  1040. position: fixed;
  1041. height: 100vh;
  1042. width: 100vw;
  1043. top: 0;
  1044. left: 0;
  1045. background: rgba(0, 0, 0, 0.3);
  1046. z-index: 998;
  1047. }
  1048. .mask2 {
  1049. background: rgba(0, 0, 0, 0.68);
  1050. }
  1051. .confirmDiaBg {
  1052. width: 100%;
  1053. height: 100vh;
  1054. position: fixed;
  1055. left: 0;
  1056. top: 0;
  1057. display: flex;
  1058. align-items: center;
  1059. justify-content: center;
  1060. z-index: 999;
  1061. .confirmDiaWindow {
  1062. width: 40%;
  1063. height: 43.4%;
  1064. border-radius: 1.6rem;
  1065. opacity: 1;
  1066. box-sizing: border-box;
  1067. border: 0.55rem solid #13ED84;
  1068. text-align: center;
  1069. display: flex;
  1070. align-items: center;
  1071. justify-content: center;
  1072. position: fixed;
  1073. background: radial-gradient(96% 96% at 2% 32%, #FFFFFF 0%, #FCFDFD 54%, #E1E4E7 100%);
  1074. .readyBox {
  1075. text-align: center;
  1076. color: #1A293A;
  1077. .lable {
  1078. font-size: 4.3rem;
  1079. line-height: 1;
  1080. margin-bottom: 1.5rem;
  1081. }
  1082. .value {
  1083. font-size: 10rem;
  1084. line-height: 1;
  1085. font-family: 'Saira-BlackItalic';
  1086. }
  1087. .transparent {
  1088. opacity: 0;
  1089. }
  1090. }
  1091. }
  1092. }
  1093. .footerBtn {
  1094. width: 100%;
  1095. padding: 0 calc(13.02rem /2);
  1096. box-sizing: border-box;
  1097. position: fixed;
  1098. bottom: 3vh;
  1099. display: flex;
  1100. justify-content: end;
  1101. .btn {
  1102. width: 14.6vw;
  1103. height: 6.1vh;
  1104. line-height: 6.1vh;
  1105. font-size: 3vh;
  1106. color: #1A293A;
  1107. text-align: center;
  1108. border-radius: 1vh;
  1109. cursor: pointer;
  1110. margin-left: 10px;
  1111. background: radial-gradient(159% 126% at 5% 93%, #8EFFA9 0%, #07FFE7 100%);
  1112. box-shadow: 1px 1px 1px 1px rgba(0, 0, 0, 0.1874), inset 0px 1px 0px 1px rgba(255, 255, 255, 0.3);
  1113. &:hover {
  1114. background: #8EFFA9;
  1115. }
  1116. }
  1117. .startBtn {
  1118. color: #ffffff;
  1119. background: radial-gradient(159% 126% at 5% 93%, #F99F02 0%, #ED7905 100%);
  1120. box-shadow: 3px 6px 4px 1px rgba(0, 0, 0, 0.1874), inset 0px 1px 0px 2px rgba(255, 255, 255, 0.3);
  1121. &:hover {
  1122. background: #F99F02;
  1123. }
  1124. }
  1125. .testRecordBtn {
  1126. position: relative;
  1127. z-index: 999;
  1128. }
  1129. }
  1130. .main-right {
  1131. width: 22.7%;
  1132. height: 80vh;
  1133. border-radius: 1.6rem;
  1134. // background: linear-gradient(29deg, #092941 -82%, #2A484B 94%);
  1135. background-color: rgba(9, 41, 65, 0.8);
  1136. box-shadow: inset 0px 1px 0px 2px rgba(255, 255, 255, 0.4);
  1137. display: flex;
  1138. flex-direction: column;
  1139. overflow: hidden;
  1140. position: absolute;
  1141. z-index: 999;
  1142. bottom: 6.5vh;
  1143. right: calc(13.02rem /2);
  1144. }
  1145. //列表样式写在此父组件里,子组件尽量减少个性化class和style,多样性以父组件控制类型
  1146. ::v-deep(.testBox1) {
  1147. $listMargin: 10vw;
  1148. $listWidth: calc((100vw - ($waiPadding * 2) - $listMargin) / 5);
  1149. display: flex;
  1150. flex-wrap: wrap;
  1151. align-items: center;
  1152. .ul {
  1153. width: 100%;
  1154. height: 36vh;
  1155. display: flex;
  1156. .li {
  1157. width: $listWidth;
  1158. position: relative;
  1159. .ready {
  1160. position: absolute;
  1161. height: 100%;
  1162. width: 100%;
  1163. display: flex;
  1164. align-items: center;
  1165. justify-items: center;
  1166. img {
  1167. width: 100%;
  1168. }
  1169. }
  1170. .userInfo {
  1171. width: 100%;
  1172. height: 100%;
  1173. border-radius: 1.6rem;
  1174. background: radial-gradient(122% 126% at 97% 6%, #35FFC6 0%, #00FFE8 100%);
  1175. text-align: center;
  1176. display: flex;
  1177. align-items: center;
  1178. justify-content: center;
  1179. cursor: pointer;
  1180. margin-bottom: 3px;
  1181. .userInfo-center {
  1182. .pic {
  1183. width: calc(36vh * 0.62);
  1184. height: calc(36vh * 0.62);
  1185. border-radius: 50%;
  1186. display: flex;
  1187. justify-content: center;
  1188. align-items: center;
  1189. overflow: hidden;
  1190. margin: 0 auto 2vh auto;
  1191. position: relative;
  1192. .area {
  1193. position: absolute;
  1194. top: calc(36vh * 0.18);
  1195. color: #203C52;
  1196. font-size: 5vh;
  1197. line-height: 1;
  1198. font-family: 'Saira-ExtraBold';
  1199. text-align: center;
  1200. }
  1201. img {
  1202. width: 100%;
  1203. }
  1204. }
  1205. .pic2 {
  1206. box-sizing: border-box;
  1207. border: 0.44rem solid rgba(26, 41, 58, 0.6315);
  1208. }
  1209. .name {
  1210. width: 100%;
  1211. color: #1A293A;
  1212. font-size: 2.21rem;
  1213. }
  1214. .name2 {
  1215. box-sizing: border-box;
  1216. padding: 0.1rem 0.4rem;
  1217. border-radius: 1.1rem;
  1218. background: radial-gradient(96% 96% at 2% 32%, #FFFFFF 0%, #FCFDFD 54%, #E1E4E7 100%);
  1219. box-shadow: inset 0px 1px 0px 2px rgba(255, 255, 255, 0.9046), inset 0px 3px 6px 0px rgba(0, 0, 0, 0.0851);
  1220. }
  1221. .ctrlBox {
  1222. position: absolute;
  1223. left: 0;
  1224. top: 0;
  1225. border: 5px solid #ffffff;
  1226. display: flex;
  1227. flex-direction: column;
  1228. align-items: center;
  1229. background: rgba(0, 0, 0, 0.8);
  1230. z-index: 2;
  1231. width: 100%;
  1232. height: 100%;
  1233. box-sizing: border-box;
  1234. border-radius: 1.6rem;
  1235. img {
  1236. max-width: 100%;
  1237. max-height: 70%;
  1238. margin: 10% 0 5% 0;
  1239. }
  1240. .lable {
  1241. text-align: center;
  1242. font-size: 2rem;
  1243. color: #ffffff
  1244. }
  1245. }
  1246. }
  1247. }
  1248. .score {
  1249. height: 18vh;
  1250. line-height: 18vh;
  1251. font-size: 12vh;
  1252. font-family: 'Saira-BlackItalic';
  1253. border: 0.55rem solid #13ED84;
  1254. text-align: center;
  1255. border-radius: 1.6rem;
  1256. box-sizing: content-box;
  1257. color: #1A293A;
  1258. position: relative;
  1259. background: radial-gradient(96% 96% at 2% 32%, #FFFFFF 0%, #FCFDFD 54%, #E1E4E7 100%);
  1260. display: none;
  1261. &::before {
  1262. content: "";
  1263. width: 2vw;
  1264. height: 2vw;
  1265. display: block;
  1266. position: absolute;
  1267. top: -1.5vw;
  1268. left: 50%;
  1269. margin-left: -1vw;
  1270. background-image: url("@/assets/images/test/yuan.png");
  1271. background-position: center;
  1272. background-repeat: no-repeat;
  1273. background-size: 100% 100%;
  1274. border-radius: 50%;
  1275. flex-shrink: 0;
  1276. transition: all 0.5s;
  1277. }
  1278. }
  1279. }
  1280. .disable {
  1281. .userInfo,
  1282. .score {
  1283. opacity: 0.5;
  1284. }
  1285. }
  1286. .wait {
  1287. .userInfo,
  1288. .score {
  1289. opacity: 0.5;
  1290. }
  1291. }
  1292. &:nth-child(1) {
  1293. justify-content: space-between;
  1294. }
  1295. &:nth-child(2) {
  1296. justify-content: space-evenly;
  1297. .li {
  1298. margin-left: calc($listMargin/4);
  1299. margin-right: calc($listMargin/4);
  1300. }
  1301. }
  1302. }
  1303. .ready.ul {
  1304. &:nth-child(1) {
  1305. .li:nth-child(2) {
  1306. &::after {
  1307. content: "";
  1308. position: absolute;
  1309. height: 100%;
  1310. width: 100%;
  1311. display: block;
  1312. background-image: url("@/assets/images/test/ready3.png");
  1313. background-position: center center;
  1314. background-repeat: no-repeat;
  1315. background-size: 100%;
  1316. }
  1317. }
  1318. }
  1319. &:nth-child(2) {
  1320. .li {
  1321. &::after {
  1322. content: "";
  1323. position: absolute;
  1324. height: 100%;
  1325. width: 100%;
  1326. display: block;
  1327. background-image: url("@/assets/images/test/ready3.png");
  1328. background-position: center center;
  1329. background-repeat: no-repeat;
  1330. background-size: 100%;
  1331. top: -100%;
  1332. }
  1333. }
  1334. }
  1335. }
  1336. .hands.ul {
  1337. &:nth-child(1) {
  1338. .li:nth-child(2) {
  1339. &::after {
  1340. background-image: url("@/assets/images/test/ready4.png");
  1341. }
  1342. }
  1343. }
  1344. &:nth-child(2) {
  1345. .li {
  1346. &::after {
  1347. background-image: url("@/assets/images/test/ready4.png");
  1348. }
  1349. }
  1350. }
  1351. }
  1352. .overlap.ul {
  1353. transition: all 0.5s;
  1354. .li {
  1355. .score {
  1356. display: block;
  1357. }
  1358. }
  1359. &:nth-child(1) {
  1360. margin-top: 5vh;
  1361. .li {
  1362. &::before {
  1363. display: none
  1364. }
  1365. &::after {
  1366. display: none
  1367. }
  1368. }
  1369. }
  1370. &:nth-child(2) {
  1371. margin-top: -20vh;
  1372. .li {
  1373. &::before {
  1374. display: none
  1375. }
  1376. &::after {
  1377. display: none
  1378. }
  1379. }
  1380. }
  1381. }
  1382. }
  1383. ::v-deep(.testBox2) {
  1384. $listMargin: 10vw;
  1385. $listWidth: calc((100% - $listMargin) / 5);
  1386. .ul {
  1387. width: 100%;
  1388. height: 34vh;
  1389. display: flex;
  1390. justify-content: space-between;
  1391. margin-bottom: 4vh;
  1392. .li {
  1393. width: $listWidth;
  1394. position: relative;
  1395. height: 100%;
  1396. border-radius: 3vh;
  1397. padding: 0.6vw;
  1398. background: radial-gradient(122% 126% at 97% 6%, #35FFC6 0%, #00FFE8 100%);
  1399. display: flex;
  1400. flex-direction: column;
  1401. justify-content: space-between;
  1402. box-sizing: border-box;
  1403. .userInfo {
  1404. width: 100%;
  1405. height: 100%;
  1406. border-radius: 1.6rem;
  1407. background: radial-gradient(122% 126% at 97% 6%, #35FFC6 0%, #00FFE8 100%);
  1408. text-align: center;
  1409. display: flex;
  1410. align-items: center;
  1411. justify-content: center;
  1412. cursor: pointer;
  1413. position: relative;
  1414. .userInfo-center {
  1415. .pic {
  1416. width: calc(36vh * 0.62);
  1417. height: calc(36vh * 0.62);
  1418. border-radius: 50%;
  1419. display: flex;
  1420. justify-content: center;
  1421. align-items: center;
  1422. overflow: hidden;
  1423. margin: 0 auto 2vh auto;
  1424. position: relative;
  1425. .area {
  1426. position: absolute;
  1427. top: calc(36vh * 0.18);
  1428. color: #203C52;
  1429. font-size: 5vh;
  1430. line-height: 1;
  1431. font-family: 'Saira-ExtraBold';
  1432. text-align: center;
  1433. }
  1434. img {
  1435. width: 100%;
  1436. }
  1437. }
  1438. .pic2 {
  1439. box-sizing: border-box;
  1440. border: 0.44rem solid rgba(26, 41, 58, 0.6315);
  1441. }
  1442. .name {
  1443. width: 100%;
  1444. color: #1A293A;
  1445. font-size: 2.21rem;
  1446. }
  1447. .ctrlBox {
  1448. position: absolute;
  1449. left: 0;
  1450. top: 0;
  1451. border: 5px solid #ffffff;
  1452. display: flex;
  1453. flex-direction: column;
  1454. align-items: center;
  1455. background: rgba(0, 0, 0, 0.8);
  1456. z-index: 2;
  1457. width: 100%;
  1458. height: 100%;
  1459. box-sizing: border-box;
  1460. border-radius: 1.6rem;
  1461. img {
  1462. max-width: 100%;
  1463. max-height: 70%;
  1464. margin: 10% 0 5% 0;
  1465. }
  1466. .lable {
  1467. text-align: center;
  1468. font-size: 2rem;
  1469. color: #ffffff
  1470. }
  1471. }
  1472. }
  1473. }
  1474. .score {
  1475. height: 14vh;
  1476. line-height: 14vh;
  1477. font-size: 9vh;
  1478. font-family: 'Saira-BlackItalic';
  1479. background: #ffffff;
  1480. box-sizing: border-box;
  1481. border: 0.55rem solid #13ED84;
  1482. text-align: center;
  1483. border-radius: 1.6rem;
  1484. box-sizing: content-box;
  1485. color: #1A293A;
  1486. position: relative;
  1487. display: none;
  1488. &::before {
  1489. content: "";
  1490. width: 2vw;
  1491. height: 2vw;
  1492. display: block;
  1493. position: absolute;
  1494. top: -1.3vw;
  1495. left: 50%;
  1496. margin-left: -1vw;
  1497. background-image: url("@/assets/images/test/yuan.png");
  1498. background-position: center;
  1499. background-repeat: no-repeat;
  1500. background-size: 100% 100%;
  1501. border-radius: 50%;
  1502. flex-shrink: 0;
  1503. transition: all 0.5s;
  1504. }
  1505. }
  1506. }
  1507. .disable {
  1508. opacity: 0.5;
  1509. }
  1510. .wait {
  1511. opacity: 0.5;
  1512. }
  1513. }
  1514. .overlap {
  1515. .li {
  1516. .userInfo {
  1517. height: 6.2vw;
  1518. .userInfo-center {
  1519. width: 100%;
  1520. text-align: center;
  1521. display: flex;
  1522. align-items: center;
  1523. cursor: pointer;
  1524. .pic {
  1525. width: 6.2vw;
  1526. height: 6.2vw;
  1527. border-radius: 50%;
  1528. display: flex;
  1529. justify-content: center;
  1530. align-items: center;
  1531. overflow: hidden;
  1532. position: relative;
  1533. flex-shrink: 0;
  1534. margin: 0;
  1535. .area {
  1536. position: absolute;
  1537. top: 0;
  1538. left: 0;
  1539. width: 100%;
  1540. height: 100%;
  1541. line-height: 6.2vw;
  1542. color: #ffffff;
  1543. font-size: 2.5vw;
  1544. font-family: 'Saira-ExtraBold';
  1545. text-align: center;
  1546. background: rgba(#000000, 0.4)
  1547. }
  1548. img {
  1549. width: 100%;
  1550. }
  1551. }
  1552. .pic2 {
  1553. box-sizing: border-box;
  1554. border: 2px solid rgba(26, 41, 58, 0.6315);
  1555. }
  1556. .name {
  1557. width: 100%;
  1558. color: #1A293A;
  1559. font-size: 1.8rem;
  1560. border-radius: 2vw;
  1561. padding: 0.5rem 0;
  1562. background: radial-gradient(96% 96% at 2% 32%, #FFFFFF 0%, #FCFDFD 54%, #E1E4E7 100%);
  1563. box-shadow: inset 0px 1px 0px 2px rgba(255, 255, 255, 0.9046), inset 0px 3px 6px 0px rgba(0, 0, 0, 0.0851);
  1564. }
  1565. }
  1566. }
  1567. .score {
  1568. display: block;
  1569. }
  1570. }
  1571. }
  1572. }
  1573. ::v-deep(.testBox3) {
  1574. $listMargin: 5vw;
  1575. $listWidth: calc((100% - $listMargin) / 10);
  1576. .ul {
  1577. width: 100%;
  1578. height: 14vh;
  1579. display: flex;
  1580. justify-content: space-around;
  1581. margin-bottom: calc($listMargin / 10);
  1582. .li {
  1583. width: $listWidth;
  1584. position: relative;
  1585. height: 100%;
  1586. border-radius: 5vh;
  1587. background: radial-gradient(122% 126% at 97% 6%, #35FFC6 0%, #00FFE8 100%);
  1588. .userInfo {
  1589. padding: 2vh 0.6vw 0 0.6vw;
  1590. margin-bottom: 0.8vh;
  1591. .userInfo-center {
  1592. text-align: center;
  1593. display: flex;
  1594. align-items: center;
  1595. cursor: pointer;
  1596. border-radius: 1.3vw;
  1597. height: 2.6vw;
  1598. background: linear-gradient(180deg, #FFFFFF 0%, rgba(255, 255, 255, 0.6571) 100%);
  1599. border: 1px solid #FFFFFF;
  1600. .pic {
  1601. width: 2.6vw;
  1602. height: 2.6vw;
  1603. border-radius: 50%;
  1604. display: flex;
  1605. justify-content: center;
  1606. align-items: center;
  1607. overflow: hidden;
  1608. position: relative;
  1609. flex-shrink: 0;
  1610. .area {
  1611. position: absolute;
  1612. top: 0;
  1613. left: 0;
  1614. width: 100%;
  1615. height: 100%;
  1616. line-height: 2.6vw;
  1617. color: #ffffff;
  1618. font-size: 1.4vw;
  1619. font-family: 'Saira-ExtraBold';
  1620. text-align: center;
  1621. background: rgba(#000000, 0.4)
  1622. }
  1623. img {
  1624. width: 100%;
  1625. }
  1626. }
  1627. .pic2 {
  1628. box-sizing: border-box;
  1629. border: 2px solid rgba(26, 41, 58, 0.6315);
  1630. }
  1631. .name {
  1632. color: #1A293A;
  1633. font-size: 1rem;
  1634. margin-left: 0.5vw;
  1635. }
  1636. .ctrlBox {
  1637. position: absolute;
  1638. left: 0;
  1639. top: 0;
  1640. border: 5px solid #ffffff;
  1641. display: flex;
  1642. flex-direction: column;
  1643. align-items: center;
  1644. background: rgba(0, 0, 0, 0.8);
  1645. z-index: 2;
  1646. width: 100%;
  1647. height: 100%;
  1648. box-sizing: border-box;
  1649. border-radius: 5vh;
  1650. img {
  1651. max-width: 100%;
  1652. max-height: 60%;
  1653. margin: 5% 0 5% 0;
  1654. }
  1655. .lable {
  1656. text-align: center;
  1657. font-size: 1rem;
  1658. color: #ffffff
  1659. }
  1660. }
  1661. }
  1662. }
  1663. .score {
  1664. font-size: 3rem;
  1665. font-family: 'Saira-BlackItalic';
  1666. text-align: center;
  1667. color: #1A293A;
  1668. line-height: 1;
  1669. }
  1670. }
  1671. .disable {
  1672. opacity: 0.5;
  1673. }
  1674. .wait {
  1675. opacity: 0.75;
  1676. }
  1677. .startedAlready {
  1678. background: #15ef96;
  1679. }
  1680. }
  1681. }
  1682. </style>