<template>
<!--  大圆盘抽奖页面-->
  <van-overlay :show="showAll" @click="showAll = false">
    <div class="wrapper" @click="showAll = false">
      <div class="snapdragonDiv">
        <div>
          <rotal-table
            v-if="show"
            :isTemplate="isTemplate"
            :datas="datas"
            :styleData="styleData"
            :keyData="keyData"
            :templateData="templateData"
            style="top:1rem"
          />
        </div>
        <div v-if="show" class="explainCss">
          <span>{{this.explain}}</span>
        </div>
      </div>
    </div>
  </van-overlay>

</template>

<script>
import Vue from 'vue';
import { Overlay } from 'vant';
import rotalTable from '../../luckyDraw/rotary.vue';
Vue.use(Overlay);
export default {
  name: "draw",
  props: ['isTemplate', 'datas', 'styleData', 'keyData', 'templateData'],
  components: {rotalTable},
  data() {
    return {
      showAll: false,
      show: false,
      explain:"",
    }
  },
  created() {
    this.publicData.$on('picDrawShow', args => {
      if(args.zanFlg === undefined){
          this.explain = '说明：每集' + args.zanCount + '个赞可获得1次抽奖机会，无限累计';
      }
      else{
          //this.explain = '说明：每集' + args.zanCount + '个赞可获得1次抽奖机会，最多' + args.zanFlg + '次';
          this.explain = '说明：每集' + args.zanCount + '个赞可获得1次抽奖机会。';
      }
      console.log('picDrawShow-----', args)
      this.showAll = true;
      this.show = true;
    });
  },
}
</script>

<style lang="scss" scoped>
  .snapdragonDiv {
    width: 100%;
    height: 100%;
    top: 0;
    bottom: 0;
  .basicPopDiv {
    position: fixed;
    width: 6.48rem;
    min-height: 7rem;
    max-height: 100vh;
    background-color: #eaebf0;
    border-radius: 0.2rem;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: stretch;

  .titleDiv {
    width: 100%;
    height: 1.14rem;
    position: relative;
    flex-grow: 0;
    flex-shrink: 0;

  .titleDiv1 {
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #333333;
    font-size: 0.46rem;
  }

  .leftLineDiv {
    width: 34px;
    height: 4px;
    background: linear-gradient(to right, #4f5f7a, #e9eaef);
    border-radius: 4px;
    margin-right: 0.1rem;
  }

  .RightLineDiv {
    width: 34px;
    height: 4px;
    background: linear-gradient(to left, #4f5f7a, #e9eaef);
    border-radius: 4px;
    margin-left: 0.1rem;
  }

  .closeDiv {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 48px;
    height: 48px;

  img {
    display: none
  }

  &:before, &:after {
               position: absolute;
               left: 50%;
               top: 50%;
               display: block;
               content: "";
               width: .4rem;
               height: 0.04rem;
               border-radius: 1px;
               background-color: #8293ab;
             }

  &:before {
     transform: translate(-50%, -50%) rotate(45deg);
   }

  &:after {
     transform: translate(-50%, -50%) rotate(-45deg);
   }
  }
  }

  .content-body {
    flex-grow: 1;
    flex-shrink: 1;
    margin: 0.25rem;
    background-color: white;
    padding: .34rem;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
    box-shadow: 0rem 0.05rem 0.16rem 0rem rgba(177, 177, 177, 0.18);
    border-radius: 0.1rem;
    font-weight: normal;
    font-stretch: normal;
    line-height: 0.47rem;
    letter-spacing: 0rem;
    color: #495975;
    display: flex;
    flex-direction: column;
    font-size: 0.44rem;
    align-items: center;
    justify-content: space-evenly;

  .icon {
    width: 1.53rem;
    height: 1.53rem;
  }

  .text {
    color: #495975;
  }

  .button {
    width: 100%;
    height: 0.94rem;
    background-color: #495975;
    border-radius: 0.1rem;
    color: #ffffff;
    font-size: 0.46rem;
  }
  }
  }
  }
  .explainCss{
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    margin-top: 10rem;
    width: 6.4rem;
    height: 0.74rem;
    background-color: #495975;
    border-radius: 0.22rem;
    padding-top:0.2rem;
    font-family: SourceHanSansCN-Normal;
    font-size: 0.23rem;
    font-weight: normal;
    font-stretch: normal;
    line-height: 0.36rem;
    letter-spacing: 0rem;
    color: #ffffff;
  }
  .wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
  }

  .block {
    width: 120px;
    height: 120px;
    background-color: #fff;
  }
</style>

<style lang="scss">
  .restDrawCount .restDrawCount1{
    font-size: 0.5rem;
  }
  /*.aaa{*/
  /*  width: 557px;*/
  /*  height: 44px;*/
  /*  background-color: #495975;*/
  /*  border-radius: 22px;*/
  /*}*/
</style>
