|
@@ -1,6 +1,6 @@
|
|
|
<template>
|
|
|
<div class="test">
|
|
|
- <SquareGame></SquareGame>
|
|
|
+ <SquareGame ref="squareGameRef"></SquareGame>
|
|
|
<Header @confirmExit="confirmExit" @setMusic="setMusic"></Header>
|
|
|
<div class="main">
|
|
|
<div class="main-left">
|
|
@@ -35,9 +35,11 @@
|
|
|
<div class="complete" :class="{ 'complete2': needStart && [42].includes(examState) }"
|
|
|
v-if="faceCheckStu.student_id && time.ready <= 0 && examState != 43 && examState != 41">
|
|
|
<div class="scoreBox">
|
|
|
- <div class="score" v-if="currentResultObj?.count && currentResultObj.count >= 0">{{ currentResultObj.count
|
|
|
+ <div class="score" v-if="currentResultObj?.count && currentResultObj.count >= 0">{{
|
|
|
+ currentResultObj.count
|
|
|
}}</div>
|
|
|
- <div class="prompt" v-if="currentResultObj?.count && currentResultObj.count == 0 && examState == 42">请开始测试
|
|
|
+ <div class="prompt" v-if="currentResultObj?.count && currentResultObj.count == 0 && examState == 42">
|
|
|
+ 请开始测试
|
|
|
</div>
|
|
|
<div class="unit"
|
|
|
v-if="!['basketballv1', 'footballv1'].includes(parameter.project) && currentResultObj.count && !needStart">
|
|
@@ -158,6 +160,7 @@ const reportListRef = ref();
|
|
|
const gameContainer = ref();
|
|
|
const myInfo: any = localStorage.getItem('userInfo');
|
|
|
const dic: any = dataDictionary;
|
|
|
+const squareGameRef = ref();
|
|
|
const data = reactive<any>({
|
|
|
timerManager: {}, //计时器管理
|
|
|
parameter: {}, //参数
|
|
@@ -354,10 +357,7 @@ const getFaceConfirmOnly = (data?: any) => {
|
|
|
},
|
|
|
() => {
|
|
|
faceWindowRef.value?.close();
|
|
|
- //不需要按钮的自动进入下一步
|
|
|
- if (needStart.value == false) {
|
|
|
- getStartOneTest();
|
|
|
- }
|
|
|
+ getReady();
|
|
|
}
|
|
|
);
|
|
|
};
|
|
@@ -729,7 +729,7 @@ const getAchievement = (data: any) => {
|
|
|
* 准备开始
|
|
|
*/
|
|
|
const getReady = () => {
|
|
|
- if (needStart.value && examState.value == 43 && !time.value.ready && readyState.value) {
|
|
|
+ if (examState.value == 43 && !time.value.ready && readyState.value) {
|
|
|
if (time.value.ready) {
|
|
|
return false;
|
|
|
}
|
|
@@ -741,6 +741,7 @@ const getReady = () => {
|
|
|
if (time.value.ready <= 0) {
|
|
|
getClearTimer('readyTimer');
|
|
|
getStartOneTest();
|
|
|
+ squareGameRef.value.loginGame();
|
|
|
} else {
|
|
|
speckText(time.value.ready);
|
|
|
}
|
|
@@ -1043,7 +1044,7 @@ watch(
|
|
|
);
|
|
|
|
|
|
/**
|
|
|
- * 播报时间
|
|
|
+ * 监听跳跃
|
|
|
*/
|
|
|
watch(
|
|
|
() => currentResultObj.value.count,
|
|
@@ -1051,6 +1052,7 @@ watch(
|
|
|
if (newData > 0 && ['jumprope'].includes(parameter.value.project)) {
|
|
|
//let frameRate = 12;
|
|
|
//gameContainer.value.sports(frameRate);
|
|
|
+ squareGameRef.value.jump();
|
|
|
}
|
|
|
},
|
|
|
{ immediate: true }
|
|
@@ -1081,7 +1083,7 @@ onBeforeMount(() => {
|
|
|
parameter.value.gesture = false;
|
|
|
}
|
|
|
//需要开始按钮的项目
|
|
|
- let myList = ['situp', 'jumprope', 'jumpingjack', 'highknees', 'footballv1', 'basketballv1', 'pingpong'];
|
|
|
+ let myList: any = [];
|
|
|
if (myList.includes(project)) {
|
|
|
needStart.value = true;
|
|
|
}
|