<template>
  <div class="basicMaskDiv" @click="closeClick" v-if="show">
    <div class="draw-success">
      <transition name="ease">
        <div class="draw-success-bg">
          <div class="draw-success-close" @click="drawSuccessShow = false;"></div>
          <div class="draw-success-top">报名成功!</div>
          <div class="draw-success-main">
            <div class="draw-success-text">
              <p class="draw-success-text-t">{{data.data.prizeName}}</p>
              <p class="draw-success-text-b" v-if="data.data.prizeType == 3">
                您已经完成活动报名，在完成订单付款，并最终确认收货后，可联系商家进行实物礼品发货。请在报名后1小时之内及时填写邮寄地址，以免礼品发放失败！未完成付款或未确认收货的将无法获得礼品</p>
              <p class="draw-success-text-b" v-else>您已经完成活动报名，虚拟礼品将在您完成订单付款，并最终确认收货后<span
                style="color: #ff3333;">20至30</span>分钟内自动发放，未完成付款或未确认收货的将无法获得礼品</p>
            </div>
            <div class="draw-success-big-btn" @click="goToSavePage()"
                 v-if="data.data.prizeType == 3">填写邮寄地址
            </div>
            <div class="dialog-big-btn" @click="drawSuccessShow = false;" v-else>朕知道了</div>
          </div>
        </div>
      </transition>
    </div>
  </div>
</template>

<script>
import {OrderAddressPopService, OrderCheckPopComService} from "../../../util/comCreate";

export default {
  props: [],
  components: {},
  data() {
    return {
      show: true,
      helpSuccessWindow: false,
      hasHelpedWindow: false,
      returnInviterPage: false,
      num: 3,
      url1:'',
      activityInfo:[],
    };
  },
  created() {
    document.querySelector("body").setAttribute("style",
      "position:#fixed;top:0;height:100%;overflow:hidden"
    );
    this.initData();
  },
  methods: {
    closeClick() {
      document.querySelector("body").removeAttribute("style");
      this.submit();
    },
    initData() {
      if (this.data == 0) {
        this.helpSuccessWindow = true;
      } else if (this.data == 1) {
        this.hasHelpedWindow = true;
      } else if (this.data == 2) {
        this.returnInviterPage = true;
        setInterval(this.timer, 1000);
      }
    },
    goToSavePage(){
      OrderAddressPopService.create(prizeRecordDetilClick => {
        OrderAddressPopService.close();
      });
    },
  },
};
</script>

<style lang="scss">
/*奖品领取成功*/
.dialog-big-btn {
  width: 5rem;
  height: .8rem;
  line-height: .8rem;
  background-color: #e2231a;
  border-radius: .05rem;
  font-size: .3rem;
  font-weight: normal;
  font-stretch: normal;
  letter-spacing: 0px;
  color: #ffffff;
  text-align: center;
  position: absolute;
  bottom: .3rem;
  right: 0;
  left: 0;
  margin: 0 auto;
}
.draw-success {
  background: rgba(0, 0, 0, 0.7);
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  position: fixed;
  display: flex;
  justify-content: center;
  align-items: center;
}

.draw-success-bg {
  position: relative;
  width: 6rem;
  height: 6.6rem;
  background: url("//img10.360buyimg.com/imgzone/jfs/t1/130941/9/17938/428800/5fc7593aE5ec0aaa0/139dd5a212929863.png") no-repeat;
  background-size: 100% 100%;
  display: flex;
  justify-content: center;
}

.draw-success-close {
  width: .24rem;
  height: .24rem;
  position: absolute;
  top: .2rem;
  right: .2rem;
}

.draw-success-top {
  font-size: .36rem;
  font-stretch: normal;
  letter-spacing: 0px;
  color: #ff3333;
  position: absolute;
  top: .46rem;
  font-weight: bold;
}

.draw-success-main {
  width: 5.6rem;
  height: 3rem;
  background-color: #ffffff;
  box-shadow: 0px .05rem .16rem 0px rgba(177, 177, 177, 0.24);
  border-radius: .1rem;
  margin-top: 3.4rem;
  position: relative;
  text-align: center;
}

.draw-success-text {
  margin-top: .15rem;
}

.draw-success-text-t {
  font-size: .36rem;
  font-weight: normal;
  font-stretch: normal;
  letter-spacing: 0px;
  color: #ff3333;
  margin-bottom: .1rem;
}

.draw-success-text-b {
  font-size: .22rem;
  font-weight: normal;
  font-stretch: normal;
  letter-spacing: 0px;
  color: #333333;
}

.draw-success-big-btn {
  width: 5rem;
  height: .8rem;
  line-height: .8rem;
  background-color: #e2231a;
  border-radius: .05rem;
  font-size: .3rem;
  font-weight: normal;
  font-stretch: normal;
  letter-spacing: 0px;
  color: #ffffff;
  text-align: center;
  position: absolute;
  bottom: .15rem;
  right: 0;
  left: 0;
  margin: 0 auto;
}

.basicMaskDiv {
  position: fixed;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  top: 0;
  bottom: 0;
  z-index: 200;
}
</style>
