扫码验收,去掉条形码前面的0
Showing
1 changed file
with
4 additions
and
0 deletions
... | @@ -79,6 +79,10 @@ | ... | @@ -79,6 +79,10 @@ |
79 | 79 | ||
80 | console.log(r+"条形码读取的数据");//返回二维码读取的数据 | 80 | console.log(r+"条形码读取的数据");//返回二维码读取的数据 |
81 | if(r){ | 81 | if(r){ |
82 | r = r+""; | ||
83 | if(typeof r == 'string'){//去掉条形码前面的0 | ||
84 | r = r.replace(/\b(0+)/gi,""); | ||
85 | } | ||
82 | var itemData = {barcode:r} | 86 | var itemData = {barcode:r} |
83 | itemData.currentSelected = selectTabs === 1 ? 'left': 'right'; | 87 | itemData.currentSelected = selectTabs === 1 ? 'left': 'right'; |
84 | console.log(JSON.stringify(itemData)) | 88 | console.log(JSON.stringify(itemData)) | ... | ... |
-
Please register or sign in to post a comment