scanForPlugins^8.2
插件页面的扫一扫
#请求参数
| Prop | 
Type | 
Default | 
Comment | 
types | 
Array | 
["1","2","3"] | 
定制扫一扫类型 1 扫条码 2 拍食材 3 扫食谱 | 
defaultType | 
Number | 
N/A | 
默认选择拍食材 | 
#引入接口模块
import bridge from '@minix-iot/etsbridge-sdk'
#接口调用示例
const params = {
  types: [1, 2, 3],
  defaultType: 2,
}
bridge
  .scanForPlugins(params)
  .then((res) => {
    console.log(res)
  })
  .catch((err) => {
    console.log(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 | 
错误信息 |