<template>
  <div v-if="show">
    <div class="snapdragonDiv" @click="clickEmpty()">
      <div class="basicPopDiv" :style="styleData.failPopBackground" @click="stopClickEmpty">
        <div class="titleDiv">
          <div v-if="styleData.titleDiv1" class="titleDiv1" :style="styleData.titleDiv1">
            <div class="leftLineDiv"></div>
            <span>很遗憾</span>
            <div class="RightLineDiv"></div>
          </div>
          <div class="closeDiv" @click="closeClick()"></div>
        </div>
        <div class="content-body">
          <!-- <img alt="图标" class="icon"
          src="//img10.360buyimg.com/imgzone/jfs/t1/195219/30/2852/6030/609d0959Ef55dcf31/cc2dde0a0b8a0d50.png" />
        -->
          <div class="essmsgTitle" :style="styleData.essmsgTitle">{{ datas.essmsgTitle }}</div>
          <div class="text" :style="styleData.text">{{ datas.essmsg }}</div>
          <div class="buttonDiv" :style="styleData.buttonDiv" v-if="datas.btnText == '邀请好友'" @click="shareFriendBtn">{{ datas.btnText }}</div>
          <div class="buttonDiv" :style="styleData.buttonDiv" v-else @click="closeReloadClick">{{ datas.btnText }}</div>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
import { teamShare } from '../../../js/share.js';
import { moreCoupon } from '../../../util/tools.js';
export default {
  data() {
    return {};
  },
  created() {
    console.log(this.datas, '拼券失败信息');
    // console.log(this.styleData, '拼券失败信息styleData');
  },
  methods: {
    //点击空白处关闭弹框
    clickEmpty() {
      this.submit();
    },
    //阻止冒泡
    stopClickEmpty(event) {
      event.stopPropagation();
    },
    closeClick() {
      this.submit();
    },
    //邀请好友
    shareFriendBtn() {
      console.log(this.datas, '拼券信息')
      teamShare(false, this.datas.prizeDetailInfo.teamId, this, callBackData => {
        console.log(callBackData, 'callBackData');
      });
    },
    //发现更多优惠
    closeReloadClick() {
      this.submit();
      moreCoupon();
    }
  }
};
</script>

<style lang="scss" scoped="scoped">
.snapdragonDiv {
  position: fixed;
  width: 100%;
  height: 100%;
  background: rgba($color: #000000, $alpha: 0.7);
  top: 0;
  bottom: 0;
  z-index: 200;

  .basicPopDiv {
    position: fixed;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 6rem;
    height: 6.3rem;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: stretch;
    background-size: 100;

    .titleDiv {
      width: 100%;
      height: 1.14rem;
      position: relative;
      flex-grow: 0;
      flex-shrink: 0;

      .titleDiv1 {
        height: 100%;
        display: flex;
        justify-content: center;
        align-items: center;
        color: #333333;
        font-size: 0.46rem;
      }

      .leftLineDiv {
        width: 34px;
        height: 4px;
        background: linear-gradient(to right, #4f5f7a, #e9eaef);
        border-radius: 4px;
        margin-right: 0.1rem;
      }

      .RightLineDiv {
        width: 34px;
        height: 4px;
        background: linear-gradient(to left, #4f5f7a, #e9eaef);
        border-radius: 4px;
        margin-left: 0.1rem;
      }

      .closeDiv {
        position: absolute;
        top: 0;
        right: 0;
        bottom: 0;
        width: 48px;
        height: 48px;

        img {
          display: none;
        }

        &:before,
        &:after {
          position: absolute;
          left: 50%;
          top: 50%;
          display: block;
          content: '';
          width: 0.4rem;
          height: 0.04rem;
          border-radius: 1px;
          background-color: #8293ab;
        }

        &:before {
          transform: translate(-50%, -50%) rotate(45deg);
        }

        &:after {
          transform: translate(-50%, -50%) rotate(-45deg);
        }
      }
    }

    .content-body {
      flex-grow: 1;
      flex-shrink: 1;
      margin: 1.76rem 0.25rem 0 0.25rem;

      padding: 0 0.34rem;
      overflow: auto;
      -webkit-overflow-scrolling: touch;
      line-height: 0.47rem;
      letter-spacing: 0rem;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: space-evenly;

      .icon {
        width: 1.53rem;
        height: 1.53rem;
      }

      .text {
        color: #afafaf;
        font-size: 0.22rem;
      }
      .essmsgTitle {
        color: #262626;
        font-size: 0.46rem;
        font-weight: bold;
      }

      .buttonDiv {
        width: 100%;
        padding: 0.22rem 0;
        background: linear-gradient(to right, #f2270c, #fe631f);
        border-radius: 0.46rem;
        color: #ffffff;
        font-size: 0.28rem;
        text-align: center;
      }
    }
  }
}
</style>
