[fix] 理赔:人脸识别在微信端修改微信的人脸识别

This commit is contained in:
tian.guangyuan
2020-05-14 15:18:03 +08:00
parent 37365129e4
commit c984b404e1
2 changed files with 82 additions and 7 deletions

View File

@@ -77,6 +77,7 @@ export function uploadImg(data) {
data data
}) })
} }
/*
// 人脸识别 // 人脸识别
export function recognition(data) { export function recognition(data) {
return request({ return request({
@@ -85,8 +86,26 @@ export function recognition(data) {
data data
}) })
} }
*/
//获取腾讯人脸识别URL接口
export function getRecognitionUrl(data) {
return request({
url: getUrl('/customer/tencent/getRecognitionUrl', 1),
method: 'post',
data
})
}
//获取腾讯人脸识别结果接口
export function getRecognitionResult(data) {
return request({
url: getUrl('/customer/tencent/getRecognitionResult', 1),
method: 'post',
data
})
}
// 139.9.27.13:7002/updown/uploadImage
// 核保接口 // 核保接口
export function underWrite(data) { export function underWrite(data) {
return request({ return request({
@@ -195,3 +214,11 @@ export function getPayState(data) {
}) })
} }
// 查询支付结果
export function revokeOrder(data) {
return request({
url: getUrl('/sale/order/revokeOrder', 1),
method: 'post',
data
})
}

View File

@@ -75,15 +75,15 @@
<div class="bottom-btn bg-white" v-if="!isWeixin && list.applyerSignState == 1"> <div class="bottom-btn bg-white" v-if="!isWeixin && list.applyerSignState == 1">
<van-button type="danger" size="large" @click="next" v-no-more-click="1000" v-if="!isWeixin" :disabled="list.applyerSignState == 0">提交</van-button> <van-button type="danger" size="large" @click="next" v-no-more-click="1000" v-if="!isWeixin" :disabled="list.applyerSignState == 0">提交</van-button>
</div> </div>
<UploadImageFile :typeface="idcardData.typeface" :realName="idcardData.idcardName" :idno="idcardData.idcardNumber" @sendimage="sendimage"></UploadImageFile> <!-- <UploadImageFile :typeface="idcardData.typeface" :realName="idcardData.idcardName" :idno="idcardData.idcardNumber" @sendimage="sendimage"></UploadImageFile> -->
<Read v-show="readShow" @confirm="goToNext"/> <Read v-show="readShow" @confirm="goToNext" />
</div> </div>
</template> </template>
<script> <script>
import UploadImageFile from '@/components/ebiz/sale/UploadImageFile' // import UploadImageFile from '@/components/ebiz/sale/UploadImageFile'
import Read from '@/components/ebiz/claims/Read' import Read from '@/components/ebiz/claims/Read'
import { Cell, CellGroup, Collapse, CollapseItem, Dialog } from 'vant' import { Cell, CellGroup, Collapse, CollapseItem, Dialog } from 'vant'
import { getToken, getSignInvalid, checkSignInvalid } from '@/api/ebiz/sale/sale' import { getToken, getSignInvalid, checkSignInvalid, getRecognitionUrl, getRecognitionResult } from '@/api/ebiz/sale/sale'
import { progressDetail, submit } from '@/api/ebiz/claims/claims' import { progressDetail, submit } from '@/api/ebiz/claims/claims'
import { weixinShare } from '@/assets/js/utils/wxShare.js' import { weixinShare } from '@/assets/js/utils/wxShare.js'
export default { export default {
@@ -123,7 +123,7 @@ export default {
[Collapse.name]: Collapse, [Collapse.name]: Collapse,
[CollapseItem.name]: CollapseItem, [CollapseItem.name]: CollapseItem,
[Dialog.name]: Dialog, [Dialog.name]: Dialog,
UploadImageFile: UploadImageFile, // UploadImageFile: UploadImageFile,
Read Read
}, },
created() { created() {
@@ -137,6 +137,10 @@ export default {
}) })
window.appCallBack = this.appCallBack window.appCallBack = this.appCallBack
} }
if (localStorage['faceAuthWeXin-requestId'] && localStorage['faceAuthWeXin-bizToken']) {
this.getRecognitionResult(JSON.parse(localStorage['faceAuthWeXin-requestId']), JSON.parse(localStorage['faceAuthWeXin-bizToken']))
}
}, },
methods: { methods: {
// 初始化 // 初始化
@@ -256,9 +260,10 @@ export default {
if (that.list.applyerCertiType != '1') { if (that.list.applyerCertiType != '1') {
this.showRead() this.showRead()
} else { } else {
this.idcardData.typeface = !this.idcardData.typeface // this.idcardData.typeface = !this.idcardData.typeface
this.idcardData.idcardName = this.list.applyerName this.idcardData.idcardName = this.list.applyerName
this.idcardData.idcardNumber = this.list.applyerCertiCode this.idcardData.idcardNumber = this.list.applyerCertiCode
this.getRecognitionUrl()
} }
} }
} else { } else {
@@ -282,6 +287,49 @@ export default {
} }
} }
}, },
getRecognitionUrl(val, num) {
localStorage.setItem('faceAuthWeXin-requestId', '')
localStorage.setItem('faceAuthWeXin-bizToken', '')
return new Promise((resolve, reject) => {
// this.$route.fullPath
let data = { realName: this.idcardData.idcardName, idno: this.idcardData.idcardNumber, redirectUrl: location.origin + '/#' + this.$route.fullPath }
console.log('获取URL请求参数', data)
getRecognitionUrl(data).then(
res => {
console.log('getRecognitionUrl', res)
if (res.result == '0') {
localStorage.setItem('faceAuthWeXin-requestId', JSON.stringify(res.content.requestId))
localStorage.setItem('faceAuthWeXin-bizToken', JSON.stringify(res.content.bizToken))
window.location.href = res.content.url
} else {
this.$toast(res.resultMessage)
}
},
error => {
console.log(error)
}
)
})
},
getRecognitionResult(requestId, bizToken) {
getRecognitionResult({ requestId, bizToken })
.then(res => {
console.log('getRecognitionResult', res)
if (res.result == '0') {
// this.recognizeResult = res.content.result
// this.recognizeMessage = res.content.result == '1' ? res.content.resultMessage : ''
// this.sendimage(true)
this.showRead()
} else {
this.$toast(res.resultMessage)
}
})
.catch(error => {
console.log(error)
})
localStorage.setItem('faceAuthWeXin-requestId', '')
localStorage.setItem('faceAuthWeXin-bizToken', '')
},
sendimage(e) { sendimage(e) {
if (e) { if (e) {
this.showRead() this.showRead()