提交 9aa080eb authored 作者: pengxiaohui's avatar pengxiaohui

feat: 签到成功弹窗提示

上级 04bd251f
......@@ -5,7 +5,9 @@
{{title}}
<i class="icon-close el-icon-close" @click="handleClose"></i>
</div>
<slot></slot>
<div class="content">
<slot></slot>
</div>
</div>
<div class="overlay"></div>
</div>
......@@ -48,7 +50,6 @@ export default {
top:50%;
transform:translate(-50%, -50%);
z-index:2000;
background:#fff;
max-width:80vw;
border-radius:5px;
overflow:hidden;
......@@ -59,7 +60,7 @@ export default {
color:#fff;
padding:10px 40px 10px 15px;
position:relative;
min-width:190px;
min-width:220px;
}
.title>i{
position:absolute;
......@@ -71,4 +72,7 @@ export default {
.title>i:hover{
color: #e3e3e3;
}
.content{
background:#fff;
}
</style>
......@@ -96,17 +96,28 @@
</ul>
</div>
</div>
<app-popup :title="popup.title" :visible.sync="popup.visible">
<p v-if="newLiveMsg.live" class="popup-content" @click="goLive">
{{newLiveMsg.course_name}} {{newLiveMsg.live.start_time}} <span>进入直播</span>
</p>
</app-popup>
</div>
</template>
<script>
import cAction from '@action'
import AppPopup from '@/components/popup'
let UserInfo = {}
export default {
components: {},
components: { AppPopup },
data() {
UserInfo = window.G.UserInfo.student_info || {}
return {
popup: {
title: '签到成功',
visible: false,
data: {}
},
userInfo: {},
filter: {
studyEarly: 'down',
......@@ -292,12 +303,15 @@ export default {
cAction.Player.signIn(id)
.then(res => {
const { code, status } = res
let msg = ''
if (code === 0) {
if (status === 1) {
this.$message.success('签到成功')
msg = '签到成功'
} else if (status === 2) {
this.$message.success('课程已开始,您已迟到,请于课后补看错过视频')
msg = '课程已开始,您已迟到,请于课后补看错过视频'
}
this.popup.title = msg
this.popup.visible = true
this.getLatestLive()
}
})
......@@ -310,6 +324,19 @@ export default {
</script>
<style lang="scss" scoped>
.popup-content{
padding: 16px 15px;
font-size:14px;
cursor:pointer;
margin:0;
}
.popup-content:hover,.popup-content:hover span{
color:#d21f28;
}
.popup-content span{
color:#999;
font-size:12px;
}
.live-msg {
position: relative;
padding: 40px;
......
......@@ -92,10 +92,10 @@
<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.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="[1, 2].includes(item1.live.sign_status)" type="danger" size="small">{{item1.live.sign_status === 2 ? '迟到' : '已签到'}}</el-tag>
<el-tag v-if="item1.live.sign_status === 1" type="success" size="small">已签到</el-tag>
<el-tag v-if="item1.live.sign_status === 2" type="danger" size="small">迟到</el-tag>
<template v-if="[3, 5].includes(item1.live.live_status)">
<el-tag v-if="item1.live.sign_status === 3" type="success" size="small">缺课</el-tag>
<el-tag v-if="item1.live.sign_status === 3" type="danger" size="small">缺课</el-tag>
</template>
</template>
</div>
......@@ -1002,9 +1002,10 @@ export default {
<style lang="scss" scoped>
.popup-content{
padding: 2px 15px;
padding: 16px 15px;
font-size:14px;
cursor:pointer;
margin:0;
}
.popup-content:hover,.popup-content:hover span{
color:#d21f28;
......
......@@ -16,7 +16,7 @@
</div>
</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>
<el-tag size="small" @click.stop="handleSignIn(latest.live, latest.course_id)"> </el-tag>
</div>
<div v-else class="right" @click="onClick(latest.live, latest.course_id)">{{ $t('live.goLive') }}</div>
</div>
......@@ -33,9 +33,10 @@
<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, 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>
<el-tag v-if="subitem.sign_status === 2" type="danger" style="float:right;" size="small">迟到</el-tag>
<el-tag v-if="subitem.sign_status === 1" type="success" size="small" style="float:right;">已签到</el-tag>
<template v-if="[3, 5].includes(subitem.live_status)">
<el-tag v-if="subitem.sign_status === 3" type="success" size="small" style="float:right;">缺课</el-tag>
<el-tag v-if="subitem.sign_status === 3" type="danger" size="small" style="float:right;">缺课</el-tag>
</template>
</div>
</div>
......@@ -44,8 +45,8 @@
</template>
</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 v-if="popup.data" class="popup-content" @click="onClick(popup.data, popup.courseId)">
{{popup.data.topic}} {{popup.data.start_time}}<span>进入直播</span>
</p>
</app-popup>
</div>
......@@ -314,12 +315,10 @@ export default {
</script>
<style>
.popup-content{
padding: 2px 15px;
padding: 16px 15px;
font-size:14px;
cursor:pointer;
}
.popup-content:hover,.popup-content:hover span{
color:#d21f28;
margin:0;
}
.popup-content span{
color:#999;
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论