|
@@ -473,21 +473,21 @@ const getAddTestList = (num: number) => {
|
|
|
const initHand = () => {
|
|
|
handWs((e: any) => {
|
|
|
//左滑动
|
|
|
- if (e.data.result == "next_item") {
|
|
|
+ if (e?.data?.result == "next_item") {
|
|
|
}
|
|
|
//举左手
|
|
|
- if (e.data.result == "left_hand") {
|
|
|
+ if (e?.data?.result == "left_hand") {
|
|
|
getReady();
|
|
|
}
|
|
|
//退出
|
|
|
- if (e.data.result == "exit") {
|
|
|
+ if (e?.data?.result == "exit") {
|
|
|
// console.log("exit.value", exit.value)
|
|
|
if (exit.value == 0) {
|
|
|
console
|
|
|
//第一次才弹出
|
|
|
confirmExit();
|
|
|
setTimeout(() => {
|
|
|
- let keyEvent = null;
|
|
|
+ let keyEvent: any = null;
|
|
|
let myKey = null;
|
|
|
//如果交叉手两秒后返回超过4次就确认退出
|
|
|
if (exit.value >= 4) {
|
|
@@ -522,7 +522,7 @@ const initHand = () => {
|
|
|
cancelable: true // 是否可以取消事件的默认行为
|
|
|
});
|
|
|
}
|
|
|
- document.activeElement.dispatchEvent(keyEvent);
|
|
|
+ document.activeElement?.dispatchEvent(keyEvent);
|
|
|
}, 2500)
|
|
|
}
|
|
|
exit.value = exit.value + 1
|