提交 53523e60 authored 作者: 王鹏飞's avatar 王鹏飞

修复课程开始学习跳转错误的问题

上级 ff6af890
...@@ -4,16 +4,14 @@ ...@@ -4,16 +4,14 @@
<div class="detail-box"> <div class="detail-box">
<div class="box-thd"> <div class="box-thd">
<div class="title" @click="noWantThisCourse">{{headerInfo.title}} <div class="title" @click="noWantThisCourse">{{headerInfo.title}}
<template v-if="tabs[1].chapterList.course[0].chapters[0].vid"> <template v-if='headerInfo.isStart && tabs[1].chapterList.currentChapterId'>
<template v-if='headerInfo.isStart && tabs[1].chapterList.currentChapterId'> <el-button class="rbtn" type="primary" size="mini" @click='startLearn' :data-cid='cid' :data-sid='sid' :data-type='tabs[1].chapterList.currentVideoProvider' :data-vid='tabs[1].chapterList.currentChapterId'>继续学习</el-button>
<el-button class="rbtn" type="primary" size="mini" @click='startLearn' :data-cid='cid' :data-sid='sid' :data-type='tabs[1].chapterList.currentVideoProvider' :data-vid='tabs[1].chapterList.currentChapterId'>继续学习</el-button> </template>
</template> <template v-else-if='headerInfo.isStart'>
<template v-else-if='headerInfo.isStart'> <el-button class="rbtn" type="primary" size="mini" @click='startLearn' :data-cid='cid' :data-sid='sid' :data-type='firstVideo.video_provider' :data-vid='firstVideo.vid'>开始学习</el-button>
<el-button class="rbtn" type="primary" size="mini" @click='startLearn' :data-cid='cid' :data-sid='sid' :data-type='tabs[1].chapterList.course[0].chapters[0].video_provider' :data-vid='tabs[1].chapterList.course[0].chapters[0].vid'>开始学习</el-button> </template>
</template> <template v-else>
<template v-else> <el-button class="rbtn" type="primary" size="mini" @click='wantThisCourse'>选课</el-button>
<el-button class="rbtn" type="primary" size="mini" @click='wantThisCourse'>选课</el-button>
</template>
</template> </template>
</div> </div>
<div class="tags"> <div class="tags">
...@@ -352,7 +350,8 @@ export default { ...@@ -352,7 +350,8 @@ export default {
isOpenNewTabFlag: false, isOpenNewTabFlag: false,
arrFn: [], arrFn: [],
cloudClassUrls: {}, cloudClassUrls: {},
timeHeart: null timeHeart: null,
firstVideo: {}
} }
}, },
mounted () { mounted () {
...@@ -376,6 +375,23 @@ export default { ...@@ -376,6 +375,23 @@ export default {
this.tabs[0].content = json.tabs0Content this.tabs[0].content = json.tabs0Content
this.tabs[1].chapterList = json.tabs1ChapterList this.tabs[1].chapterList = json.tabs1ChapterList
json.tabs3richTest && (this.tabs[3].richText = json.tabs3richTest) json.tabs3richTest && (this.tabs[3].richText = json.tabs3richTest)
// 设置开始学习的视频
const courseList = json.tabs1ChapterList.course
for (let i = 0; i < courseList.length; i++) {
const children = courseList[i].chapters || []
if (this.firstVideo && this.firstVideo.vid) {
break
}
for (let k = 0; k < children.length; k++) {
const item = children[k]
if (item.vid && item.video_provider) {
this.firstVideo = item
break
}
}
}
cAction.Course.getCourseAssess(this.cid, this.sid).then(json1 => { cAction.Course.getCourseAssess(this.cid, this.sid).then(json1 => {
const _courseArr = json.tabs1ChapterList.course const _courseArr = json.tabs1ChapterList.course
/* 进行一次 对照,将 视频 vid 赋值 */ /* 进行一次 对照,将 视频 vid 赋值 */
...@@ -393,7 +409,6 @@ export default { ...@@ -393,7 +409,6 @@ export default {
} }
} }
} }
this.tabs[3].assess = json1 this.tabs[3].assess = json1
loading.close() loading.close()
}).catch(e => { this.$message.error(e.message) }).finally(() => { }) }).catch(e => { this.$message.error(e.message) }).finally(() => { })
...@@ -620,7 +635,11 @@ export default { ...@@ -620,7 +635,11 @@ export default {
const cid = _data.cid const cid = _data.cid
const vid = _data.vid const vid = _data.vid
const type = _data.type const type = _data.type
this.$router.push({ path: `/player/${sid}/${cid}/chapter-video/${vid}/${type}` }) if (vid && type !== '') {
this.$router.push({ path: `/player/${sid}/${cid}/chapter-video/${vid}/${type}` })
} else {
this.$message.error('当前暂无点播课程')
}
}, },
/** /**
* 退课 - 隐藏功能,点击 标题15次,进行退课 * 退课 - 隐藏功能,点击 标题15次,进行退课
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论