Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
study
Project
Project
Details
Activity
Releases
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
Damon
study
Commits
765a3b41
Commit
765a3b41
authored
Aug 03, 2021
by
linwenqing
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refactor:身份证识别修改
parent
492d6bea
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
5 deletions
+20
-5
certify.vue
src/pages/mine/certify.vue
+20
-5
No files found.
src/pages/mine/certify.vue
View file @
765a3b41
...
@@ -79,7 +79,8 @@ export default {
...
@@ -79,7 +79,8 @@ export default {
data
()
{
data
()
{
return
{
return
{
student
:
{},
student
:
{},
token
:
''
,
qiToken
:
''
,
vToken
:
null
,
}
}
},
},
computed
:
{
computed
:
{
...
@@ -118,7 +119,11 @@ export default {
...
@@ -118,7 +119,11 @@ export default {
},
},
onLoad
()
{
onLoad
()
{
this
.
student
=
getApp
().
globalData
.
student
this
.
student
=
getApp
().
globalData
.
student
this
.
token
=
getApp
().
globalData
.
qiNiuToken
this
.
qiToken
=
getApp
().
globalData
.
qiNiuToken
this
.
vToken
=
this
.
vuex_token
},
onUnload
()
{
uni
.
hideLoading
()
},
},
methods
:
{
methods
:
{
submit
()
{
submit
()
{
...
@@ -148,19 +153,24 @@ export default {
...
@@ -148,19 +153,24 @@ export default {
})
})
},
},
getFront
()
{
getFront
()
{
let
that
=
this
//身份证正面图片识别
//身份证正面图片识别
upload
.
getPhoto
(
2
,
this
.
t
oken
).
then
((
res
)
=>
{
upload
.
getPhoto
(
2
,
this
.
qiT
oken
).
then
((
res
)
=>
{
this
.
student
.
identityFrontPath
=
res
.
key
this
.
student
.
identityFrontPath
=
res
.
key
uni
.
showLoading
({
title
:
'识别中,请稍后'
,
})
this
.
$u
.
api
this
.
$u
.
api
.
getCertifyInfoByType
(
'front'
,
{
.
getCertifyInfoByType
(
'front'
,
{
url
:
process
.
uniEnv
.
qn_asset_url
+
res
.
key
,
url
:
process
.
uniEnv
.
qn_asset_url
+
res
.
key
,
})
})
.
then
((
res
)
=>
{
.
then
((
res
)
=>
{
console
.
log
(
'识别结果'
,
res
)
uni
.
hideLoading
(
)
this
.
student
.
name
=
res
.
name
this
.
student
.
name
=
res
.
name
this
.
student
.
identityNumber
=
res
.
number
this
.
student
.
identityNumber
=
res
.
number
})
})
.
catch
((
data
)
=>
{
.
catch
((
data
)
=>
{
uni
.
hideLoading
()
this
.
student
.
name
=
''
this
.
student
.
name
=
''
this
.
student
.
identityNumber
=
''
this
.
student
.
identityNumber
=
''
this
.
$u
.
toast
(
'识别身份证信息错误'
)
this
.
$u
.
toast
(
'识别身份证信息错误'
)
...
@@ -169,17 +179,22 @@ export default {
...
@@ -169,17 +179,22 @@ export default {
},
},
getBack
()
{
getBack
()
{
//身份证反面图片识别
//身份证反面图片识别
upload
.
getPhoto
(
2
,
this
.
t
oken
).
then
((
res
)
=>
{
upload
.
getPhoto
(
2
,
this
.
qiT
oken
).
then
((
res
)
=>
{
this
.
student
.
identityBackPath
=
res
.
key
this
.
student
.
identityBackPath
=
res
.
key
uni
.
showLoading
({
title
:
'识别中,请稍后'
,
})
this
.
$u
.
api
this
.
$u
.
api
.
getCertifyInfoByType
(
'back'
,
{
.
getCertifyInfoByType
(
'back'
,
{
url
:
process
.
uniEnv
.
qn_asset_url
+
res
.
key
,
url
:
process
.
uniEnv
.
qn_asset_url
+
res
.
key
,
})
})
.
then
((
res
)
=>
{
.
then
((
res
)
=>
{
uni
.
hideLoading
()
console
.
log
(
'识别结果'
,
res
)
console
.
log
(
'识别结果'
,
res
)
this
.
student
.
certificateValidityDate
=
res
.
expire
this
.
student
.
certificateValidityDate
=
res
.
expire
})
})
.
catch
((
data
)
=>
{
.
catch
((
data
)
=>
{
uni
.
hideLoading
()
this
.
student
.
certificateValidityDate
=
''
this
.
student
.
certificateValidityDate
=
''
this
.
$u
.
toast
(
'识别身份证信息错误'
)
this
.
$u
.
toast
(
'识别身份证信息错误'
)
})
})
...
...
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