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

bug fixes

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