12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958 |
- <template>
- <div>
- <Header @confirmExit="confirmExit" @setMusic="setMusic"></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', 'highknees', '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', 'highknees', '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>
- <div class="btn exitBtn" @click="confirmExit">退 出</div>
- <!--测试记录开始-->
- <div class="mask mask2" v-show="showReportList" @click="getTestRecord"></div>
- <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.leave">
- <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 useAppStore from '@/store/modules/app';
- 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: {}, //弹出手动选择对应的区号
- deviceInfo: {}, //设备信息
- musicList: [] //音乐列表
- });
- const {
- timerManager,
- parameter,
- time,
- userInfo,
- examState,
- needStart,
- showTestAgain,
- testList,
- multipleItemRefList,
- styleType,
- showReportList,
- exitStatus,
- sid,
- chooseStudentArea,
- deviceInfo,
- musicList
- } = 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 && musicList.value.length) {
- let obj = musicList.value.find((item: any) => {
- return item.id == parameter.value.music;
- });
- if (obj != undefined) {
- playMusic(obj.url);
- }
- }
- //显示再测一次按钮
- showTestAgain.value = true;
- //时间为0的为正计时,大于0的为倒计时
- if (time.value.testTime == 0) {
- getCounting('+');
- } else {
- getCounting('-');
- }
- };
- /**
- * 再测一次
- */
- const getAgain = async () => {
- let txt = '是否再测一次?';
- await proxy?.$modal.confirm(txt);
- getClearTimer();
- 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 {
- if (parameter.value.taskId) {
- router.push({ path: '/test' });
- } else {
- router.push({ path: '/train' });
- }
- }
- };
- /**
- * 清空定时任务
- */
- 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 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;
- let myList = newList.filter((item: any) => {
- return item.examState == 0;
- });
- if (myList.length == newList.length) {
- 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 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();
- localStorage.removeItem('token');
- localStorage.removeItem('userInfo');
- //跳转
- router.push({ path: '/login/qrcode' });
- }
- };
- /**
- * 获取音乐
- */
- const getMusic = async () => {
- const list: any = useAppStore().getMusic();
- if (list.length) {
- musicList.value = list;
- } else {
- await proxy?.$http.train.musicList().then((res: any) => {
- if (res.data.length > 0) {
- let myList: any = res.data;
- musicList.value = myList;
- useAppStore().setMusic(myList);
- }
- });
- }
- };
- /**
- * 设置音乐
- */
- const setMusic = async (data: any) => {
- //console.log("data",data)
- parameter.value.music = data;
- };
- /**
- * 加载手势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) {
- deviceInfo.value = e.device_info;
- let handcontroller_id = deviceInfo.value.handcontroller_id;
- stateHand(handcontroller_id);
- }
- //获取手势状态
- if (e?.cmd == 'get_handcontroller_state' && e?.state == 0) {
- let handcontroller_id = deviceInfo.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 || !needStart.value) {
- return false;
- }
- if (newData >= 30 && newData < time.value.testTime) {
- if (newData % 30 == 0) {
- speckText(`还有${newData}秒`);
- }
- }
- if (newData == 10) {
- speckText('还有10秒');
- }
- if (newData <= 5) {
- speckText(newData);
- }
- if (newData == 0) {
- speckText('哨声');
- }
- },
- { immediate: true }
- );
- /**
- * 将测试列表转为多行
- */
- 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 countdownNumFormat = computed(() => {
- // return time.value.countdownNum;
- // //return proxy?.$utils.timeFormat(time.value.countdownNum);
- // });
- 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', 'highknees', 'situp'];
- if (myList.includes(project) && styleType.value == 3) {
- needStart.value = true;
- }
- //加载音乐
- getMusic();
- });
- 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();
- //刷新关闭
- 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: 13vw;
- 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;
- }
- }
- .exitBtn {
- color: #ffffff;
- background: radial-gradient(159% 126% at 5% 93%, #931b1b 0%, #ec5624 0%, #ff6860 76%);
- box-shadow: 3px 6px 4px 1px rgba(0, 0, 0, 0.1874), inset 0px 1px 0px 2px rgba(255, 255, 255, 0.5577);
- &:hover {
- background: #ec5624;
- }
- }
- .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>
|