<template>
  <cr-popup v-model="tipShow" round @close="handleClosePop">
    <img class="wx" :src="typeInfo[type].url" alt="qr" />
  </cr-popup>
</template>
<script>
export default {
  components: {},
  props: {
    value: {
      type: Boolean,
      default: false
    },
    type: {
      type: String,
      default: 'wx'
    }
  },
  data() {
    return {
      tipShow: false,
      typeInfo: {
        wx: {
          url: 'https://img.lkbang.net/xcx/downGzh.png',
          qr: 'https://img.lkbang.net/xcx/gzhQrcode.png',
          top: '请关注【羊小咩Plus】公众号，获得更多信息',
          title: '关注微信'
        }
      }
    };
  },
  watch: {
    value(val) {
      this.tipShow = val;
    }
  },
  methods: {
    handleClosePop() {
      this.$emit('update:value', false);
    }
  }
};
</script>
<style lang="less">
.wx {
  width: 300px;
  display: block;
}
</style>
