Microseer.scanCode(object)

调起客户端扫码界面,扫码成功后返回对应的结果

object 参数说明

参数名 类型 必填 说明
success function 是 接口调用成功的回调函数
fail function 否 接口调用失败的回调函数
complete function 否 接口调用结束的回调函数(调用成功、失败都会执行)

sucess 回调参数说明

属性 类型 说明
result string 所扫码的内容
scanType string 所扫码的类型

fail 回调参数说明

属性 类型 说明
无 string 扫码失败原因

eg:

let callBack = {
    success: function(res) {
        console.log("扫码内容: " + res.result);
        console.log("类型: " + res.scanType);
    },
    fail: function(res) {
        console.error("失败: " + res);
    },
    complete: function() {
        console.log("扫码完毕");
    }
}
Microseer.scanCode(callBack);

results matching ""

    No results matching ""