<template>
  <div class="toastbox" @click="close" v-if="show">
    <div class="toastdetal">
      <div class="toastcontent">
        <!-- <div class="desc">
          <span class="toastdesc">投票成功</span>
          <span class="toastdesc">您今天还有2次投票机会！</span>
          <span class="toastdesc">恭喜你获得一次抽奖机会!</span>
        </div> -->
          <div class="desc">
          <span class="toastdesc">已投票3次！</span>
          <span class="toastdesc"> 您今日投票次数已达到上限～</span>
          <span class="toastdesc"> 明天再来吧！</span>
        </div>
        <div class="btn">
          <button class="confirm" @click="confirmbtn">确定</button>
          <!-- <button class="confirm" @click="gotocosmobonus">立即前往</button> -->
        </div>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  name: "toastbox",
  data() {
    return {
      show: true
    };
  },
  methods: {
    close() {
      this.$emit("close");
    },
    confirmbtn() {
      this.show = false;
    },
    gotocosmobonus(){
      
    }
  }
};
</script>

<style lang="scss" scoped>
.toastbox {
  position: fixed;
  top: 0px;
  left: 0px;
  z-index: 5;
  width: 100%;
  height: 100%;
  // display: none;
  flex: 1;
  background: rgba(0, 0, 0, 0.5);

  .toastdetal {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;

    .toastcontent {
      width: 70%;
      height: 1.69rem;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      position: fixed;
      border-radius: 0.04rem;
      background: rgba(255, 255, 255, 1);
      box-shadow: 0px 2px 4px 0px rgba(194, 194, 194, 0.5);
      .desc {
        display: flex;
        flex-direction: column;
        padding-bottom: 0.25rem;
        justify-content: center;
        align-items: center;

        .toastdesc {
          font-size: 0.16rem;
          font-family: PingFangSC-Regular;
          font-weight: 400;
          color: rgba(0, 0, 0, 1);
          line-height: 0.22rem;
          word-wrap: break-word;
          word-break: normal;
        }
      }

      .btn {
        width: 100%;
        display: flex;
        flex-direction: row;
        align-items: center;
        justify-content: center;

        .confirm {
          width: 46%;
          height: 0.34rem;
          border-radius: 0.04rem;
          border: 1px solid rgba(112,125,138,1);
          background-color: rgba(255, 255, 255, 0);
          font-size: 0.14rem;
          font-family: PingFangSC-Medium;
          font-weight: bold;
         color:rgba(112,125,138,1);
          line-height: 0.2rem;
          margin-right: 0.15rem;
        }
      }
    }
  }
}
</style>

