Html 用于表单网站的手机条码扫描器

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/17738395/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-29 11:19:04  来源:igfitidea点击:

Barcode scanner for mobile phone for Website in form

javascripthtmlqr-codebarcode-scanner

提问by M.A

I have inventory maintenance website up and running. currently the back end users are manually typing the item id on the system and using to search and do their work. I would like to automate the typing to scanning qr codes. We are trying to implement users to use their mobile phone camera to act as a scanner.

我已经启动并运行了库存维护网站。目前,后端用户正在系统上手动输入项目 ID 并用于搜索和完成工作。我想自动打字以扫描二维码。我们正在尝试让用户使用他们的手机摄像头来充当扫描仪。

Thus the user set focus on the text-box and uses his mobile phone to scan the code and the value has to be automatically placed on the text box.

因此,用户将焦点设置在文本框上并使用他的手机扫描代码,值必须自动放置在文本框上。

The apps in the market do not transfer data into a pc or web form directly. We are trying to implement an open source web scanner rather then buying an expensive product or app. Can you suggest one or must we create our own app? If so, where can I start from?

市场上的应用程序不会直接将数据传输到 PC 或 Web 表单中。我们正在尝试实施开源网络扫描仪,而不是购买昂贵的产品或应用程序。你能推荐一个还是我们必须创建我们自己的应用程序?如果是这样,我可以从哪里开始?

回答by edi9999

There's a JS QrCode scanner, that works on mobile sites with a camera:

有一个 JS QrCode 扫描仪,可以在带有摄像头的移动网站上工作:

https://github.com/LazarSoft/jsqrcode

https://github.com/LazarSoft/jsqrcode

I have worked with it for one of my project and it works pretty good !

我在我的一个项目中使用过它,效果很好!

回答by bchr02

Check out https://github.com/serratus/quaggaJS

查看https://github.com/serratus/quaggaJS

"QuaggaJS is a barcode-scanner entirely written in JavaScript supporting real- time localization and decoding of various types of barcodes such as EAN, CODE 128, CODE 39, EAN 8, UPC-A, UPC-C, I2of5, 2of5, CODE 93 and CODABAR. The library is also capable of using getUserMedia to get direct access to the user's camera stream. Although the code relies on heavy image-processing even recent smartphones are capable of locating and decoding barcodes in real-time."

“QuaggaJS 是一个完全用 JavaScript 编写的条码扫描器,支持实时定位和解码各种类型的条码,例如 EAN、CODE 128、CODE 39、EAN 8、UPC-A、UPC-C、I2of5、2of5、CODE 93和 CODABAR。该库还能够使用 getUserMedia 直接访问用户的相机流。尽管代码依赖于大量的图像处理,但即使是最近的智能手机也能够实时定位和解码条形码。”

回答by mak

Scanditis a startup whose goal is to replace bulky, expensive laser barcode scanners with cheap mobile phones.

Scandit是一家初创公司,其目标是用廉价的手机取代笨重、昂贵的激光条码扫描仪。

There are SDKs for Android, iOS, Windows, C API/Linux, React Native, Cordova/PhoneGap, Xamarin.

有适用于 Android、iOS、Windows、C API/Linux、React Native、Cordova/PhoneGap、Xamarin 的 SDK。

There is also Scandit Barcode Scanner SDK for the Webwhich the WebAssembly version of the SDK. It runs in modern browsers, also on phones.

还有用于 Web 的 Scandit Barcode Scanner SDK,它是SDK的 WebAssembly 版本。它可以在现代浏览器中运行,也可以在手机上运行。

There's a client librarythat also provides a barcode picker component. It can be used like this:

还有一个客户端库,它也提供了一个条形码选择器组件。它可以像这样使用:

<div id="barcode-picker" style="max-width: 1280px; max-height: 80%;"></div>

<script src="https://unpkg.com/scandit-sdk"></script>
<script>
    console.log('Loading...');
    ScanditSDK.configure("xxx", {
engineLocation: "https://unpkg.com/scandit-sdk/build/"
    }).then(() => {
      console.log('Loaded');
      ScanditSDK.BarcodePicker.create(document.getElementById('barcode-picker'), {
        playSoundOnScan: true,
        vibrateOnScan: true
      }).then(function(barcodePicker) {
        console.log("Ready");
        barcodePicker.applyScanSettings(new ScanditSDK.ScanSettings({
          enabledSymbologies: ["ean8", "ean13", "upca", "upce", "code128", "code39", "code93", "itf", "qr"],
          codeDuplicateFilter: 1000
        }));
        barcodePicker.onScan(function(barcodes) {
          console.log(barcodes);
        });
      });
    });
</script>

Disclaimer: I work for Scandit

免责声明:我为 Scandit 工作

回答by TheStoryCoder

You can use the Android app Barcode Scanner Terminal(DISCLAIMER! I'm the developer). It can scan the barcode and send it to the PC and in your case enter it on the web form. More details here.

您可以使用 Android 应用条码扫描仪终端(免责声明!我是开发人员)。它可以扫描条形码并将其发送到 PC,然后在您的情况下将其输入到 Web 表单中。更多细节在这里

回答by Berry Wing

We have an app in Google Play and the App Store that will scan barcodes into a web site. The app is called Scan to Web. http://berrywing.com/scantoweb.html

我们在 Google Play 和 App Store 中有一个应用程序,可以将条形码扫描到网站中。该应用程序称为扫描到 Web。 http://berrywing.com/scantoweb.html

You can even embed a link or button to start the scanner yourself within your web page.

您甚至可以在网页中嵌入链接或按钮以自行启动扫描仪。

<a href="bwstw://startscanner">Link to start scanner</a>

The developer documentation website for the app covers how to use the app and use JavaScript for processing the barcode scan. http://berrywing.com/scantoweb/#htmlscanbutton

该应用程序的开发人员文档网站介绍了如何使用该应用程序以及如何使用 JavaScript 来处理条码扫描。 http://berrywing.com/scantoweb/#htmlscanbutton

回答by Jorge Cevallos

Check this out: http://qrdroid.com/web-masters.php

看看这个:http: //qrdroid.com/web-masters.php

You can create a link in your web form, something like:

您可以在您的网络表单中创建一个链接,例如:

http://qrdroid.com/scan?q=http://www.your-site.com/your-form.php?code={CODE}

http://qrdroid.com/scan?q=http://www.your-site.com/your-form.php?code={CODE}

When somebody clicks that link, an app to scan the code will be opened. After the user scans the code, http://www.your-site.com/your-form.php?code={CODE}will be automatically called. You can then make your-form.phpread the parameter codeto prepopulate the field.

当有人点击该链接时,将打开一个扫描代码的应用程序。用户扫码后,会自动调用http://www.your-site.com/your-form.php?code={CODE}。然后,您可以让your-form.php读取参数代码以预填充该字段。