<template>
  <div
    class="dialog-bg"
    v-if="show"
  >
    <div class="content">
      <div class="content-detail-bg">
        <div class="content-detail">
          <div class="title">您还未关注服务号</div>
          <div class="subtitle">关注服务号，助力赢好礼</div>
          <div class="qrcode-box">
            <div class="image-box">
              <img :src="qrcodeUrl" class="qrcode-img" />
            </div>
            <div class="tips">长按保存/识别二维码</div>
          </div>
        </div>
      </div>
      <div class="iconfont icon-guanbi" @click="close"></div>
    </div>
  </div>
</template>

<script>
export default {
  props: {
    show: Boolean,
    qrcodeUrl: String,
  },
  data() {
    return {};
  },
  methods: {
    close() {
      this.$emit("update:show", false);
    },
  },
};
</script>

<style scoped lang="scss">
.dialog-bg {
  position: fixed;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  z-index: 99;
  background: rgba(0, 0, 0, 0.85);
}

.dialog-bg .content {
  position: absolute;
  z-index: 2;
  left: 50%;
  top: 45%;
  transform: translate(-50%, -50%);
  text-align: center;
  width: 75%;
  .content-detail-bg {
    background: #D9FCF5;
    box-sizing: border-box;
    border-radius: 10px;
    border: 1px solid #54fefe;
    box-shadow: 0px 1px 2px 0px rgba(0, 0, 0, 0.5);
    padding: 8px 10px;
    .content-detail {
      border-radius: 10px;
      border: 2px solid #ADC9C5;
      text-align: center;
      padding: 10px 13px;
      .title {
        color: #21252B;
        font-weight: 600;
        font-size: 20px;
        padding-top: 15px;
      }
      .subtitle {
        color: #21252B;
        font-size: 15px;
        padding: 20px 0 18px;
        white-space: pre-wrap;
      }
      .qrcode-box {
        margin: 0 auto;
        text-align: center;
        width: fit-content;
        .image-box {
          background: white;
          padding: 5px;
          border-radius: 4px;
          border: 2px solid #ADC9C5;
          .qrcode-img {
            width: 110px;
            height: 110px;
          }
        }
        .tips {
          color: #21252B;
          text-align: center;
          font-size: 12px;
          padding: 8px 0 24px;
        }
      }
    }
  }
}

.dialog-bg .content .icon-guanbi {
  margin: 40px auto 0;
  color: white;
  opacity: 0.8;
  padding: 15px;
  font-size: 28px;
  height: 28px;
  width: 28px;
}
</style>
