Преглед изворни кода

fix: UI更新-课程卡片

mjh пре 3 година
родитељ
комит
430479d04b
1 измењених фајлова са 22 додато и 8 уклоњено
  1. 22 8
      src/components/CourseCard.vue

+ 22 - 8
src/components/CourseCard.vue

@@ -2,14 +2,17 @@
   <el-card class="course-card" shadow="hover" @click="toCourseInfo">
     <img :src="imageUrl" alt="" class="image">
     <el-row>
-      <el-col :span="16" class="name" :title="this.title">{{ title.length>12?title.substring(0,12)+"...":title }}</el-col>
+      <el-col :span="16" class="name" :title="this.title">{{ title }}</el-col>
       <el-col :span="8" class="status">
         <el-tag v-if="state==='NOT_STARTED'" size="small" type="info"
-                round effect="plain">未开始</el-tag>
+                round effect="plain">未开始
+        </el-tag>
         <el-tag v-else-if="state==='RUNNING'" size="small"
-                round effect="plain">进行中</el-tag>
+                round effect="plain">进行中
+        </el-tag>
         <el-tag v-else-if="state==='FINISHED'" size="small" type="danger"
-                round effect="plain">已结束</el-tag>
+                round effect="plain">已结束
+        </el-tag>
       </el-col>
     </el-row>
     <el-row class="teacher">
@@ -19,7 +22,7 @@
       季度: {{ semester }}
     </el-row>
     <el-row class="time">
-      时间: {{ startTime.replace(/-/g,".") }}至{{ endTime.replace(/-/g,".") }}
+      时间: {{ startTime.replace(/-/g, ".") }}至{{ endTime.replace(/-/g, ".") }}
     </el-row>
     <el-row class="description">
       {{ description }}
@@ -75,7 +78,7 @@ export default {
       return this.timestampToTime(this.courseVO.endTime);
     },
     description() {
-      return this.courseVO.description.length > 28 ? this.courseVO.description.substring(0, 28) + "..." : this.courseVO.description;
+      return this.courseVO.description;
     },
     isManagePage() {
       return this.$route.name === "Manage" && this.$store.getters.isTeacher;
@@ -123,6 +126,12 @@ export default {
 
 .name {
   font-weight: bold;
+  -webkit-line-clamp: 2;
+  display: -webkit-box;
+  -webkit-box-orient: vertical;
+  overflow: hidden;
+  text-overflow: ellipsis;
+  height: 45px;
 }
 
 .status {
@@ -151,10 +160,15 @@ export default {
   background-color: #f6f6f6;
   margin-top: 10px;
   border-radius: 8px;
-  padding: 10px;
+  padding: 5px;
   font-size: 10px;
   color: #777777;
-  height: 53px;
+  -webkit-line-clamp: 2;
+  display: -webkit-box;
+  -webkit-box-orient: vertical;
+  overflow: hidden;
+  text-overflow: ellipsis;
+  height: 43px;
 }
 
 .button {