Commit 51b6750cfdfe2743115c7ea2531dd8b5162cd27a

Authored by yvan.ni
1 parent e8c0bf5b

条形码扫码的优化

components/qr_code/qr_code.js
@@ -35,7 +35,7 @@ Component({ @@ -35,7 +35,7 @@ Component({
35 this.setData({q_show: 1,object:e,barcode_canvas:list,qrcode_canvas:list,is_fw:e.is_fw }); 35 this.setData({q_show: 1,object:e,barcode_canvas:list,qrcode_canvas:list,is_fw:e.is_fw });
36 var val=e.val; 36 var val=e.val;
37 37
38 - barcode('barcode'+this.data.index,val, 620, 160,this); 38 + barcode('barcode'+this.data.index,val+"", 620, 160,this);
39 qrcode('qrcode'+this.data.index, val, 520, 520,this); 39 qrcode('qrcode'+this.data.index, val, 520, 520,this);
40 } 40 }
41 }, 41 },
utils/barcode.js
@@ -197,7 +197,7 @@ function stringToCode128(text) { @@ -197,7 +197,7 @@ function stringToCode128(text) {
197 //ok some type of shift is nessecary 197 //ok some type of shift is nessecary
198 if (shifter != -1) { 198 if (shifter != -1) {
199 result.push(shifter); 199 result.push(shifter);
200 - result.push(codeValue(chr2)); 200 + result.push(codeValue(chr1));
201 } 201 }
202 else { 202 else {
203 if (currcs == CODESET.C) { 203 if (currcs == CODESET.C) {