|
@@ -25,6 +25,7 @@
|
|
|
<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="getStartOneTest" v-if="examState == 43">开始测试</div>
|
|
|
+ <div class="btn" @click="getAllRetestFace" v-if="examState == 43 || examState == 42">重新识别</div>
|
|
|
</template>
|
|
|
<template v-else>
|
|
|
<div class="btn startBtn" @click="getReady" v-if="examState == 43">开始测试</div>
|
|
@@ -53,8 +54,8 @@
|
|
|
<div class="confirmDiaBg" v-show="examState == 43 && time.ready">
|
|
|
<div class="confirmDiaWindow">
|
|
|
<div class="readyBox">
|
|
|
- <div class="lable" :class="{ 'transparent': time.ready > 5 }">倒计时</div>
|
|
|
- <div class="value">{{ time.ready }}</div>
|
|
|
+ <div class="lable">倒计时</div>
|
|
|
+ <div class="value" :class="{ 'transparent': time.ready > 5 }">{{ time.ready }}</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -180,12 +181,23 @@ const getStartOneTest = () => {
|
|
|
*/
|
|
|
const getAgain = async () => {
|
|
|
cleanData();
|
|
|
- examState.value = 43;
|
|
|
+ examState.value = 41;
|
|
|
for (let i = 0; i < multipleItemRefList.value.length; i++) {
|
|
|
multipleItemRefList.value[i].getAgain()
|
|
|
}
|
|
|
};
|
|
|
|
|
|
+/**
|
|
|
+ * 重新识别
|
|
|
+*/
|
|
|
+const getAllRetestFace = async () => {
|
|
|
+ showTestAgain.value = false;
|
|
|
+ examState.value = 3;
|
|
|
+ for (let i = 0; i < multipleItemRefList.value.length; i++) {
|
|
|
+ multipleItemRefList.value[i].getAllRetestFace()
|
|
|
+ }
|
|
|
+};
|
|
|
+
|
|
|
/**
|
|
|
* 确认退出
|
|
|
*/
|
|
@@ -292,6 +304,15 @@ const returnData = (data: any) => {
|
|
|
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(`请点击右下角的【开始识别】`);
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -324,6 +345,18 @@ const returnData = (data: any) => {
|
|
|
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)
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -342,6 +375,18 @@ const returnData = (data: any) => {
|
|
|
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)
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -488,6 +533,23 @@ const initHand = () => {
|
|
|
}
|
|
|
//举左手
|
|
|
if (e?.data?.result == "left_hand") {
|
|
|
+ //开始识别
|
|
|
+ if (needStart.value && examState.value < 41) {
|
|
|
+ getOpenOneTestAndStartFace();
|
|
|
+ }
|
|
|
+ //停止人脸识别
|
|
|
+ if (needStart.value && examState.value == 41) {
|
|
|
+ getStopFace();
|
|
|
+ }
|
|
|
+ //开始测试
|
|
|
+ if (examState.value == 43) {
|
|
|
+ if (needStart.value) {
|
|
|
+ getStartOneTest();
|
|
|
+ } else {
|
|
|
+ getReady()
|
|
|
+ }
|
|
|
+ }
|
|
|
+ //确认退出
|
|
|
if (exit.value) {
|
|
|
exit.value = 0;
|
|
|
//确认退出
|
|
@@ -504,8 +566,6 @@ const initHand = () => {
|
|
|
cancelable: true // 是否可以取消事件的默认行为
|
|
|
});
|
|
|
document.activeElement?.dispatchEvent(keyEvent);
|
|
|
- } else {
|
|
|
- getReady()
|
|
|
}
|
|
|
}
|
|
|
//退出
|
|
@@ -1432,6 +1492,14 @@ $waiPadding: 6.51rem;
|
|
|
.disable {
|
|
|
opacity: 0.5;
|
|
|
}
|
|
|
+
|
|
|
+ .wait {
|
|
|
+ opacity: 0.75;
|
|
|
+ }
|
|
|
+
|
|
|
+ .startedAlready {
|
|
|
+ background: #15ef96;
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
</style>
|