提交 fac28b75 authored 作者: pengxiaohui's avatar pengxiaohui

feat: 签到弹窗优化外观样式

上级 9aa080eb
<template> <template>
<div class="popup" v-show="visible"> <div class="popup" v-show="visible">
<div class="popup-container"> <div class="popup-container" :class="signStatus === 1 ? 'success':'warn'">
<div class="title"> <p v-if="signStatus === 1" class="success">签到成功!</p>
{{title}} <p v-if="signStatus === 2" class="warn">
<i class="icon-close el-icon-close" @click="handleClose"></i> 您已迟到。<span>请于课后补看错过视频。</span>
</div> </p>
<div class="content"> <div class="content">
<slot></slot> <slot></slot>
</div> </div>
<i class="el-icon-circle-close" @click="handleClose"></i>
</div> </div>
<div class="overlay"></div> <div class="overlay"></div>
</div> </div>
...@@ -22,6 +23,10 @@ export default { ...@@ -22,6 +23,10 @@ export default {
title: { title: {
type: String, type: String,
default: '' default: ''
},
signStatus: {
type: Number,
default: 1
} }
}, },
data() { data() {
...@@ -50,29 +55,56 @@ export default { ...@@ -50,29 +55,56 @@ export default {
top:50%; top:50%;
transform:translate(-50%, -50%); transform:translate(-50%, -50%);
z-index:2000; z-index:2000;
max-width:80vw; width:313px;
height:211px;
padding-top:150px;
border-radius:5px; border-radius:5px;
overflow:hidden; box-shadow: 0 1px 3px rgb(0 0 0 / 30%);
box-shadow: 0 1px 3px rgb(0 0 0 / 30%) background-image: url('@/assets/images/popup_bg1.png');
background-size:313px;
} }
.title{ .popup-container.warn{
background:#2994ea; background-image: url('@/assets/images/popup_bg2.png');
color:#fff; }
padding:10px 40px 10px 15px; .popup-container p{
position:relative; color:#1B6EBB;
min-width:220px; font-size:28px;
text-align:center;
margin:0;
}
.popup-container p.warn{
color:#D51E2A;
} }
.title>i{ .popup-container p.warn span{
color:#959595;
font-size:18px;
display:block;
}
.popup-container>i{
position:absolute; position:absolute;
right:6px; left:50%;
top:6px; bottom:-60px;
transform:translateX(-50%);
padding:5px; padding:5px;
cursor:pointer; cursor:pointer;
font-size:30px;
color:#fff;
} }
.title>i:hover{ .popup-container>i:hover{
color: #e3e3e3; color: #e3e3e3;
} }
.content{ .content{
background:#fff; text-align: center;
padding-top:40px;
}
.content button{
width:180px;
font-size:16px;
background:#1B6EBB;
border-color:#1B6EBB;
}
.popup-container.warn .content button{
background:#D51E2A;
border-color:#D51E2A;
} }
</style> </style>
...@@ -96,10 +96,8 @@ ...@@ -96,10 +96,8 @@
</ul> </ul>
</div> </div>
</div> </div>
<app-popup :title="popup.title" :visible.sync="popup.visible"> <app-popup :signStatus="popup.signStatus" :visible.sync="popup.visible">
<p v-if="newLiveMsg.live" class="popup-content" @click="goLive"> <el-button type="primary" round size="medium" @click="goLive">进入直播</el-button>
{{newLiveMsg.course_name}} {{newLiveMsg.live.start_time}} <span>进入直播</span>
</p>
</app-popup> </app-popup>
</div> </div>
</template> </template>
...@@ -114,7 +112,7 @@ export default { ...@@ -114,7 +112,7 @@ export default {
UserInfo = window.G.UserInfo.student_info || {} UserInfo = window.G.UserInfo.student_info || {}
return { return {
popup: { popup: {
title: '签到成功', signStatus: 1,
visible: false, visible: false,
data: {} data: {}
}, },
...@@ -303,14 +301,8 @@ export default { ...@@ -303,14 +301,8 @@ 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) { this.popup.signStatus = status
msg = '签到成功'
} else if (status === 2) {
msg = '课程已开始,您已迟到,请于课后补看错过视频'
}
this.popup.title = msg
this.popup.visible = true this.popup.visible = true
this.getLatestLive() this.getLatestLive()
} }
...@@ -324,19 +316,6 @@ export default { ...@@ -324,19 +316,6 @@ 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;
......
...@@ -274,10 +274,8 @@ ...@@ -274,10 +274,8 @@
</el-col> </el-col>
</el-row> </el-row>
</div> </div>
<app-popup :title="popup.title" :visible.sync="popup.visible"> <app-popup :signStatus="popup.signStatus" :visible.sync="popup.visible">
<p v-if="popup.data.live" class="popup-content" @click="jumpToOtherVA(popup.data)"> <el-button type="primary" round size="medium" @click="jumpToOtherVA(popup.data)">进入直播</el-button>
{{popup.data.live.topic}} {{popup.data.live.start_time}} <span>进入直播</span>
</p>
</app-popup> </app-popup>
</div> </div>
</template> </template>
...@@ -298,7 +296,7 @@ export default { ...@@ -298,7 +296,7 @@ export default {
data() { data() {
return { return {
popup: { popup: {
title: '签到成功', signStatus: 1,
visible: false, visible: false,
data: {} data: {}
}, },
...@@ -979,14 +977,8 @@ export default { ...@@ -979,14 +977,8 @@ export default {
cAction.Player.signIn(item.live.id) cAction.Player.signIn(item.live.id)
.then(res => { .then(res => {
const { code, status } = res const { code, status } = res
let msg = ''
if (code === 0) { if (code === 0) {
if (status === 1) { this.popup.signStatus = status
msg = '签到成功'
} else if (status === 2) {
msg = '课程已开始,您已迟到,请于课后补看错过视频'
}
this.popup.title = msg
this.popup.visible = true this.popup.visible = true
this.popup.data = item this.popup.data = item
this.updatePages() this.updatePages()
...@@ -1001,19 +993,6 @@ export default { ...@@ -1001,19 +993,6 @@ 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;
}
body .el-tab-pane { body .el-tab-pane {
padding-top: 0; padding-top: 0;
} }
......
...@@ -44,10 +44,8 @@ ...@@ -44,10 +44,8 @@
</div> </div>
</template> </template>
</div> </div>
<app-popup :title="popup.title" :visible.sync="popup.visible"> <app-popup :signStatus="popup.signStatus" :visible.sync="popup.visible">
<p v-if="popup.data" class="popup-content" @click="onClick(popup.data, popup.courseId)"> <el-button type="primary" round size="medium" @click="onClick(popup.data, popup.courseId)">进入直播</el-button>
{{popup.data.topic}} {{popup.data.start_time}}<span>进入直播</span>
</p>
</app-popup> </app-popup>
</div> </div>
</template> </template>
...@@ -73,7 +71,7 @@ export default { ...@@ -73,7 +71,7 @@ export default {
wechatVersion, wechatVersion,
notSupport, notSupport,
popup: { popup: {
title: '签到成功', signStatus: 1,
visible: false, visible: false,
data: {}, data: {},
courseId: '' courseId: ''
...@@ -274,13 +272,7 @@ export default { ...@@ -274,13 +272,7 @@ export default {
.then(res => { .then(res => {
const { code, status } = res const { code, status } = res
if (code === 0) { if (code === 0) {
let msg = '' this.popup.signStatus = status
if (status === 1) {
msg = '签到成功'
} else if (status === 2) {
msg = '课程已开始,您已迟到,请于课后补看错过视频'
}
this.popup.title = msg
this.popup.visible = true this.popup.visible = true
this.popup.data = item this.popup.data = item
this.popup.courseId = courseId this.popup.courseId = courseId
...@@ -314,16 +306,6 @@ export default { ...@@ -314,16 +306,6 @@ export default {
} }
</script> </script>
<style> <style>
.popup-content{
padding: 16px 15px;
font-size:14px;
cursor:pointer;
margin:0;
}
.popup-content span{
color:#999;
font-size:12px;
}
html { html {
font-size: 100px; font-size: 100px;
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论