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

bug fixes

上级 5af815e0
module.exports = { module.exports = {
demain: 'dev.ezijing.com', demain: 'dev.ezijing.com',
url: 'https://wmp-learning.ezijing.com/api', url: 'https://wmp-learning2.ezijing.com/api',
apiBaseURL: '/', apiBaseURL: '/',
others: { others: {
url: '/login/is-login' url: '/login/is-login'
......
...@@ -5,14 +5,7 @@ export default class Before { ...@@ -5,14 +5,7 @@ export default class Before {
const UA = navigator.userAgent const UA = navigator.userAgent
this.opt = opt || {} this.opt = opt || {}
// 免登录列表 // 免登录列表
this.whiteList = [ this.whiteList = ['login-normal', 'login-code', 'login-forget', 'studentHelp', 'teacherHelp', 'login-register']
'login-normal',
'login-code',
'login-forget',
'studentHelp',
'teacherHelp',
'login-register'
]
this.isMobile = /android|iphone|ipad|ipod/i.test(UA) this.isMobile = /android|iphone|ipad|ipod/i.test(UA)
} }
...@@ -46,7 +39,6 @@ export default class Before { ...@@ -46,7 +39,6 @@ export default class Before {
.then(([p1, p2]) => { .then(([p1, p2]) => {
const res = { student_info: p1, ...p2.data } const res = { student_info: p1, ...p2.data }
if (res.id) { if (res.id) {
console.log(111, p1)
window.G.UserInfo = res window.G.UserInfo = res
return true return true
} else { } else {
......
...@@ -81,7 +81,7 @@ ...@@ -81,7 +81,7 @@
size="small" size="small"
round round
@click="goCourseContent(item)" @click="goCourseContent(item)"
v-show="canOpenCourse(item)" v-show="canOpenCourse(item.id)"
>{{ $t('pages.learn.course.showCourse') }}</el-button> >{{ $t('pages.learn.course.showCourse') }}</el-button>
</div> </div>
</li> </li>
...@@ -133,7 +133,6 @@ export default { ...@@ -133,7 +133,6 @@ export default {
}, },
mounted() { mounted() {
this.userInfo = UserInfo this.userInfo = UserInfo
console.log(this.userInfo, '=====')
if (this.timeInterval) { if (this.timeInterval) {
clearInterval(this.timeInterval) clearInterval(this.timeInterval)
this.timeInterval = null this.timeInterval = null
...@@ -162,10 +161,10 @@ export default { ...@@ -162,10 +161,10 @@ export default {
}, },
methods: { methods: {
// 是否可以打开课程详情 // 是否可以打开课程详情
canOpenCourse(data) { canOpenCourse(courseId) {
if (this.userInfo.is_open_course) { if (this.userInfo.is_open_course) {
const ids = this.userInfo.open_course_id || [] const ids = this.userInfo.open_course_id || []
return ids.includes(data.id) return ids.includes(courseId)
} }
return true return true
}, },
...@@ -173,7 +172,7 @@ export default { ...@@ -173,7 +172,7 @@ export default {
this.$router.push({ path: '/app/learn/course-all' }) this.$router.push({ path: '/app/learn/course-all' })
}, },
goCourseContent(data) { goCourseContent(data) {
if (this.canOpenCourse(data)) { if (this.canOpenCourse(data.id)) {
this.$router.push({ path: `/app/learn/course-detail/${data.id}?v=${this.homeList[0].course_type}` }) this.$router.push({ path: `/app/learn/course-detail/${data.id}?v=${this.homeList[0].course_type}` })
} }
}, },
...@@ -250,13 +249,7 @@ export default { ...@@ -250,13 +249,7 @@ export default {
}, },
/* 直接进直播 */ /* 直接进直播 */
goLive() { goLive() {
console.log(333, this.userInfo) if (this.canOpenCourse(this.newLiveMsg.course_id)) {
let flag = true
if (this.userInfo.is_open_course) {
const ids = this.userInfo.open_course_id || []
flag = ids.includes(this.newLiveMsg.live.id)
}
if (flag) {
this.$router.push({ path: `/player/${this.newLiveMsg.course_id}/live/${this.newLiveMsg.live.id}` }) this.$router.push({ path: `/player/${this.newLiveMsg.course_id}/live/${this.newLiveMsg.live.id}` })
} else { } else {
this.$message.error('尚未开通该课程的观看权限') this.$message.error('尚未开通该课程的观看权限')
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
<div class="logout" @click="logout">{{$t('components.learnSysLayout.sideBar.outLogin')}}</div> <div class="logout" @click="logout">{{$t('components.learnSysLayout.sideBar.outLogin')}}</div>
</div> </div>
</div> </div>
<div class="hint" v-if="latest" @click="onClick(latest.live)"> <div class="hint" v-if="latest" @click="onClick(latest.live, latest.course_id)">
<div class="left"> <div class="left">
<div class="left-1">{{$t('live.liveReminder')}}</div> <div class="left-1">{{$t('live.liveReminder')}}</div>
<div <div
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
class="live-item" class="live-item"
:key="subitem.id" :key="subitem.id"
v-for="subitem in item.live" v-for="subitem in item.live"
@click="onClick(subitem)" @click="onClick(subitem, item.course_id)"
> >
<h4 class="live-item-name">{{item.course_name}}</h4> <h4 class="live-item-name">{{item.course_name}}</h4>
<div class="live-item-main"> <div class="live-item-main">
...@@ -115,7 +115,7 @@ export default { ...@@ -115,7 +115,7 @@ export default {
}) })
}, },
dealRender: () => { dealRender: () => {
;(function(win, doc) { ;(function (win, doc) {
const wWidth = const wWidth =
win.screen.width > 0 win.screen.width > 0
? win.innerWidth >= win.screen.width || win.innerWidth === 0 ? win.innerWidth >= win.screen.width || win.innerWidth === 0
...@@ -127,23 +127,18 @@ export default { ...@@ -127,23 +127,18 @@ export default {
doc.documentElement.style.fontSize = wFsize + 'px' doc.documentElement.style.fontSize = wFsize + 'px'
})(window, document) })(window, document)
}, },
onClick(data) { onClick(data, courseId) {
const userInfo = window.G.UserInfo.student_info || {} const userInfo = window.G.UserInfo.student_info || {}
console.log(222, userInfo)
let flag = true let flag = true
if (userInfo.is_open_course) { if (userInfo.is_open_course) {
const ids = userInfo.open_course_id || [] const ids = userInfo.open_course_id || []
flag = ids.includes(data.id) flag = ids.includes(courseId)
} }
if (!flag) { if (!flag) {
this.$message.error('尚未开通该课程的观看权限') this.$message.error('尚未开通该课程的观看权限')
return return
} }
const { const { live_status: liveStatus, live_type: liveType = 'live', start_time: liveTime } = data
live_status: liveStatus,
live_type: liveType = 'live',
start_time: liveTime
} = data
let message = this.calcTimeText(liveTime, liveStatus) let message = this.calcTimeText(liveTime, liveStatus)
if (liveStatus === 103 && data.enable_record !== 1) { if (liveStatus === 103 && data.enable_record !== 1) {
message = this.$t('live.noPlayback') message = this.$t('live.noPlayback')
...@@ -179,8 +174,7 @@ export default { ...@@ -179,8 +174,7 @@ export default {
openCloudClass(data, message) { openCloudClass(data, message) {
// 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.viewer_name = data.viewer_name = data.viewer_name || window.G.UserInfo.student_info.personal_name
data.viewer_name || window.G.UserInfo.student_info.personal_name
if (liveStatus === 1) { if (liveStatus === 1) {
// 进行中 // 进行中
const url = `http://view.csslcloud.net/api/view/index?roomid=${data.room_id}&userid=${data.user_id}&autoLogin=true&viewername=${data.username}&viewertoken=${data.password}` const url = `http://view.csslcloud.net/api/view/index?roomid=${data.room_id}&userid=${data.user_id}&autoLogin=true&viewername=${data.username}&viewertoken=${data.password}`
...@@ -243,8 +237,7 @@ export default { ...@@ -243,8 +237,7 @@ export default {
if (liveStatus === 0 && liveTime) { if (liveStatus === 0 && liveTime) {
liveTime = liveTime.replace(/-/g, '/') liveTime = liveTime.replace(/-/g, '/')
const time = const time = (new Date(liveTime).getTime() - new Date().getTime()) / 1000 || 0
(new Date(liveTime).getTime() - new Date().getTime()) / 1000 || 0
if (time <= 5 * 60) { if (time <= 5 * 60) {
result = this.$t('live.start') result = this.$t('live.start')
} else if (time <= 1 * 60 * 60) { } else if (time <= 1 * 60 * 60) {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论