<template>
  <div class="cmain">
    <div class="ewm">
      <div id="qrcode"></div>
    </div>
  </div>
</template>

<script>
import QRCode from 'qrcodejs2';
export default {
  data() {
    return {
      company: {}
    };
  },
  props: {
    param: {
      type: Object,
      default: () => {
        return {};
      }
    },
    layerid: {
      type: String
    }
  },
  mounted() {
    this.ajax({ url: '/work/company/index' }).then((response) => {
      this.company = response.data;
      this.$nextTick(() => {
        this.qrCode();
      });
    });
  },
  methods: {
    qrCode() {
      document.getElementById('qrcode').innerHTML = '';
      new QRCode('qrcode', {
        width: 250,
        height: 250,
        text: '' + this.company.id
      });
    }
  }
};
</script>
<style lang="scss">
.ewm {
  text-align: center;
  padding-top: 15px;
  img {
    margin: 0 auto;
  }
}
</style>
