<template>
  <div>
    <a-modal title="邀请二维码" width="500px" :visible="QRCodeParams.visible" @cancel="handleCancel" :footer="null">
      <div class="qr_code_wrap">
        <img class="qr_code" :src="QRCodeParams.QRcodeImg" alt="" />
        <a-button type="dashed" :disabled="QRCodeParams.downloadLoading" @click="download(QRCodeParams.qrId)"
          >下载</a-button
        >
      </div>
    </a-modal>
  </div>
</template>

<script>
export default {
  props: {
    QRCodeParams: {
      type: Object,
      default: () => {},
    },
  },
  methods: {
    handleCancel() {
      this.$parent.handleCancel()
    },
    download(id) {
      this.$parent.download(id)
    },
  },
}
</script>

<style scoped>
.qr_code_wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.qr_code {
  width: 220px;
  height: 220px;
  margin-bottom: 30px;
}
</style>
