Skip to content

Commit

Permalink
V1.6.1版本
Browse files Browse the repository at this point in the history
  • Loading branch information
szvone committed Apr 26, 2019
1 parent 15eff62 commit d7dda15
Show file tree
Hide file tree
Showing 5 changed files with 91 additions and 14 deletions.
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,13 @@ V免签为完全开源项目,开源项目意味着作者没有任何收入来
+ 微信店员收款推送通知

## 更新记录

+ v1.6.1(2019.04.26)
+ 再次优化二维码识别,使用js解析二维码,如果失败,则使用PHP解析


+ v1.6(2019.04.25)
+ 优化二维码识别,使用js解析二维码,解决部分二维码识别返回false问题
+ 优化二维码识别,使用js解析二维码,解决部分二维码识别返回false问题

+ v1.5(2019.04.24)
+ 同步最新版APP
Expand Down
22 changes: 18 additions & 4 deletions public/admin/addwxqrcode.html
Original file line number Diff line number Diff line change
Expand Up @@ -93,10 +93,24 @@
qrcode.decode(getObjectURL(file),result);
qrcode.callback = function(imgMsg,img64) {

imgs.push({"index":imgs.length,"money":"","b64":img64,"url":imgMsg});
mytable.reload({
data: imgs
});
if (imgMsg==""){
$.post("qr-code/test.php","base64="+encodeURIComponent(img64.split(",")[1]),function (data) {
console.log(data)
if (!data.data) {
data = JSON.parse(data);
}

imgs.push({"index":imgs.length,"money":"","b64":img64,"url":data.data});
mytable.reload({
data: imgs
});
});
} else{
imgs.push({"index":imgs.length,"money":"","b64":img64,"url":imgMsg});
mytable.reload({
data: imgs
});
}
}

});
Expand Down
23 changes: 19 additions & 4 deletions public/admin/addzfbqrcode.html
Original file line number Diff line number Diff line change
Expand Up @@ -85,11 +85,26 @@
*/
qrcode.decode(getObjectURL(file),result);
qrcode.callback = function(imgMsg,img64) {
if (imgMsg==""){
$.post("qr-code/test.php","base64="+encodeURIComponent(img64.split(",")[1]),function (data) {
console.log(data)
if (!data.data) {
data = JSON.parse(data);
}

imgs.push({"index":imgs.length,"money":"","b64":img64,"url":data.data});
mytable.reload({
data: imgs
});
});
} else{
imgs.push({"index":imgs.length,"money":"","b64":img64,"url":imgMsg});
mytable.reload({
data: imgs
});
}


imgs.push({"index":imgs.length,"money":"","b64":img64,"url":imgMsg});
mytable.reload({
data: imgs
});
}

});
Expand Down
47 changes: 45 additions & 2 deletions public/admin/setting.html
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,29 @@
qrcode.decode(getObjectURL(file));
qrcode.callback = function(imgMsg) {
console.log(imgMsg)
$('#wximg').attr('src', "enQrcode?url="+imgMsg);
if(imgMsg!=""){
$('#wximg').attr('src', "enQrcode?url="+imgMsg);
}else{
layer.msg('处理中', {
icon: 16
,shade: 0.01
,time:0
});

$.post("qr-code/test.php","base64="+encodeURIComponent(result.split(",")[1]),function (data) {
console.log(data)
if (!data.data) {
data = JSON.parse(data);
}
if (data.code==1){
$('#wximg').attr('src', "enQrcode?url="+data.data);
layer.msg('处理成功');
} else{
return layer.msg('处理失败');
}

});
}
}
});

Expand Down Expand Up @@ -166,7 +188,28 @@
qrcode.decode(getObjectURL(file));
qrcode.callback = function(imgMsg) {
console.log(imgMsg)
$('#zfbimg').attr('src', "enQrcode?url="+imgMsg);
if(imgMsg!=""){
$('#zfbimg').attr('src', "enQrcode?url="+imgMsg);
}else{
layer.msg('处理中', {
icon: 16
,shade: 0.01
,time:0
});
$.post("qr-code/test.php","base64="+encodeURIComponent(result.split(",")[1]),function (data) {
console.log(data)
if (!data.data) {
data = JSON.parse(data);
}
if (data.code==1){
$('#zfbimg').attr('src', "enQrcode?url="+data.data);
layer.msg('处理成功');
} else{
return layer.msg('处理失败');
}

});
}
}
});

Expand Down
6 changes: 3 additions & 3 deletions public/js/llqrcode.js
Original file line number Diff line number Diff line change
Expand Up @@ -1466,7 +1466,7 @@ qrcode.decode = function (d,b64) {
try {
qrcode.imagedata = h.getImageData(0, 0, i.width, i.height)
} catch (m) {
qrcode.result = "Cross domain image reading not supported in your browser! Save it to your computer then drag and drop the file!";
qrcode.result = "";
if (qrcode.callback != null) {
qrcode.callback(qrcode.result,b64)
}
Expand All @@ -1476,15 +1476,15 @@ qrcode.decode = function (d,b64) {
qrcode.result = qrcode.process(h)
} catch (m) {
console.log(m);
qrcode.result = "error decoding QR Code"
qrcode.result = ""
}
if (qrcode.callback != null) {
qrcode.callback(qrcode.result,b64)
}
};
c.onerror = function () {
if (qrcode.callback != null) {
qrcode.callback("Failed to load the image")
qrcode.callback("")
}
};
c.src = d
Expand Down

0 comments on commit d7dda15

Please sign in to comment.