<template>
  <van-popup
    v-model="visible"
    position="bottom"
    round
    transfer
    class="force-popup"
  >
  <div class="main">
    <div class="box">
      <img class="box-img" src="~@/assets/images/lottery/force.png" alt="">
      <img class="box-close" src="~@/assets/images/lottery/force-close.png" alt="" @click="visible = false">
      <div class="box-warp">
        <div class="box-warp__title">抽奖信息填写，快人一步!</div>
        <div class="box-warp__content">该直播间有抽奖活动现在填写信息，参与抽奖更快哦！</div>
        <div class="box-warp__btn" @click="goConfig">立即填写</div>
      </div>
    </div>
  </div>
  </van-popup>
</template>

<script>
import Bus from '@/utils/Bus'
import { mapGetters, mapActions } from 'vuex'

export default {
  name: 'ForcePopup',
  props: {
    value: {
      type: Boolean,
      default: true,
    },
  },
  data() {
    return {
    }
  },
  computed: {
    ...mapGetters({
      uin: 'users/uin',
      lotteryInfo: 'lottery/lotteryInfo'
    }),
    visible: {
      get() {
        return this.value
      },
      set(val) {
        this.$emit('input', val)
      },
    },
  },
  methods: {
    ...mapActions({
      getLotteryDetail: 'lottery/getLotteryDetail',
      updateInfo: 'lottery/updateInfo',
      checkPremise: 'lottery/check_premise'
    }),
    goConfig() {
      Bus.$emit('showConfig')
      this.visible = false
    }
  }
}
</script>

<style lang="less" scoped>
.force-popup {
  background-color: transparent;
  .main {
    height: 100vh;
    max-width: 540px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0 auto;
    .box {
      width: 70%;
      position: relative;
      margin-bottom: 10%;
      &-img {
        width: 100%;
        position: relative;
      }
      &-close {
        width: 20px;
        height: 20px;
        position: absolute;
        top: 10%;
        right: -20px;
      }
      &-warp {
        position: absolute;
        display: flex;
        flex-direction: column;
        justify-content: flex-end;
        align-items: center;
        padding-bottom: 13%;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        &__title {
          font-family: PingFangSC, PingFang SC;
          font-weight: 500;
          font-size: 18px;
          color: #333333;
          text-align: center;
        }
        &__content {
          max-width: 80%;
          font-family: PingFangSC, PingFang SC;
          font-weight: 400;
          font-size: 14px;
          color: #666666;
          text-align: center;
          line-height: 19px;
          margin: 14px 0 37px;
        }
        &__btn {
          width: 120px;
          height: 36px;
          background: linear-gradient( 201deg, #FD8192 0%, #FF4F31 100%);
          border-radius: 37px;
          font-family: PingFangSC, PingFang SC;
          font-weight: 500;
          font-size: 14px;
          color: #FFFFFF;
          line-height: 36px;
          text-align: center;
          cursor: pointer;
        }
      }
    }
  }
}
</style>
