|
|
@@ -1,5 +1,5 @@
|
|
|
<template>
|
|
|
- <el-card class="course-card" shadow="hover">
|
|
|
+ <el-card class="course-card" shadow="hover" @click="toCourseInfo">
|
|
|
<div class="image">
|
|
|
<img :src="imageUrl" alt="">
|
|
|
</div>
|
|
|
@@ -16,20 +16,20 @@
|
|
|
教师: {{ courseVO.teacher.name }}
|
|
|
</el-row>
|
|
|
<el-row class="semester">
|
|
|
-
|
|
|
+ 季度: {{ courseVO.semester }}
|
|
|
</el-row>
|
|
|
<el-row class="time">
|
|
|
- {{ courseVO.semester }} : {{ timeToCHN(courseVO.startTime) }} 至 {{ timeToCHN(courseVO.endTime) }}
|
|
|
+ 时间: {{ timestampToTime(courseVO.startTime) }} 至 {{ timestampToTime(courseVO.endTime) }}
|
|
|
</el-row>
|
|
|
<el-row class="description">
|
|
|
{{ courseVO.description }}
|
|
|
</el-row>
|
|
|
- <el-row class="button">
|
|
|
- <el-col :span="24">
|
|
|
- <el-button v-if="state==='FINISHED'" size="small" type="success" plain>结果报告</el-button>
|
|
|
- <el-button v-else size="small" type="primary" plain>查看详情</el-button>
|
|
|
- </el-col>
|
|
|
- </el-row>
|
|
|
+<!-- <el-row class="button">-->
|
|
|
+<!-- <el-col :span="24">-->
|
|
|
+<!-- <el-button v-if="state==='FINISHED'" plain size="small" type="success">结果报告</el-button>-->
|
|
|
+<!-- <el-button v-else plain size="small" type="primary">查看详情</el-button>-->
|
|
|
+<!-- </el-col>-->
|
|
|
+<!-- </el-row>-->
|
|
|
</el-card>
|
|
|
</template>
|
|
|
|
|
|
@@ -47,8 +47,8 @@ export default {
|
|
|
return "OVER";
|
|
|
} else if (new Date(this.courseVO.startTime) > new Date()) {
|
|
|
return "NOT_STARTED";
|
|
|
- // } else if (this.examVO.finished) {
|
|
|
- // return "FINISHED";
|
|
|
+ } else if (this.examVO.finished) {
|
|
|
+ return "FINISHED";
|
|
|
} else {
|
|
|
return "RUNNING";
|
|
|
}
|
|
|
@@ -60,12 +60,15 @@ export default {
|
|
|
mounted() {
|
|
|
},
|
|
|
methods: {
|
|
|
- timeToCHN: function (time) {
|
|
|
- const date = new Date(time);
|
|
|
- const hours = date.getHours() > 9 ? date.getHours() : "0" + date.getHours();
|
|
|
- const minutes = date.getMinutes() > 9 ? date.getMinutes() : "0" + date.getMinutes();
|
|
|
- return (date.getMonth() + 1) + "月" + date.getDate() + "日 " +
|
|
|
- hours + ":" + minutes;
|
|
|
+ timestampToTime(timestamp) {
|
|
|
+ const date = new Date(timestamp);
|
|
|
+ const Y = date.getFullYear() + "-";
|
|
|
+ const M = (date.getMonth() + 1 < 10 ? "0" + (date.getMonth() + 1) : date.getMonth() + 1) + "-";
|
|
|
+ const D = (date.getDate() < 10 ? "0" + date.getDate() : date.getDate());
|
|
|
+ return Y + M + D;
|
|
|
+ },
|
|
|
+ toCourseInfo() {
|
|
|
+ this.$router.push("/course/" + this.courseVO.id);
|
|
|
},
|
|
|
},
|
|
|
};
|
|
|
@@ -73,19 +76,22 @@ export default {
|
|
|
|
|
|
<style scoped>
|
|
|
.course-card {
|
|
|
- background-color: #f8f9fb;
|
|
|
- border: 1px solid #e4e7ed;
|
|
|
margin-bottom: 10px;
|
|
|
border-radius: 4px;
|
|
|
height: calc(100% - 10px);
|
|
|
+ position: relative;
|
|
|
}
|
|
|
|
|
|
-.course-card :hover {
|
|
|
+.course-card:hover {
|
|
|
cursor: pointer;
|
|
|
+ border: 1px solid #aaaaaa;
|
|
|
}
|
|
|
|
|
|
.image {
|
|
|
height: 80px;
|
|
|
+ outline: solid 1px #eeeeee;
|
|
|
+ margin-bottom: 10px;
|
|
|
+ border-radius: 4px;
|
|
|
}
|
|
|
|
|
|
.image img {
|
|
|
@@ -93,13 +99,6 @@ export default {
|
|
|
width: 100%;
|
|
|
}
|
|
|
|
|
|
-/*.info {*/
|
|
|
-/* margin-top: 4px;*/
|
|
|
-/* box-sizing: border-box;*/
|
|
|
-/* position: relative;*/
|
|
|
-/* height: 120px;*/
|
|
|
-/*}*/
|
|
|
-
|
|
|
.name {
|
|
|
font-weight: bold;
|
|
|
}
|
|
|
@@ -111,28 +110,34 @@ export default {
|
|
|
.teacher {
|
|
|
font-size: 10px;
|
|
|
margin-top: 10px;
|
|
|
+ color: #999999;
|
|
|
}
|
|
|
|
|
|
.semester {
|
|
|
margin-top: 4px;
|
|
|
font-size: 10px;
|
|
|
+ color: #999999;
|
|
|
}
|
|
|
|
|
|
.time {
|
|
|
margin-top: 4px;
|
|
|
font-size: 10px;
|
|
|
+ color: #999999;
|
|
|
}
|
|
|
|
|
|
.description {
|
|
|
- background-color: #ffffff;
|
|
|
+ background-color: #f8f8f8;
|
|
|
margin-top: 10px;
|
|
|
- border-radius: 12px;
|
|
|
+ border-radius: 8px;
|
|
|
padding: 10px;
|
|
|
font-size: 10px;
|
|
|
+ color: #777777;
|
|
|
}
|
|
|
|
|
|
-.button {
|
|
|
- margin-top: 12px;
|
|
|
- text-align: center;
|
|
|
-}
|
|
|
+/*.button {*/
|
|
|
+/* position: absolute;*/
|
|
|
+/* bottom: 8px;*/
|
|
|
+/* left: calc(50% - 40px);*/
|
|
|
+/* text-align: center;*/
|
|
|
+/*}*/
|
|
|
</style>
|