<template>
  <div class="content">
    <back :title="titlename"></back>
    <div class="body">
      <div class="dh">
        <p>
          快递单号：<span>123224443</span
          ><span style="color: #0c2469;padding-left: .1rem;">复制单号</span>
        </p>
      </div>
      <div class="qrcode" ref="qrCodeUrl"></div>
    </div>
  </div>
</template>

<script>
import QRCode from "qrcodejs2";
export default {
  data() {
    return {
      titlename: "扫码"
    };
  },
  created: function() {
    this.isLogin();
  },
  methods: {
    creatQrCode() {
      var qrcode = new QRCode(this.$refs.qrCodeUrl, {
        text: "www.baidu.com", // 需要转换为二维码的内容
        width: 150,
        height: 150,
        colorDark: "#000000",
        colorLight: "#ffffff",
        correctLevel: QRCode.CorrectLevel.H
      });
    }
  },
  mounted: function() {
    this.creatQrCode();
  }
};
</script>
<style scoped lang="less">
.content {
  .body {
    font-size: 0.3rem;
    padding: 0.37rem;
    .dh {
      background: white;
      padding-top: 0.3rem;
      text-align: center;
    }
    /deep/.qrcode {
      background: white;
      display: inline-block;
      width: 100%;
      text-align: center;
      padding: 0.3rem 0rem;
      img {
        margin: 0 auto;
      }
    }
  }
}
</style>
