<template>
  <div>
    <van-overlay :show="value" :duration="0.1" @click="$emit('change', false)">
      <div class="exitModal" @click.stop>
        <div class="exitImg">
          <img :src="pageData.remarks.exitImg" alt="">
        </div>
        <div class="productName">
          <p class="p1">确定要放弃</p>
          <p class="p2"><span>{{ pageData.remarks.exitText }}</span></p>
        </div>
        <div class="productBtn">
          <div class="btnLeft div" @click="goBack">仍要放弃</div>
          <div class="btnRight div" @click="buyClick()">立即订购</div>
        </div>
      </div>
    </van-overlay>
  </div>
</template>

<script>
import addR from "../common/addRecord";
export default {
  model: { prop: "value", event: "change" },
  props: { value: Boolean },
  computed: {
    pageData () {
      return this.$store.state.pageData;
    },
  },
  methods: {
    goBack () {
      addR.exitClick()
      this.$emit('change', false)
      this.$store.commit('setRouter', false)
      this.$router.back();
    },
    buyClick () {
      this.$emit('change', false)
      if (this.pageData.remarks.attestation == 0 || this.pageData.remarks.attestation == 3) {
        this.$parent.openIframe()
      }

    }
  }
}
</script>

<style lang="scss">
.exitModal {
  box-sizing: border-box;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: 590px;
  background-color: #fff;
  border-radius: 56px;
  top: 377px;
  // padding: 40px 65px;
  text-align: center;
  .exitImg {
    width: 590px;
    height: auto;
    img {
      width: 100%;
      height: auto;
    }
  }
  .productName {
    font-size: 28px;
    font-weight: 600;
    p {
      font-size: 42px;
      font-family: HYYakuHei-FEW, HYYakuHei;
      font-weight: bold;
      color: #121212;
      margin-top: 33px;
      span {
        font-size: 46px;
        color: #ff0606;
      }
    }
  }
  .productBtn {
    display: flex;
    justify-content: space-between;
    margin-bottom: 62px;
    padding: 0 37px;
    .div {
      width: 238px;
      height: 94px;
      border-radius: 57px;
      line-height: 94px;
      font-size: 40px;
      border-style: solid;
      border-width: 4px;
      font-weight: bold;
      font-family: HYYakuHei-HEW, HYYakuHei;
    }
    .btnLeft {
      color: #bfbfbf;
      border-color: #bfbfbf;
    }
    .btnRight {
      font-size: 42px;
      color: #fff;
      background: linear-gradient(320deg, #ff7a7a 0%, #ff0606 100%);
    }
  }
}
</style>