扫条形码、二维码
调用biz.util.scan扫条形码或二维码。
调试
访问JSAPI Explorer在线调试该接口。
使用说明
客户端 | Android | iOS | PC |
|---|---|---|---|
支持说明 | 支持 | 支持 | 不支持 |
dd.biz.util.scan({
type: String , // type 为 all、qrCode、barCode,默认是all。
onSuccess: function(data) {
//onSuccess将在扫码成功之后回调
/* data结构
{ 'text': String}
*/
},
onFail : function(err) {
}
})参数说明
参数 | 类型 | 说明 |
|---|---|---|
type | String |
|
返回结果
参数 | 说明 |
|---|---|
text | 扫码内容。 |