<template>
  <div class="popup" v-show="visible">
    <div :class="{ 'popup-container': true, success: signStatus === 1, warn: signStatus === 2 }">
      <p v-if="signStatus === 1" class="success">签到成功!</p>
      <p v-if="signStatus === 2" class="warn">
        您已迟到。<span>请于课后补看错过视频。</span>
      </p>
      <p v-if="signStatus === -1" class="info">
        直播未开始<span>请提前10分钟进入签到</span>
      </p>
      <div class="content">
        <slot></slot>
      </div>
      <i class="el-icon-circle-close" @click="handleClose"></i>
    </div>
    <div class="overlay"></div>
  </div>
</template>
<script>
export default {
  props: {
    visible: {
      type: Boolean,
      default: false
    },
    title: {
      type: String,
      default: ''
    },
    signStatus: {
      type: Number,
      default: 1
    }
  },
  data() {
    return {}
  },
  methods: {
    handleClose() {
      this.$emit('update:visible', false)
    }
  }
}
</script>
<style scoped>
.overlay{
  position:fixed;
  left:0;
  top:0;
  right:0;
  bottom:0;
  z-index:1999;
  background:rgba(0, 0, 0, .5);
}
.popup-container{
  position:fixed;
  left:50%;
  top:50%;
  transform:translate(-50%, -50%);
  z-index:2000;
  width:313px;
  height:211px;
  padding-top:150px;
  border-radius:5px;
  box-shadow: 0 1px 3px rgb(0 0 0 / 30%);
  background-image: url('@/assets/images/popup_bg1.png');
  background-size:313px;
}
.popup-container.warn{
  background-image: url('@/assets/images/popup_bg2.png');
}
.popup-container p{
  color:#1B6EBB;
  font-size:28px;
  text-align:center;
  margin:0;
}
.popup-container p span{
  color:#959595;
  font-size:18px;
  line-height:36px;
  display:block;
}
.popup-container p.warn{
  color:#D51E2A;
}
.popup-container p.info{
  color:#333;
}
.popup-container>i{
  position:absolute;
  left:50%;
  bottom:-60px;
  transform:translateX(-50%);
  padding:5px;
  cursor:pointer;
  font-size:30px;
  color:#fff;
}
.popup-container>i:hover{
  color: #e3e3e3;
}
.content{
  text-align: center;
  padding-top:40px;
}
.content button{
  width:180px;
  font-size:16px;
  background:#1B6EBB;
  border-color:#1B6EBB;
}
.popup-container.warn .content button{
  background:#D51E2A;
  border-color:#D51E2A;
}
</style>
