forked from mtianyan/vue-mooc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathchapter.vue
123 lines (122 loc) · 3.18 KB
/
chapter.vue
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
<template>
<div class="chapter">
<div v-if="catalog.introduction" class="chapter-introduce">
{{ catalog.introduction }}
</div>
<div v-for="(item,index) in catalog.chapter" :key="index" class="chapter-item">
<h2 class="chapter-title">
{{ item.title }}
</h2>
<p class="chapter-desc">
{{ item.introduction }}
</p>
<ul>
<li v-for="(term, index) in item.term" :key="index" class="term-item">
<p>
<span class="iconfont play"></span>
<span>{{ term.title }}({{ term.seconds | filterSecond }})</span>
<span class="right">
<!-- <i v-if="term.rate == 100" class="iconfont complete"></i>
<span v-else-if="term.rate > 0 && term.rate < 100" class="doning">
最近学习
<i class="iconfont"></i>
</span> -->
<i class="iconfont ready"></i>
</span>
</p>
</li>
</ul>
</div>
<p v-if="catalog.isComplete" class="complete-info">
<i class="iconfont"></i>
本课程已完结
</p>
</div>
</template>
<script>
import { normalSeconds } from 'utils/utils.js'
export default {
props: {
catalog: {
type: Object,
default () {
return {}
}
}
},
filters: {
filterSecond (val) {
return normalSeconds(val)
}
}
}
</script>
<style lang="stylus" scoped>
.chapter
& > div
margin-bottom: 16px;
padding: 24px 32px 32px;
background-color: #fff;
box-shadow: 0 8px 16px rgba(7,17,27,0.1);
border-radius: 12px;
color: #1c1f21;
font-size: 14px;
&.chapter-introduce
line-height: 28px;
&.chapter-item
.chapter-title
font-size: 16px;
line-height: 24px;
font-weight: 700;
.chapter-desc
margin-top: 2px;
margin-bottom: 16px;
font-size: 12px;
color: #545c63;
.term-item
width: 100%;
padding-left: 12px;
line-height: 48px;
cursor: pointer;
& > p
display: flex;
align-items: center;
& > span
&:nth-child(2)
flex: 1;
&:hover
background-color: rgba(242,13,13,.05);
border-radius: 4px;
color: #f20d0d;
.play
color: #f20d0d;
.right
& > i
color: #f20d0d!important;
.play
margin-right: 8px;
font-size: 24px;
color: #9199a1;
.right
margin-right:15px;
font-size: 16px;
color: #d9dde1;
.complete, .doning
color: #00b43c;
font-size: 12px;
.doning
i
margin-left: 10px;
font-size: 12px;
.complete-info
margin-bottom: 16px;
padding: 12px 0 12px 32px;
font-size: 16px;
color: #93999f;
line-height: 24px;
.iconfont
display: inline-block;
vertical-align: middle;
margin-right: 12px;
font-size: 24px;
</style>