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

feat: 签到成功弹窗提示

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