// 弱关弹窗
<template>
  <x-prompt :visible="visible">
    <div class="p-weak-subscribe">
      <div class="head">温馨提示</div>
      <div class="body">
        <p>关注作者授权公众号继续阅读</p>
        <p>更多精彩内容等你哟~</p>
        <div style="position: relative; height: auto">
          <img v-if="head"
               class="head-img"
               :src="head">
          <img :src="src">
        </div>
        <p>长按上图识别二维码关注</p>
      </div>
      <div class="close"
           @click="visible = false"></div>
    </div>
  </x-prompt>
</template>
<script>
import prompt from "../prompt.vue";
import { getweakSubscribeQR } from "@/api";
export default {
  components: { "x-prompt": prompt },
  data() {
    return {
      src: "",
      head: ""
    };
  },
  created() {
    getweakSubscribeQR().then(r => {
      this.src = r.src;
      this.head = r.head_img;
    });
  },
  methods: {}
};
</script>
<style lang="scss">
.p-weak-subscribe {
  position: relative;
  .head.head {
    font-size: 0.36rem;
    color: #32a1ff;
    font-weight: bold;
  }
  p:nth-child(1) {
    font-size: 0.34rem;
    color: #ff6060;
    font-weight: bold;
    margin-bottom: 0.15rem;
  }
  p:nth-child(2) {
    color: #ff6060;
    font-size: 0.3rem;
  }
  img {
    height: 4rem;
    width: 4rem;
    margin: 0.3rem auto;
    display: block;
  }
  .head-img {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    height: .8rem;
    width: .8rem;
    margin: 0;
    pointer-events: none;
  }
}
</style>