multiple.vue 28 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197
  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="[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) }"
  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. :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="getStartOneTest" v-if="examState == 43">开始测试</div>
  28. </template>
  29. <template v-else>
  30. <div class="btn startBtn" @click="getReady" v-if="examState == 43">开始测试</div>
  31. </template>
  32. <div class="btn" :class="{ testRecordBtn: showReportList }" @click="getTestRecord"
  33. v-if="![43, 42].includes(examState)">
  34. {{ showReportList ? '关闭记录' : '测试记录' }}
  35. </div>
  36. <!--测试记录开始-->
  37. <Transition :enter-active-class="proxy?.animate.mask.enter" :leave-active-class="proxy?.animate.mask.leave">
  38. <div class="mask mask2" v-show="showReportList" @click="getTestRecord"></div>
  39. </Transition>
  40. <Transition :enter-active-class="proxy?.animate.report.enter" :leave-active-class="proxy?.animate.report.leave">
  41. <div class="main-right" v-show="showReportList">
  42. <ReportList ref="reportListRef" :parameter="parameter" :showQRCode="false" />
  43. </div>
  44. </Transition>
  45. <!--测试记录结束-->
  46. </div>
  47. <!--倒计时开始-->
  48. <div>
  49. <Transition :enter-active-class="proxy?.animate.mask.enter" :leave-active-class="proxy?.animate.mask.leave">
  50. <div class="mask" v-show="examState == 43 && time.ready"></div>
  51. </Transition>
  52. <Transition :enter-active-class="proxy?.animate.face.enter" :leave-active-class="proxy?.animate.face.leave2">
  53. <div class="confirmDiaBg" v-show="examState == 43 && time.ready">
  54. <div class="confirmDiaWindow">
  55. <div class="readyBox">
  56. <div class="lable">倒计时</div>
  57. <div class="value">{{ time.ready }}</div>
  58. </div>
  59. </div>
  60. </div>
  61. </Transition>
  62. </div>
  63. <!--倒计时结束-->
  64. </div>
  65. </template>
  66. <script setup name="Multiple" lang="ts">
  67. import { initSpeech, speckText, speckCancel, chineseNumber } from '@/utils/speech'
  68. import { initWs, examEnds, openOneTest, startFace, stopFace, faceConfirmOnly, startOneTest, finishOneTest, closeOneTest, suspendFaceRecognitionChannels, resumeFaceRecognitionChannels } from '@/utils/ws'
  69. const { proxy } = getCurrentInstance() as any;
  70. const router = useRouter();
  71. const route = useRoute();
  72. const reportListRef = ref();
  73. const data = reactive<any>({
  74. timerManager: {},//计时器管理
  75. parameter: {},//参数
  76. time: {
  77. testTime: 60,//时长
  78. countdownNum: 0,//计时
  79. ready: 0,//预备
  80. },
  81. userInfo: {},//用户信息
  82. examState: 0,//当前状态
  83. needStart: false,//是否需要按钮
  84. showTestAgain: false,//再测一次按钮
  85. testList: [],//获取区列表
  86. multipleItemRefList: [],//获取区列表
  87. styleType: null,//展示样式1:1-5个,2:6-10个,3:10个以上
  88. showReportList: false,//显示隐藏测试记录
  89. });
  90. const { timerManager, parameter, time, userInfo, examState, needStart, showTestAgain, testList, multipleItemRefList, styleType, showReportList } = toRefs(data);
  91. /**
  92. * 创建组件实例
  93. */
  94. const multipleItemRef = (el: any, index: number, area: any) => {
  95. multipleItemRefList.value[index - 1] = el;
  96. }
  97. /**
  98. * 开始识别
  99. */
  100. const getOpenOneTestAndStartFace = () => {
  101. cleanData();
  102. examState.value = 41;
  103. for (let i = 0; i < multipleItemRefList.value.length; i++) {
  104. multipleItemRefList.value[i].getOpenOneTestAndStartFace()
  105. }
  106. };
  107. /**
  108. * 停止人脸识别
  109. */
  110. const getStopFace = async () => {
  111. // let flag = false;
  112. // for (let i = 0; i < testList.value.length; i++) {
  113. // if (testList.value[i] && testList.value[i].faceCheckStu?.student_id) {
  114. // flag = true;
  115. // }
  116. // }
  117. // if (!flag) {
  118. // proxy?.$modal.msgWarning("请选择人员!");
  119. // return false;
  120. // }
  121. examState.value = 43;
  122. for (let i = 0; i < multipleItemRefList.value.length; i++) {
  123. multipleItemRefList.value[i].getStopFace()
  124. }
  125. };
  126. /**
  127. * 开始测试
  128. */
  129. const getStartOneTest = () => {
  130. if (examState.value != 43) {
  131. return false;
  132. }
  133. let flag = false;
  134. for (let i = 0; i < testList.value.length; i++) {
  135. if (testList.value[i] && testList.value[i].faceCheckStu?.student_id) {
  136. flag = true;
  137. }
  138. }
  139. if (!flag) {
  140. proxy?.$modal.msgWarning("请选择人员!");
  141. return false;
  142. }
  143. getClearTimer("readyTimer");
  144. time.value.ready = 0;
  145. examState.value = 42;
  146. for (let i = 0; i < multipleItemRefList.value.length; i++) {
  147. if (testList.value[i].examState == 41) {
  148. //正在识别的停止识别
  149. multipleItemRefList.value[i].getStopFace()
  150. }
  151. if (testList.value[i].examState == 43) {
  152. multipleItemRefList.value[i].getStartOneTest()
  153. }
  154. }
  155. speckText("哨声");
  156. //显示再测一次按钮
  157. showTestAgain.value = true;
  158. //时间为0的为正计时,大于0的为倒计时
  159. if (time.value.testTime == 0) {
  160. getCounting("+");
  161. } else {
  162. getCounting("-");
  163. }
  164. };
  165. /**
  166. * 再测一次
  167. */
  168. const getAgain = async () => {
  169. cleanData();
  170. examState.value = 43;
  171. for (let i = 0; i < multipleItemRefList.value.length; i++) {
  172. multipleItemRefList.value[i].getAgain()
  173. }
  174. };
  175. /**
  176. * 确认退出
  177. */
  178. const confirmExit = () => {
  179. proxy?.$modal.confirm("确定退出吗?").then(() => {
  180. getExit();
  181. }).finally(() => {
  182. });
  183. };
  184. /**
  185. * 退出
  186. */
  187. const getExit = () => {
  188. getClearTimer();//清除计时器
  189. examEnds();//通知工作站关闭
  190. speckCancel()//停止播报;
  191. router.push({ path: '/' });//跳转
  192. };
  193. /**
  194. * 清空定时任务
  195. */
  196. const getClearTimer = (data?: any) => {
  197. if (data) {
  198. //清除指定
  199. clearInterval(timerManager.value[data])
  200. timerManager.value[data] = null;
  201. } else {
  202. //清除全部
  203. for (let key in timerManager.value) {
  204. if (timerManager.value.hasOwnProperty(key)) {
  205. clearInterval(timerManager.value[key])
  206. timerManager.value[key] = null;
  207. }
  208. }
  209. }
  210. };
  211. /**
  212. * 清除历史记录
  213. */
  214. const cleanData = () => {
  215. getClearTimer("countdownTimer");
  216. time.value.countdownNum = time.value.testTime;
  217. showTestAgain.value = false;
  218. };
  219. /**
  220. * 时间转换
  221. */
  222. // const countdownNumFormat = computed(() => {
  223. // return time.value.countdownNum;
  224. // //return proxy?.$utils.timeFormat(time.value.countdownNum);
  225. // });
  226. /**
  227. * 倒计时
  228. */
  229. const getCounting = (type: string) => {
  230. timerManager.value.countdownTimer = setInterval(() => {
  231. //正计时
  232. if (type == "+") {
  233. time.value.countdownNum++;
  234. }
  235. //倒计时
  236. if (type == "-") {
  237. if (time.value.countdownNum <= 0) {
  238. getClearTimer("countdownTimer");
  239. } else {
  240. time.value.countdownNum--;
  241. }
  242. }
  243. }, 1000);
  244. };
  245. /**
  246. * 子组件返回数据
  247. */
  248. const returnData = (data: any) => {
  249. let index = testList.value.findIndex((item: any) => {
  250. return item.area == data.area;
  251. });
  252. let obj = Object.assign(testList.value[index], data);
  253. testList.value[index] = JSON.parse(JSON.stringify(obj));
  254. console.log("testList.value", testList.value)
  255. if (examState.value == 0) {
  256. let flag = false;
  257. //只监听人脸识别的区
  258. let newList = testList.value;
  259. for (let i = 0; i < newList.length; i++) {
  260. if (newList[i] && newList[i].examState == 3) {
  261. flag = true;
  262. }
  263. }
  264. if (flag) {
  265. console.log("变更状态:", 3)
  266. examState.value = 3;
  267. }
  268. }
  269. if (examState.value == 3) {
  270. let flag = false;
  271. //只监听人脸识别的区
  272. let newList = testList.value;
  273. for (let i = 0; i < newList.length; i++) {
  274. if (newList[i] && newList[i].examState == 40) {
  275. flag = true;
  276. }
  277. }
  278. if (flag) {
  279. console.log("变更状态:", 40)
  280. examState.value = 40;
  281. }
  282. }
  283. if (examState.value == 40) {
  284. let flag = false;
  285. //只监听人脸识别的区
  286. let newList = testList.value;
  287. for (let i = 0; i < newList.length; i++) {
  288. if (newList[i] && newList[i].examState == 41) {
  289. flag = true;
  290. }
  291. }
  292. if (flag) {
  293. console.log("变更状态:", 41)
  294. examState.value = 41;
  295. let txt = parameter.value.gesture ? "请举手看摄像头人脸识别" : "请看摄像头进行人脸识别";
  296. speckText(txt);
  297. }
  298. }
  299. if (examState.value == 41) {
  300. let flag = false;
  301. //只监听人脸识别的区
  302. let newList = testList.value.filter((item: any) => {
  303. return item?.faceCheckStu?.student_id;
  304. })
  305. for (let i = 0; i < newList.length; i++) {
  306. if (newList[i] && newList[i].faceCheckStu?.student_id && newList[i].examState == 43) {
  307. flag = true;
  308. }
  309. }
  310. if (flag) {
  311. console.log("变更状态:", 43)
  312. examState.value = 43;
  313. cleanData();
  314. }
  315. }
  316. //测试完成后回退状态
  317. if (examState.value == 42) {
  318. let flag = false;
  319. //只监听人脸识别的区
  320. let newList = testList.value.filter((item: any) => {
  321. return item?.faceCheckStu?.student_id;
  322. })
  323. for (let i = 0; i < newList.length; i++) {
  324. if (newList[i] && newList[i].faceCheckStu?.student_id && newList[i].examState == 3) {
  325. flag = true;
  326. } else {
  327. return false;
  328. }
  329. }
  330. if (flag) {
  331. console.log("变更状态:", 3)
  332. examState.value = 3;
  333. }
  334. }
  335. //如果全部状态为0就退出
  336. if (examState.value >= 0) {
  337. let flag = false;
  338. //只监听人脸识别的区
  339. let newList = testList.value;
  340. for (let i = 0; i < newList.length; i++) {
  341. if (newList[i] && newList[i].examState == 0) {
  342. flag = true;
  343. } else {
  344. return false;
  345. }
  346. }
  347. if (flag) {
  348. examState.value = 0;
  349. getExit();
  350. }
  351. }
  352. };
  353. /**
  354. * 准备开始
  355. */
  356. const getReady = () => {
  357. //停止播报;
  358. speckCancel()
  359. //正在识别的停止识别
  360. for (let i = 0; i < multipleItemRefList.value.length; i++) {
  361. if (testList.value[i].examState == 41) {
  362. multipleItemRefList.value[i].getStopFace()
  363. }
  364. }
  365. time.value.ready = 5;
  366. speckText(time.value.ready);
  367. timerManager.value.readyTimer = setInterval(() => {
  368. time.value.ready--;
  369. if (time.value.ready <= 0) {
  370. getClearTimer("readyTimer");
  371. getStartOneTest();
  372. } else {
  373. speckText(time.value.ready);
  374. }
  375. }, 1000);
  376. };
  377. /**
  378. * 将测试列表转为多行
  379. */
  380. const testListArr = computed(() => {
  381. let list: any = [];
  382. let num = 0;
  383. if (styleType.value == 1) {
  384. num = 3
  385. }
  386. if (styleType.value == 2) {
  387. num = 5
  388. }
  389. if (styleType.value == 3) {
  390. num = 10
  391. }
  392. let myLength = Math.ceil(testList.value.length / num);
  393. for (let i = 0; i < myLength; i++) {
  394. list[i] = [];
  395. for (let j = 0; j < testList.value.length; j++) {
  396. if (j >= i * num && j < (i + 1) * num) {
  397. list[i].push(testList.value[j])
  398. }
  399. }
  400. }
  401. return list;
  402. });
  403. /**
  404. * 将测试列表转为多行
  405. */
  406. const getTestRecord = () => {
  407. if (showReportList.value) {
  408. showReportList.value = false;
  409. } else {
  410. reportListRef.value.getIniReportList();
  411. showReportList.value = true;
  412. }
  413. };
  414. /**
  415. * 自动填补空缺
  416. */
  417. const getAddTestList = (num: number) => {
  418. let list = parameter.value.area.split(',');
  419. let myLength = num - list.length;
  420. for (let i = 0; i < myLength; i++) {
  421. let obj = {
  422. area: "",
  423. itemNumber: list.length + (i + 1)
  424. }
  425. testList.value.push(
  426. obj
  427. )
  428. }
  429. };
  430. /**
  431. * 播报时间
  432. */
  433. watch(() => time.value.countdownNum, (newData) => {
  434. if (examState.value != 42) {
  435. return false;
  436. }
  437. if (newData >= 30) {
  438. if (newData % 30 == 0) {
  439. speckText(
  440. `还有${newData}秒`
  441. );
  442. }
  443. }
  444. if (newData == 10) {
  445. speckText("还有10秒");
  446. }
  447. if (newData <= 5) {
  448. speckText(newData);
  449. }
  450. if (newData == 0) {
  451. speckText("哨声");
  452. }
  453. }, { immediate: true });
  454. onBeforeMount(() => {
  455. parameter.value = route.query;
  456. let project = parameter.value.project;
  457. let area = parameter.value.area;
  458. parameter.value.examId = `${project}_${area}`; //项目+区
  459. if (parameter.value.time) {
  460. time.value.testTime = parameter.value.time
  461. }
  462. time.value.countdownNum = time.value.testTime;
  463. let myInfo: any = localStorage.getItem("userInfo");
  464. userInfo.value = JSON.parse(myInfo);
  465. if (parameter.value.gesture == 'true') {
  466. parameter.value.gesture = true
  467. } else {
  468. parameter.value.gesture = false
  469. }
  470. let list = parameter.value.area.split(',');
  471. testList.value = list.map((item: any, index: number) => {
  472. let obj = {
  473. area: item,
  474. itemNumber: index + 1
  475. }
  476. return obj;
  477. });
  478. //需要开始按钮的项目
  479. if (testList.value.length > 10) {
  480. needStart.value = true;
  481. }
  482. //展示样式控制
  483. if (testList.value.length <= 5) {
  484. styleType.value = 1;
  485. //填补空缺
  486. getAddTestList(5)
  487. }
  488. if (testList.value.length > 5 && testList.value.length <= 10) {
  489. styleType.value = 2;
  490. //填补空缺
  491. getAddTestList(10)
  492. }
  493. if (testList.value.length > 10) {
  494. styleType.value = 3;
  495. }
  496. })
  497. onMounted(() => {
  498. //加载WS
  499. let project = parameter.value.project;
  500. initWs({ parameter: parameter.value, testTime: time.value.testTime, version: "v2" }, (data: any) => {
  501. let index = testList.value.findIndex((item: any) => {
  502. let examId = `${project}_${item.area}`;
  503. return examId == data.exam_id;
  504. })
  505. multipleItemRefList.value[index]?.getMessage(data);
  506. });
  507. initSpeech();
  508. setTimeout(() => {
  509. //10秒还在0状态就算超时
  510. if (examState.value == 0) {
  511. getExit();
  512. }
  513. }, 10000);
  514. })
  515. onUnmounted(() => {
  516. getExit();
  517. })
  518. </script>
  519. <style scoped lang="scss">
  520. $waiPadding: 6.51rem;
  521. .time {
  522. width: 20vh;
  523. height: 20vh;
  524. line-height: 20vh;
  525. border-radius: 50%;
  526. color: #FF9402;
  527. font-size: 8vh;
  528. text-align: center;
  529. background-image: url("@/assets/images/test/time.png");
  530. background-position: center;
  531. background-repeat: no-repeat;
  532. background-size: 100% 100%;
  533. position: absolute;
  534. right: 50%;
  535. top: -4vh;
  536. margin-right: -10vh;
  537. font-family: 'Saira-BlackItalic';
  538. }
  539. .time1 {
  540. width: 26vh;
  541. height: 26vh;
  542. line-height: 26vh;
  543. font-size: 10.3vh;
  544. right: auto;
  545. left: 50%;
  546. top: 0vh;
  547. margin-left: 8vw;
  548. margin-right: auto;
  549. }
  550. .main {
  551. width: calc(100% - ($waiPadding * 2));
  552. height: 78vh;
  553. padding-top: 10rem;
  554. margin: 0 auto;
  555. display: flex;
  556. overflow: hidden;
  557. flex-direction: column;
  558. }
  559. .mask {
  560. position: fixed;
  561. height: 100vh;
  562. width: 100vw;
  563. top: 0;
  564. left: 0;
  565. background: rgba(0, 0, 0, 0.3);
  566. z-index: 998;
  567. }
  568. .mask2 {
  569. background: rgba(0, 0, 0, 0.68);
  570. }
  571. .confirmDiaBg {
  572. width: 100%;
  573. height: 100vh;
  574. position: fixed;
  575. left: 0;
  576. top: 0;
  577. display: flex;
  578. align-items: center;
  579. justify-content: center;
  580. z-index: 999;
  581. .confirmDiaWindow {
  582. width: 40%;
  583. height: 43.4%;
  584. border-radius: 1.6rem;
  585. opacity: 1;
  586. box-sizing: border-box;
  587. border: 0.55rem solid #13ED84;
  588. text-align: center;
  589. display: flex;
  590. align-items: center;
  591. justify-content: center;
  592. position: fixed;
  593. background: radial-gradient(96% 96% at 2% 32%, #FFFFFF 0%, #FCFDFD 54%, #E1E4E7 100%);
  594. .readyBox {
  595. text-align: center;
  596. color: #1A293A;
  597. .lable {
  598. font-size: 4.3rem;
  599. line-height: 1;
  600. margin-bottom: 1.5rem;
  601. }
  602. .value {
  603. font-size: 10rem;
  604. line-height: 1;
  605. font-family: 'Saira-BlackItalic';
  606. }
  607. }
  608. }
  609. }
  610. .footerBtn {
  611. width: 100%;
  612. padding: 0 calc(13.02rem /2);
  613. box-sizing: border-box;
  614. position: fixed;
  615. bottom: 3vh;
  616. display: flex;
  617. justify-content: end;
  618. .btn {
  619. width: 14.6vw;
  620. height: 6.1vh;
  621. line-height: 6.1vh;
  622. font-size: 3vh;
  623. color: #1A293A;
  624. text-align: center;
  625. border-radius: 1vh;
  626. cursor: pointer;
  627. margin-left: 10px;
  628. background: radial-gradient(159% 126% at 5% 93%, #8EFFA9 0%, #07FFE7 100%);
  629. box-shadow: 1px 1px 1px 1px rgba(0, 0, 0, 0.1874), inset 0px 1px 0px 1px rgba(255, 255, 255, 0.5577);
  630. &:hover {
  631. background: #8EFFA9;
  632. }
  633. }
  634. .startBtn {
  635. color: #ffffff;
  636. background: radial-gradient(159% 126% at 5% 93%, #F99F02 0%, #ED7905 100%);
  637. box-shadow: 3px 6px 4px 1px rgba(0, 0, 0, 0.1874), inset 0px 1px 0px 2px rgba(255, 255, 255, 0.5577);
  638. &:hover {
  639. background: #F99F02;
  640. }
  641. }
  642. .testRecordBtn {
  643. position: relative;
  644. z-index: 999;
  645. }
  646. }
  647. .main-right {
  648. width: 22.7%;
  649. height: 80vh;
  650. border-radius: 1.6rem;
  651. // background: linear-gradient(29deg, #092941 -82%, #2A484B 94%);
  652. background-color: rgba(9, 41, 65, 0.8);
  653. box-shadow: inset 0px 1px 0px 2px rgba(255, 255, 255, 0.4);
  654. display: flex;
  655. flex-direction: column;
  656. overflow: hidden;
  657. position: absolute;
  658. z-index: 999;
  659. bottom: 6.5vh;
  660. right: calc(13.02rem /2);
  661. }
  662. //列表样式写在此父组件里,子组件尽量减少个性化class和style,多样性以父组件控制类型
  663. ::v-deep(.testBox1) {
  664. $listMargin: 10vw;
  665. $listWidth: calc((100vw - ($waiPadding * 2) - $listMargin) / 5);
  666. display: flex;
  667. flex-wrap: wrap;
  668. align-items: center;
  669. .ul {
  670. width: 100%;
  671. height: 36vh;
  672. display: flex;
  673. .li {
  674. width: $listWidth;
  675. position: relative;
  676. .ready {
  677. position: absolute;
  678. height: 100%;
  679. width: 100%;
  680. display: flex;
  681. align-items: center;
  682. justify-items: center;
  683. img {
  684. width: 100%;
  685. }
  686. }
  687. .userInfo {
  688. width: 100%;
  689. height: 100%;
  690. border-radius: 1.6rem;
  691. background: radial-gradient(122% 126% at 97% 6%, #35FFC6 0%, #00FFE8 100%);
  692. text-align: center;
  693. display: flex;
  694. align-items: center;
  695. justify-content: center;
  696. cursor: pointer;
  697. margin-bottom: 3px;
  698. .userInfo-center {
  699. .pic {
  700. width: calc(36vh * 0.62);
  701. height: calc(36vh * 0.62);
  702. border-radius: 50%;
  703. display: flex;
  704. justify-content: center;
  705. align-items: center;
  706. overflow: hidden;
  707. margin: 0 auto 2vh auto;
  708. position: relative;
  709. .area {
  710. position: absolute;
  711. top: calc(36vh * 0.18);
  712. color: #203C52;
  713. font-size: 5vh;
  714. line-height: 1;
  715. font-family: 'Saira-ExtraBold';
  716. text-align: center;
  717. }
  718. img {
  719. width: 100%;
  720. }
  721. }
  722. .pic2 {
  723. box-sizing: border-box;
  724. border: 0.44rem solid rgba(26, 41, 58, 0.6315);
  725. }
  726. .name {
  727. width: 100%;
  728. color: #1A293A;
  729. font-size: 2.21rem;
  730. }
  731. .name2 {
  732. padding: 0.1rem 0.4rem;
  733. border-radius: 1.1rem;
  734. background: radial-gradient(96% 96% at 2% 32%, #FFFFFF 0%, #FCFDFD 54%, #E1E4E7 100%);
  735. box-shadow: inset 0px 1px 0px 2px rgba(255, 255, 255, 0.9046), inset 0px 3px 6px 0px rgba(0, 0, 0, 0.0851);
  736. }
  737. }
  738. }
  739. .score {
  740. height: 18vh;
  741. line-height: 18vh;
  742. font-size: 12vh;
  743. font-family: 'Saira-BlackItalic';
  744. border: 0.55rem solid #13ED84;
  745. text-align: center;
  746. border-radius: 1.6rem;
  747. box-sizing: content-box;
  748. color: #1A293A;
  749. position: relative;
  750. background: radial-gradient(96% 96% at 2% 32%, #FFFFFF 0%, #FCFDFD 54%, #E1E4E7 100%);
  751. display: none;
  752. &::before {
  753. content: "";
  754. width: 2vw;
  755. height: 2vw;
  756. display: block;
  757. position: absolute;
  758. top: -1.5vw;
  759. left: 50%;
  760. margin-left: -1vw;
  761. background-image: url("@/assets/images/home/test_icon.png");
  762. background-position: center;
  763. background-repeat: no-repeat;
  764. background-size: 100% 100%;
  765. border-radius: 50%;
  766. flex-shrink: 0;
  767. transition: all 0.5s;
  768. }
  769. }
  770. }
  771. &:nth-child(1) {
  772. justify-content: space-between;
  773. }
  774. &:nth-child(2) {
  775. justify-content: space-evenly;
  776. .li {
  777. margin-left: calc($listMargin/4);
  778. margin-right: calc($listMargin/4);
  779. }
  780. }
  781. }
  782. .ready.ul {
  783. &:nth-child(1) {
  784. .li:nth-child(2) {
  785. &::after {
  786. content: "";
  787. position: absolute;
  788. height: 100%;
  789. width: 100%;
  790. display: block;
  791. background-image: url("@/assets/images/test/ready3.png");
  792. background-position: center center;
  793. background-repeat: no-repeat;
  794. background-size: 100%;
  795. }
  796. }
  797. }
  798. &:nth-child(2) {
  799. .li {
  800. &::after {
  801. content: "";
  802. position: absolute;
  803. height: 100%;
  804. width: 100%;
  805. display: block;
  806. background-image: url("@/assets/images/test/ready3.png");
  807. background-position: center center;
  808. background-repeat: no-repeat;
  809. background-size: 100%;
  810. top: -100%;
  811. }
  812. }
  813. }
  814. }
  815. .overlap.ul {
  816. transition: all 0.5s;
  817. .li {
  818. .score {
  819. display: block;
  820. }
  821. }
  822. &:nth-child(1) {
  823. margin-top: 5vh;
  824. .li {
  825. &::before {
  826. display: none
  827. }
  828. &::after {
  829. display: none
  830. }
  831. }
  832. }
  833. &:nth-child(2) {
  834. margin-top: -20vh;
  835. .li {
  836. &::before {
  837. display: none
  838. }
  839. &::after {
  840. display: none
  841. }
  842. }
  843. }
  844. }
  845. }
  846. ::v-deep(.testBox2) {
  847. $listMargin: 10vw;
  848. $listWidth: calc((100% - $listMargin) / 5);
  849. .ul {
  850. width: 100%;
  851. height: 34vh;
  852. display: flex;
  853. justify-content: space-between;
  854. margin-bottom: 4vh;
  855. .li {
  856. width: $listWidth;
  857. position: relative;
  858. height: 100%;
  859. border-radius: 3vh;
  860. padding: 0.6vw;
  861. background: radial-gradient(122% 126% at 97% 6%, #35FFC6 0%, #00FFE8 100%);
  862. display: flex;
  863. flex-direction: column;
  864. justify-content: space-between;
  865. box-sizing: border-box;
  866. .userInfo {
  867. width: 100%;
  868. height: 100%;
  869. border-radius: 1.6rem;
  870. background: radial-gradient(122% 126% at 97% 6%, #35FFC6 0%, #00FFE8 100%);
  871. text-align: center;
  872. display: flex;
  873. align-items: center;
  874. justify-content: center;
  875. cursor: pointer;
  876. .userInfo-center {
  877. .pic {
  878. width: calc(36vh * 0.62);
  879. height: calc(36vh * 0.62);
  880. border-radius: 50%;
  881. display: flex;
  882. justify-content: center;
  883. align-items: center;
  884. overflow: hidden;
  885. margin: 0 auto 2vh auto;
  886. position: relative;
  887. .area {
  888. position: absolute;
  889. top: calc(36vh * 0.18);
  890. color: #203C52;
  891. font-size: 5vh;
  892. line-height: 1;
  893. font-family: 'Saira-ExtraBold';
  894. text-align: center;
  895. }
  896. img {
  897. width: 100%;
  898. }
  899. }
  900. .pic2 {
  901. box-sizing: border-box;
  902. border: 0.44rem solid rgba(26, 41, 58, 0.6315);
  903. }
  904. .name {
  905. width: 100%;
  906. color: #1A293A;
  907. font-size: 2.21rem;
  908. }
  909. }
  910. }
  911. .score {
  912. height: 14vh;
  913. line-height: 14vh;
  914. font-size: 9vh;
  915. font-family: 'Saira-BlackItalic';
  916. background: #ffffff;
  917. box-sizing: border-box;
  918. border: 0.55rem solid #13ED84;
  919. text-align: center;
  920. border-radius: 1.6rem;
  921. box-sizing: content-box;
  922. color: #1A293A;
  923. position: relative;
  924. display: none;
  925. &::before {
  926. content: "";
  927. width: 2vw;
  928. height: 2vw;
  929. display: block;
  930. position: absolute;
  931. top: -1.3vw;
  932. left: 50%;
  933. margin-left: -1vw;
  934. background-image: url("@/assets/images/home/test_icon.png");
  935. background-position: center;
  936. background-repeat: no-repeat;
  937. background-size: 100% 100%;
  938. border-radius: 50%;
  939. flex-shrink: 0;
  940. transition: all 0.5s;
  941. }
  942. }
  943. }
  944. }
  945. .overlap {
  946. .li {
  947. .userInfo {
  948. height: 6.2vw;
  949. .userInfo-center {
  950. width: 100%;
  951. text-align: center;
  952. display: flex;
  953. align-items: center;
  954. cursor: pointer;
  955. .pic {
  956. width: 6.2vw;
  957. height: 6.2vw;
  958. border-radius: 50%;
  959. display: flex;
  960. justify-content: center;
  961. align-items: center;
  962. overflow: hidden;
  963. position: relative;
  964. flex-shrink: 0;
  965. margin: 0;
  966. .area {
  967. position: absolute;
  968. top: 0;
  969. left: 0;
  970. width: 100%;
  971. height: 100%;
  972. line-height: 6.2vw;
  973. color: #ffffff;
  974. font-size: 2.5vw;
  975. font-family: 'Saira-ExtraBold';
  976. text-align: center;
  977. background: rgba(#000000, 0.4)
  978. }
  979. img {
  980. width: 100%;
  981. }
  982. }
  983. .pic2 {
  984. box-sizing: border-box;
  985. border: 2px solid rgba(26, 41, 58, 0.6315);
  986. }
  987. .name {
  988. width: 100%;
  989. color: #1A293A;
  990. font-size: 1.8rem;
  991. border-radius: 2vw;
  992. padding: 0.5rem 0;
  993. background: radial-gradient(96% 96% at 2% 32%, #FFFFFF 0%, #FCFDFD 54%, #E1E4E7 100%);
  994. box-shadow: inset 0px 1px 0px 2px rgba(255, 255, 255, 0.9046), inset 0px 3px 6px 0px rgba(0, 0, 0, 0.0851);
  995. }
  996. }
  997. }
  998. .score {
  999. display: block;
  1000. }
  1001. }
  1002. }
  1003. }
  1004. ::v-deep(.testBox3) {
  1005. $listMargin: 5vw;
  1006. $listWidth: calc((100% - $listMargin) / 10);
  1007. .ul {
  1008. width: 100%;
  1009. height: 14vh;
  1010. display: flex;
  1011. justify-content: space-around;
  1012. margin-bottom: calc($listMargin / 10);
  1013. .li {
  1014. width: $listWidth;
  1015. position: relative;
  1016. height: 100%;
  1017. border-radius: 5vh;
  1018. background: radial-gradient(122% 126% at 97% 6%, #35FFC6 0%, #00FFE8 100%);
  1019. .userInfo {
  1020. padding: 2vh 0.6vw 0 0.6vw;
  1021. margin-bottom: 0.8vh;
  1022. .userInfo-center {
  1023. text-align: center;
  1024. display: flex;
  1025. align-items: center;
  1026. cursor: pointer;
  1027. border-radius: 1.3vw;
  1028. height: 2.6vw;
  1029. background: linear-gradient(180deg, #FFFFFF 0%, rgba(255, 255, 255, 0.6571) 100%);
  1030. border: 1px solid #FFFFFF;
  1031. .pic {
  1032. width: 2.6vw;
  1033. height: 2.6vw;
  1034. border-radius: 50%;
  1035. display: flex;
  1036. justify-content: center;
  1037. align-items: center;
  1038. overflow: hidden;
  1039. position: relative;
  1040. flex-shrink: 0;
  1041. .area {
  1042. position: absolute;
  1043. top: 0;
  1044. left: 0;
  1045. width: 100%;
  1046. height: 100%;
  1047. line-height: 2.6vw;
  1048. color: #ffffff;
  1049. font-size: 1.4vw;
  1050. font-family: 'Saira-ExtraBold';
  1051. text-align: center;
  1052. background: rgba(#000000, 0.4)
  1053. }
  1054. img {
  1055. width: 100%;
  1056. }
  1057. }
  1058. .pic2 {
  1059. box-sizing: border-box;
  1060. border: 2px solid rgba(26, 41, 58, 0.6315);
  1061. }
  1062. .name {
  1063. color: #1A293A;
  1064. font-size: 1rem;
  1065. margin-left: 0.5vw;
  1066. }
  1067. }
  1068. }
  1069. .score {
  1070. font-size: 3rem;
  1071. font-family: 'Saira-BlackItalic';
  1072. text-align: center;
  1073. color: #1A293A;
  1074. line-height: 1;
  1075. }
  1076. }
  1077. }
  1078. }
  1079. </style>