提交 b8db9b6c authored 作者: lihuihui's avatar lihuihui

fix:修改bug

上级 349cea5c
...@@ -209,7 +209,7 @@ export default { ...@@ -209,7 +209,7 @@ export default {
.el-submenu__title { .el-submenu__title {
height: 50px; height: 50px;
line-height: 50px; line-height: 50px;
padding-left: 25px !important; // padding-left: 25px !important;
} }
.el-menu-item:hover, .el-menu-item:hover,
.el-menu-item:focus { .el-menu-item:focus {
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
<div class="name">{{ subItem.name }}</div> <div class="name">{{ subItem.name }}</div>
<div class="duration">{{ subItem.duration }}</div> <div class="duration">{{ subItem.duration }}</div>
<div class="progress" v-if="showProgress && subItem.type === 2"> <div class="progress" v-if="showProgress && subItem.type === 2">
{{ progressText(subItem.video_progress) }} {{ formatDuration(subItem.video.video_length) }}
</div> </div>
<div class="buttons" v-if="subItem.type === 9"> <div class="buttons" v-if="subItem.type === 9">
<el-button round size="mini" v-if="subItem.status === 100" @click="toExamPage(subItem, 1)"> <el-button round size="mini" v-if="subItem.status === 100" @click="toExamPage(subItem, 1)">
...@@ -85,6 +85,17 @@ export default { ...@@ -85,6 +85,17 @@ export default {
}, },
handleDownload(item) { handleDownload(item) {
window.location.href = item.file_url window.location.href = item.file_url
},
formatDuration(duration) {
const h = Math.floor(duration / 3600)
const m = Math.floor((duration - h * 3600) / 60)
const s = (duration - h * 3600 - m * 60) % 60
function tenify(a) {
return a >= 10 ? a : '0' + a
}
const to = { h: tenify(h), m: tenify(m), s: tenify(s) }
const format = 'h:m:s'
return format.replace(/h|m|s/g, k => to[k]).replace(/^00:/, '')
} }
} }
} }
......
...@@ -3,7 +3,6 @@ ...@@ -3,7 +3,6 @@
</template> </template>
<script> <script>
import * as api from '@/api/course.js'
import CourseList from '@/components/CourseList.vue' import CourseList from '@/components/CourseList.vue'
export default { export default {
......
...@@ -11,7 +11,7 @@ VueRouter.prototype.push = function push(location, onResolve, onReject) { ...@@ -11,7 +11,7 @@ VueRouter.prototype.push = function push(location, onResolve, onReject) {
const routes = [ const routes = [
{ path: '*', redirect: '/index' }, { path: '*', redirect: '/index' },
{ path: '/', redirect: '/course/learn' } { path: '/', redirect: '/notice' }
] ]
const router = new VueRouter({ const router = new VueRouter({
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论