Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
L
learn-online-pc
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
EzijingWeb
learn-online-pc
Commits
04bd251f
提交
04bd251f
authored
7月 29, 2021
作者:
pengxiaohui
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
feat: 签到成功显示提示弹窗
上级
7b2e0772
显示空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
156 行增加
和
22 行删除
+156
-22
popup.vue
src/components/popup.vue
+74
-0
courseDetail.vue
src/pages/learn/courseDetail.vue
+42
-10
list.vue
src/pages/mobile/list.vue
+40
-12
没有找到文件。
src/components/popup.vue
0 → 100644
浏览文件 @
04bd251f
<
template
>
<div
class=
"popup"
v-show=
"visible"
>
<div
class=
"popup-container"
>
<div
class=
"title"
>
{{
title
}}
<i
class=
"icon-close el-icon-close"
@
click=
"handleClose"
></i>
</div>
<slot></slot>
</div>
<div
class=
"overlay"
></div>
</div>
</
template
>
<
script
>
export
default
{
props
:
{
visible
:
{
type
:
Boolean
,
default
:
false
},
title
:
{
type
:
String
,
default
:
''
}
},
data
()
{
return
{}
},
methods
:
{
handleClose
()
{
this
.
$emit
(
'update:visible'
,
false
)
}
}
}
</
script
>
<
style
scoped
>
.overlay
{
position
:
fixed
;
left
:
0
;
top
:
0
;
right
:
0
;
bottom
:
0
;
z-index
:
1999
;
background
:
rgba
(
0
,
0
,
0
,
.5
);
}
.popup-container
{
position
:
fixed
;
left
:
50%
;
top
:
50%
;
transform
:
translate
(
-50%
,
-50%
);
z-index
:
2000
;
background
:
#fff
;
max-width
:
80vw
;
border-radius
:
5px
;
overflow
:
hidden
;
box-shadow
:
0
1px
3px
rgb
(
0
0
0
/
30%
)
}
.title
{
background
:
#2994ea
;
color
:
#fff
;
padding
:
10px
40px
10px
15px
;
position
:
relative
;
min-width
:
190px
;
}
.title
>
i
{
position
:
absolute
;
right
:
6px
;
top
:
6px
;
padding
:
5px
;
cursor
:
pointer
;
}
.title
>
i
:hover
{
color
:
#e3e3e3
;
}
</
style
>
src/pages/learn/courseDetail.vue
浏览文件 @
04bd251f
...
@@ -91,11 +91,11 @@
...
@@ -91,11 +91,11 @@
<div
class=
"time"
v-if=
"item1.type === 5"
>
<div
class=
"time"
v-if=
"item1.type === 5"
>
<template>
<template>
{{
item1
.
live
.
start_time
}}
{{
item1
.
live
.
statusStr
}}
{{
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
.
stop=
"handleSignIn(item1
.live
)"
>
签到
</el-button>
<el-button
v-if=
"[-1, 0].includes(item1.live.sign_status)"
class=
"in-btn"
type=
"primary"
size=
"mini"
round
@
click
.
stop=
"handleSignIn(item1)"
>
签到
</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>
-->
<!--
<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>
-->
<el-tag
v-if=
"[1, 2].includes(item1.live.sign_status)"
type=
"danger"
size=
"small"
>
{{
item1
.
live
.
sign_status
===
2
?
'迟到'
:
'已签到'
}}
</el-tag>
<template
v-if=
"[3, 5].includes(item1.live.live_status)"
>
<template
v-if=
"[3, 5].includes(item1.live.live_status)"
>
<el-tag
v-if=
"[2, 3].includes(item1.live.sign_status)"
type=
"danger"
size=
"small"
>
{{
item1
.
live
.
sign_status
===
2
?
'迟到'
:
'缺课'
}}
</el-tag>
<el-tag
v-if=
"item1.live.sign_status === 3"
type=
"success"
size=
"small"
>
缺课
</el-tag>
<el-tag
v-if=
"item1.live.sign_status === 1"
type=
"success"
size=
"small"
>
已签到
</el-tag>
</
template
>
</
template
>
</template>
</template>
</div>
</div>
...
@@ -274,6 +274,11 @@
...
@@ -274,6 +274,11 @@
</el-col>
</el-col>
</el-row>
</el-row>
</div>
</div>
<app-popup
:title=
"popup.title"
:visible
.
sync=
"popup.visible"
>
<p
v-if=
"popup.data.live"
class=
"popup-content"
@
click=
"jumpToOtherVA(popup.data)"
>
{{popup.data.live.topic}} {{popup.data.live.start_time}}
<span>
进入直播
</span>
</p>
</app-popup>
</div>
</div>
</template>
</template>
...
@@ -282,15 +287,21 @@ import cAction from '@action'
...
@@ -282,15 +287,21 @@ import cAction from '@action'
import
cTool
from
'@tool'
import
cTool
from
'@tool'
import
VEditor
from
'@/components/ckeditor'
import
VEditor
from
'@/components/ckeditor'
import
AppPopup
from
'@/components/popup'
export
default
{
export
default
{
components
:
{
VEditor
},
components
:
{
VEditor
,
AppPopup
},
props
:
{
props
:
{
sid
:
{
type
:
String
,
require
:
false
},
sid
:
{
type
:
String
,
require
:
false
},
cid
:
{
type
:
String
,
require
:
false
}
cid
:
{
type
:
String
,
require
:
false
}
},
},
data
()
{
data
()
{
return
{
return
{
popup
:
{
title
:
'签到成功'
,
visible
:
false
,
data
:
{}
},
params
:
{
params
:
{
path
:
`/
${
this
.
cid
}
`
,
path
:
`/
${
this
.
cid
}
`
,
request
:
'getCourseDiscussList'
,
request
:
'getCourseDiscussList'
,
...
@@ -610,11 +621,16 @@ export default {
...
@@ -610,11 +621,16 @@ export default {
this
.
resizeRoot
()
this
.
resizeRoot
()
},
},
methods
:
{
methods
:
{
handleTestSign
(
item
)
{
this
.
popup
.
title
=
'签到成功'
this
.
popup
.
visible
=
true
this
.
popup
.
data
=
item
},
handleSignIn
(
item
)
{
handleSignIn
(
item
)
{
if
(
item
.
sign_status
===
-
1
)
{
if
(
item
.
live
.
sign_status
===
-
1
)
{
this
.
$message
.
error
(
'直播未开始,请提前10分钟进入签到'
)
this
.
$message
.
error
(
'直播未开始,请提前10分钟进入签到'
)
}
else
{
}
else
{
this
.
fetchSignIn
(
item
.
id
)
this
.
fetchSignIn
(
item
)
}
}
},
},
handleClick
(
tab
,
event
)
{
handleClick
(
tab
,
event
)
{
...
@@ -959,16 +975,20 @@ export default {
...
@@ -959,16 +975,20 @@ export default {
if
(
r
!=
null
)
return
unescape
(
r
[
2
])
if
(
r
!=
null
)
return
unescape
(
r
[
2
])
return
null
return
null
},
},
fetchSignIn
(
i
d
)
{
fetchSignIn
(
i
tem
)
{
cAction
.
Player
.
signIn
(
id
)
cAction
.
Player
.
signIn
(
i
tem
.
live
.
i
d
)
.
then
(
res
=>
{
.
then
(
res
=>
{
const
{
code
,
status
}
=
res
const
{
code
,
status
}
=
res
let
msg
=
''
if
(
code
===
0
)
{
if
(
code
===
0
)
{
if
(
status
===
1
)
{
if
(
status
===
1
)
{
this
.
$message
.
success
(
'签到成功'
)
msg
=
'签到成功'
}
else
if
(
status
===
2
)
{
}
else
if
(
status
===
2
)
{
this
.
$message
.
success
(
'课程已开始,您已迟到,请于课后补看错过视频'
)
msg
=
'课程已开始,您已迟到,请于课后补看错过视频'
}
}
this
.
popup
.
title
=
msg
this
.
popup
.
visible
=
true
this
.
popup
.
data
=
item
this
.
updatePages
()
this
.
updatePages
()
}
}
})
})
...
@@ -981,6 +1001,18 @@ export default {
...
@@ -981,6 +1001,18 @@ export default {
</
script
>
</
script
>
<
style
lang=
"scss"
scoped
>
<
style
lang=
"scss"
scoped
>
.popup-content
{
padding
:
2px
15px
;
font-size
:
14px
;
cursor
:pointer
;
}
.popup-content
:hover
,
.popup-content
:hover
span
{
color
:
#d21f28
;
}
.popup-content
span
{
color
:
#999
;
font-size
:
12px
;
}
body
.el-tab-pane
{
body
.el-tab-pane
{
padding-top
:
0
;
padding-top
:
0
;
}
}
...
...
src/pages/mobile/list.vue
浏览文件 @
04bd251f
...
@@ -32,10 +32,10 @@
...
@@ -32,10 +32,10 @@
<
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"
>
<
div
class
=
"live-item-content__status"
>
{{
calcTimeText
(
subitem
)
}}
{{
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
=
"[-1, 0].includes(subitem.sign_status)"
style
=
"float:right;"
size
=
"small"
@
click
.
stop
=
"handleSignIn(subitem, item.course_id)"
>
签
到
<
/el-tag
>
<
el
-
tag
v
-
if
=
"[1, 2].includes(subitem.sign_status)"
type
=
"danger"
style
=
"float:right;"
size
=
"small"
>
{{
subitem
.
sign_status
===
2
?
'迟到'
:
'已签到'
}}
<
/el-tag
>
<
template
v
-
if
=
"[3, 5].includes(subitem.live_status)"
>
<
template
v
-
if
=
"[3, 5].includes(subitem.live_status)"
>
<
el
-
tag
v
-
if
=
"[2, 3].includes(subitem.sign_status)"
type
=
"danger"
style
=
"float:right;"
size
=
"small"
>
{{
subitem
.
sign_status
===
2
?
'迟到'
:
'缺课'
}}
<
/el-tag
>
<
el
-
tag
v
-
if
=
"subitem.sign_status === 3"
type
=
"success"
size
=
"small"
style
=
"float:right;"
>
缺课
<
/el-tag
>
<
el
-
tag
v
-
if
=
"subitem.sign_status === 1"
type
=
"success"
size
=
"small"
style
=
"float:right;"
>
已签到
<
/el-tag
>
<
/template
>
<
/template
>
<
/div
>
<
/div
>
<
/div
>
<
/div
>
...
@@ -43,14 +43,19 @@
...
@@ -43,14 +43,19 @@
<
/div
>
<
/div
>
<
/template
>
<
/template
>
<
/div
>
<
/div
>
<
app
-
popup
:
title
=
"popup.title"
:
visible
.
sync
=
"popup.visible"
>
<
p
v
-
if
=
"popup.data"
class
=
"popup-content"
@
click
=
"jumpToOtherVA(popup.data)"
>
{{
popup
.
datatopic
}}
{{
popup
.
data
.
start_time
}}
<
span
>
进入直播
<
/span
>
<
/p
>
<
/app-popup
>
<
/div
>
<
/div
>
<
/template
>
<
/template
>
<
script
>
<
script
>
import
cAction
from
'@action'
import
cAction
from
'@action'
import
LanguageSwitch
from
'@/components/languageSwitch/index.vue'
import
LanguageSwitch
from
'@/components/languageSwitch/index.vue'
import
AppPopup
from
'@/components/popup'
export
default
{
export
default
{
components
:
{
LanguageSwitch
}
,
components
:
{
LanguageSwitch
,
AppPopup
}
,
data
()
{
data
()
{
const
UA
=
navigator
.
userAgent
const
UA
=
navigator
.
userAgent
const
isWechat
=
/micromessenger/i
.
test
(
UA
)
const
isWechat
=
/micromessenger/i
.
test
(
UA
)
...
@@ -65,7 +70,13 @@ export default {
...
@@ -65,7 +70,13 @@ export default {
timer
:
null
,
timer
:
null
,
isWechat
,
isWechat
,
wechatVersion
,
wechatVersion
,
notSupport
notSupport
,
popup
:
{
title
:
'签到成功'
,
visible
:
false
,
data
:
{
}
,
courseId
:
''
}
}
}
}
,
}
,
computed
:
{
computed
:
{
...
@@ -77,11 +88,11 @@ export default {
...
@@ -77,11 +88,11 @@ export default {
}
}
}
,
}
,
methods
:
{
methods
:
{
handleSignIn
(
item
)
{
handleSignIn
(
item
,
courseId
)
{
if
(
item
.
sign_status
===
-
1
)
{
if
(
item
.
sign_status
===
-
1
)
{
this
.
$message
.
error
(
'直播未开始,请提前10分钟进入签到'
)
this
.
$message
.
error
(
'直播未开始,请提前10分钟进入签到'
)
}
else
{
}
else
{
this
.
fetchSignIn
(
item
.
i
d
)
this
.
fetchSignIn
(
item
,
courseI
d
)
}
}
}
,
}
,
/* 退出登录 - 跳转方法 */
/* 退出登录 - 跳转方法 */
...
@@ -257,16 +268,21 @@ export default {
...
@@ -257,16 +268,21 @@ export default {
}
}
return result
return result
}
,
}
,
fetchSignIn(id) {
fetchSignIn(i
tem, courseI
d) {
cAction.Player.signIn(id)
cAction.Player.signIn(i
tem.i
d)
.then(res => {
.then(res => {
const { code, status
}
= res
const { code, status
}
= res
if (code === 0) {
if (code === 0) {
let msg = ''
if (status === 1) {
if (status === 1) {
this.$message.success('签到成功')
msg = '签到成功'
}
else if (status === 2) {
}
else if (status === 2) {
this.$message.success('课程已开始,您已迟到,请于课后补看错过视频')
msg = '课程已开始,您已迟到,请于课后补看错过视频'
}
}
this.popup.title = msg
this.popup.visible = true
this.popup.data = item
this.popup.courseId = courseId
this.getNewLiveMsg()
this.getNewLiveMsg()
this.getLiveList()
this.getLiveList()
}
}
...
@@ -297,6 +313,18 @@ export default {
...
@@ -297,6 +313,18 @@ export default {
}
}
</script>
</script>
<style>
<style>
.popup-content{
padding: 2px 15px;
font-size:14px;
cursor:pointer;
}
.popup-content:hover,.popup-content:hover span{
color:#d21f28;
}
.popup-content span{
color:#999;
font-size:12px;
}
html {
html {
font-size: 100px;
font-size: 100px;
}
}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论