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

对接直播bug修复

上级 486ad978
......@@ -139,13 +139,16 @@ export default class CourseAction extends BaseACTION {
__.live.live_status = parseInt(__.live.live_status)
let str = ''
switch (__.live.live_status) {
case 0: str = '直播未开始'; break
case 1: str = '正在直播'; break
case 2: str = '直播结束'; break
case 1: str = '直播未开始'; break
case 2: str = '正在直播'; break
case 3: str = '直播结束'; break
case 4: str = '即将开始'; break
case 5: str = '直播未开始'; break
case 11: str = '直播结束'; break
default: str = '直播未开始'
}
// 5分钟内显示“即将开始”,5~1小时内“N分钟后开始”,1~24小时内“N小时后开始”,1天以上“N天后开始”天就显示年月日
if (__.live.live_status === 0 && __.live.start_time) {
if (__.live.live_status === 1 && __.live.start_time) {
const time = (new Date(__.live.start_time).getTime() - new Date().getTime()) / 1000
if (time <= 5 * 60) {
str = '即将开始'
......@@ -157,7 +160,7 @@ export default class CourseAction extends BaseACTION {
str = parseInt(time / (24 * 60 * 60)) + '天后开始'
}
}
if (__.live.live_status === 2 && __.live.enable_record && __.live.record_url) {
if (__.live.live_status === 3 && __.live.enable_record && __.live.record_url) {
str = '观看回放'
}
__.live.statusStr = str
......
......@@ -50,7 +50,7 @@
<div v-bind:key="index1" :class='["body", (item1.id === tabs[1].chapterList.currentChapterId && "on")]'>
<div class='name' :data-vid='item1.vid' :data-cid='item1.cid' :data-sid='item1.sid' :data-hasVA='item1.time' :data-type="item1.video_provider" :data-name='item1.name' :data-index='index' :data-count='index1' @click='jumpToOtherVA(item1)'>
{{item1.name}}
<template v-if='item1.type === 5'>
<template v-if='[5,8].includes(item1.type)'>
<div class='time'>{{ item1.live.start_time }} {{ item1.live.statusStr }}</div>
</template>
<template v-else>
......
......@@ -144,14 +144,7 @@ export default {
this.openMeeting(data, message)
return
}
// 其他直播类型直接打开
if (liveStatus === 1) {
// 进行中
this.openNewWindow(data.join_url)
} else if (liveStatus === 2) {
// 查看回放
this.openNewWindow(data.record_url)
}
this.openNewWindow(data.record_url || data.join_url)
},
// 打开云课堂
openCloudClass(data, message) {
......@@ -206,13 +199,16 @@ export default {
// 计算日期
calcTimeText(liveTime, liveStatus) {
const map = {
0: this.$t('live.notStarted'),
1: this.$t('live.liveStreaming'),
2: this.$t('live.liveEnd')
1: this.$t('live.notStarted'),
2: this.$t('live.liveStreaming'),
3: this.$t('live.liveEnd'),
4: this.$t('live.start'),
5: this.$t('live.notStarted'),
11: this.$t('live.liveEnd')
}
let result = map[liveStatus] || liveTime
if (liveStatus === 0 && liveTime) {
if (liveStatus === 1 && liveTime) {
liveTime = liveTime.replace(/-/g, '/')
const time = (new Date(liveTime).getTime() - new Date().getTime()) / 1000 || 0
if (time <= 5 * 60) {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论