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:
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 |
function | Callback function for successful interface call | ||||
function | Callback function for failed interface call | ||||
function | The callback function at the end of the interface call (will be executed if the call is successful or failed) |
// 允许从相机和相册扫码 wx.scanCode({ success (res) { console.log(res) } }) // 只允许从相机扫码 wx.scanCode({ onlyFromCamera: true, success (res) { console.log(res) } })
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!