Commit 8c1ce6d3 authored by Facius's avatar Facius

feat: 首页弹窗

parent 2ebefd8a
......@@ -105,6 +105,9 @@ export default {
padding: 48rpx 40rpx;
min-height: 520rpx;
position: relative;
background-image: linear-gradient(to top, #f8fafd 0%, #e9f3ff 50%);
background-size: 100% 240rpx;
background-repeat: no-repeat;
.pop-title {
font-size: 40rpx;
margin-bottom: 30rpx;
......
<template>
<u-popup
border-radius="12"
v-model="visible"
safe-area-inset-bottom
mode="center"
width="654rpx"
:mask-close-able="false"
>
<view class="toast-pop">
<view class="pop-title">
<text>{{ title }}</text>
</view>
<view class="pop-message">
<text>{{ message }}</text>
</view>
<view class="pop-btn-view">
<view class="line-view"> </view>
<view class="content-view">
<view class="cancel-button" @click="handleClickCancel">
取消
</view>
<view class="line-view-v" />
<view class="sure-button" @click="$u.throttle(handleClickSure, 500)">
{{ buttonText }}
</view>
</view>
</view>
</view>
</u-popup>
</template>
<script>
export default {
props: {
visible: {
type: Boolean,
default: false,
},
title: {
type: String,
default: '温馨提示',
},
message: {
type: String,
default: '',
},
buttonText: {
// 确定按钮
type: String,
default: '去选择',
},
},
data() {
return {}
},
computed: {
customStyleCancel() {
return {
width: '264rpx',
height: '80rpx',
color: '#9EA5BB',
fontWeight: 'bold',
fontSize: '32rpx',
}
},
customStyleSave() {
return {
backgroundColor: '#2953FF',
width: '264rpx',
height: '80rpx',
color: '#ffffff',
fontWeight: 'bold',
fontSize: '32rpx',
}
},
},
methods: {
changeVisibleValue(val) {
this.$emit('update:visible', val)
},
handleClickCancel() {
this.changeVisibleValue(false)
this.$emit('cancel')
},
handleClickSure() {
this.changeVisibleValue(false)
this.$emit('submit')
},
},
}
</script>
<style lang="scss" scoped>
.toast-pop {
min-height: 480rpx;
position: relative;
background-image: linear-gradient(to top, #ffffff 0%, #e9f3ff 50%);
background-size: 100% 240rpx;
background-repeat: no-repeat;
text-align: center;
.pop-title {
font-size: 40rpx;
text-align: center;
color: #9ea5bb;
font-weight: bold;
padding-top: 40rpx;
}
.pop-message {
font-size: 32rpx;
text-align: center;
color: #191c27;
font-weight: bold;
padding: 90rpx 30rpx 80rpx 30rpx;
}
.pop-btn-view {
position: absolute;
bottom: 0rpx;
left: 0rpx;
right: 0rpx;
height: 112rpx;
.line-view {
background-color: #e8ebf3;
height: 2rpx;
width: 100%;
}
.content-view {
display: flex;
align-items: center;
justify-content: space-between;
.cancel-button {
width: 50%;
color: #9ea5bb;
font-size: 32rpx;
font-weight: bold;
text-align: center;
height: 112rpx;
line-height: 112rpx;
}
.line-view-v {
width: 2rpx;
background-color: #e8ebf3;
height: 112rpx;
}
.sure-button {
width: 50%;
color: #2953ff;
font-size: 32rpx;
font-weight: bold;
text-align: center;
height: 112rpx;
line-height: 112rpx;
}
}
}
}
</style>
......@@ -63,19 +63,27 @@
<view>想要轻松考过,首选模考大师</view>
</view>
</view>
<ExperiencePop :visible.sync="visible" />
<view class="experience-pop-view">
<ExperiencePop :visible.sync="visible" />
</view>
<ToastPop
:visible.sync="show"
message="为了您能更好的使用“模考大师”小程序请先选择题库"
/>
</view>
</template>
<script>
import SubjectStatistics from '@/components/subject-statistics'
import ExperiencePop from '@/components/experience-pop'
import ToastPop from '@/components/toast-pop'
export default {
components: { SubjectStatistics, ExperiencePop },
components: { SubjectStatistics, ExperiencePop, ToastPop },
data() {
return {
visible: false,
show: false,
selected: {
key: 0,
name: '熔化焊接与热切割作业',
......@@ -200,7 +208,13 @@ export default {
// this.$u.route({ url: 'pages/login/index' })
// }
},
handleAnswer() {},
// 每日一练
handleAnswer() {
if (this.selected) {
} else {
this.show = true
}
},
handleClick(path) {
// if (this.vuex_token) {
this.$u.route({
......@@ -215,7 +229,7 @@ export default {
</script>
<style lang="scss">
.page-index {
.experience-pop-view {
.u-countdown-colon {
margin-left: 6rpx;
margin-right: 6rpx;
......
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