浏览代码

日常开发

林旭祥 1 周之前
父节点
当前提交
a7a22f45ed
共有 5 个文件被更改,包括 56 次插入25 次删除
  1. 二进制
      public/static/images/game/fruit.png
  2. 1 0
      src/router/index.ts
  3. 23 0
      src/views/game/fruit.vue
  4. 14 10
      src/views/game/index.vue
  5. 18 15
      src/views/home/index.vue

二进制
public/static/images/game/fruit.png


+ 1 - 0
src/router/index.ts

@@ -32,6 +32,7 @@ const router = createRouter({
         { path: '/sunshineRun', component: () => import('@/views/sunshineRun/index.vue') },
         { path: '/game', component: () => import('@/views/game/index.vue') },
         { path: '/game/square', component: () => import('@/views/game/square.vue') },
+        { path: '/game/fruit', component: () => import('@/views/game/fruit.vue') },
         { path: '/score', component: () => import('@/views/score/index.vue') },
       ]
     }

+ 23 - 0
src/views/game/fruit.vue

@@ -0,0 +1,23 @@
+<template>
+  <div>
+
+  </div>
+</template>
+
+<script setup name="Fruit" lang="ts">
+const data = reactive<any>({
+});
+const {
+} = toRefs(data);
+
+
+onBeforeMount(() => {
+
+});
+
+onBeforeUnmount(() => {
+
+});
+</script>
+
+<style lang="scss" scoped></style>

+ 14 - 10
src/views/game/index.vue

@@ -40,15 +40,19 @@ const { projectList } = toRefs(data);
 
 //跳转
 const getJump = (data: any) => {
-  router.push({
-    path: `/game/${data.key}`, query: {
-      project: 'jumprope',
-      time: 60,
-      area: 29,
-      gesture: 'true',
-      classes: '1'
-    }
-  });
+  if (data.key == 'square') {
+    router.push({
+      path: `/game/${data.key}`, query: {
+        project: 'jumprope',
+        time: 60,
+        area: 29,
+        gesture: 'true',
+        classes: '1'
+      }
+    });
+  } else {
+    router.push({ path: `/game/${data.key}`, query: {} });
+  }
 };
 
 /**
@@ -66,7 +70,7 @@ onBeforeMount(async () => {
 onMounted(() => {
   //停止播报;
   speckCancel();
-  projectList.value = [{ name: "方块跳一跳", key: "square" }]
+  projectList.value = [{ name: "方块跳一跳", key: "square" }, { name: "水果忍者", key: "fruit" }]
 });
 
 onBeforeUnmount(() => {

+ 18 - 15
src/views/home/index.vue

@@ -8,22 +8,25 @@
       <div class="right">
         <div class="right-top">
           <div class="li" @click="getJump('/test', '测试')">
-            <img src="@/assets/images/home/test.png" alt="测试"/>
+            <img src="@/assets/images/home/test.png" alt="测试" />
             <i></i>
           </div>
-          <div class="li" @click="getJump('/ranking', '排行榜')"><img src="@/assets/images/home/ranking.png" alt="排行榜" /></div>
+          <div class="li" @click="getJump('/ranking', '排行榜')"><img src="@/assets/images/home/ranking.png" alt="排行榜" />
+          </div>
         </div>
         <div class="right-bottom">
           <div class="right-bottom-left">
-            <div class="li" @click="getJump('/game', '游戏')"><img src="@/assets/images/home/game.png" alt="游戏"/></div>
+            <div class="li" @click="getJump('/game', '游戏')"><img src="@/assets/images/home/game.png" alt="游戏" /></div>
           </div>
           <div class="right-bottom-right">
             <div class="right-bottom-right-left">
-              <div class="li" @click="getJump('/query', '查询')"><img src="@/assets/images/home/query.png" alt="查询"/></div>
+              <div class="li" @click="getJump('/query', '查询')"><img src="@/assets/images/home/query.png" alt="查询" />
+              </div>
             </div>
             <div class="right-bottom-right-right">
-              <div class="li" @click="getJump('/course', '课程')"><img src="@/assets/images/home/course2.png" alt="课程"/></div>
-              <div class="li" @click="getJump('/set', '设置')"><img src="@/assets/images/home/set2.png" alt="设置"/></div>
+              <div class="li" @click="getJump('/course', '课程')"><img src="@/assets/images/home/course2.png" alt="课程" />
+              </div>
+              <div class="li" @click="getJump('/set', '设置')"><img src="@/assets/images/home/set2.png" alt="设置" /></div>
             </div>
           </div>
         </div>
@@ -103,15 +106,15 @@ const getJump = (url: string, name: string) => {
       })
       .finally(() => { });
   } else if (url == '/game') {
-    proxy?.$modal.msgWarning('暂不开放使用,敬请期待!');
-    // proxy?.$modal
-    //   .prompt('请输入密码')
-    //   .then((e: any) => {
-    //     if (e.action == 'confirm' && e.value == 'trops') {
-    //       router.push({ path: url });
-    //     }
-    //   })
-    //   .finally(() => { });
+    // proxy?.$modal.msgWarning('暂不开放使用,敬请期待!');
+    proxy?.$modal
+      .prompt('请输入密码')
+      .then((e: any) => {
+        if (e.action == 'confirm' && e.value == 'trops') {
+          router.push({ path: url });
+        }
+      })
+      .finally(() => { });
 
     //  router.push({ path: url });
     // if (import.meta.env.DEV) {