Browse Source

fix:修复个人中心中个人信息不显示的问题
style:修改热门测试样式

茫茫燃 5 years ago
parent
commit
68a665283d

+ 1 - 1
assets/css/course-card.scss

@@ -46,7 +46,7 @@
     padding: 5px 20px;
     font-size: 14px;
     background-color: #FFFFFF;
-    border-radius: 24px;
+    border-radius: 8px;
     height: 66px;
 
 

+ 1 - 7
assets/css/home.scss

@@ -32,7 +32,7 @@ a{
   font-weight: 500;
 }
 
-.course-list{
+.course-list,.test-list{
   display: flex;
   flex-wrap: nowrap;
   align-items: flex-end;
@@ -41,9 +41,3 @@ a{
   width: 1200px;
   margin: 0 auto;
 }
-.test-list{
-  display: flex;
-  justify-content: center;
-  align-items: center;
-  margin-top: 30px;
-}

+ 3 - 1
assets/css/main.scss

@@ -150,10 +150,12 @@ body{
   width: 100%;
   background-color: white;
   color: $common-color;
-  padding: 30px 0 0 0;
+  padding: 20px 0 0 0;
   border: 1px solid #ebeef5;
   box-shadow: 0 2px 12px 0 rgba(0,0,0,.1);
   margin-top: 50px;
+  position: fixed;
+  bottom: 0;
 
   &__main{
     width: 1200px;

+ 7 - 6
assets/css/test-card.css

@@ -1,9 +1,6 @@
 .test-card {
-  height: 180px;
-}
-
-.test-container {
-  width: 40%;
+  height: 200px;
+  width: 340px;
 }
 
 .test-card__header {
@@ -16,6 +13,7 @@
 .test-card__name {
   font-size: 20px;
   font-weight: 500;
+  width: 80%;
 }
 
 .test-card__status {
@@ -29,7 +27,7 @@
 
 .test-card__time {
   margin-top: 16px;
-  font-size: 16px;
+  font-size: 15px;
   color: #999999;
 }
 
@@ -44,6 +42,9 @@
 
 .test-card__btn >>> .el-button{
   margin-left: 0;
+  width: 72px;
+  padding-left: 0;
+  padding-right: 0;
 }
 
 .test-card__invigilate{

+ 1 - 0
components/Foot.vue

@@ -41,4 +41,5 @@ export default {
 
 <style scoped>
 
+
 </style>

+ 3 - 3
components/TestCard.vue

@@ -8,9 +8,9 @@
       </div>
       <div class="test-card__option">
         <div class="test-card__time">
-          <div class="test-card__startTime">开始时间:{{ startTime }}</div>
-          <div class="test-card__endTime">结束时间:{{ endTime }}</div>
-          <div class="test-card__invigilate">监考:{{ antiCheating }}</div>
+          <div class="test-card__startTime">起始:{{ startTime }}</div>
+          <div class="test-card__endTime">结束:{{ endTime }}</div>
+          <div class="test-card__invigilate">监考:{{ antiCheating }}</div>
         </div>
         <div class="test-card__btn">
           <el-button type="primary" plain @click.native="getTestDetail">查看详情</el-button>

+ 14 - 10
pages/index.vue

@@ -3,9 +3,9 @@
     <!--<img class="home-banner" src="/image/SEEC_banner3.png"/>-->
     <h1 class="title">热门测试</h1>
     <div class="test-list">
-      <test-card :start-time="examList.startTime" :end-time="examList.endTime"
-                 :exam-name="examList.examName" :anti-cheating="examList.antiCheating===false? '无':'有'"
-                 :status="examList.status"></test-card>
+      <test-card v-for="(item,index) in examList" :key="index" :start-time="item.startTime" :end-time="item.endTime"
+                 :exam-name="item.examName" :anti-cheating="item.antiCheating===false? '无':'有'"
+                 :status="item.status"></test-card>
     </div>
     <h1 class="title">热门课程</h1>
     <div class="course-list">
@@ -76,13 +76,17 @@ export default {
     }
   },
   mounted () {
-    this.$api.$get('https://eval-test.seec.seecoder.cn/api/exam/list?pageSize=5&pageNum=1').then(res => {
-      this.examList = res.result.examVOList[0]
-      const startTime = this.examList.startTime
-      const endTime = this.examList.endTime
-      this.examList.status = computeExamStatusText({
-        startTime: startTime,
-        endTime: endTime
+    const token = this.$store.state.token
+    this.$api.get('https://eval-test.seec.seecoder.cn/api/exam/list?pageSize=5&pageNum=1').then(res => {
+
+      this.examList = res.data.result.examVOList
+      this.examList.forEach((item) => {
+        const startTime = item.startTime
+        const endTime = item.endTime
+        item.status = computeExamStatusText({
+          startTime: startTime,
+          endTime: endTime
+        })
       })
     })
   }

+ 6 - 2
plugins/api.js

@@ -1,5 +1,9 @@
-
-export default function ({ $axios, redirect, app, store }, inject) {
+export default function ({
+  $axios,
+  redirect,
+  app,
+  store
+}, inject) {
   // $axios.onRequest(config => {
   //   if(store.state.token){
   //     config.headers['Authorization'] = 'Bearer ' + store.state.token;