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
250832c5
Commit
250832c5
authored
Nov 11, 2019
by
李晓兵
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
'人脸比对'
parent
899a5e6d
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
148 additions
and
24 deletions
+148
-24
contract-detail.vue
src/pages/contractSigning/contract-detail.vue
+112
-21
my-info.vue
src/pages/myInfo/my-info.vue
+0
-1
naturePerson.vue
src/pages/userBind/np/naturePerson.vue
+1
-1
enterprise.vue
src/pages/userBind/org/enterprise.vue
+1
-1
hlsUtil.js
src/scripts/hlsUtil.js
+34
-0
No files found.
src/pages/contractSigning/contract-detail.vue
View file @
250832c5
...
...
@@ -375,31 +375,122 @@ export default {
content
:
`您确认
${
val
}
吗?`
,
onConfirm
:
(
data
)
=>
{
if
(
data
)
{
let
vm
=
this
let
url
=
process
.
env
.
basePath
+
'do_confrim_bp'
let
param
=
{
'master'
:
{
confirm_id
:
vm
.
confirm_id
,
confirm_status
:
status
,
confirm_note
:
this
.
confirm_note
,
},
}
vm
.
hlsPopup
.
showLoading
(
'提交数据中!'
)
vm
.
hlsHttp
.
post
(
url
,
param
).
then
(
function
(
res
)
{
vm
.
hlsPopup
.
hideLoading
()
if
(
res
.
result
===
'S'
)
{
vm
.
hlsPopup
.
showSuccess
(
`审批成功,已
${
val
}
`
)
vm
.
$router
.
push
({
name
:
'ContractSigning'
,
})
}
else
{
vm
.
hlsPopup
.
showSuccess
(
res
.
message
)
}
})
// 执行同意的逻辑,先打开相机自拍一张
this
.
takePhonto
(
status
)
// this.confirmContractSign()
}
},
})
},
takePhonto
(
status
)
{
hlsPopup
.
showPopup
({
title
:
'提示'
,
content
:
`请自拍一张`
,
onConfirm
:
()
=>
{
this
.
takePhontoOpenCamera
(
status
)
},
})
},
// 打开相机自拍
takePhontoOpenCamera
(
status
)
{
let
vm
=
this
let
obj
=
{
'pkvalue'
:
check_id
,
'source_type'
:
'PRJ_CDD_ITEM_CHECK'
,
'picture'
:
''
,
'check_id'
:
check_id
,
'filePath'
:
''
,
'attachment_id'
:
''
,
'user_id'
:
1
,
'fileName'
:
''
,
}
let
cameraoptions
=
{
quality
:
100
,
cameraDirection
:
1
,
}
let
success
=
function
(
imgdata
)
{
obj
.
filePath
=
imgdata
this
.
confirmContractSign
(
imgdata
,
status
)
/* let list = []
list.push(obj)
// vm.upload_list.push(obj)
// 拍完一张立马执行保存图片逻辑
vm.save_picture(list) */
}
let
error
=
function
()
{
hlsPopup
.
showLongCenter
(
'请拍照'
)
}
hlsUtil
.
openCamera
(
cameraoptions
,
success
,
error
)
},
// 执行同意的逻辑(查询对应的身份证正面图片->人脸识别->确认签约)
async
confirmContractSign
(
faceImg
,
status
)
{
let
idCardImgUrl
=
await
this
.
idCardImgUrlGet
()
this
.
faceIdentify
(
faceImg
,
idCardImgUrl
,
status
)
},
// 获取身份证照片
async
idCardImgUrlGet
()
{
let
vm
=
this
let
url
=
$config
.
basePath
+
''
let
param
=
{
}
hlsPopup
.
showLoading
(
'请稍候'
)
let
res
=
await
vm
.
$post
(
url
,
param
)
hlsPopup
.
hideLoading
()
if
(
res
.
result
===
'S'
)
{
return
res
.
url
}
else
{
hlsPopup
.
showLongCenter
(
res
.
info
.
msg
)
return
null
}
},
// 人脸比对
faceIdentify
(
faceImg
,
idCardImgUrl
,
status
)
{
let
vm
=
this
let
obj
=
{
'fileUrl'
:
faceImg
,
'idCardImgUrl'
:
idCardImgUrl
,
}
hlsPopup
.
showLoading
(
'正在比对'
)
let
url
=
process
.
env
.
ocrPath
+
'/baidu/ocr/face'
hlsUtil
.
baiduOcrFace
(
obj
,
url
,
function
(
res
)
{
hlsPopup
.
hideLoading
()
if
(
res
.
success
)
{
let
identifyScore
=
res
.
result
.
result
.
score
.
toFixed
(
0
)
hlsPopup
.
showPopup
({
title
:
'提示'
,
content
:
`识别分数为
${
identifyScore
}
`
,
onConfirm
:
()
=>
{
this
.
doConfirm
(
status
)
},
})
}
})
},
// 确认签约逻辑
doConfirm
(
status
)
{
let
vm
=
this
let
url
=
process
.
env
.
basePath
+
'do_confrim_bp'
let
param
=
{
'master'
:
{
confirm_id
:
vm
.
confirm_id
,
confirm_status
:
status
,
confirm_note
:
this
.
confirm_note
,
},
}
vm
.
hlsPopup
.
showLoading
(
'提交数据中!'
)
vm
.
hlsHttp
.
post
(
url
,
param
).
then
(
function
(
res
)
{
vm
.
hlsPopup
.
hideLoading
()
if
(
res
.
result
===
'S'
)
{
vm
.
hlsPopup
.
showSuccess
(
`审批成功,已
${
val
}
`
)
vm
.
$router
.
push
({
name
:
'ContractSigning'
,
})
}
else
{
vm
.
hlsPopup
.
showSuccess
(
res
.
message
)
}
})
},
popProtocol
()
{
let
modal
=
document
.
querySelector
(
'.myModal'
)
let
alpha
=
0
...
...
src/pages/myInfo/my-info.vue
View file @
250832c5
...
...
@@ -523,7 +523,6 @@ export default {
hlsPopup
.
showLoading
(
'请稍候'
)
let
res
=
await
vm
.
$post
(
url
,
param
)
hlsPopup
.
hideLoading
()
debugger
if
(
res
.
info
.
code
===
0
)
{
return
res
.
info
.
data
.
authUrl
}
else
{
...
...
src/pages/userBind/np/naturePerson.vue
View file @
250832c5
...
...
@@ -276,7 +276,7 @@
</item>
</list-item>
</div>
<div
v-if=
"cddItemList.length"
class=
"userInfo"
>
资产
信息
</div>
<div
v-if=
"cddItemList.length"
class=
"userInfo"
>
附件
信息
</div>
<div
v-for=
"(list, index) in cddItemList"
:key=
"index"
class=
"card"
>
<span>
{{
list
.
description
}}
</span>
<div
class=
"img-content"
>
...
...
src/pages/userBind/org/enterprise.vue
View file @
250832c5
...
...
@@ -374,7 +374,7 @@
<!-- 资产信息 -->
<div
v-if=
"cddItemList.length"
:class=
"
{martop: flag,types:!flag}" class="userInfo">
资产
信息
</div>
<div
v-if=
"cddItemList.length"
:class=
"
{martop: flag,types:!flag}" class="userInfo">
附件
信息
</div>
<div
v-for=
"(list, index) in cddItemList"
:key=
"index"
class=
"card2"
>
<span>
{{
list
.
description
}}
</span>
<div
class=
"img-content"
>
...
...
src/scripts/hlsUtil.js
View file @
250832c5
...
...
@@ -278,6 +278,7 @@ export default {
popoverOptions
:
CameraPopoverOptions
,
saveToPhotoAlbum
:
window
.
localStorage
.
savePhoto
||
false
,
correctOrientation
:
true
,
cameraDirection
:
cameraoption
.
cameraDirection
||
0
}
navigator
.
camera
.
getPicture
(
onSuccess
,
onFail
,
options
)
}
else
{
...
...
@@ -474,6 +475,39 @@ export default {
ft
.
upload
(
path
,
url
,
uploadSuccess
,
error
,
options
)
},
/**
* 百度OCR人脸识别
* @param file
* @param url
* @param success
*/
baiduOcrFace
:
function
(
file
,
postUrl
,
success
)
{
let
path
=
file
.
fileUrl
let
name
=
path
.
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'
options
.
params
=
{
'imagePath'
:
file
.
idCardImgUrl
,
}
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