| | |
| | | |
| | | import './index.scss' |
| | | |
| | | class BarCode extends Component { |
| | | class MkQrCode extends Component { |
| | | static propTpyes = { |
| | | card: PropTypes.object, // 条码设置 |
| | | value: PropTypes.any, // 条码值 |
| | |
| | | const { value, card } = this.props |
| | | let color = card.color |
| | | let size = card.qrWidth || 50 |
| | | let width = size + 'px' |
| | | |
| | | if (/rgb/ig.test(color)) { |
| | | color = this.hexify(color) |
| | | } |
| | | if (size < 640) { |
| | | size = 640 |
| | | } |
| | | |
| | | return ( |
| | | <div className="qrcode-box"> |
| | | <div className="qrcode-box" style={{width: width, height: width}}> |
| | | <QrCode |
| | | value={value} |
| | | size={size} |
| | |
| | | } |
| | | } |
| | | |
| | | export default BarCode |
| | | export default MkQrCode |