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

'face'

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