Commit ffb23df5 authored by westzmg's avatar westzmg

增加身份证识别的直传

parent 60cf5026
...@@ -250,3 +250,46 @@ options { ...@@ -250,3 +250,46 @@ options {
@result {uri, type, fileName, base64} @result {uri, type, fileName, base64}
``` ```
# 识别身份证正面照的信息
### await discernIdCardFront(options)
```
options {
imageId --身份证正面照图片ID
}
@result {
real_name, --姓名
id_no, --身份证号码
birth, --生日
address, --地址
ethnicity, --民族
sex --性别
}
```
# 识别身份证背面照的信息
### await discernIdCardBack(options)
```
options {
imageId --身份证正面照图片ID
}
@result {
issued_by, --发证机关
valid_to, --有效期开始
valid_from --有效期截止
}
```
# 捕捉身份证信息后直接上传并获取验证结果
### await takeIdCardAndDiscern(options)
```
options {
front: true, --是否正面
}
@result {
data: {
... --上传图片的返回结果
discernInfo --对应的身份证正反面识别的结果
},
}
```
...@@ -404,6 +404,45 @@ export const scanBusinessLicense = async (opt) => { ...@@ -404,6 +404,45 @@ export const scanBusinessLicense = async (opt) => {
}) })
}; };
/*
* @name discernIdCardFront 识别身份证正面照的信息
* options {
* imageId --身份证正面照图片ID
* }
*/
export const discernIdCardFront = async (opt) => {
return new Promise(async (resolve) => {
invoke.define('discernIdCardFrontCompleted', async (result) => {resolve(result)});
await invoke.bind("discernIdCardFront")(opt)
})
};
/*
* @name discernIdCardBack 识别身份证背面照的信息
* options {
* imageId --身份证背面照图片ID
* }
*/
export const discernIdCardBack = async (opt) => {
return new Promise(async (resolve) => {
invoke.define('discernIdCardBackCompleted', async (result) => {resolve(result)});
await invoke.bind("discernIdCardBack")(opt)
})
};
/*
* @name takeIdCardAndDiscern 捕捉身份证信息后直接上传并获取验证结果
* options {
* front: true, --是否正面
* }
*/
export const takeIdCardAndDiscern = async (opt) => {
return new Promise(async (resolve) => {
invoke.define('takeIdCardAndDiscernCompleted', async (result) => {resolve(result)});
await invoke.bind("takeIdCardAndDiscern")(opt)
})
};
export const EVENTS_TYPE = { export const EVENTS_TYPE = {
keyboardWillShow: 'keyboardWillShow', // 键盘即将出现 keyboardWillShow: 'keyboardWillShow', // 键盘即将出现
keyboardDidShow: 'keyboardDidShow', // 键盘已经出现 keyboardDidShow: 'keyboardDidShow', // 键盘已经出现
...@@ -443,6 +482,9 @@ export default { ...@@ -443,6 +482,9 @@ export default {
takeIdCard, takeIdCard,
scanCarNo, scanCarNo,
scanBusinessLicense, scanBusinessLicense,
discernIdCardFront,
discernIdCardBack,
takeIdCardAndDiscern,
} }
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment