Home > WeChat Applet > Mini Program Development > Does the mini program have a scanning function?

Does the mini program have a scanning function?

angryTom
Release: 2020-03-20 17:19:07
Original
6728 people have browsed it

Does the mini program have a scanning function?

Does the mini program have a QR code scanning function?

The mini program has a QR code scanning function. For specific usage methods, please refer to the WeChat mini program development documentation , only a brief introduction is given here.

You can use the mini program to call the code scanning functionwx.scanCode(Object object)

The parameters are as follows:

##successfunctionNoCallback function for successful interface callfailfunctionNoCallback function for failed interface callcompletefunctionNoThe callback function at the end of the interface call (will be executed if the call is successful or failed)
Attribute Type Default value Required Description Minimum version
onlyFromCamera boolean false No Whether the code can only be scanned from the camera, not allowed from Album selection picture 1.2.0
scanType Array. ['barCode', 'qrCode '] No Scan code type 1.7.0






Sample code:


// 允许从相机和相册扫码
wx.scanCode({
  success (res) {
    console.log(res)
  }
})

// 只允许从相机扫码
wx.scanCode({
  onlyFromCamera: true,
  success (res) {
    console.log(res)
  }
})
Copy after login

PHP Chinese website, a large number of

small program development, welcome study!

The above is the detailed content of Does the mini program have a scanning function?. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template