<template>
<div class="game">
    <div class="game-box">
		<div class="logo">logo</div>
		<div class="zhuti">
			<img :src="comp.props.zhutiImg.val" :style="{'width':comp.props.zhutiWidth.val}" alt="">
		</div>
		<div class="gzbtn"><span @click="showRule()">查看获取规则></span></div>
		<div class="bg-box">
			<img class="bg2" src="./img/bg2.png" alt="">
			<div class="hb-div">
				<img class="hb" @click="openPrize()" src="./img/hb.png" alt="">
			</div>
		</div>
    </div>
    <!-- 中奖 -->
    <div class="mask" v-show="prizeMask">
		<div class="w-prize">
			<img src="./img/gxn.png" class="gxn">
			<div class="prize-info">获得￥<span>88</span>现金红包</div>
			<div class="exchange" v-if="comp.props.pageType.val==1">门店扫码后奖励到账</div>
			<div class="exchange" v-if="comp.props.pageType.val!=1">消费者扫码后奖励到账</div>
			<div>
				<button class="duihuan-btn" @click="clear()">继续扫码</button>
			</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>
			</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: "customerRecommendation",
	props: ["comp", "cfg", "selectedPage"],
	data() {
		return {
			prizeMask:false,
			showPrize:false,
			ruleMask:false,
			guajiangFlag:false //防止多次刮奖
		};
	},
	created() {
		this.mergeCompProps(this.comp);
		console.log(this.cfg);

		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;
		},
		clear(){
			this.prizeMask = false;
			this.ruleMask = false;
		},
		openPrize(){
			this.prizeMask = true;
		}
	}
};
</script>

<style scoped>
.game{
  /* overflow: hidden; */
  position: relative;
  min-height: 100vh;
  background-color: #ec3c33;
  background-image: url("./img/bg.png");
  background-size: 100%;
  background-repeat: no-repeat;
}
.img-bg {
	box-sizing: border-box;
	width: 100%;
	overflow: hidden;
	z-index: 1;
}
.guaguale-box {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
}
.logo{
	padding: 1rem 2rem;
	color: #fff;
	font-size: 2rem;
}
.zhuti{
	padding: 0 2rem;
	text-align: center;
}
.bg-box{
	padding-top: 3rem;
	position: relative;
}
.bg-box .bg2{
	width: 100%;
}
.bg-box .hb-div{
	position: absolute;
	width: 100%;
	padding-top: 2.5rem;
	top:0;
	left: 0;
	text-align: center;
}
.bg-box .hb-div .hb{
	width: 65%;
}
.gzbtn{
	text-align: center;
	color: #fff;
}
.guajiang{
	width:90%;
	position: relative;
	margin: 0 auto;
}
.img-libao{
	width:100%;
	display: block;
}
.guajiang-title{
	position: relative;
	width:100%;
	text-align: center;
	color: #da8a24;
	font-size: 1rem;
	font-weight: bold;
	background: linear-gradient(#fde27c, #fec665,#feaf52);
	height:4rem;
	line-height: 4rem;
	box-shadow: 0px 10px 10px #e65321;
	z-index: 2;
}
.btn-div{
	padding: 2rem;
	text-align: center;
}
.rule-btn{
	width: 7rem;
	height: 2rem;
	border:1px solid #7a0409;
	background: transparent;
	border-radius: 2rem;
}
.rule-icon{
	display: inline-block;
	width: 0.9rem;
  	height: 1rem;
	/* background: url("./img/gzicon.png"); */
	background-size: 100% 100%;
	color: #7a0409;
	vertical-align: top;
}

.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: 4rem 4rem 0 4rem;
  top: 50%;
  left: 50%;
  width: 20rem;
  height: 22rem;
  margin-left: -10rem;
  margin-top: -11rem;
  background: url("./img/kj.png") no-repeat;
  background-size: 100%;
  z-index: 10001;
  box-sizing: border-box;
  text-align: center;
  color: #fff;
}
.gxn{
	width: 8rem;
	display: block;
	margin: 0 auto 2rem auto;;
}
.prize-name{
	margin-bottom: 2.5rem;
}
.prize-info{
	margin-bottom: 2rem;
	font-size: .9rem;
	color: #ffff8c;
}
.prize-info span{
	font-size: 2rem;
}
.exchange{
	color: #ffe5c4;
	margin-bottom: 1rem;
}
.duihuan-btn{
	width: 90%;
	height: 2.5rem;
	border-radius: 2.5rem;
	color: #b62232;
	background: linear-gradient(#ffff8c, #f4c66a,#e98c49);
	border: none;
	font-size: 1rem;
}
.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: 30rem;
	margin-left: -40%;
	margin-top: -15rem;
	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: 23rem;
	overflow-y: scroll;
}
</style>
