plg 6 месяцев назад
Родитель
Сommit
d37cb49f73
4 измененных файлов с 60 добавлено и 20 удалено
  1. 1 1
      index.html
  2. 2 2
      src/components/CpmdHeader.vue
  3. 47 12
      src/views/HomeView.vue
  4. 10 5
      src/views/Login.vue

+ 1 - 1
index.html

@@ -4,7 +4,7 @@
     <meta charset="UTF-8">
     <link rel="icon" href="/favicon.png">
     <meta name="viewport" content="width=device-width, initial-scale=1.0">
-    <title>Vite App</title>
+    <title>郑州大学大学生心理健康测评系统</title>
   </head>
   <body>
     <div id="app"></div>

+ 2 - 2
src/components/CpmdHeader.vue

@@ -69,7 +69,7 @@ const comT = () => {
         <div class="header_image">
             <!-- <img style="width: 239px; height: 55px" src="../assets/home/trademarkNew.png"></img> -->
             <!-- <img style="width: 239px; height: 55px" src="../assets/home/trademarkNew.png"></img> -->
-            <div>郑州大学大学生心理健康测评</div>
+            <div>郑州大学大学生心理健康测评系统</div>
         </div>
         <el-menu :default-active="activeIndex" class="el-menu-demo" style="display: flex;" mode="horizontal"
             :ellipsis="false" @select="handleSelect">
@@ -239,7 +239,7 @@ const comT = () => {
 
     .header_image {
         // flex: 1
-        margin-right: 100px;
+        // margin-right: 100px;
 
         div {
             color: #48D68E;

+ 47 - 12
src/views/HomeView.vue

@@ -189,13 +189,13 @@ const planNumGet = async () => {
   </div>
   <div class="home_mid">
 
-    <div class="home_mid_plan" v-show="taskCircleFlag && userInfo.planCurrentNum != 0" @click="openSquare"
+    <!-- <div class="home_mid_plan" v-show="taskCircleFlag && userInfo.planCurrentNum != 0" @click="openSquare"
       ref="plan_jihua" :style="{ top: plan_jihua + 'px' }">
       <div class="badge_custom">
         {{ userInfo.planCurrentNum }}
       </div>
       <img src="../assets/home/jihua_img.png" />
-    </div>
+    </div> -->
     <div class="kepu_title">科普小课堂</div>
     <div class="kepu_title_sub">心灵成长不迷茫,科普小课堂为你点亮前行的方向</div>
     <div class="man1_group">
@@ -245,6 +245,13 @@ const planNumGet = async () => {
     <div class="get_more">
       <img src="../assets/home/get_more.png" @click="goMore" />
     </div>
+    <div class="home_mid_plan" v-show="taskCircleFlag && userInfo.planCurrentNum != 0" @click="openSquare"
+      ref="plan_jihua">
+      <div class=" badge_custom">
+        {{ userInfo.planCurrentNum }}
+      </div>
+      <img src="../assets/home/jihua_img.png" />
+    </div>
   </div>
 </template>
 <style lang="scss" scoped>
@@ -468,17 +475,27 @@ const planNumGet = async () => {
   margin-top: 20px;
   // position: relative;
 
-  .home_mid_plan {
-    cursor: pointer;
-    // top: 1000px;
-    position: absolute;
-    right: 0px;
+  // .home_mid_plan {
+  //   z-index: 111;
+  //   cursor: pointer;
+  //   // top: 1000px;
+  //   position: fixed;
+  //   width: 100%;
+  //   height: 200px;
+  //   top: 10px;
 
-    // top: -30px;
-    img {
-      width: 100px;
-    }
-  }
+  //   bottom: 0px;
+
+  //   left: 0px;
+
+  //   right: 0px;
+  //   // right: 200px;
+
+  //   // top: -30px;
+  //   img {
+  //     width: 100px;
+  //   }
+  // }
 
 
 
@@ -608,4 +625,22 @@ const planNumGet = async () => {
   width: 100%;
   background-color: #000000;
 }
+
+.home_mid_plan {
+  z-index: 1;
+  cursor: pointer;
+  // top: 1000px;
+  position: fixed;
+  width: 100px;
+  height: 100px;
+  top: 0;
+
+
+  right: 0;
+  margin: auto;
+
+  img {
+    width: 100px;
+  }
+}
 </style>

+ 10 - 5
src/views/Login.vue

@@ -77,12 +77,17 @@ const loginFun = async () => {
     }
     const res: any = await userLoginApi(params)
     if (res.code == 200) {
+        if (res.data.type == '3') {
+            userInfo.saveToken(res.data.token)
+            userInfo.saveUserInfo(res.data.user)
+            ElMessage({ message: `${res.msg}`, type: 'success' })
+            //跳转到首页
+            router.push({ name: 'homeView' })
+        } else {
+            ElMessage({ message: `请使用普通账户登录`, type: 'error' })
+        }
         //登录成功后将信息存入缓存  
-        userInfo.saveToken(res.data.token)
-        userInfo.saveUserInfo(res.data.user)
-        ElMessage({ message: `${res.msg}`, type: 'success' })
-        //跳转到首页
-        router.push({ name: 'homeView' })
+
     } else {
         ElMessage({ message: `${res.msg}`, type: 'error' })
     }