diff --git a/src/components/Footer.js b/src/components/Footer.js
new file mode 100644
index 0000000..69e2ed8
--- /dev/null
+++ b/src/components/Footer.js
@@ -0,0 +1,20 @@
+import React from "react";
+import './Qrcode.css';
+
+const currentYear = new Date().getFullYear();
+
+class Footer extends React.Component {
+ render() {
+ return (
+
+
+
+
Copyright © {currentYear} QRBTF. 保留所有权利。
+
+
+
+ );
+ }
+}
+
+export default Footer
diff --git a/src/components/Qrcode.js b/src/components/Qrcode.js
index 4937c38..e613130 100644
--- a/src/components/Qrcode.js
+++ b/src/components/Qrcode.js
@@ -8,6 +8,7 @@ import {isWeiXin} from "../utils/util";
import './Qrcode.css';
import logo from '../qrbtf-logo.svg';
+import Footer from "./Footer";
import QrItem from "./QrItem";
import QrRendererBase from "./QrRendererBase";
import QrRendererRound from "./QrRendererRound";
@@ -32,7 +33,6 @@ const styleList = [
{value: "D2", renderer: QrRendererBlank},
];
-const currentYear = new Date().getFullYear();
class Qrcode extends React.Component {
paramInfoBuffer;
@@ -53,7 +53,8 @@ class Qrcode extends React.Component {
options: {text: ''},
qrcode: null,
paramInfo: [],
- paramValue: []
+ paramValue: [],
+ correctLevel: 0
};
this.paramInfoBuffer = new Array(16).fill(new Array(16));
this.paramValueBuffer = new Array(16).fill(new Array(16));
@@ -66,7 +67,7 @@ class Qrcode extends React.Component {
paramValue: this.paramValueBuffer,
text: text,
options: {text: text},
- qrcode: getQrcodeData({text: text})
+ qrcode: getQrcodeData({text: text, correctLevel: this.state.correctLevel})
});
}
@@ -95,13 +96,8 @@ class Qrcode extends React.Component {
handleCreate(e) {
let text = this.state.text
-
- if (text.length > 0)
- 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 (text.length <= 0) text = 'https://qrbtf.com/';
+ this.setState({text: text, options: {text: text}, qrcode: getQrcodeData({text: text, correctLevel: this.state.correctLevel})});
if (e) e.target.blur();
}
@@ -219,6 +215,23 @@ class Qrcode extends React.Component {
+
+ 容错率 |
+
+
+ |
+
{this.renderAdjustment()}
@@ -258,13 +271,7 @@ class Qrcode extends React.Component {
-
-
-
-
Copyright © {currentYear} QRBTF. 保留所有权利。
-
-
-
+
);
}