Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
H
hls-xcmg-vue-app
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
xugong
hls-xcmg-vue-app
Commits
58a867bc
Commit
58a867bc
authored
Oct 14, 2019
by
李晓兵
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
'身份证识别'
parent
c208f02a
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
68 additions
and
45 deletions
+68
-45
dev.env.js
config/dev.env.js
+4
-3
uat.env.js
config/uat.env.js
+3
-3
login.vue
src/pages/login.vue
+1
-1
naturePerson.vue
src/pages/userBind/np/naturePerson.vue
+26
-37
hlsUtil.js
src/scripts/hlsUtil.js
+34
-1
No files found.
config/dev.env.js
View file @
58a867bc
...
...
@@ -7,9 +7,10 @@ module.exports = merge(prodEnv, {
CONFIG_ENV
:
JSON
.
stringify
(
process
.
env
.
CONFIG_ENV
),
debug
:
true
,
isMobilePlatform
:
false
,
loginPath
:
'"http://hlsapp.hand-china.com/core/oauth/token?client_id=client2&client_secret=secret&grant_type=password&username=app&password=" '
,
basePath
:
'"http://hlsapp.hand-china.com/core/r/api?sysName=XCMG_DEV&apiName="'
,
rootPath
:
'"http://hlsapp.hand-china.com/core/r/api"'
,
loginPath
:
'"http://180.104.121.66:8088/oauth/token?client_id=client2&client_secret=secret&grant_type=password&username=admin&password=" '
,
basePath
:
'"http://180.104.121.66:8088/r/api/interface?sysName=XCMG_DEV&apiName="'
,
rootPath
:
'"http://180.104.121.66:8088/r/api/interface"'
,
ocrPath
:
'"http://180.104.121.66:8088/r/api"'
,
file_url
:
'"http://hlsapp.hand-china.com/file/"'
,
appId
:
'"com.hls.easy.car"'
,
currentVersion
:
'"0.0.1"'
...
...
config/uat.env.js
View file @
58a867bc
...
...
@@ -4,9 +4,9 @@ module.exports = {
CONFIG_ENV
:
JSON
.
stringify
(
process
.
env
.
CONFIG_ENV
),
debug
:
false
,
isMobilePlatform
:
true
,
loginPath
:
'"http://
hlsapp.hand-china.com/core/oauth/token?client_id=client2&client_secret=secret&grant_type=password&username=app&password=appadmin
" '
,
basePath
:
'"http://
hlsapp.hand-china.com/core/r/api
?sysName=XCMG_DEV&apiName="'
,
rootPath
:
'"http://
hlsapp.hand-china.com/core/r/api
"'
,
loginPath
:
'"http://
180.104.121.66:8088/oauth/token?client_id=client2&client_secret=secret&grant_type=password&username=admin&password=
" '
,
basePath
:
'"http://
180.104.121.66:8088/r/api/interface
?sysName=XCMG_DEV&apiName="'
,
rootPath
:
'"http://
180.104.121.66:8088/r/api/interface
"'
,
file_url
:
'"http://hlsapp.hand-china.com/file/"'
,
appId
:
'"com.hls.easy.car"'
,
currentVersion
:
'"0.0.1"'
...
...
src/pages/login.vue
View file @
58a867bc
...
...
@@ -87,7 +87,7 @@ export default {
}
else
if
(
!
vm
.
password
||
vm
.
password
===
undefined
)
{
vm
.
hlsPopup
.
showLongCenter
(
'请输入密码'
)
}
else
{
let
url
=
process
.
env
.
loginPath
+
'a
ppa
dmin'
let
url
=
process
.
env
.
loginPath
+
'admin'
let
param
=
{}
vm
.
hlsPopup
.
showLoading
(
'请稍等'
)
vm
.
$post
(
url
,
param
).
then
(
function
(
res
)
{
...
...
src/pages/userBind/np/naturePerson.vue
View file @
58a867bc
...
...
@@ -50,7 +50,7 @@
<img
src=
"@/assets/userBind/front.png"
>
<p>
正面
</p>
</div>
<div>
<div
@
click=
"show()"
>
<img
src=
"@/assets/userBind/back.png"
>
<p>
反面
</p>
</div>
...
...
@@ -446,60 +446,49 @@ export default {
})
},
openCamera
()
{
alert
(
'相机'
)
let
vm
=
this
let
obj
=
{
// 'table_pk_value': check_id,
table_name
:
'PRJ_CDD_ITEM_CHECK'
,
// 'check_id': check_id,
picture
:
''
,
filePath
:
''
,
attachment_id
:
''
,
timestamp
:
new
Date
().
getTime
(),
}
let
cameraoptions
=
{
quality
:
100
,
quality
:
60
,
width
:
1843
,
height
:
1382
,
}
let
success
=
function
(
imgdata
)
{
obj
.
picture
=
imgdata
obj
.
filePath
=
imgdata
vm
.
upload_list
.
push
(
obj
)
vm
.
idCardIdentify
(
imgdata
)
}
let
error
=
function
()
{
console
.
log
(
'出现错误'
)
hlsPopup
.
showLongCenter
(
error
)
}
hlsUtil
.
openCamera
(
cameraoptions
,
success
,
error
)
},
takePicture
()
{
alert
(
'相册'
)
let
vm
=
this
let
cameraoptions
=
{
quality
:
100
,
var
cameraoptions
=
{
quality
:
70
,
width
:
1843
,
height
:
1382
,
maxCount
:
1
,
}
let
success
=
function
(
imgUrl
)
{
// for (let i = 0; i
<
imgUrl
.
length
;
i
++
)
{
let
obj
=
{
// 'table_pk_value': check_id,
table_name
:
'PRJ_CDD_ITEM_CHECK'
,
// 'check_id': check_id,
picture
:
''
,
filePath
:
''
,
attachment_id
:
''
,
timestamp
:
new
Date
().
getTime
(),
sequence
:
''
,
}
obj
.
picture
=
imgUrl
obj
.
filePath
=
imgUrl
// obj.picture = imgUrl[i]
// obj.filePath = imgUrl[i]
// obj.sequence = i + 1
// push到上传列表中 通知前台数据发生改变
vm
.
upload_list
.
push
(
obj
)
vm
.
idCardIdentify
(
imgUrl
[
0
])
}
// }
let
error
=
function
()
{
console
.
log
(
'出现错误'
)
hlsPopup
.
showLongCenter
(
error
)
}
vm
.
hlsUtil
.
takePicture
(
cameraoptions
,
success
,
error
)
},
// 身份证识别
idCardIdentify
(
fileUrl
)
{
alert
(
'fileUrl '
+
fileUrl
)
let
vm
=
this
hlsPopup
.
showLoading
(
'正在识别'
)
let
url
=
process
.
env
.
rootPath
+
'/baidu/ocr/idCard'
hlsUtil
.
baiduOcr
(
fileUrl
,
url
,
function
(
res
)
{
hlsPopup
.
hideLoading
()
alert
(
'识别结果: '
+
JSON
.
stringify
(
res
))
})
},
successCall
()
{
this
.
hideModal
()
this
.
getBankInfo
()
...
...
src/scripts/hlsUtil.js
View file @
58a867bc
...
...
@@ -279,7 +279,7 @@ export default {
saveToPhotoAlbum
:
window
.
localStorage
.
savePhoto
||
false
,
correctOrientation
:
true
,
}
navigator
.
c
amera
.
getPicture
(
onSuccess
,
onFail
,
options
)
$cordovaC
amera
.
getPicture
(
onSuccess
,
onFail
,
options
)
}
else
{
window
.
hlsPopup
.
showLongCenter
(
'参数有误!'
)
}
...
...
@@ -436,6 +436,39 @@ export default {
ft
.
upload
(
path
,
url
,
uploadSuccess
,
error
,
options
)
},
/**
* 百度OCR识别
* @param file
* @param url
* @param success
*/
baiduOcr
:
function
(
fileUrl
,
postUrl
,
success
)
{
if
(
!
fileUrl
)
{
return
}
let
path
=
fileUrl
let
name
=
fileUrl
.
substr
(
fileUrl
.
lastIndexOf
(
'/'
)
+
1
)
let
url
=
encodeURI
(
postUrl
)
let
options
=
new
FileUploadOptions
()
// eslint-disable-line
options
.
headers
=
{
'Authorization'
:
'Bearer '
+
window
.
localStorage
.
access_token
,
}
options
.
fileKey
=
'file'
options
.
fileName
=
name
options
.
mimeType
=
'multipart/form-date'
let
ft
=
new
FileTransfer
()
// eslint-disable-line
function
uploadSuccess
(
message
)
{
let
res
=
JSON
.
parse
(
message
.
response
)
success
(
res
)
}
function
error
(
e
)
{
this
.
hlsPopup
.
showLongCenter
(
'识别失败'
)
}
ft
.
upload
(
path
,
url
,
uploadSuccess
,
error
,
options
)
},
/**
*
* @param x 输入的数字
...
...
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