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

merge...

...@@ -144,8 +144,7 @@ export default class CourseAction extends BaseACTION { ...@@ -144,8 +144,7 @@ export default class CourseAction extends BaseACTION {
case 2: str = '正在直播'; break case 2: str = '正在直播'; break
case 3: str = '直播结束'; break case 3: str = '直播结束'; break
case 4: str = '即将开始'; break case 4: str = '即将开始'; break
case 5: str = '直播未开始'; break case 5: str = '直播结束'; break
case 11: str = '直播结束'; break
default: str = '直播未开始' default: str = '直播未开始'
} }
// 5分钟内显示“即将开始”,5~1小时内“N分钟后开始”,1~24小时内“N小时后开始”,1天以上“N天后开始”天就显示年月日 // 5分钟内显示“即将开始”,5~1小时内“N分钟后开始”,1~24小时内“N小时后开始”,1天以上“N天后开始”天就显示年月日
......
...@@ -4,24 +4,24 @@ ...@@ -4,24 +4,24 @@
<div class="user-1"> <div class="user-1">
<img class="img-1" :src="avatar" /> <img class="img-1" :src="avatar" />
<div class="right-1"> <div class="right-1">
<div class="name-1">{{data.replier.nickname}}</div> <div class="name-1">{{ data.replier.nickname }}</div>
<div class="time-1">{{data.created_time}}</div> <div class="time-1">{{ data.created_time }}</div>
</div> </div>
</div> </div>
<div class="text" v-html="data.contents"></div> <div class="text" v-html="data.contents"></div>
<div class="user"> <div class="user">
<template v-if="data.mine"> <template v-if="data.mine">
<div <div class="right-txt" @click="deleteAnswer(data.id)">{{ $t('pages.learn.discussDetail.delete') }}</div>
class="right-txt"
@click="deleteAnswer(data.id)"
>{{ $t('pages.learn.discussDetail.delete') }}</div>
</template> </template>
<div class="right-txt" @click="$emit('reply', {answer_id: data.id})">{{ $t('pages.learn.discussDetail.reply') }}</div> <div class="right-txt" @click="$emit('reply', { answer_id: data.id })">
<div {{ $t('pages.learn.discussDetail.reply') }}
class="right-txt" </div>
@click="commentVisible = !commentVisible" <div class="right-txt" @click="commentVisible = !commentVisible">
>{{ $t('pages.learn.discussDetail.discuss') }}({{data.comments.length}})</div> {{ $t('pages.learn.discussDetail.discuss') }}({{ data.comments.length }})
<div class="right-txt" @click="$emit('btnlike', {tagId: data.tag ? data.tag.id : null, ansId: data.id})">点赞({{data.tag_count}})</div> </div>
<div class="right-txt" @click="$emit('btnlike', { tagId: data.tag ? data.tag.id : null, ansId: data.id })">
点赞({{ data.tag_count }})
</div>
</div> </div>
<template v-if="commentVisible"> <template v-if="commentVisible">
<!-- 评论列表 --> <!-- 评论列表 -->
...@@ -36,29 +36,34 @@ ...@@ -36,29 +36,34 @@
<script> <script>
import * as api from '../api/index.js' import * as api from '../api/index.js'
import replyItem from './replyItem.vue' import replyItem from './replyItem.vue'
import defaultAvatar from '../assets/images/person-default.jpg'
export default { export default {
components: { replyItem }, components: { replyItem },
props: { props: {
data: { type: Object, default: () => {} } data: { type: Object, default: () => {} }
}, },
data() { data() {
console.log(this.data)
return { return {
commentVisible: false commentVisible: false
} }
}, },
computed: { computed: {
avatar() { avatar() {
return this.data.replier.avatar || '../assets/images/person-default.jpg' return this.data.replier.avatar || defaultAvatar
} }
}, },
methods: { methods: {
deleteAnswer (id) { deleteAnswer(id) {
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)' })
api.deleteAnswer(id).then(json => { api
this.$emit('updateList') .deleteAnswer(id)
this.$message({ type: 'success', message: this.$t('pages.learn.discussDetail.deleteSuccess') }) .then(json => {
}).catch(e => { this.$message.error(e.message) }).finally(() => { loading.close() }) this.$emit('updateList')
this.$message({ type: 'success', message: this.$t('pages.learn.discussDetail.deleteSuccess') })
})
.finally(() => {
loading.close()
})
} }
} }
} }
......
...@@ -62,7 +62,13 @@ export default { ...@@ -62,7 +62,13 @@ export default {
} }
// zoom直播 // zoom直播
if (data.type === 8) { if (data.type === 8) {
window.open(data.live.record_url || data.live.join_url) const live = data.live
const hasRecordUrl = live.enable_record && live.record_url
if ([3, 5].includes(live.live_status) && !hasRecordUrl) {
this.$message.error('直播结束')
return
}
window.open(live.record_url || live.join_url)
return return
} }
// 课程大作业 // 课程大作业
......
...@@ -48,7 +48,7 @@ export default { ...@@ -48,7 +48,7 @@ export default {
}, },
// 是否直播结束 // 是否直播结束
isLiveEnd() { isLiveEnd() {
return this.live.live_status === 2 return [3, 5].includes(this.live.live_status)
}, },
// 是否有回放 // 是否有回放
hasRecord() { hasRecord() {
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
<li class="file-list-item" v-for="file in files" :key="file.id"> <li class="file-list-item" v-for="file in files" :key="file.id">
<a :href="file.file_url" target="_blank"> <a :href="file.file_url" target="_blank">
<i class="el-icon-document"></i> <i class="el-icon-document"></i>
<div v-html="file.file_name"></div> <div class="file-list-item__inner" v-html="file.file_name"></div>
</a> </a>
<!-- <span v-if="file.file_size">{{ file.file_size }}</span> --> <!-- <span v-if="file.file_size">{{ file.file_size }}</span> -->
<a :href="file.file_url" :download="file.file_name" target="_blank"> <a :href="file.file_url" :download="file.file_name" target="_blank">
...@@ -50,7 +50,6 @@ export default { ...@@ -50,7 +50,6 @@ export default {
align-items: center; align-items: center;
text-decoration: none; text-decoration: none;
color: #333; color: #333;
white-space: nowrap;
&:hover { &:hover {
color: #b49441; color: #b49441;
} }
...@@ -67,4 +66,7 @@ export default { ...@@ -67,4 +66,7 @@ export default {
text-align: center; text-align: center;
border-radius: 40px; border-radius: 40px;
} }
.file-list-item__inner {
margin: 0 10px !important;
}
</style> </style>
...@@ -253,8 +253,9 @@ export default { ...@@ -253,8 +253,9 @@ export default {
this.$message.error('尚未开通该课程的观看权限') this.$message.error('尚未开通该课程的观看权限')
return return
} }
if (this.newLiveMsg.live.type === 8) { const live = this.newLiveMsg.live
window.open(this.newLiveMsg.live.record_url || this.newLiveMsg.live.join_url) if (live.type === 8) {
window.open(live.record_url || live.join_url)
} else { } else {
this.$router.push({ this.$router.push({
name: 'viewerCourseChapter', name: 'viewerCourseChapter',
......
...@@ -596,7 +596,7 @@ export default { ...@@ -596,7 +596,7 @@ export default {
cAction.Player.getChapterList(cid, sid, _id).then(json => { cAction.Player.getChapterList(cid, sid, _id).then(json => {
this.live = (json.curJson && json.curJson.live) || {} this.live = (json.curJson && json.curJson.live) || {}
if (this.live.id) { if (this.live.id) {
if (this.live.live_status === 2 && this.live.enable_record && this.live.record_url) { if (this.live.live_status === 3 && this.live.enable_record && this.live.record_url) {
this.live.url = this.live.record_url this.live.url = this.live.record_url
} else { } else {
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
...@@ -645,8 +645,8 @@ export default { ...@@ -645,8 +645,8 @@ export default {
// cc直播 // cc直播
if (type === 5) { if (type === 5) {
const live = data.live const live = data.live
const status = live.live_status const hasRecordUrl = live.enable_record && live.record_url
if (status === 2 && !live.enable_record) { if ([3, 5].includes(live.live_status) && !hasRecordUrl) {
this.$message.error(live.statusStr) this.$message.error(live.statusStr)
return return
} }
...@@ -666,6 +666,12 @@ export default { ...@@ -666,6 +666,12 @@ export default {
} }
// zoom直播 // zoom直播
if (type === 8) { if (type === 8) {
const live = data.live
const hasRecordUrl = live.enable_record && live.record_url
if ([3, 5].includes(live.live_status) && !hasRecordUrl) {
this.$message.error(live.statusStr)
return
}
window.open(data.live.record_url || data.live.join_url) window.open(data.live.record_url || data.live.join_url)
return return
} }
......
...@@ -132,41 +132,31 @@ export default { ...@@ -132,41 +132,31 @@ export default {
return return
} }
data.live_status = parseInt(data.live_status) data.live_status = parseInt(data.live_status)
const { live_status: liveStatus, type: liveType = 5, start_time: liveTime } = data const { live_status: liveStatus, type: liveType } = data
let message = this.calcTimeText(liveTime, liveStatus) const hasRecordUrl = data.enable_record && data.record_url
if (liveStatus === 2 && !data.enable_record) { if ([3, 5].includes(liveStatus) && !hasRecordUrl) {
message = this.$t('live.noPlayback')
this.message && this.message.close() this.message && this.message.close()
this.message = this.$message({ type: 'warning', offset: 0, message }) this.message = this.$message({ type: 'warning', offset: 0, message: this.$t('live.liveEnd') })
return
}
if (liveType === 'cloud') {
// 打开云课堂
this.openCloudClass(data, message)
return return
} }
if (liveType === 5) { if (liveType === 5) {
// 打开云直播 // 打开云直播
this.openCloudLive(data, message) this.openCloudLive(data)
return return
} }
if (liveType === 'meeting') { if (liveType === 'cloud') {
// 打开腾讯会议 // 打开云课堂
this.openMeeting(data, message) this.openCloudClass(data)
return return
} }
this.openNewWindow(data.record_url || data.join_url) this.openNewWindow(data.record_url || data.join_url)
}, },
// 打开云课堂 // 打开云课堂
openCloudClass(data, message) { openCloudClass(data) {
// https://doc.bokecc.com/class/developer/api/login.html // https://doc.bokecc.com/class/developer/api/login.html
const liveStatus = data.live_status const liveStatus = data.live_status
data.user_name = data.user_name || window.G.UserInfo.student_info.personal_name data.user_name = data.user_name || window.G.UserInfo.student_info.personal_name
if (liveStatus === 1) { if (liveStatus === 3) {
// 进行中
const url = `http://view.csslcloud.net/api/view/index?roomid=${data.room_id}&userid=${data.account_id}&autoLogin=true&viewername=${data.username}&viewertoken=${data.password}`
this.openNewWindow(url)
} else if (liveStatus === 2) {
// 查看回放 // 查看回放
const replayUrl = data.record_url.replayUrl const replayUrl = data.record_url.replayUrl
const url = replayUrl const url = replayUrl
...@@ -174,17 +164,17 @@ export default { ...@@ -174,17 +164,17 @@ export default {
: '' : ''
this.openNewWindow(url) this.openNewWindow(url)
} else { } else {
this.message && this.message.close() // 进行中
this.message = this.$message({ type: 'warning', offset: 0, message }) const url = `http://view.csslcloud.net/api/view/index?roomid=${data.room_id}&userid=${data.account_id}&autoLogin=true&viewername=${data.username}&viewertoken=${data.password}`
this.openNewWindow(url)
} }
}, },
// 打开云直播 // 打开云直播
openCloudLive(data, message) { openCloudLive(data) {
// https://doc.bokecc.com/live/Appendix_1.html // https://doc.bokecc.com/live/Appendix_1.html
const liveStatus = data.live_status const liveStatus = data.live_status
data.user_name = data.user_name || this.nickName data.user_name = data.user_name || this.nickName
if (liveStatus === 2 && data.enable_record === 1) { if (liveStatus === 3) {
// enable_record 0:不启用回放 1:开启回放
// 查看回放 // 查看回放
// const url = `https://view.csslcloud.net/api/view/callback?recordid=${data.record_id}&roomid=${data.room_id}&userid=${data.account_id}&autoLogin=true&viewername=${data.user_name}&viewertoken=${data.play_pass}` // const url = `https://view.csslcloud.net/api/view/callback?recordid=${data.record_id}&roomid=${data.room_id}&userid=${data.account_id}&autoLogin=true&viewername=${data.user_name}&viewertoken=${data.play_pass}`
this.openNewWindow(data.record_url) this.openNewWindow(data.record_url)
...@@ -194,15 +184,6 @@ export default { ...@@ -194,15 +184,6 @@ export default {
this.openNewWindow(url) this.openNewWindow(url)
} }
}, },
// 打开腾讯会议
openMeeting(data, message) {
if (data.join_url) {
this.openNewWindow(data.join_url)
} else {
this.message && this.message.close()
this.message = this.$message({ type: 'warning', offset: 0, message })
}
},
// 新窗口打开 // 新窗口打开
openNewWindow(url) { openNewWindow(url) {
url && window.open(url, '_blank') url && window.open(url, '_blank')
...@@ -214,8 +195,7 @@ export default { ...@@ -214,8 +195,7 @@ export default {
2: this.$t('live.liveStreaming'), 2: this.$t('live.liveStreaming'),
3: this.$t('live.liveEnd'), 3: this.$t('live.liveEnd'),
4: this.$t('live.start'), 4: this.$t('live.start'),
5: this.$t('live.notStarted'), 5: this.$t('live.liveEnd')
11: this.$t('live.liveEnd')
} }
let result = map[liveStatus] || liveTime let result = map[liveStatus] || liveTime
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论