<template>
<div class="game">
    <div class="game-box">
		<div class="logo">logo</div>
		<img src="./img/zhuti.png" class="img-zhuti">
		<div class="surplus-div">
			<div class="surplus-div1">
				<div class="surplus-div2">
					<button>今天大红包还剩6个</button>
				</div>
			</div>
		</div>
		<div class="rule-btn" @click="showRule()">查看规则></div>
    </div>
	<div class="lingqv-div">
		<img src="./img/bg2.png" class="bg2">
		<div class="lingqv-btn">
			<button @click="openPrize()">立即领取</button>
		</div>
	</div>
	
    <!-- 中奖 -->
    <div class="mask" v-show="prizeMask">
		<div class="w-prize">
			<div class="prize-name">获得新人奖励</div>
			<div class="prize-info">￥<span>40</span>现金红包</div>
			<div class="prize-pic cl">
				<div class="shiyong">
					<p>全场满299元可用</p>
					<button>立即使用</button>
				</div>
			</div>
			<div class="tips">红包将于24小时内发放到您的微信零钱包，请注意查收</div>
		</div>
		<div class="clear-div">
			<span class="clear" @click="clear()"></span>
		</div>
	</div>
	<!-- 规则 -->
    <div class="mask" v-show="ruleMask">
		<div class="rule-box">
			<div class="clear-gz">
				<span class="clear" @click="clear()"></span>
			</div>
			<img src="./img/gz.png" class="gz-title">
			<div class="rule-info">
				<h4>活动时间</h4>
				<p>2020/03/24</p>
				<h4>活动范围</h4>
				<p>全国（不包括港澳台地区）</p>
				<h4>活动奖品</h4>
				<p>一等奖</p>
				<p>二等奖</p>
				<p>三等奖</p>
				<h4>活动规则</h4>
				<p>用参与活动。。。</p>
			</div>
		</div>
		
	</div>
    
</div>
</template>

<script>
import { Toast } from "mint-ui";
import apiHelper from "@/assets/js/apiHelper.js";
import { Indicator } from "mint-ui";
import ut from "@/assets/js/utils.js";

export default {
	name: "guaguale",
	props: ["comp", "cfg", "selectedPage"],
	data() {
		return {
			prizeMask:false,
			showPrize:false,
			ruleMask:false
		};
	},
	created: function() {
		// var that = this;
		// this.mergeCompProps(this.comp);

		switch (this.sup8.env) {
			case this.sup8._def.env.design:
				this.env = "设计器模式";
				this.envType = "design";
				break;
			case this.sup8._def.env.preview:
				this.env = "预览模式";
				break;
			case this.sup8._def.env.run:
				this.env = "运行模式";
				break;
			default:
				break;
		}
	},
	mounted() {
	},
	methods: {
		showRule(){
			this.ruleMask=true;
		},
		openPrize(){
			this.prizeMask=true;
		},
		clear(){
			this.prizeMask = false;
			this.ruleMask = false;
		},
	}
};
</script>

<style scoped>
.game{
  /* position: relative; */
  min-height: 100vh;
  background: url("./img/bg.png");
  background-size: 100% 100%;
}
.img-bg {
	box-sizing: border-box;
	width: 100%;
	min-height: 100vh;
	overflow: hidden;
	z-index: 1;
}
.game-box {
	margin: 0 auto;
	padding-top: 1rem;
	width: 90%;
}
.logo{
	/* text-align: center; */
	color: #fff;
	font-size: 1.5rem;
}
.img-zhuti{
	display: block;
	width: 100%;
	margin: 0 auto 1.5rem;
}
.surplus-div{
	text-align: center;
	height: 2.5rem;
	border-radius: 2.5rem;
	background-color: rgba(255, 255, 255, 0.1);
	margin-bottom: 1rem;
}
.surplus-div1{
	display: inline-block;
	width: 85%;
	height: 2.5rem;
	border-radius: 2.5rem;
	background-color: rgba(255, 255, 255, 0.2);
}
.surplus-div2{
	display: inline-block;
	width: 80%;
	height: 2.5rem;
	border-radius: 2.5rem;
	background-color: rgba(255, 255, 255, 0.3);
}
.surplus-div button{
	width: 75%;
	height: 2.5rem;
	border-radius: 2.5rem;
	border: none;
	background: linear-gradient(#fffbef, #ffd158,#ffce4f);
	color: #ec3c33;
	box-shadow: 0px 10px 0px #da4447;
	font-weight: bold;
	font-size: 1rem;
}
.img-libao{
	width:100%;
	display: block;
}
.btn-div{
	padding: 2rem;
	text-align: center;
}
.rule-btn{
	text-align: center;
	color: #fff;
	font-size: .9rem;
}
.lingqv-div{
	position: relative;
}
.lingqv-btn{
	width: 100%;
	position: absolute;
	left: 0;
	bottom: 1rem;
	text-align: center;
}
.lingqv-btn button{
	border: none;
	width: 10rem;
	height: 3rem;
	background: linear-gradient(#4f92ff, #2d7dff);
	box-shadow: 0px 5px 0px #0e5ad6;
	color: #fff;
	border-radius: 3rem;
	font-size: 1rem;
	outline: none;
}
.bg2{
	width: 100%;
}
.rule {
  position: absolute;
  width: 100%;
  top: 78%;
  text-align: center;
  font-size: 0.9rem;
  color: #404040;
}
.mask {
  position: fixed;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 10000;
}
.w-prize {
  position: fixed;
  padding: 2rem 4rem 0 4rem;
  top: 50%;
  left: 50%;
  width: 22rem;
  height: 24rem;
  margin-left: -11rem;
  margin-top: -12rem;
  background: url("./img/hbbj.png") no-repeat;
  background-size: 100%;
  z-index: 10001;
  box-sizing: border-box;
  text-align: center;
  color: #fff;
}
.prize-name{
	margin-bottom: 1rem;
	color: #d43142;
	font-weight: bold;
}
.prize-info{
	margin-bottom: 3.5rem;
	font-size: .9rem;
	color: #c62a3b;
}
.prize-info span{
	font-size: 2.5rem;
}
.prize-pic{
	width: 100%;
	height: 6rem;
	background: url("./img/yhq.png");
	background-size: 100% 100%;
	margin-bottom: .8rem;
}
.shiyong{
	padding-top: 1.1rem;
	width: 48%;
	float: right;
	font-size: .7rem;
}
.shiyong button{
	border: none;
	width: 5rem;
	height: 1.5rem;
	background: linear-gradient(#4f92ff, #2d7dff);
	box-shadow: 0px 3px 0px #0e5ad6;
	color: #fff;
	border-radius: 1.5rem;
	font-size: .7rem;
	outline: none;
}
.w-prize .tips{
	padding: 0 1rem;
	color: #661818;
	font-size: .8rem;
}
.clear-div{
	padding: 1rem;
	text-align: right;
}
.clear{
	width: 1.5rem;
	height: 1.5rem;
	display: inline-block;
	background: url("./img/x.png");
	background-size: 100% 100%;
}
.rule-box{
	position: fixed;
	top: 50%;
	left: 50%;
	width: 80%;
	height: 26rem;
	margin-left: -40%;
	margin-top: -13rem;
	background-size: 100%;
	z-index: 10001;
	box-sizing: border-box;
	border: 3px solid #fed148;
	border-radius: 5px;
	background: #fff;
}
.clear-gz{
	position:absolute;
	padding: .8rem;
	top:0;
	left:0;
	width: 100%;
	text-align: right;
	box-sizing: border-box;
}
.gz-title{
	width: 100%;
}
.rule-info{
	padding: 0 .8rem;
	height: 20.5rem;
	overflow-y: scroll;
}
</style>
