From 267c002e0145144e9afdaff430599b81374b7830 Mon Sep 17 00:00:00 2001 From: CPunisher <1343316114@qq.com> Date: Mon, 1 Mar 2021 16:35:15 +0800 Subject: [PATCH 1/5] change download count display --- src/components/app/PartDownload.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/components/app/PartDownload.js b/src/components/app/PartDownload.js index 916d02d..6aa4da1 100644 --- a/src/components/app/PartDownload.js +++ b/src/components/app/PartDownload.js @@ -3,6 +3,11 @@ import './App.css'; import PropTypes from 'prop-types'; import {isWeiXin} from "../../utils/navigatorUtils"; +function parseValue(value) { + if (value < 10000) return value; + return (value / 10000).toFixed(1) + "万"; +} + const WxMessage = () => { if (isWeiXin()) { return ( @@ -37,7 +42,7 @@ const PartDownload = ({ value, downloadCount, onSvgDownload, onImgDownload }) =>
Downloads

下载二维码 — {value} - {downloadCount} + {parseValue(downloadCount)}

From 07291e3363805af49f7aa7a98490cdb29d9b5dee Mon Sep 17 00:00:00 2001 From: CPunisher <1343316114@qq.com> Date: Thu, 4 Mar 2021 19:47:50 +0800 Subject: [PATCH 2/5] Fix NaN download count --- src/components/app/PartDownload.js | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/src/components/app/PartDownload.js b/src/components/app/PartDownload.js index 6aa4da1..22a04ee 100644 --- a/src/components/app/PartDownload.js +++ b/src/components/app/PartDownload.js @@ -5,7 +5,15 @@ import {isWeiXin} from "../../utils/navigatorUtils"; function parseValue(value) { if (value < 10000) return value; - return (value / 10000).toFixed(1) + "万"; + return +} + +const CountComponent = ({ value }) => { + if (value >= 10000) value = (value / 10000).toFixed(1); + if (!isNaN(value)) { + return {value + "万"} + } + return null; } const WxMessage = () => { @@ -17,7 +25,7 @@ const WxMessage = () => {
) } - return null + return null; } const ImgBox = ({ imgData }) => { @@ -41,8 +49,8 @@ const PartDownload = ({ value, downloadCount, onSvgDownload, onImgDownload }) =>
Downloads

- 下载二维码 — {value} - {parseValue(downloadCount)} + 下载二维码 — {value} +

From fa1138c2cedf53a58cbc2f94c7989c3422ded18b Mon Sep 17 00:00:00 2001 From: CPunisher <1343316114@qq.com> Date: Sat, 13 Mar 2021 16:04:23 +0800 Subject: [PATCH 3/5] Fix download count error --- src/components/app/PartDownload.js | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/src/components/app/PartDownload.js b/src/components/app/PartDownload.js index 22a04ee..4268628 100644 --- a/src/components/app/PartDownload.js +++ b/src/components/app/PartDownload.js @@ -3,17 +3,10 @@ import './App.css'; import PropTypes from 'prop-types'; import {isWeiXin} from "../../utils/navigatorUtils"; -function parseValue(value) { - if (value < 10000) return value; - return -} - const CountComponent = ({ value }) => { - if (value >= 10000) value = (value / 10000).toFixed(1); - if (!isNaN(value)) { - return {value + "万"} - } - return null; + if (isNaN(value)) return null; + if (value >= 10000) value = (value / 10000).toFixed(1) + "万"; + return {value} } const WxMessage = () => { From 04730a769a5a134e76a114f9f7d61fcf6dc48079 Mon Sep 17 00:00:00 2001 From: CPunisher <1343316114@qq.com> Date: Mon, 29 Mar 2021 11:48:59 +0800 Subject: [PATCH 4/5] image format --- src/components/param/ParamUpload.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/param/ParamUpload.js b/src/components/param/ParamUpload.js index 69cb275..59026b5 100644 --- a/src/components/param/ParamUpload.js +++ b/src/components/param/ParamUpload.js @@ -17,7 +17,7 @@ const ParamUpload = ({ rendererIndex, paramIndex, onChange }) => ( key={"input_" + rendererIndex + "_" + paramIndex} id="image_upload" hidden={true} - accept=".jpg, .jpeg, .png" + accept="image/*" onChange={onChange} /> From 006fee6490eca1c4d864801a6dfc4c169c17d60e Mon Sep 17 00:00:00 2001 From: CPunisher <1343316114@qq.com> Date: Wed, 6 Oct 2021 01:47:42 +0800 Subject: [PATCH 5/5] feature: batch qrcode generation --- .idea/inspectionProfiles/Project_Default.xml | 15 ++++ package.json | 1 + src/actions/index.js | 17 +++- src/components/Qrcode.css | 7 +- src/components/app/PartDownload.js | 6 +- src/components/app/PartMore.js | 1 + src/components/renderer/RendererResImage.js | 1 - src/components/svg/FileImport.js | 15 ++++ src/containers/app/InputText.js | 34 +++++++- src/containers/app/PartDownloadViewer.js | 82 ++++++++++++++++---- src/reducers/index.js | 4 +- src/utils/downloader.js | 24 +++--- src/utils/imageUtils.js | 1 - yarn.lock | 29 ++++++- 14 files changed, 194 insertions(+), 43 deletions(-) create mode 100644 .idea/inspectionProfiles/Project_Default.xml create mode 100644 src/components/svg/FileImport.js diff --git a/.idea/inspectionProfiles/Project_Default.xml b/.idea/inspectionProfiles/Project_Default.xml new file mode 100644 index 0000000..9575e9d --- /dev/null +++ b/.idea/inspectionProfiles/Project_Default.xml @@ -0,0 +1,15 @@ + + + + \ No newline at end of file diff --git a/package.json b/package.json index db19c0d..6efc473 100644 --- a/package.json +++ b/package.json @@ -7,6 +7,7 @@ "@testing-library/react": "^9.3.2", "@testing-library/user-event": "^7.1.2", "jsqr": "^1.3.1", + "jszip": "^3.7.1", "medium-zoom": "^1.0.5", "prop-types": "^15.7.2", "react": "^16.13.1", diff --git a/src/actions/index.js b/src/actions/index.js index ad09615..712816d 100644 --- a/src/actions/index.js +++ b/src/actions/index.js @@ -1,10 +1,19 @@ import {actionTypes} from "../constant/ActionTypes"; import {handleStyle} from "../utils/gaHelper"; -export const genQRInfo = text => ({ - type: actionTypes.GENERATE_QR_INFO, - text -}) +export const genQRInfo = text => { + if (Array.isArray(text)) { + return { + type: actionTypes.GENERATE_QR_INFO, + text: text[0], + textArray: text + } + } + return { + type: actionTypes.GENERATE_QR_INFO, + text + } +} export const changeStyle = (rendererIndex, rendererType, value) => { handleStyle(value); diff --git a/src/components/Qrcode.css b/src/components/Qrcode.css index a0adebc..f7879db 100644 --- a/src/components/Qrcode.css +++ b/src/components/Qrcode.css @@ -318,7 +318,7 @@ td { .Qr-input-upload { display: flex; max-width: calc(100vw - 46px); - width: 20em; + width: 22em; } .Qr-input-upload-div { @@ -360,7 +360,7 @@ td { height: calc(2em + 6px); font-size: calc(10px + 2vmin); border: var(--border-color) solid 2px; - margin-left: 10px; + margin: 0 10px; flex: 1; } @@ -372,6 +372,7 @@ td { .Qr-upload { color: var(--upload-color); + fill: var(--upload-color); font-size: calc(10px + 2vmin); border: var(--border-color) solid 2px; width: calc(2em + 6px)!important; @@ -409,6 +410,7 @@ td { .Qr-upload:hover { border-color: var(--border-color-focus); color: var(--border-color-focus); + fill: var(--border-color-focus); } .Qr-upload:active { @@ -417,6 +419,7 @@ td { -moz-transition-duration: 0s; border-color: #3BBC9F; color: #3BBC9F; + fill: #3BBC9F; } .Qr-upload-svg { diff --git a/src/components/app/PartDownload.js b/src/components/app/PartDownload.js index 4268628..1174d3e 100644 --- a/src/components/app/PartDownload.js +++ b/src/components/app/PartDownload.js @@ -34,7 +34,7 @@ const ImgBox = ({ imgData }) => { return null } -const PartDownload = ({ value, downloadCount, onSvgDownload, onImgDownload }) => { +const PartDownload = ({ value, batchMode, downloadCount, onSvgDownload, onImgDownload }) => { const [imgData, setImgData] = useState(''); return ( @@ -42,7 +42,9 @@ const PartDownload = ({ value, downloadCount, onSvgDownload, onImgDownload }) =>
Downloads

- 下载二维码 — {value} + 下载二维码 + ({batchMode ? "批量模式" : "单文件模式"}) + — {value}

diff --git a/src/components/app/PartMore.js b/src/components/app/PartMore.js index e25f8b1..aae1891 100644 --- a/src/components/app/PartMore.js +++ b/src/components/app/PartMore.js @@ -51,6 +51,7 @@ const PartMore = () => {

最新消息

+

2021.10.5
新增批量生成二维码。

2020.9.1
新增 C3 样式、图标插入、 PNG 下载。

2020.6.29
新的反馈渠道!我们开始征集好玩的二维码设计啦,可以是推送尾图、海报等等,快来上传吧。 + +