<template>
  <van-popup
    v-model="visible"
    class="online-tip-popup"
    :style="{ background: 'transparent' }"
    @click-close-icon="onClose"
  >
  <div class="main">
    <div class="box">
      <img class="box-img" src="~@/assets/images/lottery/needOnline.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>
    </div>
  </div>
  </van-popup>
</template>

<script>
import Bus from '@/utils/Bus'

export default {
  name: 'OnlineTipPopup',
  components: {},
  props: {
    value: {
      type: Boolean,
      default: false
    },
    info: {
      type: Object,
      default: () => ({})
    },
    type: {
      type: String,
      default: ''
    }
  },
  computed: {
    visible: {
      get() {
        return this.value
      },
      set(val) {
        Bus.$emit('updateMain', { isShowOnlineTip: val })
      }
    },
    isWin() {
      return !!Number(this.info.id)
    }
  },
  methods: {
    know() {
      Bus.$emit('updateMain', { func: 'winCallback' })
    },
    onClose() {
      Bus.$emit('updateMain', { func: 'winCloseCallback' })
    }
  }
}
</script>

<style lang="less" scoped>
.online-tip-popup {
  // overflow: visible;
  width: 100%;
  /deep/ .van-popup__close-icon {
    right: 10px;
    top: -16px;
    font-size: 22px;
    color: #fff;
  }
  background-color: transparent;
  .main {
    // width: 100%;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    .box {
      width: 70%;
      position: relative;
      &-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: 8%;
        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: 33px;
          background: linear-gradient( 201deg, #FD8192 0%, #FF4F31 100%);
          border-radius: 37px;
          font-family: PingFangSC, PingFang SC;
          font-weight: 500;
          font-size: 13px;
          color: #FFFFFF;
          line-height: 33px;
          text-align: center;
        }
      }
    }
  }
}
</style>
