From 51b6750cfdfe2743115c7ea2531dd8b5162cd27a Mon Sep 17 00:00:00 2001 From: yvan.ni Date: Mon, 10 Oct 2022 17:20:28 +0800 Subject: [PATCH] 条形码扫码的优化 --- components/qr_code/qr_code.js | 2 +- utils/barcode.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/components/qr_code/qr_code.js b/components/qr_code/qr_code.js index 812d7c8..2d4833d 100644 --- a/components/qr_code/qr_code.js +++ b/components/qr_code/qr_code.js @@ -35,7 +35,7 @@ Component({ this.setData({q_show: 1,object:e,barcode_canvas:list,qrcode_canvas:list,is_fw:e.is_fw }); var val=e.val; - barcode('barcode'+this.data.index,val, 620, 160,this); + barcode('barcode'+this.data.index,val+"", 620, 160,this); qrcode('qrcode'+this.data.index, val, 520, 520,this); } }, diff --git a/utils/barcode.js b/utils/barcode.js index 57fca94..737e2f4 100644 --- a/utils/barcode.js +++ b/utils/barcode.js @@ -197,7 +197,7 @@ function stringToCode128(text) { //ok some type of shift is nessecary if (shifter != -1) { result.push(shifter); - result.push(codeValue(chr2)); + result.push(codeValue(chr1)); } else { if (currcs == CODESET.C) { -- libgit2 0.21.4