当前位置:网站首页>Uni app QR code scanning and identification function
Uni app QR code scanning and identification function
2022-06-26 03:40:00 【yyxhzdm】

From this we can see that ,uni-app Bring their own api stay h5 Platform cannot be called uni.scanCode Of , So no h5 The platform realizes two-dimensional code scanning and recognition method :
uni.scanCode({
success(res) {
_this.tempImgUrl = res.path
_this.isChooseImg = true
_this.resultStr = res.result
console.log(" Other platforms Two dimensional code analysis results resultStr = " + _this.resultStr)
}
})
H5:
First add reqrcode.js, You can search and download more in Baidu
stay script I quote
let reqrcode = require("../../components/scancode/reqrcode.js")

Method : Select the QR code image and analyze it
uni.chooseImage({
count: 1, // Default 9
sizeType: ['original', 'compressed'], // You can specify whether it is original or compressed , By default, both of them have
sourceType: ['album', "camera"], // Select from the album 、 Using the camera
success(res) {
_this.tempImgUrl = res.tempFilePaths[0]
_this.isChooseImg = true
console.log(" Select the confirmation form again tempImgUrl = " + _this.tempImgUrl)
reqrcode.qrcode.decode(res.tempFilePaths[0])
reqrcode.qrcode.callback = function(res1) {
_this.resultStr = res1
console.log("H5 Two dimensional code analysis results resultStr = " + _this.resultStr)
}
}
})

边栏推荐
- 云计算基础-0
- Nebula Graph学习篇3_多线程完成6000w+关系数据迁移
- 项目部署遇到的问题-生产环境
- Class diagram
- Add an "open search description" to the site to adapt to the browser's "site search"“
- Kotlin quick start
- 请求对象,发送请求
- MySQL增删查改(进阶)
- Cultivate children's creativity under the concept of project steam Education
- 路由跳转之点击列表的操作按钮,跳转至另一个菜单页面并激活相应的菜单
猜你喜欢

计组笔记 数据表示与运算 校验码部分

Classic model – RESNET

点击事件
![[paper notes] supersizing self supervision: learning to grasp from 50K tries and 700 robot hours](/img/fe/f8208747e03133f4a66e73598409d5.png)
[paper notes] supersizing self supervision: learning to grasp from 50K tries and 700 robot hours

Review of the paper: unmixing based soft color segmentation for image manipulation

分割、柱子、list

计组笔记——CPU的指令流水

Class diagram

redux-thunk 简单案例,优缺点和思考

【读点论文】FBNetV3: Joint Architecture-Recipe Search using Predictor Pretraining 网络结构和超参数全当训练参数给训练了
随机推荐
多媒体元素,音频、视频
Analysis of the multiple evaluation system of children's programming
Is Guoxin golden sun reliable? Is it safe to open a securities account?
An easy-to-use tablayout
Route jump: click the operation button of the list to jump to another menu page and activate the corresponding menu
小程序或者for循序要不要加key?
如何筹备一场感人的婚礼
【论文笔记】Manufacturing Control in Job Shop Environments with Reinforcement Learning
[appium stepping pit] io appium. uiautomator2. common. exceptions. InvalidArgumentException: ‘capabilities‘ are mand
关于#sql#的问题:SQL问题--账号多地登录的SQL代码
USB驱动-debug
todolist未完成,已完成
Do you want to add a key to the applet or for sequence?
Nebula Graph学习篇3_多线程完成6000w+关系数据迁移
USB peripheral driver - Enumeration
js array数组json去重
进程之间的通信方式
Gradient
Class diagram
Double carbon bonus + great year of infrastructure construction 𞓜 deep ploughing into the field of green intelligent equipment for water conservancy and hydropower