Merge branch 'master' of https://github.com/ciaochaos/qrbtf
This commit is contained in:
commit
f1a2d3d442
|
@ -0,0 +1,20 @@
|
||||||
|
import React from "react";
|
||||||
|
import './Qrcode.css';
|
||||||
|
|
||||||
|
const currentYear = new Date().getFullYear();
|
||||||
|
|
||||||
|
class Footer extends React.Component {
|
||||||
|
render() {
|
||||||
|
return (
|
||||||
|
<div className="Qr-titled">
|
||||||
|
<div className="Qr-Centered Qr-footer note-font">
|
||||||
|
<div><strong>作者</strong> <a href="https://blog.ciaochaos.com/" rel="noopener noreferrer" target="_blank">ciaochaos</a> <a href="https://github.com/CPunisher/" rel="noopener noreferrer" target="_blank">CPunisher</a></div>
|
||||||
|
<div className="Gray">Copyright © {currentYear} QRBTF. 保留所有权利。</div>
|
||||||
|
<div className="Gray"><a href="http://www.beian.miit.gov.cn/" rel="noopener noreferrer" target="_blank">浙 ICP 备 19005869 号 </a></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export default Footer
|
|
@ -8,6 +8,7 @@ import {isWeiXin} from "../utils/util";
|
||||||
import './Qrcode.css';
|
import './Qrcode.css';
|
||||||
import logo from '../qrbtf-logo.svg';
|
import logo from '../qrbtf-logo.svg';
|
||||||
|
|
||||||
|
import Footer from "./Footer";
|
||||||
import QrItem from "./QrItem";
|
import QrItem from "./QrItem";
|
||||||
import QrRendererBase from "./QrRendererBase";
|
import QrRendererBase from "./QrRendererBase";
|
||||||
import QrRendererRound from "./QrRendererRound";
|
import QrRendererRound from "./QrRendererRound";
|
||||||
|
@ -33,7 +34,6 @@ const styleList = [
|
||||||
{value: "D2", renderer: QrRendererBlank},
|
{value: "D2", renderer: QrRendererBlank},
|
||||||
];
|
];
|
||||||
|
|
||||||
const currentYear = new Date().getFullYear();
|
|
||||||
|
|
||||||
class Qrcode extends React.Component {
|
class Qrcode extends React.Component {
|
||||||
paramInfoBuffer;
|
paramInfoBuffer;
|
||||||
|
@ -54,7 +54,8 @@ class Qrcode extends React.Component {
|
||||||
options: {text: ''},
|
options: {text: ''},
|
||||||
qrcode: null,
|
qrcode: null,
|
||||||
paramInfo: [],
|
paramInfo: [],
|
||||||
paramValue: []
|
paramValue: [],
|
||||||
|
correctLevel: 0
|
||||||
};
|
};
|
||||||
this.paramInfoBuffer = new Array(16).fill(new Array(16));
|
this.paramInfoBuffer = new Array(16).fill(new Array(16));
|
||||||
this.paramValueBuffer = new Array(16).fill(new Array(16));
|
this.paramValueBuffer = new Array(16).fill(new Array(16));
|
||||||
|
@ -67,7 +68,7 @@ class Qrcode extends React.Component {
|
||||||
paramValue: this.paramValueBuffer,
|
paramValue: this.paramValueBuffer,
|
||||||
text: text,
|
text: text,
|
||||||
options: {text: text},
|
options: {text: text},
|
||||||
qrcode: getQrcodeData({text: text})
|
qrcode: getQrcodeData({text: text, correctLevel: this.state.correctLevel})
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -96,13 +97,8 @@ class Qrcode extends React.Component {
|
||||||
|
|
||||||
handleCreate(e) {
|
handleCreate(e) {
|
||||||
let text = this.state.text
|
let text = this.state.text
|
||||||
|
if (text.length <= 0) text = 'https://qrbtf.com/';
|
||||||
if (text.length > 0)
|
this.setState({text: text, options: {text: text}, qrcode: getQrcodeData({text: text, correctLevel: this.state.correctLevel})});
|
||||||
this.setState({options: {text: text}, qrcode: getQrcodeData({text: text})});
|
|
||||||
else {
|
|
||||||
text = 'https://qrbtf.com/';
|
|
||||||
this.setState({text: text, options: {text: text}, qrcode: getQrcodeData({text: text})});
|
|
||||||
}
|
|
||||||
if (e) e.target.blur();
|
if (e) e.target.blur();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -220,15 +216,24 @@ class Qrcode extends React.Component {
|
||||||
<div className="Qr-div-table">
|
<div className="Qr-div-table">
|
||||||
<table className="Qr-table">
|
<table className="Qr-table">
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr>
|
<tr>
|
||||||
<td>容错率</td>
|
<td>容错率</td>
|
||||||
<td>
|
<td>
|
||||||
<select className="Qr-select">
|
<select
|
||||||
<option>123</option>
|
className="Qr-select"
|
||||||
</select>
|
value={this.state.correctLevel}
|
||||||
</td>
|
onChange={(e) => { this.setState({correctLevel: parseInt(e.target.value)})
|
||||||
</tr>
|
this.setState({correctLevel: parseInt(e.target.value)})
|
||||||
{this.renderAdjustment()}
|
this.handleCreate()
|
||||||
|
}}>
|
||||||
|
<option value={1}>7%</option>
|
||||||
|
<option value={0}>15%</option>
|
||||||
|
<option value={3}>20%</option>
|
||||||
|
<option value={2}>30%</option>
|
||||||
|
</select>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
{this.renderAdjustment()}
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
|
@ -267,13 +272,7 @@ class Qrcode extends React.Component {
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className="Qr-titled">
|
<Footer />
|
||||||
<div className="Qr-Centered Qr-footer note-font">
|
|
||||||
<div><strong>作者</strong> <a href="https://blog.ciaochaos.com/" rel="noopener noreferrer" target="_blank">ciaochaos</a> <a href="https://github.com/CPunisher/" rel="noopener noreferrer" target="_blank">CPunisher</a></div>
|
|
||||||
<div className="Gray">Copyright © {currentYear} QRBTF. 保留所有权利。</div>
|
|
||||||
<div className="Gray"><a href="http://www.beian.miit.gov.cn/" rel="noopener noreferrer" target="_blank">浙 ICP 备 19005869 号 </a></div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue