Kaynağa Gözat

日常开发

林旭祥 1 ay önce
ebeveyn
işleme
6efc2f50e3
4 değiştirilmiş dosya ile 596 ekleme ve 523 silme
  1. 54 52
      src/views/home/index.vue
  2. 6 2
      src/views/train/multiple.vue
  3. 239 211
      src/views/train/run.vue
  4. 297 258
      src/views/train/test.vue

+ 54 - 52
src/views/home/index.vue

@@ -3,28 +3,23 @@
     <Header :showClose="false" :showTool="true" logoClass="logo2"></Header>
     <div class="menu">
       <div class="left">
-        <div class="li" @click="getJump('/train', '自助锻炼')"><img src="@/assets/images/home/train.png" />
-        </div>
+        <div class="li" @click="getJump('/train', '自助锻炼')"><img src="@/assets/images/home/train.png" /></div>
       </div>
       <div class="right">
         <div class="right-top">
-          <div class="li" @click="getJump('/test', '测试')"><img src="@/assets/images/home/test.png" />
+          <div class="li" @click="getJump('/test', '测试')">
+            <img src="@/assets/images/home/test.png" />
             <i></i>
           </div>
-          <div class="li" @click="getJump('/ranking', '排行榜')"><img src="@/assets/images/home/ranking.png" />
-          </div>
+          <div class="li" @click="getJump('/ranking', '排行榜')"><img src="@/assets/images/home/ranking.png" /></div>
         </div>
         <div class="right-bottom">
-          <div class="li" @click="getJump('/gesture', '竞赛')"><img src="@/assets/images/home/competition.png" />
-          </div>
-          <div class="li" @click="getJump('/course', '课程')"><img src="@/assets/images/home/course.png" />
-          </div>
-          <div class="li" @click="getJump('/set', '设置')"><img src="@/assets/images/home/set.png" />
-          </div>
+          <div class="li" @click="getJump('/gesture', '竞赛')"><img src="@/assets/images/home/competition.png" /></div>
+          <div class="li" @click="getJump('/course', '课程')"><img src="@/assets/images/home/course.png" /></div>
+          <div class="li" @click="getJump('/set', '设置')"><img src="@/assets/images/home/set.png" /></div>
         </div>
       </div>
     </div>
-
   </div>
 </template>
 
@@ -43,43 +38,57 @@ const getJump = (url: string, name: string) => {
       proxy?.$modal.msgSuccess('测试环境免密进入设置');
       router.push({ path: url });
     } else {
-      let myInfo: any = localStorage.getItem("userInfo");
+      let myInfo: any = localStorage.getItem('userInfo');
       let userInfo = JSON.parse(myInfo);
-      proxy?.$modal.prompt(`【${userInfo.login_name}】,请输入密码`, 'password').then((e: any) => {
+      proxy?.$modal
+        .prompt(`【${userInfo.login_name}】,请输入密码`, 'password')
+        .then((e: any) => {
+          // console.log("e", e)
+          if (e.action == 'confirm' && e.value) {
+            let params = {
+              password: e.value
+            };
+            proxy?.$http.common.checkPassword(params).then((res: any) => {
+              if (res.status === 200 || res.status === 1) {
+                router.push({ path: url });
+              } else {
+                proxy?.$modal.msgError(res.message);
+              }
+            });
+          }
+        })
+        .finally(() => {});
+    }
+  } else if (url == '/test') {
+    proxy?.$modal
+      .prompt('请输入密码')
+      .then((e: any) => {
         // console.log("e", e)
-        if (e.action == 'confirm' && e.value) {
-          let params = {
-            password: e.value
-          };
-          proxy?.$http.common.checkPassword(params).then((res: any) => {
-            if (res.status === 200 || res.status === 1) {
-              router.push({ path: url });
-            } else {
-              proxy?.$modal.msgError(res.message);
-            }
-          });
+        if (e.action == 'confirm' && e.value == '160713') {
+          let deviceid = e.value;
+          localStorage.setItem('deviceid', deviceid);
+          router.push({ path: url });
         }
-      }).finally(() => {
-      });
-    }
+      })
+      .finally(() => {});
   } else if (url == '/gesture') {
-    proxy?.$modal.prompt('请输入设备码').then((e: any) => {
-      // console.log("e", e)
-      if (e.action == 'confirm' && e.value) {
-        let deviceid = e.value;
-        localStorage.setItem("deviceid", deviceid);
-        router.push({ path: url });
-      }
-    }).finally(() => {
-    });
+    proxy?.$modal
+      .prompt('请输入设备码')
+      .then((e: any) => {
+        // console.log("e", e)
+        if (e.action == 'confirm' && e.value) {
+          let deviceid = e.value;
+          localStorage.setItem('deviceid', deviceid);
+          router.push({ path: url });
+        }
+      })
+      .finally(() => {});
   } else {
     router.push({ path: url });
   }
 };
 
-onMounted(() => {
-
-})
+onMounted(() => {});
 </script>
 
 <style lang="scss" scoped>
@@ -102,20 +111,16 @@ $waiPadding: 6.51rem;
     cursor: pointer;
 
     &:hover {
-
       img,
       i {
         transform: scale(1.06);
       }
-
     }
   }
 
   img {
     width: 100%;
     transition: all 0.5s;
-
-
   }
 
   .left {
@@ -137,7 +142,7 @@ $waiPadding: 6.51rem;
       margin-bottom: $myPadding;
 
       .li {
-        width: calc(50% - $myPadding /2);
+        width: calc(50% - $myPadding / 2);
       }
 
       .li:nth-child(1) {
@@ -151,7 +156,7 @@ $waiPadding: 6.51rem;
           top: calc(6vw / -6.4);
           left: 50%;
           margin-left: calc(6vw * -0.15);
-          background-image: url("@/assets/images/home/test_icon.png");
+          background-image: url('@/assets/images/home/test_icon.png');
           background-position: center;
           background-repeat: no-repeat;
           background-size: 100% 100%;
@@ -159,28 +164,25 @@ $waiPadding: 6.51rem;
           transition: all 0.5s;
         }
       }
-
     }
 
     .right-bottom {
-
       display: flex;
       justify-content: space-between;
       padding-left: $myPadding;
 
       .li:nth-child(1) {
-        width: calc(50% - $myPadding /2);
+        width: calc(50% - $myPadding / 2);
       }
 
       .li:nth-child(2) {
-        width: calc((50% - $myPadding /2)/2 - $myPadding /2 + 0.05rem);
+        width: calc((50% - $myPadding / 2) / 2 - $myPadding / 2 + 0.05rem);
       }
 
       .li:nth-child(3) {
-        width: calc((50% - $myPadding /2)/2 - $myPadding /2 - 0.05rem);
+        width: calc((50% - $myPadding / 2) / 2 - $myPadding / 2 - 0.05rem);
       }
     }
-
   }
 }
 

+ 6 - 2
src/views/train/multiple.vue

@@ -265,9 +265,13 @@ const getExit = () => {
   window.onbeforeunload = null;//移除事件处理器
   let handcontroller_id = parameter.value.handcontroller;
   if (handcontroller_id) {
-    router.push({ path: '/gesture' });//跳转
+    router.push({ path: '/gesture' });
   } else {
-    router.push({ path: '/' });//跳转
+    if (parameter.value.taskId) {
+      router.push({ path: '/test' });
+    } else {
+      router.push({ path: '/' });
+    }
   }
 };
 

Dosya farkı çok büyük olduğundan ihmal edildi
+ 239 - 211
src/views/train/run.vue


Dosya farkı çok büyük olduğundan ihmal edildi
+ 297 - 258
src/views/train/test.vue


Bu fark içinde çok fazla dosya değişikliği olduğu için bazı dosyalar gösterilmiyor