scanForPlugins^8.2
插件页面的扫一扫
#请求参数
| Prop |
Type |
Default |
Comment |
types |
Array |
["1","2","3"] |
定制扫一扫类型 1扫条码 2拍食材 3扫食谱 |
defaultType |
Number |
N/A |
默认选择拍食材 |
#接口调用示例
let params = {
types:["1","2","3"],
defaultType:2
}
this.$bridge
.scanForPlugins(params)
.then(res => {
this.$alert(res)
})
.catch(err => {
this.$toast(err)
})
#返回参数
| prop |
Type |
value |
comment |
code |
Number |
0 |
成功码 |
msg |
String |
1 |
|
type |
Number |
1 |
1 扫条码;2 拍食材;3 扫食谱; |
**data |
String |
xxx |
条码值;食材图片base64;食谱二维码 |
失败时(level 或者 message 为空或者没有)返回
| Prop |
Type |
Value |
code |
Number |
-1 摄像头没有权限 |
msg |
String |
错误信息 |