Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
L
learn-online-pc
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
EzijingWeb
learn-online-pc
Commits
a46280ad
提交
a46280ad
authored
7月 23, 2021
作者:
pengxiaohui
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
feat: 增加签到功能
上级
88878544
隐藏空白字符变更
内嵌
并排
正在显示
5 个修改的文件
包含
101 行增加
和
5 行删除
+101
-5
PlayerAction.js
src/action/PlayerAction.js
+2
-0
player_api.js
src/api/player_api.js
+5
-0
course.vue
src/pages/learn/course.vue
+27
-1
courseDetail.vue
src/pages/learn/courseDetail.vue
+32
-1
list.vue
src/pages/mobile/list.vue
+35
-3
没有找到文件。
src/action/PlayerAction.js
浏览文件 @
a46280ad
...
@@ -326,6 +326,8 @@ export default class PlayerAction extends BaseACTION {
...
@@ -326,6 +326,8 @@ export default class PlayerAction extends BaseACTION {
updateCourseHomework
(
sid
,
cid
,
obj
)
{
return
Player
.
updateCourseHomework
(
sid
,
cid
,
obj
).
then
(
res
=>
res
)
}
updateCourseHomework
(
sid
,
cid
,
obj
)
{
return
Player
.
updateCourseHomework
(
sid
,
cid
,
obj
).
then
(
res
=>
res
)
}
/* 提交课程考核 */
/* 提交课程考核 */
updateSurveyAnswer
(
obj
)
{
return
Player
.
updateSurveyAnswer
(
obj
).
then
(
res
=>
res
)
}
updateSurveyAnswer
(
obj
)
{
return
Player
.
updateSurveyAnswer
(
obj
).
then
(
res
=>
res
)
}
/* 签到 */
signIn
(
id
)
{
return
Player
.
signIn
(
id
).
then
(
res
=>
res
)
}
/* 获取当前最新直播提醒 */
/* 获取当前最新直播提醒 */
getNewLiveMsg
()
{
return
Player
.
getNewLiveMsg
().
then
(
res
=>
res
)
}
getNewLiveMsg
()
{
return
Player
.
getNewLiveMsg
().
then
(
res
=>
res
)
}
/* 获取手机直播列表 */
/* 获取手机直播列表 */
...
...
src/api/player_api.js
浏览文件 @
a46280ad
...
@@ -112,6 +112,11 @@ export default class PlayerAPI extends BaseAPI {
...
@@ -112,6 +112,11 @@ export default class PlayerAPI extends BaseAPI {
updateSurveyAnswer
=
obj
=>
updateSurveyAnswer
=
obj
=>
this
.
post
(
'/api/lms-ep/v2/education/survey/answer'
,
obj
,
{
headers
:
{
'Content-Type'
:
'application/json'
}
})
this
.
post
(
'/api/lms-ep/v2/education/survey/answer'
,
obj
,
{
headers
:
{
'Content-Type'
:
'application/json'
}
})
/**
* 签到
*/
signIn
=
(
id
=
''
)
=>
this
.
post
(
`/api/lms-ep/v2/education/lives/sign/
${
id
}
`
,
{})
/**
/**
* 手机端 获取实时最新直播接口
* 手机端 获取实时最新直播接口
*/
*/
...
...
src/pages/learn/course.vue
浏览文件 @
a46280ad
...
@@ -4,7 +4,8 @@
...
@@ -4,7 +4,8 @@
<div
class=
"live-msg"
>
<div
class=
"live-msg"
>
<div
class=
"txt"
>
直播提醒:
</div>
<div
class=
"txt"
>
直播提醒:
</div>
<div
class=
"txt"
>
您的直播课程 《
{{
newLiveMsg
.
course_name
}}
》 将于
{{
newLiveMsg
.
live
.
start_time
}}
开始
</div>
<div
class=
"txt"
>
您的直播课程 《
{{
newLiveMsg
.
course_name
}}
》 将于
{{
newLiveMsg
.
live
.
start_time
}}
开始
</div>
<el-button
class=
"in-btn"
type=
"primary"
size=
"small"
round
@
click=
"goLive"
>
进入直播
</el-button>
<el-button
v-if=
"[-1, 0].includes(newLiveMsg.live.sign_status)"
class=
"in-btn"
type=
"primary"
size=
"small"
round
@
click=
"handleSignIn(newLiveMsg.live.sign_status)"
>
签到
</el-button>
<el-button
v-else
class=
"in-btn"
type=
"primary"
size=
"small"
round
@
click=
"goLive"
>
进入直播
</el-button>
</div>
</div>
</
template
>
</
template
>
<!-- <div class="con-title">{{ $t('pages.learn.course.title') }}</div> -->
<!-- <div class="con-title">{{ $t('pages.learn.course.title') }}</div> -->
...
@@ -161,6 +162,13 @@ export default {
...
@@ -161,6 +162,13 @@ export default {
}
}
},
},
methods
:
{
methods
:
{
handleSignIn
(
status
)
{
if
(
status
===
-
1
)
{
this
.
$message
.
error
(
'直播未开始,请提前10分钟进入签到'
)
}
else
if
(
status
===
0
)
{
this
.
fetchSignIn
()
}
},
// 是否可以打开课程详情
// 是否可以打开课程详情
canOpenCourse
(
courseId
)
{
canOpenCourse
(
courseId
)
{
if
(
this
.
userInfo
.
is_open_course
)
{
if
(
this
.
userInfo
.
is_open_course
)
{
...
@@ -278,6 +286,24 @@ export default {
...
@@ -278,6 +286,24 @@ export default {
.
catch
(
e
=>
{
.
catch
(
e
=>
{
this
.
$message
.
error
(
e
.
message
)
this
.
$message
.
error
(
e
.
message
)
})
})
},
fetchSignIn
()
{
const
id
=
this
.
newLiveMsg
.
live
.
id
||
''
cAction
.
Player
.
signIn
(
id
)
.
then
(
res
=>
{
const
{
code
,
status
}
=
res
if
(
code
===
0
)
{
if
(
status
===
1
)
{
this
.
$message
.
success
(
'签到成功'
)
}
else
if
(
status
===
2
)
{
this
.
$message
.
success
(
'课程已开始,您已迟到,请于课后补看错过视频'
)
}
this
.
getLatestLive
()
}
})
.
catch
(
e
=>
{
this
.
$message
.
error
(
e
.
message
||
'签到失败'
)
})
}
}
}
}
}
}
...
...
src/pages/learn/courseDetail.vue
浏览文件 @
a46280ad
...
@@ -88,7 +88,14 @@
...
@@ -88,7 +88,14 @@
>
>
{{
item1
.
name
}}
{{
item1
.
name
}}
<template
v-if=
"[5, 8].includes(item1.type)"
>
<template
v-if=
"[5, 8].includes(item1.type)"
>
<div
class=
"time"
>
{{
item1
.
live
.
start_time
}}
{{
item1
.
live
.
statusStr
}}
</div>
<div
class=
"time"
v-if=
"item1.type === 5"
>
<template>
{{
item1
.
live
.
start_time
}}
{{
item1
.
live
.
statusStr
}}
<el-button
v-if=
"[-1, 0].includes(item1.live.sign_status)"
class=
"in-btn"
type=
"primary"
size=
"mini"
round
@
click=
"handleSignIn(item1.live.sign_status)"
>
签到
</el-button>
<el-tag
v-if=
"[3, 5].includes(item1.live.live_status) && [2, 3].includes(item1.live.sign_status)"
type=
"danger"
size=
"small"
>
{{
item1
.
live
.
sign_status
===
2
?
'迟到'
:
'漏签'
}}
</el-tag>
</
template
>
</div>
<div
class=
"time"
v-else
>
{{ item1.live.start_time }} {{ item1.live.statusStr }}
</div>
</template>
</template>
<
template
v-else
>
<
template
v-else
>
<div
class=
"time"
>
{{
item1
.
time
}}
</div>
<div
class=
"time"
>
{{
item1
.
time
}}
</div>
...
@@ -599,6 +606,13 @@ export default {
...
@@ -599,6 +606,13 @@ export default {
this
.
resizeRoot
()
this
.
resizeRoot
()
},
},
methods
:
{
methods
:
{
handleSignIn
(
item
)
{
if
(
item
.
sign_status
===
-
1
)
{
this
.
$message
.
error
(
'直播未开始,请提前10分钟进入签到'
)
}
else
{
this
.
fetchSignIn
(
item
.
id
)
}
},
handleClick
(
tab
,
event
)
{
handleClick
(
tab
,
event
)
{
/* console.log(tab, event) */
/* console.log(tab, event) */
},
},
...
@@ -940,6 +954,23 @@ export default {
...
@@ -940,6 +954,23 @@ export default {
const
r
=
window
.
location
.
search
.
substr
(
1
).
match
(
reg
)
const
r
=
window
.
location
.
search
.
substr
(
1
).
match
(
reg
)
if
(
r
!=
null
)
return
unescape
(
r
[
2
])
if
(
r
!=
null
)
return
unescape
(
r
[
2
])
return
null
return
null
},
fetchSignIn
(
id
)
{
cAction
.
Player
.
signIn
(
id
)
.
then
(
res
=>
{
const
{
code
,
status
}
=
res
if
(
code
===
0
)
{
if
(
status
===
1
)
{
this
.
$message
.
success
(
'签到成功'
)
}
else
if
(
status
===
2
)
{
this
.
$message
.
success
(
'课程已开始,您已迟到,请于课后补看错过视频'
)
}
this
.
updatePages
()
}
})
.
catch
(
e
=>
{
this
.
$message
.
error
(
e
.
message
||
'签到失败'
)
})
}
}
}
}
}
}
...
...
src/pages/mobile/list.vue
浏览文件 @
a46280ad
...
@@ -8,14 +8,17 @@
...
@@ -8,14 +8,17 @@
<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, latest.course_id)"
>
<div
class=
"hint"
v-if=
"latest"
>
<div
class=
"left"
>
<div
class=
"left"
>
<div
class=
"left-1"
>
{{
$t
(
'live.liveReminder'
)
}}
:
</div>
<div
class=
"left-1"
>
{{
$t
(
'live.liveReminder'
)
}}
:
</div>
<div
class=
"left-2"
>
<div
class=
"left-2"
>
《
{{
latest
.
course_name
}}
》
{{
$t
(
'live.startTime'
,
{
time
:
latest
.
live
.
start_time
}
)
}}
《
{{
latest
.
course_name
}}
》
{{
$t
(
'live.startTime'
,
{
time
:
latest
.
live
.
start_time
}
)
}}
<
/div
>
<
/div
>
<
/div
>
<
/div
>
<
div
class
=
"right"
>
{{
$t
(
'live.goLive'
)
}}
<
/div
>
<
div
v
-
if
=
"[-1, 0].includes(latest.live.sign_status)"
class
=
"right"
@
click
=
"onClick(latest.live, latest.course_id)"
>
<
el
-
tag
size
=
"small"
@
click
.
stop
=
"handleSignIn(latest.live)"
>
签
到
<
/el-tag
>
<
/div
>
<
div
v
-
else
class
=
"right"
@
click
=
"onClick(latest.live, latest.course_id)"
>
{{
$t
(
'live.goLive'
)
}}
<
/div
>
<
/div
>
<
/div
>
<
div
class
=
"tips"
>
{{
$t
(
'live.replayTips'
)
}}
<
/div
>
<
div
class
=
"tips"
>
{{
$t
(
'live.replayTips'
)
}}
<
/div
>
<
div
class
=
"live-list"
>
<
div
class
=
"live-list"
>
...
@@ -27,7 +30,11 @@
...
@@ -27,7 +30,11 @@
<
div
class
=
"live-item-content"
>
<
div
class
=
"live-item-content"
>
<
div
class
=
"live-item-content__title"
>
{{
subitem
.
topic
}}
<
/div
>
<
div
class
=
"live-item-content__title"
>
{{
subitem
.
topic
}}
<
/div
>
<
div
class
=
"live-item-content__time"
>
{{
subitem
.
start_time
}}
<
/div
>
<
div
class
=
"live-item-content__time"
>
{{
subitem
.
start_time
}}
<
/div
>
<
div
class
=
"live-item-content__status"
>
{{
calcTimeText
(
subitem
)
}}
<
/div
>
<
div
class
=
"live-item-content__status"
>
{{
calcTimeText
(
subitem
)
}}
<
el
-
tag
v
-
if
=
"[-1, 0].includes(subitem.sign_status)"
style
=
"float:right;"
size
=
"small"
@
click
.
stop
=
"handleSignIn(subitem)"
>
签
到
<
/el-tag
>
<
el
-
tag
v
-
if
=
"[3, 5].includes(subitem.live_status) && [2, 3].includes(subitem.sign_status)"
type
=
"danger"
style
=
"float:right;"
size
=
"small"
>
{{
subitem
.
sign_status
===
2
?
'迟到'
:
'漏签'
}}
<
/el-tag
>
<
/div
>
<
/div
>
<
/div
>
<
/div
>
<
/div
>
<
/div
>
<
/div
>
...
@@ -67,6 +74,13 @@ export default {
...
@@ -67,6 +74,13 @@ export default {
}
}
}
,
}
,
methods
:
{
methods
:
{
handleSignIn
(
item
)
{
if
(
item
.
sign_status
===
-
1
)
{
this
.
$message
.
error
(
'直播未开始,请提前10分钟进入签到'
)
}
else
{
this
.
fetchSignIn
(
item
.
id
)
}
}
,
/* 退出登录 - 跳转方法 */
/* 退出登录 - 跳转方法 */
logout
()
{
logout
()
{
cAction
.
Other
.
outLogin
()
cAction
.
Other
.
outLogin
()
...
@@ -239,6 +253,24 @@ export default {
...
@@ -239,6 +253,24 @@ export default {
result = this.$t('live.watchReplay')
result = this.$t('live.watchReplay')
}
}
return result
return result
}
,
fetchSignIn(id) {
cAction.Player.signIn(id)
.then(res => {
const { code, status
}
= res
if (code === 0) {
if (status === 1) {
this.$message.success('签到成功')
}
else if (status === 2) {
this.$message.success('课程已开始,您已迟到,请于课后补看错过视频')
}
this.getNewLiveMsg()
this.getLiveList()
}
}
)
.catch(e => {
this.$message.error(e.message || '签到失败')
}
)
}
}
}
,
}
,
mounted() {
mounted() {
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论