Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Z
zhu_wap_bridge
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
千变科技开源组件
zhu_wap_bridge
Commits
ffb23df5
Commit
ffb23df5
authored
Feb 06, 2021
by
westzmg
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加身份证识别的直传
parent
60cf5026
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
85 additions
and
0 deletions
+85
-0
README.md
README.md
+43
-0
_Bridge.js
components/_Bridge.js
+42
-0
umi.js
dist/umi.js
+0
-0
_Bridge.js
lib/_Bridge.js
+0
-0
baiduAI.js
pages/baiduAI.js
+0
-0
No files found.
README.md
View file @
ffb23df5
...
@@ -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 --对应的身份证正反面识别的结果
},
}
```
components/_Bridge.js
View file @
ffb23df5
...
@@ -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
,
}
}
dist/umi.js
View file @
ffb23df5
This source diff could not be displayed because it is too large. You can
view the blob
instead.
lib/_Bridge.js
View file @
ffb23df5
This diff is collapsed.
Click to expand it.
pages/baiduAI.js
View file @
ffb23df5
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment