Kaynağa Gözat

接入unity游戏

任一存 1 yıl önce
ebeveyn
işleme
9d6fb0b4a8
3 değiştirilmiş dosya ile 33 ekleme ve 8 silme
  1. 0 2
      game/README.md
  2. 3 0
      game/src/views/GameByUnity.vue
  3. 30 6
      game/src/views/HomeView.vue

+ 0 - 2
game/README.md

@@ -11,8 +11,6 @@ https://sit-cnzhengquan.4dage.com/game/index.html#/
 ## 还缺资源:
 
 ## todo
-接入unity游戏
-
 积分达到上限时的提示文字样式,每个游戏都要改,而且新增积分始终为0。
 
 

+ 3 - 0
game/src/views/GameByUnity.vue

@@ -22,7 +22,10 @@ if (store.state.loginStatus) {
   gameUrlQuery = `?userId=${store.state.userInfo.id}&token=${store.state.token}`
 }
 const gameUrlMap = {
+  AntibodyBattle: `https://app.4dage.com/test/rc/VirusWar/index.html`,
   DisasterRelief: `http://app.4dage.com/test/rc/Build/index.html`,
+  EnviromentProtection: `https://app.4dage.com/test/rc/EcologicalProtection/index.html`,
+  LostChildren: `https://app.4dage.com/WebGLTestyhz/MiniGame/H5Game-ChinaSecuritiesMuseumMaze/index.html`,
 }
 
 const gameUrl = gameUrlMap[route.query.gameName] + gameUrlQuery

+ 30 - 6
game/src/views/HomeView.vue

@@ -120,7 +120,10 @@
         >
       </button>
       <!-- 抗体大作战 -->
-      <button class="game-entry antibody-battle-entry">
+      <button
+        class="game-entry antibody-battle-entry"
+        @click="onClickGameEntry(3)"
+      >
         <img
           class=""
           src="@/assets/images/antibody-battle-entry.png"
@@ -141,7 +144,10 @@
         >
       </button>
       <!-- 生态保护 -->
-      <button class="game-entry enviroment-protection">
+      <button
+        class="game-entry enviroment-protection"
+        @click="onClickGameEntry(5)"
+      >
         <img
           class=""
           src="@/assets/images/enviroment-protection.png"
@@ -150,7 +156,10 @@
         >
       </button>
       <!-- 找回走失儿童 -->
-      <button class="game-entry lost-children-entry">
+      <button
+        class="game-entry lost-children-entry"
+        @click="onClickGameEntry(6)"
+      >
         <img
           class=""
           src="@/assets/images/lost-children-entry.png"
@@ -315,7 +324,12 @@ const entryFunctionList = [
     })
   },
   function () {
-
+    router.push({
+      name: 'GameByUnity',
+      query: {
+        gameName: 'AntibodyBattle'
+      },
+    })
   },
   function () {
     router.push({
@@ -326,10 +340,20 @@ const entryFunctionList = [
     })
   },
   function () {
-
+    router.push({
+      name: 'GameByUnity',
+      query: {
+        gameName: 'EnviromentProtection'
+      },
+    })
   },
   function () {
-
+    router.push({
+      name: 'GameByUnity',
+      query: {
+        gameName: 'LostChildren'
+      },
+    })
   },
 ]
 const isShowLoginChoice = ref(false)