Skip to content

方法事件

注意

方法事件为组件方法调用后异步回调事件

用法示例

js
//事件
onEventMethod(e) {
  console.log(e.detail)
}
js
function onEventMethod(e : JSONObject) {
  console.log("onEvent:" + e.toJSONString())
}

回调示例

json
{
    "type": "openRecognition",
    "data": {
        "data": {},
        "message": "",
        "code": 0
    }
}
json
{
    "type": "closeRecognition",
    "data": {
        "data": {},
        "message": "",
        "code": 0
    }
}
json
{
    "type": "checkRecognition",
    "data": {
        "data": {
          "status": true
        },
        "message": "",
        "code": 0
    }
}
json
{
    "type": "startIdentify",
    "data": {
        "data": {},
        "message": "",
        "code": 0
    }
}
json
{
    "type": "endIdentify",
    "data": {
        "data": {},
        "message": "",
        "code": 0
    }
}

回调说明

参数名参数类型参数描述
typeString事件类型,请参考下方说明
dataObject事件数据
data.codeInteger事件结果类型,0.成功,其他:失败
data.dataInteger事件结果数据
data.messageString事件结果消息

回调事件类型说明

开启人脸识别

类型名称

openRecognition

回调说明

参数名参数类型参数描述
messageString消息提示
dataObject数据对象
codeInteger返回类型,0.成功,其他:失败

关闭人脸识别

类型名称

closeRecognition

回调说明

参数名参数类型参数描述
messageString消息提示
dataObject数据对象
codeInteger返回类型,0.成功,其他:失败

当前是否可进行人脸识别

类型名称

checkRecognition

回调说明

参数名参数类型参数描述
messageString消息提示
dataObject数据对象
data.statusBoolean当前状态
codeInteger返回类型,0.成功,其他:失败

开始人证核检

类型名称

startIdentify

回调说明

参数名参数类型参数描述
messageString消息提示
dataObject数据对象
codeInteger返回类型,0.成功,其他:失败

结束人证核检

类型名称

endIdentify

回调说明

参数名参数类型参数描述
messageString消息提示
dataObject数据对象
codeInteger返回类型,0.成功,其他:失败