收藏
回答

企业微信开发的H5界面使用企业微信的扫码,扫描条形码时无法扫描到条形码中的括号(UDI码)怎么处理?

wx.scanQRCode({
                      desc: 'scanQRCode desc',
                      needResult: 1, // 默认为0,扫描结果由企业微信处理,1则直接返回扫描结果,
                      scanType: ["qrCode", "barCode"], // 可以指定扫二维码还是条形码(一维码),默认二者都有
                      success: function(res) {
//                          alert("----扫描结果---"+JSON.stringify(res));// 当needResult 为 1 时,扫码返回的结果
                          var barcode = res.resultStr;
                          var ifm= document.getElementById("dtlif");
                          if(type==1) 
                          {
                            ifm.contentWindow.document.getElementById("goodsval").value=barcode;
                          }else{
                            ifm.contentWindow.document.getElementById("lotsval").value=barcode;
                            ifm.contentWindow.refresh();
                          }
                             
                      },
                      error: function(res) {
                          if (res.errMsg.indexOf('function_not_exist') > 0) {
                              alert('版本过低请升级')
                          }
                      },
                  });

https://res.wx.qq.com/open/js/jweixin-1.2.0.js


回答关注问题邀请回答
收藏
登录 后发表内容