|
@@ -7,17 +7,7 @@
|
|
:leave-active-class="proxy?.animate.rankingWindow.leave">
|
|
:leave-active-class="proxy?.animate.rankingWindow.leave">
|
|
<div class="confirmDiaBg" v-if="actionState">
|
|
<div class="confirmDiaBg" v-if="actionState">
|
|
<div class="confirmDiaWindow">
|
|
<div class="confirmDiaWindow">
|
|
- <div class="prompt"><i></i> <template v-if="currentGame == 'game_fruit'">
|
|
|
|
- 举手开始游戏
|
|
|
|
- </template>
|
|
|
|
- <template v-if="currentGame == 'game_basketball'">
|
|
|
|
- 请做投篮动作开始游戏
|
|
|
|
- </template>
|
|
|
|
- <template v-if="currentGame == 'game_football'">
|
|
|
|
- 请踢腿开始游戏
|
|
|
|
- </template>
|
|
|
|
- </div>
|
|
|
|
-
|
|
|
|
|
|
+ <div class="prompt"><i></i> {{ actionText }}</div>
|
|
<div class="confirmDiaWindow-con">
|
|
<div class="confirmDiaWindow-con">
|
|
<div class="picBox">
|
|
<div class="picBox">
|
|
<div class="pic">
|
|
<div class="pic">
|
|
@@ -35,6 +25,12 @@
|
|
<div class="gamePlayer">
|
|
<div class="gamePlayer">
|
|
<div class="item" v-for="item in areaStateList" :key="item.area">
|
|
<div class="item" v-for="item in areaStateList" :key="item.area">
|
|
<div class="player">
|
|
<div class="player">
|
|
|
|
+ <template v-if="currentGame == 'bodyposecontroller'">
|
|
|
|
+ <div><img src="@/assets/images/game/fruit1.png" class="fade-image"
|
|
|
|
+ :class="{ 'fade-image1': !item.state }"></img></div>
|
|
|
|
+ <div><img v-if="!item.state" src="@/assets/images/game/fruit2.png" class="fade-image"
|
|
|
|
+ :class="{ 'fade-image2': !item.state }"></img></div>
|
|
|
|
+ </template>
|
|
<template v-if="currentGame == 'game_fruit'">
|
|
<template v-if="currentGame == 'game_fruit'">
|
|
<div><img src="@/assets/images/game/fruit1.png" class="fade-image"
|
|
<div><img src="@/assets/images/game/fruit1.png" class="fade-image"
|
|
:class="{ 'fade-image1': !item.state }"></img></div>
|
|
:class="{ 'fade-image1': !item.state }"></img></div>
|
|
@@ -83,9 +79,11 @@ const data = reactive<any>({
|
|
actionState: false,//窗口状态
|
|
actionState: false,//窗口状态
|
|
areaStateList: [],
|
|
areaStateList: [],
|
|
lock: false,
|
|
lock: false,
|
|
|
|
+ actionText: "",
|
|
|
|
+ timer: null,
|
|
});
|
|
});
|
|
|
|
|
|
-const { currentGame, currentGameArea, actionState, areaStateList, lock } = toRefs(data);
|
|
|
|
|
|
+const { currentGame, currentGameArea, actionState, areaStateList, lock, actionText, timer } = toRefs(data);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@@ -110,12 +108,19 @@ const getInit = (e: any) => {
|
|
}
|
|
}
|
|
//console.log("result", result)
|
|
//console.log("result", result)
|
|
if (currentGame.value == 'bodyposecontroller') {
|
|
if (currentGame.value == 'bodyposecontroller') {
|
|
- let myIndex = areaStateList.value.findIndex((item: any) => {
|
|
|
|
- return item.area == area;
|
|
|
|
- })
|
|
|
|
- let boxes = [{ x: arr[0], y: arr[3] }, { x: arr[0], y: arr[1] }, { x: arr[2], y: arr[1] }, { x: arr[2], y: arr[3] }];
|
|
|
|
- areaStateList.value[myIndex].state = true;
|
|
|
|
- areaStateList.value[myIndex].boxes = boxes;
|
|
|
|
|
|
+ let leftA = result[6][1];//右肩Y
|
|
|
|
+ let rightA = result[5][1];//左肩Y
|
|
|
|
+ let leftB = result[10][1];//右手Y
|
|
|
|
+ let rightB = result[9][1];//左手Y
|
|
|
|
+ let bizi = result[0][1];//鼻子Y
|
|
|
|
+ if (leftB < leftA || rightB < rightA || leftB < bizi || rightB < bizi) {
|
|
|
|
+ let myIndex = areaStateList.value.findIndex((item: any) => {
|
|
|
|
+ return item.area == area;
|
|
|
|
+ })
|
|
|
|
+ let boxes = [{ x: arr[0], y: arr[3] }, { x: arr[0], y: arr[1] }, { x: arr[2], y: arr[1] }, { x: arr[2], y: arr[3] }];
|
|
|
|
+ areaStateList.value[myIndex].state = true;
|
|
|
|
+ areaStateList.value[myIndex].boxes = boxes;
|
|
|
|
+ }
|
|
}
|
|
}
|
|
if (currentGame.value == 'game_basketball') {
|
|
if (currentGame.value == 'game_basketball') {
|
|
let leftA = result[6][1];//右肩Y
|
|
let leftA = result[6][1];//右肩Y
|
|
@@ -247,21 +252,29 @@ const getOpen = async (game: any, area: any) => {
|
|
}) || [];
|
|
}) || [];
|
|
areaStateList.value = list;
|
|
areaStateList.value = list;
|
|
actionState.value = true;
|
|
actionState.value = true;
|
|
|
|
+ let txt = ""
|
|
|
|
+ if (currentGame.value == 'bodyposecontroller') {
|
|
|
|
+ txt = "举手开始游戏";
|
|
|
|
+ }
|
|
if (currentGame.value == 'game_fruit') {
|
|
if (currentGame.value == 'game_fruit') {
|
|
- speckText("举手开始游戏");
|
|
|
|
|
|
+ txt = "举手开始游戏";
|
|
}
|
|
}
|
|
if (currentGame.value == 'game_basketball') {
|
|
if (currentGame.value == 'game_basketball') {
|
|
- speckText("请做投篮动作开始游戏");
|
|
|
|
|
|
+ txt = "请做投篮动作开始游戏";
|
|
}
|
|
}
|
|
if (currentGame.value == 'game_football') {
|
|
if (currentGame.value == 'game_football') {
|
|
- speckText("请踢腿开始游戏");
|
|
|
|
|
|
+ txt = "请踢腿开始游戏";
|
|
}
|
|
}
|
|
|
|
+ actionText.value = txt;
|
|
|
|
+ speckText(actionText.value);
|
|
};
|
|
};
|
|
|
|
|
|
/**
|
|
/**
|
|
* 关闭
|
|
* 关闭
|
|
*/
|
|
*/
|
|
const getExit = () => {
|
|
const getExit = () => {
|
|
|
|
+ clearInterval(timer.value);
|
|
|
|
+ timer.value = null;
|
|
speckCancel(); //停止播报
|
|
speckCancel(); //停止播报
|
|
actionState.value = false;
|
|
actionState.value = false;
|
|
emit('confirmExit', {});
|
|
emit('confirmExit', {});
|
|
@@ -283,11 +296,11 @@ watch(
|
|
if (state) {
|
|
if (state) {
|
|
lock.value = true;
|
|
lock.value = true;
|
|
let num = 3;
|
|
let num = 3;
|
|
- let timer: any = setInterval(() => {
|
|
|
|
|
|
+ timer.value = setInterval(() => {
|
|
if (num == 1) {
|
|
if (num == 1) {
|
|
actionState.value = false;
|
|
actionState.value = false;
|
|
- clearInterval(timer);
|
|
|
|
- timer = null;
|
|
|
|
|
|
+ clearInterval(timer.value);
|
|
|
|
+ timer.value = null;
|
|
emit('confirmStart', areaStateList.value);
|
|
emit('confirmStart', areaStateList.value);
|
|
}
|
|
}
|
|
speckText(num);
|
|
speckText(num);
|