Commit 7afcd28d authored by 李晓兵's avatar 李晓兵

'face'

parent f35e4012
8d486af335ae1cd9192a82c9555fe0fa
\ No newline at end of file
......@@ -313,6 +313,7 @@ export default {
uncheck3: unCheck3,
con_confirm_status: this.$route.params.item.confirm_status,
entry_info_flag: false,
faceListUpload: [],//自拍照上传
}
},
computed: {},
......@@ -370,13 +371,14 @@ export default {
},
methods: {
charge (val, status) {
let vm = this
this.hlsPopup.showConfirm({
title: '提示',
content: `您确认${val}吗?`,
onConfirm: (data) => {
if (data) {
// 执行同意的逻辑,先打开相机自拍一张
this.takePhonto(status)
vm.takePhonto(status)
// this.confirmContractSign()
}
},
......@@ -395,28 +397,26 @@ export default {
// 打开相机自拍
takePhontoOpenCamera (status) {
let vm = this
vm.faceListUpload = []
let obj = {
'pkvalue': vm.confirm_id,
'source_type': 'PRJ_CDD_ITEM_CHECK',
'pkvalue': 483,
'source_type': 'PRJ_PROJECT_BP_CONFIRM',
'picture': '',
'check_id': vm.confirm_id,
'check_id': 483,
'filePath': '',
'attachment_id': '',
'user_id': 1,
'fileName': '',
'fileName': 'face',
}
let cameraoptions = {
quality: 100,
// cameraDirection: 1,
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) */
//obj.filePath = imgdata
obj.filePath = 'http://hlsapp.hand-china.com/file/XCMG/2.jpg'
vm.confirmContractSign(imgdata,status)
vm.faceListUpload.push(obj)
}
let error = function () {
hlsPopup.showLongCenter('请拍照')
......@@ -431,22 +431,23 @@ export default {
},
// 获取身份证照片
async idCardImgUrlGet () {
let idCardUrl = 'http://180.104.121.66:8088/r/api/app/fileViewSvc?sysName=XCMG_DEV&apiName=file_view&attachment_id=87930&access_token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhdWQiOlsiYXBpLXJlc291cmNlIl0sInJvbGVJZHMiOlsxMDAwMSwxMDAwMl0sInVzZXJfbmFtZSI6ImFkbWluIiwic2NvcGUiOlsicmVhZCIsIndyaXRlIiwidHJ1c3QiXSwiZXhwIjoxNTc0MjQxOTYwLCJsb2NhbGUiOiJ6aF9DTiIsInVzZXJJZCI6MTAwMDEsImF1dGhvcml0aWVzIjpbIlJPTEVfVVNFUiIsIkVNUExPWUVFIiwiQURNSU4iXSwianRpIjoiYjllZDI2ODYtOGYwYy00ZGVmLWI5MzItMzRjNDA3MWFiYjMxIiwiY2xpZW50X2lkIjoiY2xpZW50MiIsImVtcGxveWVlQ29kZSI6IkFETUlOIn0.auac7h0v7qlSmf8KWhHj1TCGFr37RXYqz0qu3BjSo9s'
return idCardUrl
/* let vm = this
let url = $config.basePath + ''
// let idCardUrl = 'http://180.104.121.66:8088/r/api/app/fileViewSvc?sysName=XCMG_DEV&apiName=file_view&attachment_id=87930&access_token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhdWQiOlsiYXBpLXJlc291cmNlIl0sInJvbGVJZHMiOlsxMDAwMSwxMDAwMl0sInVzZXJfbmFtZSI6ImFkbWluIiwic2NvcGUiOlsicmVhZCIsIndyaXRlIiwidHJ1c3QiXSwiZXhwIjoxNTc0MjQxOTYwLCJsb2NhbGUiOiJ6aF9DTiIsInVzZXJJZCI6MTAwMDEsImF1dGhvcml0aWVzIjpbIlJPTEVfVVNFUiIsIkVNUExPWUVFIiwiQURNSU4iXSwianRpIjoiYjllZDI2ODYtOGYwYy00ZGVmLWI5MzItMzRjNDA3MWFiYjMxIiwiY2xpZW50X2lkIjoiY2xpZW50MiIsImVtcGxveWVlQ29kZSI6IkFETUlOIn0.auac7h0v7qlSmf8KWhHj1TCGFr37RXYqz0qu3BjSo9s'
// return idCardUrl
let vm = this
let url = $config.basePath + 'prj_id_card_query'
let param = {
confirm_id: 483,
}
hlsPopup.showLoading('请稍候')
let res = await vm.$post(url, param)
hlsPopup.hideLoading()
if (res.result === 'S') {
return res.url
let cardUrl = process.env.filePath + 'attachment_id=' + res.info.attachment_id + '&access_token=' + window.localStorage.access_token
return cardUrl
} else {
hlsPopup.showLongCenter(res.info.msg)
return null
}*/
}
},
// 人脸比对
faceIdentify (faceImg, idCardImgUrl,status) {
......@@ -466,7 +467,7 @@ export default {
content: `识别分数为${identifyScore}`,
onConfirm: () => {
alert(`识别分数为${identifyScore}`)
//this.doConfirm(status)
vm.doConfirm(status)
},
})
}
......@@ -475,7 +476,8 @@ export default {
// 确认签约逻辑
doConfirm (status) {
let vm = this
let url = process.env.basePath + 'do_confrim_bp'
vm.save_picture(vm.faceListUpload)
/*let url = process.env.basePath + 'do_confrim_bp'
let param = {
'master': {
confirm_id: vm.confirm_id,
......@@ -494,7 +496,45 @@ export default {
} else {
vm.hlsPopup.showSuccess(res.message)
}
})
})*/
},
// 图片保存
save_picture (list) {
let vm = this
if (list.length) {
// hlsPopup.showLoading('图片上传请稍候')
var alreadyUploadNum = 0
var attLength = 0
var recordUploadInterval = setInterval(function () {
if (alreadyUploadNum === attLength) {
clearInterval(recordUploadInterval)
/* hlsPopup.hideLoading()
hlsPopup.showLongCenter('图片上传成功') */
}
}, 500)
for (var i = 0; i < list.length; i++) {
let uploadSuccess = function (res) {
if (res.result === 'S') {
alreadyUploadNum++
for (var j = 0; j < list.length; j++) {
if (list[j].filePath === res.response.filePath) {
list[j].attachment_id = res.response.attachment_id
vm.upload_list.push(list[j])
break
}
}
} else {
hlsPopup.hideLoading()
}
}
if (!list[i].attachment_id) {
attLength++
hlsUtil.fileUploadSvc(list[i], uploadSuccess)
}
}
} else {
hlsPopup.hideLoading()
}
},
popProtocol () {
let modal = document.querySelector('.myModal')
......
......@@ -278,7 +278,7 @@ export default {
popoverOptions: CameraPopoverOptions,
saveToPhotoAlbum: window.localStorage.savePhoto || false,
correctOrientation: true,
//cameraDirection: cameraoption.cameraDirection || 0
cameraDirection: cameraoption.cameraDirection || 0
}
navigator.camera.getPicture(onSuccess, onFail, options)
} else {
......@@ -482,8 +482,9 @@ export default {
* @param success
*/
baiduOcrFace: function (file, postUrl, success) {
debugger
let path = file.fileUrl
let name = path.substr(fileUrl.lastIndexOf('/') + 1)
let name = path.substr(path.lastIndexOf('/') + 1)
let url = encodeURI(postUrl)
let options = new FileUploadOptions() // eslint-disable-line
options.headers = {
......
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