<template>
  <div class="redpack_dialog">
    <div class="redpack_img" v-if="type==1">
      <img :src="withdrawData.task_url" alt="">
    </div>
    <div class="redpack_img" v-else>
      <img :src="withdrawData.withdraw_url_1" alt="">
    </div>
    <div class="redpack_tip">长按识别小程序码领取</div>
    <div class="close_btn" @click="closeDialog">
      <img src="../assets/ic_close3.png" alt="">
    </div>
  </div>
</template>

<script>
  export default {
    name: "RedpackDialog",
    props:["withdrawData","type"],
    methods: {
      closeDialog() {
        this.$emit("close")
      }
    }
  }
</script>

<style scoped>

  .redpack_tip {
    position: absolute;
    left: 50%;
    top: 50%;
    margin-left: -1.2rem;
    margin-top: 3.35rem;
    color: #fff;
    font-size: 0.34rem;
    animation: redpack_tip_animate 1.5s infinite;
  }

  @keyframes redpack_tip_animate {
    0% {
      transform: scale(1, 1)
    }
    50% {
      transform: scale(1.2, 1.2)
    }
    100% {
      transform: scale(1, 1)
    }
  }

  .redpack_dialog {
    width: 100%;
    height: 100%;
    position: fixed;
    top: 0;
    left: 0;
    background: rgba(0, 0, 0, 0.7);
    border: 1px solid transparent;
    z-index: 1000;
    text-align: center;
  }

  .redpack_img {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 6.4rem;
    margin-top: -4.5rem;
    margin-left: -3.2rem;
  }

  .redpack_img img {
    width: 100%;
  }

  .close_btn {
    width: .7rem;
    position: absolute;
    top: .3rem;
    right: .5rem;
  }

  .close_btn img{
    width: 100%;
    height: 100%;
  }

</style>
