Browse Source

日常开发

林旭祥 3 weeks ago
parent
commit
221b25fdf8
1 changed files with 15 additions and 8 deletions
  1. 15 8
      src/views/game/index.vue

+ 15 - 8
src/views/game/index.vue

@@ -143,29 +143,35 @@ const getInit = async () => {
       }
     }
     if (e?.type == 'bodyposecontroller_result') {
+      let obj = projectList.value.find((item: any) => {
+        return item.exam_name == currentGame.value
+      })
+      let myList = obj.area_test_id.split(",");
       let area = e.ctrl_name.replace('bodyposecontroller_', '');
       if (currentGame.value == 'bodyposecontroller') {
-        if (area == 11) {
+        if (area == myList[0]) {
           humanBodyLeftRef.value.getInit(e);
         }
-        if (area == 12) {
+        if (area == myList[1]) {
           humanBodyRightRef.value.getInit(e);
         }
       }
       if (currentGame.value == 'game_basketball') {
-        if (area == 11) {
+        if (area == myList[0]) {
           basketballLeftRef.value.getInit(e);
         }
-        if (area == 12) {
+        if (area == myList[1]) {
           basketballRightRef.value.getInit(e);
         }
       }
       if (currentGame.value == 'game_football') {
-        if (area == 11) {
+        if (area == myList[0]) {
           footballLeftRef.value.getInit(e);
         }
-        if (area == 12) {
-          footballRightRef.value.getInit(e);
+        if (area == myList[1]) {
+          if (area == myList[0]) {
+            footballRightRef.value.getInit(e);
+          }
         }
       }
       if (currentGame.value == 'game_fruit') {
@@ -381,7 +387,8 @@ $waiPadding: 6.51rem;
   .columns {
     display: flex;
     flex-wrap: wrap;
-width: 100%;
+    width: 100%;
+
     .item {
       width: 50%;
       display: flex;