# scanCode ^4.4.0
二维码/条形码扫码功能,用于读取二维码/条形码的内容
# 请求参数
| Prop | Type | Required | Default | Description |
|---|---|---|---|---|
param | Object | Y | {}属性: scanStr:{Type: String, Default: 对准二维码,即可自动扫描,Description: 跳转的目标页面 } | 请求参数 |
# 请求参数
this.$bridge
.scanCode(params)
.then(res => {
this.$alert(res)
})
.catch(err => {
this.$toast(err)
})
1
2
3
4
5
6
7
8
2
3
4
5
6
7
8
# 返回参数
- 成功时返回
| Prop | Type | Description |
|---|---|---|
status | Number | 0扫码失败 ,1取消扫描 |
data | String | 返回结果 |
- 失败时返回
| Prop | Type | Description |
|---|---|---|
errorCode | Number | -1摄像头没有权限, -2扫描识别失败 |
TIP
- ^5.3.0增加param.desc 值为扫描框下面的描述,若不传,默认为“对准二维码,即可自动扫描”