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

bug fixes

上级 bda57728
...@@ -111,6 +111,7 @@ export default class CourseAction extends BaseACTION { ...@@ -111,6 +111,7 @@ export default class CourseAction extends BaseACTION {
currentVideoProvider: cur.latest_play_type || '1', currentVideoProvider: cur.latest_play_type || '1',
course: cur.chapters.map((_, i) => { course: cur.chapters.map((_, i) => {
return { return {
id: _.id,
title: _.name, title: _.name,
isUp: true, isUp: true,
chapters: _.children.map((__, j) => { chapters: _.children.map((__, j) => {
......
...@@ -527,17 +527,12 @@ export default { ...@@ -527,17 +527,12 @@ export default {
}, },
updatePages () { updatePages () {
cAction.Course.getCourseDetail(this.cid, this.sid).then(json => { cAction.Course.getCourseDetail(this.cid, this.sid).then(json => {
// this.tabs[1].chapterList = json.tabs1ChapterList
/* 更新直播状态 */ /* 更新直播状态 */
const course = json.tabs1ChapterList.course this.tabs[1].chapterList.course = json.tabs1ChapterList.course.map(item => {
for (let i = 0; i < course.length; i++) { const found = this.tabs[1].chapterList.course.find(rawItem => rawItem.id === item.id)
const chapters = course[i].chapters item.isUp = found ? found.isUp : item.isUp
for (let j = 0; j < chapters.length; j++) { return item
if (chapters[j].type === 5) { })
this.tabs[1].chapterList.course[i].chapters[j].live = chapters[j].live
}
}
}
}) })
// 暂不处理,新增章节不能实时更新,需要手动刷新 // 暂不处理,新增章节不能实时更新,需要手动刷新
// .catch(e => { this.$message.error(e.message) }).finally(() => { }) // .catch(e => { this.$message.error(e.message) }).finally(() => { })
......
...@@ -98,9 +98,10 @@ export default { ...@@ -98,9 +98,10 @@ export default {
this.dataList = response.data this.dataList = response.data
} }
}) })
.catch(e => { // 取消报错提醒
this.$message.error(e.message) // .catch(e => {
}) // this.$message.error(e.message)
// })
.finally(() => { .finally(() => {
if (this.loading) { if (this.loading) {
this.loading.close() this.loading.close()
...@@ -262,7 +263,7 @@ export default { ...@@ -262,7 +263,7 @@ export default {
this.timer = setInterval(() => { this.timer = setInterval(() => {
this.getNewLiveMsg() this.getNewLiveMsg()
this.getLiveList() this.getLiveList()
}, 3000) }, 10000)
}, },
beforeDestroy() { beforeDestroy() {
this.timer && clearInterval(this.timer) this.timer && clearInterval(this.timer)
......
...@@ -50,18 +50,18 @@ export default { ...@@ -50,18 +50,18 @@ export default {
const loading = this.$loading({ lock: true, text: '', spinner: '', background: 'rgba(255, 255, 255, 0.9)' }) const loading = this.$loading({ lock: true, text: '', spinner: '', background: 'rgba(255, 255, 255, 0.9)' })
cAction.Player.getChapterList(this.cid, this.sid, this.id).then(json => { cAction.Player.getChapterList(this.cid, this.sid, this.id).then(json => {
this.live = (json.curJson && json.curJson.live) || {} this.live = (json.curJson && json.curJson.live) || {}
this.$emit('changeSideBar', '')
setTimeout(() => {
if (window.document.getElementById('switch-btn')) {
window.document.getElementById('switch-btn').style.display = 'none'
window.document.getElementById('sys-help').style.display = 'block'
window.document.getElementById('sys-callback').style.display = 'block'
}
}, 1000)
if (this.live.id) { if (this.live.id) {
if (this.live.record_id && this.live.live_status === 103) { if (this.live.record_id && this.live.live_status === 103) {
this.live.url = 'https://view.csslcloud.net/api/view/callback?recordid=' + this.live.record_id + '&roomid=' + this.live.room_id + '&userid=' + this.live.user_id + '&autoLogin=true&viewername=' + this.live.viewer_name + '&viewertoken=' + this.live.viewer_token // + '&groupid=xxx' this.live.url = 'https://view.csslcloud.net/api/view/callback?recordid=' + this.live.record_id + '&roomid=' + this.live.room_id + '&userid=' + this.live.user_id + '&autoLogin=true&viewername=' + this.live.viewer_name + '&viewertoken=' + this.live.viewer_token // + '&groupid=xxx'
} else { } else {
this.$emit('changeSideBar', '')
setTimeout(() => {
if (window.document.getElementById('switch-btn')) {
window.document.getElementById('switch-btn').style.display = 'none'
window.document.getElementById('sys-help').style.display = 'block'
window.document.getElementById('sys-callback').style.display = 'block'
}
}, 1000)
this.live.viewer_name = window.G.UserInfo.student_info.personal_name || window.G.UserInfo.nickname this.live.viewer_name = window.G.UserInfo.student_info.personal_name || window.G.UserInfo.nickname
this.live.url = 'https://view.csslcloud.net/api/view/index?roomid=' + this.live.room_id + '&userid=' + this.live.user_id + '&autoLogin=true&viewername=' + this.live.viewer_name + '&viewertoken=' + this.live.viewer_token // + '&groupid=xxx' this.live.url = 'https://view.csslcloud.net/api/view/index?roomid=' + this.live.room_id + '&userid=' + this.live.user_id + '&autoLogin=true&viewername=' + this.live.viewer_name + '&viewertoken=' + this.live.viewer_token // + '&groupid=xxx'
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论