Commit 6963461c authored by Facius's avatar Facius

feat: 首页每日一练弹窗

parent ba416460
<template>
<u-popup
v-model="visible"
mode="center"
safe-area-inset-bottom
width="690rpx"
:mask-close-able="flase"
close-icon-color="#FFFFFF"
height="86%"
>
<view class="pop-view">
<image mode="widthFix" class="image-view" :src="backgroundImage"></image>
<view class="head-view">
<view class="pop-title">
<text>恭喜您获得</text>
</view>
</view>
<view class="pop-content">
<view>您已获得1次答题体验机会</view>
<view class="label-view">每日一练,轻松完成课程练习</view>
</view>
<u-button
:custom-style="customStyle"
shape="circle"
type="primary"
@click="handleClick"
>
立即练习
</u-button>
</view>
<view class="colse-view">
<image
class="image-view"
:src="closeImage"
@click="$u.throttle(handleClose, 500)"
></image>
</view>
</u-popup>
</template>
<script>
export default {
props: {
visible: {
type: Boolean,
default: false,
},
},
data() {
return {}
},
computed: {
closeImage() {
return process.uniEnv.qn_base_url + 'dianjiquxiao.png'
},
backgroundImage() {
return process.uniEnv.qn_base_url + 'zigetanchaung.png'
},
customStyle() {
return {
backgroundColor: '#2953FF',
width: '360rpx',
height: '96rpx',
color: '#ffffff',
fontWeight: 'bold',
fontSize: '32rpx',
}
},
},
methods: {
handleClose() {
this.$emit('update:visible', false)
},
handleClick() {
this.$emit('update:visible', false)
this.$emit('click')
},
},
}
</script>
<style lang="scss" scoped>
.pop-view {
margin-top: 80rpx;
padding: 48rpx 24rpx;
position: relative;
text-align: center;
background-color: #ffffff;
z-index: 1;
border-radius: 24rpx;
overflow: hidden;
.head-view {
width: 100%;
height: 432;
padding-top: 10rpx;
padding-bottom: 300rpx;
.pop-title {
font-size: 48rpx;
text-align: center;
color: #ffffff;
font-weight: bold;
}
}
.image-view {
width: 100%;
position: absolute;
top: 0;
left: 0;
z-index: -1;
}
.pop-content {
margin-bottom: 60rpx;
font-size: 36rpx;
font-weight: bold;
color: #191c27;
margin-top: 80rpx;
.label-view {
font-size: 28rpx;
color: #9ea5bb;
margin-top: 20rpx;
font-weight: 400;
}
}
}
.colse-view {
height: 80rpx;
display: flex;
align-items: center;
justify-content: center;
margin-top: 30rpx;
.image-view {
width: 60rpx;
height: 60rpx;
}
}
</style>
...@@ -77,15 +77,19 @@ ...@@ -77,15 +77,19 @@
@answer="handleAnswer" @answer="handleAnswer"
></SubjectStatistics> ></SubjectStatistics>
</view> </view>
<ExperiencePop :visible.sync="visible" />
</view> </view>
</template> </template>
<script> <script>
import SubjectStatistics from '@/components/subject-statistics' import SubjectStatistics from '@/components/subject-statistics'
import ExperiencePop from '@/components/experience-pop'
export default { export default {
components: { SubjectStatistics }, components: { SubjectStatistics, ExperiencePop },
data() { data() {
return { return {
visible: false,
selected: { selected: {
key: 0, key: 0,
name: '熔化焊接与热切割作业', name: '熔化焊接与热切割作业',
...@@ -183,6 +187,8 @@ export default { ...@@ -183,6 +187,8 @@ export default {
}, },
methods: { methods: {
handleSelect() { handleSelect() {
this.visible = true
return
// if (this.vuex_token) { // if (this.vuex_token) {
var str = this.selected ? 'selectedList' : 'addExam' var str = this.selected ? 'selectedList' : 'addExam'
this.$u.route({ this.$u.route({
...@@ -206,6 +212,19 @@ export default { ...@@ -206,6 +212,19 @@ export default {
} }
</script> </script>
<style lang="scss">
.page-index {
.u-countdown-colon {
margin-left: 6rpx;
margin-right: 6rpx;
}
.u-mode-center-box {
background-color: transparent !important;
padding-top: 40rpx;
}
}
</style>
<style lang="scss" scope> <style lang="scss" scope>
::-webkit-scrollbar { ::-webkit-scrollbar {
width: 0; width: 0;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment