deming/pageB/coupon/index.vue

90 lines
1.7 KiB
Vue
Raw Normal View History

2020-08-11 07:38:43 +00:00
<template>
<u-popup v-model="showCoupon" mode="center" class="u-coupon-popup">
<view class="coupon">
<view class="price">{{ newMemberCoupon.price }}</view>
<image src="/static/image/common/30.png" class="coupon-image" @click="viewCoupon"></image>
<image src="/static/image/common/24.png" class="close-image" @click="showCoupon=false"></image>
</view>
</u-popup>
</template>
<script>
export default {
data() {
return {
showCoupon: true,
newMemberCoupon: {},
}
},
watch: {
showCoupon(value) {
if(!value) {
uni.navigateBack();
}
}
},
onShow() {
this.isNewmembervoucher();
},
methods: {
viewCoupon() {
this.$u.route('/pageB/coupon/details', {
price: this.newMemberCoupon.price
});
},
// 是否显示新人优惠券
isNewmembervoucher() {
this.$u.api.isNewmembervoucher().then(res => {
if(res.errCode == 0) {
this.newMemberCoupon = res.data;
} else {
this.showCoupon = false;
}
})
},
}
}
</script>
2020-08-11 10:27:19 +00:00
<style lang="scss">
page{
background-color: rgba(0,0,0,0);
}
2020-08-11 07:38:43 +00:00
.u-coupon-popup {
/deep/ .u-mode-center-box {
background-color: transparent;
}
.coupon {
width: 750rpx;
height: 583rpx;
position: relative;
.price {
z-index: 3;
color: #EBB36E;
position: absolute;
2020-08-12 02:10:59 +00:00
font-size: 92rpx;
2020-08-11 07:38:43 +00:00
font-weight: bold;
top: 200rpx;
left: 50%;
2020-08-12 02:10:59 +00:00
font-family: PingFang SC;
2020-08-11 07:38:43 +00:00
transform: translate(-68%, 0);
}
.coupon-image {
width: 568rpx;
height: 583rpx;
position: absolute;
top: 0;
left: 50%;
transform: translate(-60%, 0);
}
.close-image {
position: absolute;
top: 0;
right: 155rpx;
width: 60rpx;
height: 60rpx;
}
}
}
</style>