1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888 |
- <template>
- <div>
- <Header @confirmExit="confirmExit"></Header>
- <Transition :enter-active-class="proxy?.animate.dialog.enter" :leave-active-class="proxy?.animate.dialog.leave">
- <div class="time"
- :class="{ 'time1': styleType == 1, 'time2': styleType == 2, 'time3': styleType == 3, 'time4': styleType == 4, }"
- v-show="(needStart && [42].includes(examState)) || (['jumprope', 'jumpingjack', 'situp'].includes(parameter.project) && [42].includes(examState))">
- {{
- time.countdownNum
- }}</div>
- </Transition>
- <div class="main">
- <div class="testBox"
- :class="{ 'testBox1': styleType == 1, 'testBox2': styleType == 2, 'testBox3': styleType == 3, 'testBox4': styleType == 4 }">
- <div class="ul"
- :class="{ 'overlap': (examState == 43 && time.ready) || [42].includes(examState) || (showTestAgain && ![41].includes(examState)), 'ready': [41].includes(examState), 'hands': parameter.gesture }"
- v-for="(items, indexs) in testListArr " :key="indexs">
- <MultipleItem :ref="(el: any) => { multipleItemRef(el, item.itemNumber, item.area) }"
- v-for="(item, index) in items" :query="parameter" :area="item.area" :key="index" @returnData="returnData"
- @getChooseStudent="getChooseStudent" :examState="examState" :needStart="needStart" :styleType="styleType"
- :parentTrainWsMethod="{ initWs, examEnds, openOneTest, startFace, stopFace, faceConfirmOnly, startOneTest, finishOneTest, closeOneTest, suspendFaceRecognitionChannels, resumeFaceRecognitionChannels }"
- :parentSpeechMethod="{ initSpeech, speckText, playMusic, controlMusic, speckCancel, chineseNumber }" />
- </div>
- </div>
- </div>
- <div class="footerBtn">
- <template v-if="needStart">
- <div class="btn" @click="getAgain" v-if="examState == 42 || showTestAgain">再测一次</div>
- <div class="btn" @click="getOpenOneTestAndStartFace" v-if="examState < 41">开始识别</div>
- <div class="btn" @click="getStopFace" v-if="examState == 41">停止人脸识别</div>
- <div class="btn startBtn" @click="getReady" v-if="examState == 43">开始测试</div>
- <div class="btn" @click="getAllRetestFace" v-if="examState == 43 || examState == 42">重新识别</div>
- </template>
- <template v-else>
- <template v-if="examState == 43">
- <div class="btn startBtn" @click="getReady"
- v-if="['jumprope', 'jumpingjack', 'situp'].includes(parameter.project)">开始测试</div>
- <div class="btn startBtn" @click="getStartOneTest" v-else>开始测试</div>
- </template>
- </template>
- <div class="btn" :class="{ testRecordBtn: showReportList }" @click="getTestRecord"
- v-if="![43, 42].includes(examState)">
- {{ showReportList ? '关闭记录' : '测试记录' }}
- </div>
- <!--测试记录开始-->
- <Transition :enter-active-class="proxy?.animate.mask.enter" :leave-active-class="proxy?.animate.mask.leave">
- <div class="mask mask2" v-show="showReportList" @click="getTestRecord"></div>
- </Transition>
- <Transition :enter-active-class="proxy?.animate.report.enter" :leave-active-class="proxy?.animate.report.leave">
- <div class="main-right" v-show="showReportList">
- <ReportList ref="reportListRef" :parameter="parameter" :showQRCode="true" />
- </div>
- </Transition>
- <!--测试记录结束-->
- </div>
- <!--倒计时开始-->
- <div>
- <Transition :enter-active-class="proxy?.animate.mask.enter" :leave-active-class="proxy?.animate.mask.leave">
- <div class="mask" v-show="examState == 43 && time.ready"></div>
- </Transition>
- <Transition :enter-active-class="proxy?.animate.face.enter" :leave-active-class="proxy?.animate.face.leave2">
- <div class="confirmDiaBg" v-show="examState == 43 && time.ready">
- <div class="confirmDiaWindow">
- <div class="readyBox">
- <div class="lable">倒计时</div>
- <div class="value" :class="{ 'transparent': time.ready > 5 }">{{ time.ready }}</div>
- </div>
- </div>
- </div>
- </Transition>
- </div>
- <!--倒计时结束-->
- <ChooseStudent ref="chooseStudentRef" @returnData="returnStudent" />
- </div>
- </template>
- <script setup name="Multiple" lang="ts">
- import { useWs } from '@/utils/trainWs';
- // import { initWs, examEnds, openOneTest, startFace, stopFace, faceConfirmOnly, startOneTest, finishOneTest, closeOneTest, suspendFaceRecognitionChannels, resumeFaceRecognitionChannels } from '@/utils/ws'
- import { initSpeech, speckText, playMusic, controlMusic, speckCancel, chineseNumber } from '@/utils/speech'
- import { useWebSocket } from '@/utils/handWs';
- const { handWs, startDevice, startHand, stateHand } = useWebSocket();
- const { initWs, examEnds, openOneTest, startFace, stopFace, faceConfirmOnly, startOneTest, finishOneTest, closeOneTest, suspendFaceRecognitionChannels, resumeFaceRecognitionChannels } = useWs();
- const { proxy } = getCurrentInstance() as any;
- const router = useRouter();
- const route = useRoute();
- const reportListRef = ref();
- const chooseStudentRef = ref();
- const data = reactive<any>({
- timerManager: {},//计时器管理
- parameter: {},//参数
- time: {
- testTime: 60,//时长
- countdownNum: 0,//计时
- ready: 0,//预备
- exit: 0,//退出倒计时
- },
- userInfo: {},//用户信息
- examState: 0,//当前状态
- needStart: false,//是否需要按钮
- showTestAgain: false,//再测一次按钮
- testList: [],//获取区列表
- multipleItemRefList: [],//获取区列表
- styleType: null,//展示样式1:1-5个,2:6-10个,3:10个以上,4:1-4个,
- showReportList: false,//显示隐藏测试记录
- exitStatus: 0,//退出响应次数
- sid: null,//WS的id
- chooseStudentArea: {},//弹出手动选择对应的区号
- device_info: {},//设备信息
- });
- const { timerManager, parameter, time, userInfo, examState, needStart, showTestAgain, testList, multipleItemRefList, styleType, showReportList, exitStatus, sid, chooseStudentArea, device_info } = toRefs(data);
- /**
- * 创建组件实例
- */
- const multipleItemRef = (el: any, index: number, area: any) => {
- multipleItemRefList.value[index - 1] = el;
- }
- /**
- * 开始识别
- */
- const getOpenOneTestAndStartFace = () => {
- cleanData();
- examState.value = 41;
- for (let i = 0; i < multipleItemRefList.value.length; i++) {
- multipleItemRefList.value[i].getOpenOneTestAndStartFace()
- }
- };
- /**
- * 停止人脸识别
- */
- const getStopFace = async () => {
- let flag = false;
- for (let i = 0; i < testList.value.length; i++) {
- if (testList.value[i] && testList.value[i].faceCheckStu?.student_id) {
- flag = true;
- }
- }
- if (!flag) {
- proxy?.$modal.msgWarning("请选择人员!");
- return false;
- }
- examState.value = 43;
- for (let i = 0; i < multipleItemRefList.value.length; i++) {
- multipleItemRefList.value[i].getStopFace()
- }
- };
- /**
- * 开始测试
- */
- const getStartOneTest = () => {
- if (examState.value != 43) {
- return false;
- }
- let flag = false;
- for (let i = 0; i < testList.value.length; i++) {
- if (testList.value[i] && testList.value[i].faceCheckStu?.student_id) {
- flag = true;
- }
- }
- if (!flag) {
- proxy?.$modal.msgWarning("请选择人员!");
- return false;
- }
- getClearTimer("readyTimer");
- time.value.ready = 0;
- examState.value = 42;
- for (let i = 0; i < multipleItemRefList.value.length; i++) {
- if (testList.value[i].examState == 41) {
- //正在识别的停止识别
- multipleItemRefList.value[i].getStopFace()
- }
- if (testList.value[i].examState == 43) {
- multipleItemRefList.value[i].getStartOneTest()
- }
- }
- speckText("哨声");
- if (parameter.value.music) {
- playMusic(parameter.value.music);
- }
- //显示再测一次按钮
- showTestAgain.value = true;
- //时间为0的为正计时,大于0的为倒计时
- if (time.value.testTime == 0) {
- getCounting("+");
- } else {
- getCounting("-");
- }
- };
- /**
- * 再测一次
- */
- const getAgain = () => {
- let loading = ElLoading.service({ text: '请稍等...', background: 'rgba(0, 0, 0, 0.8)', customClass: `sports ${parameter.value.project}` });
- cleanData();
- examState.value = 41;
- for (let i = 0; i < multipleItemRefList.value.length; i++) {
- multipleItemRefList.value[i].getAgain()
- }
- timerManager.value.againTimer = setInterval(() => {
- if (examState.value == 43) {
- getClearTimer("againTimer");
- loading?.close();
- }
- }, 300);
- let loadingTime = setTimeout(() => {
- if (examState.value <= 41) {
- loading?.close();
- clearTimeout(loadingTime);
- getClearTimer("againTimer");
- }
- }, 10000);
- };
- /**
- * 重新识别
- */
- const getAllRetestFace = async () => {
- let loading = ElLoading.service({ text: '请稍等...', background: 'rgba(0, 0, 0, 0.8)', customClass: `sports ${parameter.value.project}` });
- showTestAgain.value = false;
- examState.value = 3;
- for (let i = 0; i < multipleItemRefList.value.length; i++) {
- multipleItemRefList.value[i].getAllRetestFace()
- }
- timerManager.value.allRetestFaceTimer = setInterval(() => {
- if (examState.value == 41) {
- getClearTimer("allRetestFaceTimer");
- loading?.close();
- }
- }, 300);
- let loadingTime = setTimeout(() => {
- if (examState.value <= 3) {
- loading?.close();
- clearTimeout(loadingTime);
- getClearTimer("allRetestFaceTimer");
- }
- }, 10000);
- };
- /**
- * 确认退出
- */
- const confirmExit = () => {
- let handcontroller_id = parameter.value.handcontroller;
- proxy?.$modal.confirm(handcontroller_id ? `请保持两秒确认退出` : `确定退出吗?`).then(() => {
- getExit();
- }).finally(() => {
- });
- };
- /**
- * 退出
- */
- const getExit = () => {
- getClearTimer();//清除计时器
- examEnds();//通知工作站关闭
- speckCancel();//停止播报
- window.onbeforeunload = null;//移除事件处理器
- let handcontroller_id = parameter.value.handcontroller;
- if (handcontroller_id) {
- router.push({ path: '/gesture' });//跳转
- } else {
- router.push({ path: '/' });//跳转
- }
- };
- /**
- * 清空定时任务
- */
- const getClearTimer = (data?: any) => {
- if (data) {
- //清除指定
- clearInterval(timerManager.value[data])
- timerManager.value[data] = null;
- } else {
- //清除全部
- for (let key in timerManager.value) {
- if (timerManager.value.hasOwnProperty(key)) {
- clearInterval(timerManager.value[key])
- timerManager.value[key] = null;
- }
- }
- }
- };
- /**
- * 清除历史记录
- */
- const cleanData = () => {
- getClearTimer("countdownTimer");
- time.value.countdownNum = time.value.testTime;
- showTestAgain.value = false;
- };
- /**
- * 时间转换
- */
- // const countdownNumFormat = computed(() => {
- // return time.value.countdownNum;
- // //return proxy?.$utils.timeFormat(time.value.countdownNum);
- // });
- /**
- * 倒计时
- */
- const getCounting = (type: string) => {
- timerManager.value.countdownTimer = setInterval(() => {
- //正计时
- if (type == "+") {
- time.value.countdownNum++;
- }
- //倒计时
- if (type == "-") {
- if (time.value.countdownNum <= 0) {
- getClearTimer("countdownTimer");
- } else {
- time.value.countdownNum--;
- }
- }
- }, 1000);
- };
- /**
- * 子组件选择学生
- */
- const getChooseStudent = (data: any) => {
- console.log("data", data)
- chooseStudentArea.value = data;
- chooseStudentRef.value.open();
- }
- /**
- * 返回被选学生
- */
- const returnStudent = (data: any) => {
- console.log("data", data)
- let area = chooseStudentArea.value.area;
- let index = testList.value.findIndex((item: any) => {
- return area == item.area;
- })
- console.log("index", index)
- multipleItemRefList.value[index]?.returnStudent(data);
- };
- /**
- * 子组件返回数据
- */
- const returnData = (data: any) => {
- let index = testList.value.findIndex((item: any) => {
- return item.area == data.area;
- });
- let obj = Object.assign(testList.value[index], data);
- testList.value[index] = JSON.parse(JSON.stringify(obj));
- console.log("testList.value", testList.value)
- if (examState.value == 0) {
- let flag = false;
- //只监听人脸识别的区
- let newList = testList.value;
- for (let i = 0; i < newList.length; i++) {
- if (newList[i] && newList[i].examState == 3) {
- flag = true;
- }
- }
- if (flag) {
- console.log("变更状态:", 3)
- examState.value = 3;
- if (needStart.value) {
- let handcontroller = parameter.value.handcontroller;
- let ctrl = parameter.value.ctrl;
- if (handcontroller && ctrl) {
- speckText(`请${ctrl}区举左手开始识别`);
- } else {
- proxy?.$modal.msgWarning(`请点击右下角的【开始识别】`);
- }
- }
- }
- }
- if (examState.value == 3) {
- let flag = false;
- //只监听人脸识别的区
- let newList = testList.value;
- for (let i = 0; i < newList.length; i++) {
- if (newList[i] && newList[i].examState == 40) {
- flag = true;
- }
- }
- if (flag) {
- console.log("变更状态:", 40)
- examState.value = 40;
- }
- }
- if (examState.value == 40) {
- let flag = false;
- //只监听人脸识别的区
- let newList = testList.value;
- for (let i = 0; i < newList.length; i++) {
- if (newList[i] && newList[i].examState == 41) {
- flag = true;
- }
- }
- if (flag) {
- console.log("变更状态:", 41)
- examState.value = 41;
- let txt = parameter.value.gesture ? "请举右手看摄像头人脸识别" : "请看摄像头进行人脸识别";
- speckText(txt);
- //如果过段时候后仍在识别中就提示停止识别
- // setTimeout(() => {
- // if (examState.value == 41) {
- // let handcontroller = parameter.value.handcontroller;
- // let ctrl = parameter.value.ctrl;
- // if (handcontroller && ctrl) {
- // speckText(`各就位后请${ctrl}区举左手停止识别`);
- // } else {
- // proxy?.$modal.msgWarning(`各就位后请点击右下角的【停止人脸识别】`);
- // }
- // }
- // }, 15000)
- }
- }
- if (examState.value == 41) {
- let flag = false;
- //只监听人脸识别的区
- let newList = testList.value.filter((item: any) => {
- return item?.faceCheckStu?.student_id;
- })
- for (let i = 0; i < newList.length; i++) {
- if (newList[i] && newList[i].faceCheckStu?.student_id && newList[i].examState == 43) {
- flag = true;
- }
- }
- if (flag) {
- console.log("变更状态:", 43)
- examState.value = 43;
- cleanData();
- //如果过段时候后仍在识别中就提示停止识别
- // setTimeout(() => {
- // if (examState.value == 43) {
- // let handcontroller = parameter.value.handcontroller;
- // let ctrl = parameter.value.ctrl;
- // if (handcontroller && ctrl) {
- // speckText(`请${ctrl}区举左手开始测试`);
- // } else {
- // proxy?.$modal.msgWarning(`请点击右下角的【开始测试】`);
- // }
- // }
- // }, 10000)
- }
- }
- //测试完成后回退状态
- if (examState.value == 42) {
- let flag = false;
- //只监听人脸识别的区
- let newList = testList.value.filter((item: any) => {
- return item?.faceCheckStu?.student_id;
- })
- for (let i = 0; i < newList.length; i++) {
- if (newList[i] && newList[i].faceCheckStu?.student_id && newList[i].examState == 3) {
- flag = true;
- } else {
- return false;
- }
- }
- if (flag) {
- console.log("变更状态:", 3)
- examState.value = 3;
- }
- }
- //如果全部状态为0就退出
- if (examState.value >= 0) {
- let flag = false;
- //只监听人脸识别的区
- let newList = testList.value;
- for (let i = 0; i < newList.length; i++) {
- if (newList[i] && newList[i].examState == 0) {
- flag = true;
- } else {
- return false;
- }
- }
- if (flag) {
- examState.value = 0;
- getExit();
- }
- }
- };
- /**
- * 准备开始
- */
- const getReady = () => {
- if (examState.value != 43) {
- return false;
- }
- if (time.value.ready) {
- return false;
- }
- let flag = false;
- for (let i = 0; i < testList.value.length; i++) {
- if (testList.value[i] && testList.value[i].faceCheckStu?.student_id) {
- flag = true;
- }
- }
- if (!flag) {
- proxy?.$modal.msgWarning("请选择人员!");
- return false;
- }
- //停止播报;
- speckCancel()
- //正在识别的停止识别
- for (let i = 0; i < multipleItemRefList.value.length; i++) {
- if (testList.value[i].examState == 41) {
- multipleItemRefList.value[i].getStopFace()
- }
- }
- time.value.ready = 6;
- timerManager.value.readyTimer = setInterval(() => {
- time.value.ready--;
- if (time.value.ready <= 0) {
- getClearTimer("readyTimer");
- getStartOneTest();
- } else {
- speckText(time.value.ready);
- }
- }, 1000);
- };
- /**
- * 将测试列表转为多行
- */
- const testListArr = computed(() => {
- let list: any = [];
- let num = 0;
- if (styleType.value == 1) {
- num = 3
- }
- if (styleType.value == 2) {
- num = 5
- }
- if (styleType.value == 3) {
- num = 10
- }
- if (styleType.value == 4) {
- num = 4
- }
- let myLength = Math.ceil(testList.value.length / num);
- for (let i = 0; i < myLength; i++) {
- list[i] = [];
- for (let j = 0; j < testList.value.length; j++) {
- if (j >= i * num && j < (i + 1) * num) {
- list[i].push(testList.value[j])
- }
- }
- }
- console.log("list", list)
- return list;
- });
- /**
- * 将测试列表转为多行
- */
- const getTestRecord = () => {
- if (showReportList.value) {
- showReportList.value = false;
- } else {
- reportListRef.value.getIniReportList();
- showReportList.value = true;
- }
- };
- /**
- * 自动填补空缺
- */
- const getAddTestList = (num: number) => {
- let list = parameter.value.area.split(',');
- let myLength = num - list.length;
- for (let i = 0; i < myLength; i++) {
- let obj = {
- area: "",
- itemNumber: list.length + (i + 1)
- }
- testList.value.push(
- obj
- )
- }
- };
- /**
- * 获取设备项目
- */
- const getDevice = async () => {
- let deviceid = localStorage.getItem("deviceid") || '';
- if (deviceid) {
- startDevice({ deviceid: deviceid })
- } else {
- proxy?.$modal.msgError(`缺少设备信息请重新登录!`);
- await proxy?.$http.common.logout({}).then((res: any) => {
- });
- proxy?.$modal?.closeLoading()
- //清空缓存
- localStorage.clear();
- //跳转
- router.push({ path: '/login/qrcode' });
- }
- };
- /**
- * 加载手势WS
- */
- const initHand = () => {
- handWs((e: any) => {
- if (router.currentRoute.value.path != '/train/multiple' || parameter.value.handcontroller == undefined) {
- return false;
- }
- console.log("eeeee", e)
- if (e?.wksid) {
- //获取设备项目
- getDevice()
- }
- //接收设备信息
- if (e?.device_info) {
- device_info.value = e.device_info;
- let handcontroller_id = device_info.value.handcontroller_id;
- stateHand(handcontroller_id);
- }
- //获取手势状态
- if (e?.cmd == 'get_handcontroller_state' && e?.state == 0) {
- let handcontroller_id = device_info.value.handcontroller_id;
- startHand(handcontroller_id);
- }
- //刷新
- if (e?.data?.result == "refresh") {
- getExit();
- //刷新
- window.location.reload()
- }
- //没初始化完成不监听手势动作
- if (examState.value == 0) {
- return false;
- }
- //左滑动
- if (e?.data?.result == "next_item") {
- proxy?.$modal.msgSuccess('手势指令:左滑动');
- // if(examState.value == 43 && time.value.ready){
- // return false;
- // }
- // if (examState.value == 43 || examState.value == 42) {
- // speckCancel();//停止播报
- // getAllRetestFace();
- // }
- }
- //举左手
- if (e?.data?.result == "left_hand") {
- proxy?.$modal.msgSuccess('手势指令:举左手');
- //举左手确认退出
- // if (exitStatus.value) {
- // exitStatus.value = 0;
- // //确认退出
- // let keyEvent: any = null;
- // keyEvent = new KeyboardEvent('keydown', {
- // key: 'Enter', // 键值
- // code: 'Enter', // 键盘代码
- // keyCode: 13, // 旧的键盘代码
- // which: 13, // 新的键盘代码
- // shiftKey: false, // 是否按下Shift键
- // ctrlKey: false, // 是否按下Ctrl键
- // metaKey: false, // 是否按下Meta键(Win键或Command键)
- // bubbles: true, // 事件是否冒泡
- // cancelable: true // 是否可以取消事件的默认行为
- // });
- // document.activeElement?.dispatchEvent(keyEvent);
- // return false;
- // }
- //开始识别
- if (needStart.value && examState.value < 41) {
- getOpenOneTestAndStartFace();
- return false;
- }
- //停止人脸识别
- if (needStart.value && examState.value == 41) {
- getStopFace();
- return false;
- }
- //开始测试
- if (examState.value == 43) {
- getReady()
- return false;
- }
- }
- //退出
- if (e?.data?.result == "exit") {
- proxy?.$modal.msgSuccess('手势指令:交叉手');
- // console.log("exitStatus.value", exitStatus.value)
- if (exitStatus.value == 0) {
- speckText("请保持两秒确认退出");
- //第一次才弹出
- confirmExit();
- setTimeout(() => {
- let keyEvent: any = null;
- let myKey = null;
- //如果交叉手两秒后返回超过4次就确认退出
- if (exitStatus.value >= 4) {
- myKey = 'Enter';
- } else {
- myKey = 'Esc';
- }
- if (myKey == 'Esc') {
- keyEvent = new KeyboardEvent('keydown', {
- key: 'Escape', // 键值
- code: 'Escape', // 键盘代码
- keyCode: 27, // 旧的键盘代码
- which: 27, // 新的键盘代码
- shiftKey: false, // 是否按下Shift键
- ctrlKey: false, // 是否按下Ctrl键
- metaKey: false, // 是否按下Meta键(Win键或Command键)
- bubbles: true, // 事件是否冒泡
- cancelable: true // 是否可以取消事件的默认行为
- });
- exitStatus.value = 0;
- }
- if (myKey == 'Enter') {
- keyEvent = new KeyboardEvent('keydown', {
- key: 'Enter', // 键值
- code: 'Enter', // 键盘代码
- keyCode: 13, // 旧的键盘代码
- which: 13, // 新的键盘代码
- shiftKey: false, // 是否按下Shift键
- ctrlKey: false, // 是否按下Ctrl键
- metaKey: false, // 是否按下Meta键(Win键或Command键)
- bubbles: true, // 事件是否冒泡
- cancelable: true // 是否可以取消事件的默认行为
- });
- }
- document.activeElement?.dispatchEvent(keyEvent);
- }, 2500)
- }
- exitStatus.value = exitStatus.value + 1
- }
- // if (e?.data?.result == "exit") {
- // console.log("exitStatus.value", exitStatus.value)
- // if (exitStatus.value == 0) {
- // exitStatus.value = 1
- // speckText("请5秒内举左手确认退出");
- // //第一次才弹出
- // confirmExit();
- // time.value.exit = 6;
- // timerManager.value.exitTimer = setInterval(() => {
- // time.value.exit--;
- // console.log("取消倒计时", time.value.exit)
- // proxy?.$modal.msgWarning(`取消倒计时:${time.value.exit}`)
- // if (time.value.exit == 0) {
- // exitStatus.value = 0;
- // getClearTimer("exitTimer");
- // let keyEvent: any = null;
- // keyEvent = new KeyboardEvent('keydown', {
- // key: 'Escape', // 键值
- // code: 'Escape', // 键盘代码
- // keyCode: 27, // 旧的键盘代码
- // which: 27, // 新的键盘代码
- // shiftKey: false, // 是否按下Shift键
- // ctrlKey: false, // 是否按下Ctrl键
- // metaKey: false, // 是否按下Meta键(Win键或Command键)
- // bubbles: true, // 事件是否冒泡
- // cancelable: true // 是否可以取消事件的默认行为
- // });
- // document.activeElement?.dispatchEvent(keyEvent);
- // }
- // }, 1000);
- // }
- // }
- });
- };
- /**
- * 播报时间
- */
- watch(() => time.value.countdownNum, (newData) => {
- if (examState.value != 42) {
- return false;
- }
- if (newData >= 30) {
- if (newData % 30 == 0) {
- speckText(
- `还有${newData}秒`
- );
- }
- }
- if (newData == 10) {
- speckText("还有10秒");
- }
- if (newData <= 5) {
- speckText(newData);
- }
- if (newData == 0) {
- speckText("哨声");
- }
- }, { immediate: true });
- onBeforeMount(() => {
- parameter.value = route.query;
- let project = parameter.value.project;
- let area = parameter.value.area;
- parameter.value.examId = `${project}_${area}`; //项目+区
- if (parameter.value.time) {
- time.value.testTime = parameter.value.time
- }
- time.value.countdownNum = time.value.testTime;
- let myInfo: any = localStorage.getItem("userInfo");
- userInfo.value = JSON.parse(myInfo);
- if (parameter.value.gesture == 'true') {
- parameter.value.gesture = true
- } else {
- parameter.value.gesture = false
- }
- let list = parameter.value.area.split(',');
- testList.value = list.map((item: any, index: number) => {
- let obj = {
- area: item,
- itemNumber: index + 1
- }
- return obj;
- });
- //展示样式控制
- if (testList.value.length == 5) {
- styleType.value = 1;
- //填补空缺
- getAddTestList(5)
- }
- if (testList.value.length > 5 && testList.value.length <= 10) {
- styleType.value = 2;
- //填补空缺
- getAddTestList(10)
- }
- if (testList.value.length > 10) {
- styleType.value = 3;
- }
- if (testList.value.length < 5) {
- styleType.value = 4;
- }
- //需要开始按钮的项目
- let myList = ['jumprope', 'jumpingjack', 'situp'];
- if (myList.includes(project) && styleType.value == 3) {
- needStart.value = true;
- }
- })
- onMounted(() => {
- //加载WS
- let project = parameter.value.project;
- initWs({ parameter: parameter.value, testTime: time.value.testTime, version: "v2" }, (data: any) => {
- //获取sid
- if (data.cmd === 'mySid') {
- console.log("data.data.sid", data.data.sid)
- sid.value = data.data.sid;
- }
- let index = testList.value.findIndex((item: any) => {
- let examId = `${project}_${item.area}`;
- return examId == data.exam_id;
- })
- multipleItemRefList.value[index]?.getMessage(data);
- });
- //初始化语音
- initSpeech();
- //初始化手势
- initHand();
- setTimeout(() => {
- //10秒还在0状态就算超时
- if (examState.value == 0) {
- getExit();
- }
- }, 10000);
- //刷新关闭
- window.onbeforeunload = function (e) {
- var confirmationMessage = "刷新/关闭页面将会关闭页面,是否确认退出页面?";
- (e || window.event).returnValue = confirmationMessage; // 兼容 Gecko + IE
- testList.value.forEach((item: any) => {
- let examId = item.exam_id;
- let bUrl = import.meta.env.VITE_APP_BASE_API;
- let classId = parameter.value.classes;
- let mySid = sid.value;
- let token: any = localStorage.getItem("token")
- let formData = new FormData();
- formData.append("exam_id", examId);
- formData.append("class_id", classId);
- formData.append("token", token);
- formData.append("sid", mySid);
- navigator.sendBeacon(bUrl + "/exam/close_exam", formData)
- })
- return confirmationMessage; // 兼容 Gecko + Webkit, Safari, Chrome
- };
- })
- onBeforeUnmount(() => {
- getExit();
- })
- </script>
- <style scoped lang="scss">
- $waiPadding: 6.51rem;
- .time {
- width: 20vh;
- height: 20vh;
- line-height: 20vh;
- border-radius: 50%;
- color: #FF9402;
- font-size: 8vh;
- text-align: center;
- background-image: url("@/assets/images/test/time.png");
- background-position: center;
- background-repeat: no-repeat;
- background-size: 100% 100%;
- position: absolute;
- right: 50%;
- top: -4vh;
- margin-right: -10vh;
- font-family: 'Saira-BlackItalic';
- }
- .time1,
- .time4 {
- width: 26vh;
- height: 26vh;
- line-height: 26vh;
- font-size: 10.3vh;
- right: auto;
- left: 50%;
- top: 0vh;
- margin-left: 8vw;
- margin-right: auto;
- }
- .main {
- width: calc(100% - ($waiPadding * 2));
- height: 78vh;
- padding-top: 10rem;
- margin: 0 auto;
- display: flex;
- overflow: hidden;
- flex-direction: column;
- }
- .mask {
- position: fixed;
- height: 100vh;
- width: 100vw;
- top: 0;
- left: 0;
- background: rgba(0, 0, 0, 0.3);
- z-index: 998;
- }
- .mask2 {
- background: rgba(0, 0, 0, 0.68);
- }
- .confirmDiaBg {
- width: 100%;
- height: 100vh;
- position: fixed;
- left: 0;
- top: 0;
- display: flex;
- align-items: center;
- justify-content: center;
- z-index: 999;
- .confirmDiaWindow {
- width: 40%;
- height: 43.4%;
- border-radius: 1.6rem;
- opacity: 1;
- box-sizing: border-box;
- border: 0.55rem solid #13ED84;
- text-align: center;
- display: flex;
- align-items: center;
- justify-content: center;
- position: fixed;
- background: radial-gradient(96% 96% at 2% 32%, #FFFFFF 0%, #FCFDFD 54%, #E1E4E7 100%);
- .readyBox {
- text-align: center;
- color: #1A293A;
- .lable {
- font-size: 4.3rem;
- line-height: 1;
- margin-bottom: 1.5rem;
- }
- .value {
- font-size: 10rem;
- line-height: 1;
- font-family: 'Saira-BlackItalic';
- }
- .transparent {
- opacity: 0;
- }
- }
- }
- }
- .footerBtn {
- width: 100%;
- padding: 0 calc(13.02rem /2);
- box-sizing: border-box;
- position: fixed;
- bottom: 3vh;
- display: flex;
- justify-content: end;
- .btn {
- width: 14.6vw;
- height: 6.1vh;
- line-height: 6.1vh;
- font-size: 3vh;
- color: #1A293A;
- text-align: center;
- border-radius: 1vh;
- cursor: pointer;
- margin-left: 10px;
- background: radial-gradient(159% 126% at 5% 93%, #8EFFA9 0%, #07FFE7 100%);
- box-shadow: 1px 1px 1px 1px rgba(0, 0, 0, 0.1874), inset 0px 1px 0px 1px rgba(255, 255, 255, 0.3);
- &:hover {
- background: #8EFFA9;
- }
- }
- .startBtn {
- color: #ffffff;
- background: radial-gradient(159% 126% at 5% 93%, #F99F02 0%, #ED7905 100%);
- box-shadow: 3px 6px 4px 1px rgba(0, 0, 0, 0.1874), inset 0px 1px 0px 2px rgba(255, 255, 255, 0.3);
- &:hover {
- background: #F99F02;
- }
- }
- .testRecordBtn {
- position: relative;
- z-index: 999;
- }
- }
- .main-right {
- width: 22.7%;
- height: 80vh;
- border-radius: 1.6rem;
- // background: linear-gradient(29deg, #092941 -82%, #2A484B 94%);
- background-color: rgba(9, 41, 65, 0.8);
- box-shadow: inset 0px 1px 0px 2px rgba(255, 255, 255, 0.4);
- display: flex;
- flex-direction: column;
- overflow: hidden;
- position: absolute;
- z-index: 999;
- bottom: 6.5vh;
- right: calc(13.02rem /2);
- }
- //列表样式写在此父组件里,子组件尽量减少个性化class和style,多样性以父组件控制类型
- ::v-deep(.testBox1) {
- $listMargin: 10vw;
- $listWidth: calc((100vw - ($waiPadding * 2) - $listMargin) / 5);
- display: flex;
- flex-wrap: wrap;
- align-items: center;
- .ul {
- width: 100%;
- height: 36vh;
- display: flex;
- .li {
- width: $listWidth;
- position: relative;
- .ready {
- position: absolute;
- height: 100%;
- width: 100%;
- display: flex;
- align-items: center;
- justify-items: center;
- img {
- width: 100%;
- }
- }
- .userInfo {
- width: 100%;
- height: 100%;
- border-radius: 1.6rem;
- background: radial-gradient(122% 126% at 97% 6%, #35FFC6 0%, #00FFE8 100%);
- text-align: center;
- display: flex;
- align-items: center;
- justify-content: center;
- cursor: pointer;
- margin-bottom: 3px;
- .userInfo-center {
- .pic {
- width: calc(36vh * 0.62);
- height: calc(36vh * 0.62);
- border-radius: 50%;
- display: flex;
- justify-content: center;
- align-items: center;
- overflow: hidden;
- margin: 0 auto 2vh auto;
- position: relative;
- .area {
- position: absolute;
- top: calc(36vh * 0.18);
- color: #203C52;
- font-size: 5vh;
- line-height: 1;
- font-family: 'Saira-ExtraBold';
- text-align: center;
- }
- img {
- width: 100%;
- }
- }
- .pic2 {
- box-sizing: border-box;
- border: 0.44rem solid rgba(26, 41, 58, 0.6315);
- }
- .name {
- width: 100%;
- color: #1A293A;
- font-size: 2.21rem;
- }
- .name2 {
- box-sizing: border-box;
- padding: 0.1rem 0.4rem;
- border-radius: 1.1rem;
- background: radial-gradient(96% 96% at 2% 32%, #FFFFFF 0%, #FCFDFD 54%, #E1E4E7 100%);
- box-shadow: inset 0px 1px 0px 2px rgba(255, 255, 255, 0.9046), inset 0px 3px 6px 0px rgba(0, 0, 0, 0.0851);
- }
- .ctrlBox {
- position: absolute;
- left: 0;
- top: 0;
- border: 5px solid #ffffff;
- display: flex;
- flex-direction: column;
- align-items: center;
- background: rgba(0, 0, 0, 0.8);
- z-index: 2;
- width: 100%;
- height: 100%;
- box-sizing: border-box;
- border-radius: 1.6rem;
- img {
- max-width: 100%;
- max-height: 70%;
- margin: 10% 0 5% 0;
- }
- .lable {
- text-align: center;
- font-size: 2rem;
- color: #ffffff
- }
- }
- }
- }
- .score {
- height: 18vh;
- line-height: 18vh;
- font-size: 12vh;
- font-family: 'Saira-BlackItalic';
- border: 0.55rem solid #13ED84;
- text-align: center;
- border-radius: 1.6rem;
- box-sizing: content-box;
- color: #1A293A;
- position: relative;
- background: radial-gradient(96% 96% at 2% 32%, #FFFFFF 0%, #FCFDFD 54%, #E1E4E7 100%);
- display: none;
- &::before {
- content: "";
- width: 2vw;
- height: 2vw;
- display: block;
- position: absolute;
- top: -1.5vw;
- left: 50%;
- margin-left: -1vw;
- background-image: url("@/assets/images/test/yuan.png");
- background-position: center;
- background-repeat: no-repeat;
- background-size: 100% 100%;
- border-radius: 50%;
- flex-shrink: 0;
- transition: all 0.5s;
- }
- }
- }
- .disable {
- .userInfo,
- .score {
- opacity: 0.5;
- }
- }
- .wait {
- .userInfo,
- .score {
- opacity: 0.5;
- }
- }
- &:nth-child(1) {
- justify-content: space-between;
- }
- &:nth-child(2) {
- justify-content: space-evenly;
- .li {
- margin-left: calc($listMargin/4);
- margin-right: calc($listMargin/4);
- }
- }
- }
- .ready.ul {
- &:nth-child(1) {
- .li:nth-child(2) {
- &::after {
- content: "";
- position: absolute;
- height: 100%;
- width: 100%;
- display: block;
- background-image: url("@/assets/images/test/ready3.png");
- background-position: center center;
- background-repeat: no-repeat;
- background-size: 100%;
- }
- }
- }
- &:nth-child(2) {
- .li {
- &::after {
- content: "";
- position: absolute;
- height: 100%;
- width: 100%;
- display: block;
- background-image: url("@/assets/images/test/ready3.png");
- background-position: center center;
- background-repeat: no-repeat;
- background-size: 100%;
- top: -100%;
- }
- }
- }
- }
- .hands.ul {
- &:nth-child(1) {
- .li:nth-child(2) {
- &::after {
- background-image: url("@/assets/images/test/ready4.png");
- }
- }
- }
- &:nth-child(2) {
- .li {
- &::after {
- background-image: url("@/assets/images/test/ready4.png");
- }
- }
- }
- }
- .overlap.ul {
- transition: all 0.5s;
- .li {
- .score {
- display: block;
- }
- }
- &:nth-child(1) {
- margin-top: 5vh;
- .li {
- &::before {
- display: none
- }
- &::after {
- display: none
- }
- }
- }
- &:nth-child(2) {
- margin-top: -20vh;
- .li {
- &::before {
- display: none
- }
- &::after {
- display: none
- }
- }
- }
- }
- }
- ::v-deep(.testBox2) {
- $listMargin: 10vw;
- $listWidth: calc((100% - $listMargin) / 5);
- .ul {
- width: 100%;
- height: 34vh;
- display: flex;
- justify-content: space-between;
- margin-bottom: 4vh;
- .li {
- width: $listWidth;
- position: relative;
- height: 100%;
- border-radius: 3vh;
- padding: 0.6vw;
- background: radial-gradient(122% 126% at 97% 6%, #35FFC6 0%, #00FFE8 100%);
- display: flex;
- flex-direction: column;
- justify-content: space-between;
- box-sizing: border-box;
- .userInfo {
- width: 100%;
- height: 100%;
- border-radius: 1.6rem;
- background: radial-gradient(122% 126% at 97% 6%, #35FFC6 0%, #00FFE8 100%);
- text-align: center;
- display: flex;
- align-items: center;
- justify-content: center;
- cursor: pointer;
- position: relative;
- .userInfo-center {
- .pic {
- width: calc(36vh * 0.62);
- height: calc(36vh * 0.62);
- border-radius: 50%;
- display: flex;
- justify-content: center;
- align-items: center;
- overflow: hidden;
- margin: 0 auto 2vh auto;
- position: relative;
- .area {
- position: absolute;
- top: calc(36vh * 0.18);
- color: #203C52;
- font-size: 5vh;
- line-height: 1;
- font-family: 'Saira-ExtraBold';
- text-align: center;
- }
- img {
- width: 100%;
- }
- }
- .pic2 {
- box-sizing: border-box;
- border: 0.44rem solid rgba(26, 41, 58, 0.6315);
- }
- .name {
- width: 100%;
- color: #1A293A;
- font-size: 2.21rem;
- }
- .ctrlBox {
- position: absolute;
- left: 0;
- top: 0;
- border: 5px solid #ffffff;
- display: flex;
- flex-direction: column;
- align-items: center;
- background: rgba(0, 0, 0, 0.8);
- z-index: 2;
- width: 100%;
- height: 100%;
- box-sizing: border-box;
- border-radius: 1.6rem;
- img {
- max-width: 100%;
- max-height: 70%;
- margin: 10% 0 5% 0;
- }
- .lable {
- text-align: center;
- font-size: 2rem;
- color: #ffffff
- }
- }
- }
- }
- .score {
- height: 14vh;
- line-height: 14vh;
- font-size: 9vh;
- font-family: 'Saira-BlackItalic';
- background: #ffffff;
- box-sizing: border-box;
- border: 0.55rem solid #13ED84;
- text-align: center;
- border-radius: 1.6rem;
- box-sizing: content-box;
- color: #1A293A;
- position: relative;
- display: none;
- &::before {
- content: "";
- width: 2vw;
- height: 2vw;
- display: block;
- position: absolute;
- top: -1.3vw;
- left: 50%;
- margin-left: -1vw;
- background-image: url("@/assets/images/test/yuan.png");
- background-position: center;
- background-repeat: no-repeat;
- background-size: 100% 100%;
- border-radius: 50%;
- flex-shrink: 0;
- transition: all 0.5s;
- }
- }
- }
- .disable {
- opacity: 0.5;
- }
- .wait {
- opacity: 0.5;
- }
- }
- .overlap {
- .li {
- .userInfo {
- height: 6.2vw;
- .userInfo-center {
- width: 100%;
- text-align: center;
- display: flex;
- align-items: center;
- cursor: pointer;
- .pic {
- width: 6.2vw;
- height: 6.2vw;
- border-radius: 50%;
- display: flex;
- justify-content: center;
- align-items: center;
- overflow: hidden;
- position: relative;
- flex-shrink: 0;
- margin: 0;
- .area {
- position: absolute;
- top: 0;
- left: 0;
- width: 100%;
- height: 100%;
- line-height: 6.2vw;
- color: #ffffff;
- font-size: 2.5vw;
- font-family: 'Saira-ExtraBold';
- text-align: center;
- background: rgba(#000000, 0.4)
- }
- img {
- width: 100%;
- }
- }
- .pic2 {
- box-sizing: border-box;
- border: 2px solid rgba(26, 41, 58, 0.6315);
- }
- .name {
- width: 100%;
- color: #1A293A;
- font-size: 1.8rem;
- border-radius: 2vw;
- padding: 0.5rem 0;
- background: radial-gradient(96% 96% at 2% 32%, #FFFFFF 0%, #FCFDFD 54%, #E1E4E7 100%);
- box-shadow: inset 0px 1px 0px 2px rgba(255, 255, 255, 0.9046), inset 0px 3px 6px 0px rgba(0, 0, 0, 0.0851);
- }
- }
- }
- .score {
- display: block;
- }
- }
- }
- }
- ::v-deep(.testBox3) {
- $listMargin: 5vw;
- $listWidth: calc((100% - $listMargin) / 10);
- .ul {
- width: 100%;
- height: 14vh;
- display: flex;
- justify-content: space-around;
- margin-bottom: calc($listMargin / 10);
- .li {
- width: $listWidth;
- position: relative;
- height: 100%;
- border-radius: 5vh;
- background: radial-gradient(122% 126% at 97% 6%, #35FFC6 0%, #00FFE8 100%);
- .userInfo {
- padding: 2vh 0.6vw 0 0.6vw;
- margin-bottom: 0.8vh;
- .userInfo-center {
- text-align: center;
- display: flex;
- align-items: center;
- cursor: pointer;
- border-radius: 1.3vw;
- height: 2.6vw;
- background: linear-gradient(180deg, #FFFFFF 0%, rgba(255, 255, 255, 0.6571) 100%);
- border: 1px solid #FFFFFF;
- .pic {
- width: 2.6vw;
- height: 2.6vw;
- border-radius: 50%;
- display: flex;
- justify-content: center;
- align-items: center;
- overflow: hidden;
- position: relative;
- flex-shrink: 0;
- .area {
- position: absolute;
- top: 0;
- left: 0;
- width: 100%;
- height: 100%;
- line-height: 2.6vw;
- color: #ffffff;
- font-size: 1.4vw;
- font-family: 'Saira-ExtraBold';
- text-align: center;
- background: rgba(#000000, 0.4)
- }
- img {
- width: 100%;
- }
- }
- .pic2 {
- box-sizing: border-box;
- border: 2px solid rgba(26, 41, 58, 0.6315);
- }
- .name {
- color: #1A293A;
- font-size: 1rem;
- margin-left: 0.5vw;
- }
- .ctrlBox {
- position: absolute;
- left: 0;
- top: 0;
- border: 5px solid #ffffff;
- display: flex;
- flex-direction: column;
- align-items: center;
- background: rgba(0, 0, 0, 0.8);
- z-index: 2;
- width: 100%;
- height: 100%;
- box-sizing: border-box;
- border-radius: 5vh;
- img {
- max-width: 100%;
- max-height: 60%;
- margin: 5% 0 5% 0;
- }
- .lable {
- text-align: center;
- font-size: 1rem;
- color: #ffffff
- }
- }
- }
- }
- .score {
- font-size: 3rem;
- font-family: 'Saira-BlackItalic';
- text-align: center;
- color: #1A293A;
- line-height: 1;
- }
- }
- .disable {
- opacity: 0.5;
- }
- .wait {
- opacity: 0.75;
- }
- .startedAlready {
- background: #15ef96;
- }
- }
- }
- ::v-deep(.testBox4) {
- $listMargin: 10vw;
- $listWidth: calc((100vw - ($waiPadding * 2) - $listMargin) / 5);
- display: flex;
- flex-wrap: wrap;
- align-items: center;
- height: 100%;
- .ul {
- width: 100%;
- display: flex;
- justify-content: space-evenly;
- align-items: center;
- height: 36vh;
- .li {
- width: $listWidth;
- height: 100%;
- position: relative;
- .ready {
- position: absolute;
- height: 100%;
- width: 100%;
- display: flex;
- align-items: center;
- justify-items: center;
- img {
- width: 100%;
- }
- }
- .userInfo {
- width: 100%;
- height: 100%;
- border-radius: 1.6rem;
- background: radial-gradient(122% 126% at 97% 6%, #35FFC6 0%, #00FFE8 100%);
- text-align: center;
- display: flex;
- align-items: center;
- justify-content: center;
- cursor: pointer;
- margin-bottom: 3px;
- .userInfo-center {
- .pic {
- width: calc(36vh * 0.62);
- height: calc(36vh * 0.62);
- border-radius: 50%;
- display: flex;
- justify-content: center;
- align-items: center;
- overflow: hidden;
- margin: 0 auto 2vh auto;
- position: relative;
- .area {
- position: absolute;
- top: calc(36vh * 0.18);
- color: #203C52;
- font-size: 5vh;
- line-height: 1;
- font-family: 'Saira-ExtraBold';
- text-align: center;
- }
- img {
- width: 100%;
- }
- }
- .pic2 {
- box-sizing: border-box;
- border: 0.44rem solid rgba(26, 41, 58, 0.6315);
- }
- .name {
- width: 100%;
- color: #1A293A;
- font-size: 2.21rem;
- }
- .name2 {
- box-sizing: border-box;
- padding: 0.1rem 0.4rem;
- border-radius: 1.1rem;
- background: radial-gradient(96% 96% at 2% 32%, #FFFFFF 0%, #FCFDFD 54%, #E1E4E7 100%);
- box-shadow: inset 0px 1px 0px 2px rgba(255, 255, 255, 0.9046), inset 0px 3px 6px 0px rgba(0, 0, 0, 0.0851);
- }
- .ctrlBox {
- position: absolute;
- left: 0;
- top: 0;
- border: 5px solid #ffffff;
- display: flex;
- flex-direction: column;
- align-items: center;
- background: rgba(0, 0, 0, 0.8);
- z-index: 2;
- width: 100%;
- height: 100%;
- box-sizing: border-box;
- border-radius: 1.6rem;
- img {
- max-width: 100%;
- max-height: 70%;
- margin: 10% 0 5% 0;
- }
- .lable {
- text-align: center;
- font-size: 2rem;
- color: #ffffff
- }
- }
- }
- }
- .score {
- height: 18vh;
- line-height: 18vh;
- font-size: 12vh;
- font-family: 'Saira-BlackItalic';
- border: 0.55rem solid #13ED84;
- text-align: center;
- border-radius: 1.6rem;
- box-sizing: content-box;
- color: #1A293A;
- position: relative;
- background: radial-gradient(96% 96% at 2% 32%, #FFFFFF 0%, #FCFDFD 54%, #E1E4E7 100%);
- display: none;
- &::before {
- content: "";
- width: 2vw;
- height: 2vw;
- display: block;
- position: absolute;
- top: -1.5vw;
- left: 50%;
- margin-left: -1vw;
- background-image: url("@/assets/images/test/yuan.png");
- background-position: center;
- background-repeat: no-repeat;
- background-size: 100% 100%;
- border-radius: 50%;
- flex-shrink: 0;
- transition: all 0.5s;
- }
- }
- }
- .disable {
- .userInfo,
- .score {
- opacity: 0.5;
- }
- }
- .wait {
- .userInfo,
- .score {
- opacity: 0.5;
- }
- }
- }
- .overlap.ul {
- transition: all 0.5s;
- margin-top: -15vh;
- .li {
- .score {
- display: block;
- }
- }
- }
- }
- </style>
|