zengyicheng 2 years ago
parent
commit
90cd311548

+ 27 - 17
src/api/user.js

@@ -3,27 +3,37 @@ import request from '@/utils/request'
 
 // 用户信息 post 方法
 export function eduGet() {
-  return request({
-    url: '//beta.api.cocorobo.cn/api/getcookieuserid',
-    method: 'GET',
-    hideloading: true
-  })
+    return request({
+        url: '//beta.api.cocorobo.cn/api/getcookieuserid',
+        method: 'GET',
+        hideloading: true
+    })
 }
 export function eduGetUserinfo(rk) {
-  return request({
-    url: `//api.edu.cocorobo.cn/edu/admin/userinfo/userinfoById/${rk}`,
-    method: 'GET',
-    hideloading: true
-  })
+    return request({
+        url: `//api.edu.cocorobo.cn/edu/admin/userinfo/userinfoById/${rk}`,
+        method: 'GET',
+        hideloading: true
+    })
+}
+
+// 退出登录
+export function loginOut(data) {
+    return request({
+        url: '//beta.api.cocorobo.cn/api/logout',
+        method: 'post',
+        params: data,
+        hideloading: false
+    })
 }
 
 export function getUser(data) {
-  return request({
-    url: `/selectUser`,
-    method: 'GET',
-    params: data,
-    hideloading: true
-  })
+    return request({
+        url: `/selectUser`,
+        method: 'GET',
+        params: data,
+        hideloading: true
+    })
 }
 
 // // 登录
@@ -53,4 +63,4 @@ export function getUser(data) {
 //     params,
 //     hideloading: true
 //   })
-// }
+// }

BIN
src/assets/images/home/lastStep.png


BIN
src/assets/images/home/mlIcon.png


BIN
src/assets/images/home/nextStep.png


BIN
src/assets/images/home/pk.png


+ 1 - 0
src/views/course/components/stepsBox.vue

@@ -1013,6 +1013,7 @@ export default {
         border-radius: 5px;
         margin: 0 15px 10px 0;
         padding: 5px;
+        font-size: 14px;
         cursor: pointer;
         @include textoverflow();
       }

+ 55 - 5
src/views/course/index.vue

@@ -3,14 +3,15 @@
     <head-bar @back="back">
       <template #title>
         <div class="course-nav-box">
-          <span class="list" @click="navCheck"></span>
+          <div>{{ courseDetail.title }}</div>
+          <!-- <span class="list" @click="navCheck"></span>
           <span class="last" @click="nextOrpreSteps(0)">上一步</span>
           <span class="next" @click="nextOrpreSteps(1)">下一步</span>
-          <span class="comment" @click="setType(2)">评课</span>
+          <span class="comment" @click="setType(2)">评课</span> -->
         </div>
       </template>
     </head-bar>
-    <div class="course-box">
+    <div class="course-box" ref="cBox">
       <course-title :chapInfo="chapInfo" :courseType="courseType" :taskCount="taskCount"></course-title>
       <course-content-list v-if="false"></course-content-list>
       <div class="course-type-box">
@@ -43,6 +44,24 @@
           :taskCount="taskCount"
         ></comment-box>
       </div>
+      <div class="courseNavIcon">
+        <div class="nIcon" @click="navCheck">
+          <div class="iconImg"><img src="../../assets/images/home/mlIcon.png" alt="" /></div>
+          <div>目录</div>
+        </div>
+        <div class="nIcon" @click="nextOrpreSteps(0)">
+          <div class="iconImg"><img src="../../assets/images/home/lastStep.png" alt="" /></div>
+          <div>上一步</div>
+        </div>
+        <div class="nIcon" @click="nextOrpreSteps(1)">
+          <div class="iconImg"><img src="../../assets/images/home/nextStep.png" alt="" /></div>
+          <div>下一步</div>
+        </div>
+        <div class="nIcon" @click="setType(2)">
+          <div class="iconImg"><img src="../../assets/images/home/pk.png" alt="" /></div>
+          <div>评课</div>
+        </div>
+      </div>
     </div>
     <nav-box
       ref="navbox"
@@ -133,10 +152,12 @@ export default {
     },
     nextOrpreSteps(t) {
       this.$refs.navbox.nextOrpreSteps(t)
+      var a = this.$refs["cBox"];
+      a.scrollTop = 0;
     },
     back() {
       // eslint-disable-next-line prettier/prettier
-      this.$router.push({ path: '/courseDetail', query: { courseid: this.courseid }})
+      this.$router.push({ path: '/courseDetail', query: { courseid: this.courseid } })
     }
   },
   created() {
@@ -159,7 +180,7 @@ export default {
     // padding-left: 0.8rem;
     display: flex;
     align-items: center;
-    justify-content: space-between;
+    justify-content: center;
     font-size: 16px;
     > span {
       cursor: pointer;
@@ -182,6 +203,35 @@ export default {
     width: 100%;
     height: calc(100% - 1.5rem);
     overflow: auto;
+    position: relative;
+    .courseNavIcon {
+      position: fixed;
+      bottom: 0;
+      width: 100%;
+      height: 60px;
+      background: #fff;
+      box-shadow: 0 0 10px 2px #cbcbcb;
+      display: flex;
+      flex-direction: row;
+      flex-wrap: nowrap;
+      align-items: center;
+      justify-content: center;
+      .nIcon {
+        display: flex;
+        flex-direction: column;
+        flex-wrap: nowrap;
+        align-items: center;
+        width: calc(100% / 4);
+        .iconImg {
+          width: 30px;
+          height: 30px;
+          > img {
+            width: 100%;
+            height: 100%;
+          }
+        }
+      }
+    }
   }
   .course-type-box {
     background: #fff;

+ 4 - 0
src/views/courseDetail/components/courseChap.vue

@@ -93,6 +93,10 @@ export default {
       color: #fff;
       border-radius: 12px;
       margin: 0 15px 10px 0;
+      >div{
+        margin: 3px 0;
+        font-size: 14px;
+      }
       > div:nth-child(1) {
         font-size: 16px;
         font-weight: bold;

+ 4 - 4
src/views/courseDetail/components/courseMessage.vue

@@ -86,8 +86,8 @@ export default {
   flex-wrap: nowrap;
   align-items: center;
 }
-$pad: 0 0 10px 0;
-$font: 14px;
+$pad: 0 10px 10px 0;
+$font: 15px;
 .courseBox {
   margin-top: 50px;
   height: 100%;
@@ -160,8 +160,8 @@ $font: 14px;
         padding: $pad;
         @include display();
         .man {
-          width: 15px;
-          height: 15px;
+          width: 20px;
+          height: 20px;
           > img {
             width: 100%;
             height: 100%;

+ 2 - 1
src/views/home/components/classFilter.vue

@@ -158,12 +158,13 @@ export default {
     padding-top: 5px;
     > div:nth-child(1) {
       font-weight: bold;
+      font-size: 16px;
     }
     > div:nth-child(1),
     .tNameBox > div {
       padding: 0 8px 3px 8px;
       margin: 0 10px;
-      font-size: 14px;
+      font-size: 16px;
     }
     .tNameBox > div {
       color: #8c8c8c;

+ 19 - 8
src/views/home/components/courseItem.vue

@@ -11,7 +11,7 @@
           <div class="jdImg"><img src="../../../assets/images/home/jd.png" alt="" /></div>
           <div>{{ JSON.parse(c.chapters).length }}阶段</div>
         </div>
-        <div>{{ c.typename ? c.typename : '暂无分类' }}</div>
+        <div class="typeCss">{{ c.typename ? c.typename : '暂无分类' }}</div>
       </div>
     </div>
     <div class="cButtonBox" v-show="false">
@@ -54,8 +54,10 @@ export default {
   flex-wrap: nowrap;
   align-items: flex-start;
   .courseImg {
-    width: 110px;
-    height: 80px;
+    width: 120px;
+    height: 100px;
+    min-width: 120px;
+    min-height: 100px;
     > img {
       width: 100%;
       height: 100%;
@@ -64,9 +66,10 @@ export default {
     }
   }
   .cRight {
-    margin-left: 20px;
+    padding: 0 10px;
     > div {
-      margin: 2px 0;
+      margin: 5px 0;
+      font-size: 14px;
     }
     > div:nth-child(1) {
       font-size: 18px;
@@ -84,15 +87,23 @@ export default {
       align-items: center;
       justify-content: flex-start;
       .jdImg {
-        width: 15px;
-        margin-top: 1px;
-        height: 15px;
+        width: 20px;
+        height: 20px;
         > img {
           width: 100%;
           height: 100%;
         }
       }
     }
+    .typeCss {
+      display: -webkit-box;
+      overflow: hidden;
+      white-space: normal !important;
+      text-overflow: ellipsis;
+      word-wrap: break-word;
+      -webkit-line-clamp: 1;
+      -webkit-box-orient: vertical;
+    }
   }
 }
 .cButtonBox {

+ 35 - 1
src/views/home/index.vue

@@ -2,7 +2,7 @@
   <div class="home-container">
     <head-bar :isBack="false">
       <template #title>
-        <div style="width: 100%">
+        <div style="width: 90%">
           <div class="rightSearch">
             <div class="searchImg" @click="search(undefined)">
               <img src="../../assets/images/home/search.png" alt="" />
@@ -15,6 +15,7 @@
             ></el-input>
           </div>
         </div>
+        <div class="exit" @click="exitLogin">退出</div>
       </template>
     </head-bar>
     <div class="home-box">
@@ -32,6 +33,7 @@
 
 <script>
 import { selectTypeCourse2 } from '@/api/home'
+import { loginOut } from '@/api/user'
 import { mapGetters } from 'vuex'
 import headBar from '@/components/headBar.vue'
 import classFilter from './components/classFilter.vue'
@@ -110,6 +112,32 @@ export default {
         // 证明没有下一页数据了
         this.finished = true
       }
+    },
+    exitLogin() {
+      this.$dialog({
+        message: '是否退出' + this.userinfo.username + '账号',
+        showCancelButton: true,
+        beforeClose: (action, done) => {
+          if (action === 'confirm') {
+            loginOut()
+              .then(res => {
+                this.$toast({
+                  message: '退出成功',
+                  type: 'success'
+                })
+                window.location.reload()
+                done()
+              })
+              .catch(err => {
+                console.error(err)
+                done()
+              })
+          } else {
+            // 拦截取消操作
+            done()
+          }
+        }
+      })
     }
   },
   mounted() {
@@ -153,6 +181,12 @@ export default {
     box-shadow: 0 0 10px 1px #dcdfe6;
     padding: 10px;
   }
+  .exit {
+    color: #fff;
+    margin-left: 10px;
+    font-size: 15px;
+    min-width: 40px;
+  }
   // }
 }
 

+ 7 - 7
src/views/layouts/index.vue

@@ -19,13 +19,13 @@ export default {
   data() {
     return {
       tabbars: [
-        {
-          title: '学习中心',
-          to: {
-            path: '/home'
-          },
-          icon: 'home-o'
-        }
+        // {
+        //   title: '学习中心',
+        //   to: {
+        //     path: '/home'
+        //   },
+        //   icon: 'home-o'
+        // }
         // {
         //   title: '关于我',
         //   to: {