Appearance
方法事件
注意
方法事件为组件方法调用后异步回调事件
用法示例
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
}
}回调说明
| 参数名 | 参数类型 | 参数描述 |
|---|---|---|
| type | String | 事件类型,请参考下方说明 |
| data | Object | 事件数据 |
| data.code | Integer | 事件结果类型,0.成功,其他:失败 |
| data.data | Integer | 事件结果数据 |
| data.message | String | 事件结果消息 |
回调事件类型说明
开启人脸识别
类型名称
openRecognition
回调说明
| 参数名 | 参数类型 | 参数描述 |
|---|---|---|
| message | String | 消息提示 |
| data | Object | 数据对象 |
| code | Integer | 返回类型,0.成功,其他:失败 |
关闭人脸识别
类型名称
closeRecognition
回调说明
| 参数名 | 参数类型 | 参数描述 |
|---|---|---|
| message | String | 消息提示 |
| data | Object | 数据对象 |
| code | Integer | 返回类型,0.成功,其他:失败 |
当前是否可进行人脸识别
类型名称
checkRecognition
回调说明
| 参数名 | 参数类型 | 参数描述 |
|---|---|---|
| message | String | 消息提示 |
| data | Object | 数据对象 |
| data.status | Boolean | 当前状态 |
| code | Integer | 返回类型,0.成功,其他:失败 |
开始人证核检
类型名称
startIdentify
回调说明
| 参数名 | 参数类型 | 参数描述 |
|---|---|---|
| message | String | 消息提示 |
| data | Object | 数据对象 |
| code | Integer | 返回类型,0.成功,其他:失败 |
结束人证核检
类型名称
endIdentify
回调说明
| 参数名 | 参数类型 | 参数描述 |
|---|---|---|
| message | String | 消息提示 |
| data | Object | 数据对象 |
| code | Integer | 返回类型,0.成功,其他:失败 |

