import { barcode, qrcode } from '../../../utils/code';
Component({
  props: {
    bar: '1000',
    qr: '2000',
    title: '12345678',
    value: '0000',
    showBarcode: true
  },
  data: {
    key: ''
  },

  didMount() {
    this.setData({
      key: `${Math.random()}`.slice(2, 12)
    });
    barcode(`barcode-${this.data.key}`, this.props.value, 710, 88);
    qrcode(`qrcode-${this.data.key}`, this.props.value, 270, 270);
  }

});