|
@@ -24,12 +24,17 @@
|
|
|
<div class="gameWindow" v-if="currentGame">
|
|
|
<!---人体姿态识别-->
|
|
|
<div class="columns" v-if="currentGame == 'bodyposecontroller'">
|
|
|
- <div class="item left">
|
|
|
+ <template v-if="projectList.length == 2">
|
|
|
+ <div class="item left">
|
|
|
+ <HumanBody ref="humanBodyLeftRef" type="left"></HumanBody>
|
|
|
+ </div>
|
|
|
+ <div class="item right">
|
|
|
+ <HumanBody ref="humanBodyRightRef" type="right"></HumanBody>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ <template>
|
|
|
<HumanBody ref="humanBodyLeftRef" type="left"></HumanBody>
|
|
|
- </div>
|
|
|
- <div class="item right">
|
|
|
- <HumanBody ref="humanBodyRightRef" type="right"></HumanBody>
|
|
|
- </div>
|
|
|
+ </template>
|
|
|
</div>
|
|
|
<!---篮球投篮-->
|
|
|
<div class="columns" v-if="currentGame == 'game_basketball'">
|
|
@@ -159,11 +164,17 @@ const getInit = async () => {
|
|
|
let myList = obj.area_test_id.split(",");
|
|
|
let area = e.ctrl_name.replace('bodyposecontroller_', '');
|
|
|
if (currentGame.value == 'bodyposecontroller') {
|
|
|
- if (area == myList[0]) {
|
|
|
- humanBodyLeftRef.value.getInit(e);
|
|
|
- }
|
|
|
- if (area == myList[1]) {
|
|
|
- humanBodyRightRef.value.getInit(e);
|
|
|
+ if (projectList.value.length == 2) {
|
|
|
+ if (area == myList[0]) {
|
|
|
+ humanBodyLeftRef.value.getInit(e);
|
|
|
+ }
|
|
|
+ if (area == myList[1]) {
|
|
|
+ humanBodyRightRef.value.getInit(e);
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ if (area == myList[0]) {
|
|
|
+ humanBodyLeftRef.value.getInit(e);
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
if (currentGame.value == 'game_basketball') {
|
|
@@ -179,9 +190,7 @@ const getInit = async () => {
|
|
|
footballLeftRef.value.getInit(e);
|
|
|
}
|
|
|
if (area == myList[1]) {
|
|
|
- if (area == myList[0]) {
|
|
|
- footballRightRef.value.getInit(e);
|
|
|
- }
|
|
|
+ footballRightRef.value.getInit(e);
|
|
|
}
|
|
|
}
|
|
|
if (currentGame.value == 'game_fruit') {
|
|
@@ -226,14 +235,17 @@ const getExit = () => {
|
|
|
* 退出游戏
|
|
|
*/
|
|
|
const getExitGame = () => {
|
|
|
- let obj = projectList.value.find((item: any) => {
|
|
|
- return item.exam_name == currentGame.value
|
|
|
- })
|
|
|
- let myList = obj.area_test_id.split(",");
|
|
|
- myList.forEach((item: any) => {
|
|
|
- terminateBodypose(item);
|
|
|
- })
|
|
|
- currentGame.value = "";
|
|
|
+ proxy?.$modal.confirm("确定退出吗?").then(() => {
|
|
|
+ let obj = projectList.value.find((item: any) => {
|
|
|
+ return item.exam_name == currentGame.value
|
|
|
+ })
|
|
|
+ let myList = obj.area_test_id.split(",");
|
|
|
+ myList.forEach((item: any) => {
|
|
|
+ terminateBodypose(item);
|
|
|
+ })
|
|
|
+ currentGame.value = "";
|
|
|
+ }).finally(() => {
|
|
|
+ });
|
|
|
};
|
|
|
|
|
|
onBeforeMount(async () => {
|