|
@@ -299,6 +299,8 @@
|
|
margin: "0 auto"
|
|
margin: "0 auto"
|
|
},
|
|
},
|
|
frontPassed: false,
|
|
frontPassed: false,
|
|
|
|
+ idCardFrontBase64: null,
|
|
|
|
+ idCardBackBase64: null,
|
|
backPassed: false,
|
|
backPassed: false,
|
|
checkPicTips: "身份核验中....",
|
|
checkPicTips: "身份核验中....",
|
|
screenWidth: 0,
|
|
screenWidth: 0,
|
|
@@ -945,11 +947,13 @@
|
|
this.idCardInfoInPage.birth = data.birth
|
|
this.idCardInfoInPage.birth = data.birth
|
|
this.idCardInfoInPage.address = data.address
|
|
this.idCardInfoInPage.address = data.address
|
|
this.idCardInfoInPage.idNumber = data.cardNum
|
|
this.idCardInfoInPage.idNumber = data.cardNum
|
|
|
|
+ this.idCardFrontBase64 = imgBase64
|
|
this.frontPassed = true
|
|
this.frontPassed = true
|
|
} else if (_ocrType === ocrType.emblem) {
|
|
} else if (_ocrType === ocrType.emblem) {
|
|
this.idCardInfoInPage.issuingAuthority = data.issuingAuthority
|
|
this.idCardInfoInPage.issuingAuthority = data.issuingAuthority
|
|
this.idCardInfoInPage.issuingDate = data.issuingDate
|
|
this.idCardInfoInPage.issuingDate = data.issuingDate
|
|
this.idCardInfoInPage.expiryDate = data.expiryDate
|
|
this.idCardInfoInPage.expiryDate = data.expiryDate
|
|
|
|
+ this.idCardBackBase64 = imgBase64
|
|
this.backPassed = true
|
|
this.backPassed = true
|
|
}
|
|
}
|
|
my.hideLoading()
|
|
my.hideLoading()
|
|
@@ -982,13 +986,14 @@
|
|
this.showTips = false
|
|
this.showTips = false
|
|
this.isCheckingFace = true
|
|
this.isCheckingFace = true
|
|
|
|
|
|
|
|
+ let succeedImgBase64
|
|
while (!this.faceCheckSucceed) {
|
|
while (!this.faceCheckSucceed) {
|
|
- // console.log("开始takePhoto进行人脸检测");
|
|
|
|
|
|
+ // console.log("开始takePhoto进行人脸检测", this.faceCheckCam);
|
|
|
|
|
|
const photo = await this.faceCheckCam.takePhoto({
|
|
const photo = await this.faceCheckCam.takePhoto({
|
|
quality: 'normal',
|
|
quality: 'normal',
|
|
})
|
|
})
|
|
- // console.log("完成takePhoto", this.photo.tempImagePath);
|
|
|
|
|
|
+ // console.log("完成takePhoto", photo.tempImagePath);
|
|
const { data: photoBase64 } = await this.fileSystem.readFile({
|
|
const { data: photoBase64 } = await this.fileSystem.readFile({
|
|
filePath: photo.tempImagePath,
|
|
filePath: photo.tempImagePath,
|
|
encoding: "base64"
|
|
encoding: "base64"
|
|
@@ -1004,12 +1009,13 @@
|
|
// console.log("checkPicRes.data", checkPicRes.data.msg.split("原因:")[1]);
|
|
// console.log("checkPicRes.data", checkPicRes.data.msg.split("原因:")[1]);
|
|
this.checkPicTips = checkPicRes.data.msg.split("原因:")[1] + "请将面部完整放入拍摄区域。"
|
|
this.checkPicTips = checkPicRes.data.msg.split("原因:")[1] + "请将面部完整放入拍摄区域。"
|
|
} else {
|
|
} else {
|
|
|
|
+ succeedImgBase64 = photoBase64
|
|
this.faceCheckSucceed = checkPicRes.data.success
|
|
this.faceCheckSucceed = checkPicRes.data.success
|
|
}
|
|
}
|
|
setTimeout(() => {}, 100)
|
|
setTimeout(() => {}, 100)
|
|
}
|
|
}
|
|
// 进行云极人证比对
|
|
// 进行云极人证比对
|
|
- await this.afterSuccessCheckPicAlipay(photoBase64)
|
|
|
|
|
|
+ await this.afterSuccessCheckPicAlipay(succeedImgBase64)
|
|
},
|
|
},
|
|
async afterSuccessCheckPicAlipay(photoBase64) {
|
|
async afterSuccessCheckPicAlipay(photoBase64) {
|
|
if (this.userInfo.skipIdMatching === true) {
|
|
if (this.userInfo.skipIdMatching === true) {
|
|
@@ -1062,43 +1068,42 @@
|
|
title: '正在身份核验,请稍后',
|
|
title: '正在身份核验,请稍后',
|
|
});
|
|
});
|
|
let yunjiFaceCheckInfo = {
|
|
let yunjiFaceCheckInfo = {
|
|
- idNo: that.idNumber,
|
|
|
|
- name: that.name,
|
|
|
|
- image: mybase64,
|
|
|
|
|
|
+ idNo: this.idNumber,
|
|
|
|
+ name: this.name,
|
|
|
|
+ image: photoBase64,
|
|
};
|
|
};
|
|
let checkRes = await uni.$http.post(
|
|
let checkRes = await uni.$http.post(
|
|
'/faceVerification/yunjiVerification',
|
|
'/faceVerification/yunjiVerification',
|
|
yunjiFaceCheckInfo
|
|
yunjiFaceCheckInfo
|
|
);
|
|
);
|
|
|
|
|
|
- if (checkRes.data.success === true) {
|
|
|
|
|
|
+ if (checkRes.data.success) {
|
|
let infoFromIdCard = {}
|
|
let infoFromIdCard = {}
|
|
- that.infoList.forEach(info => {
|
|
|
|
- infoFromIdCard[info] = that.idCardInfoInPage[info]
|
|
|
|
|
|
+ this.infoList.forEach(info => {
|
|
|
|
+ infoFromIdCard[info] = this.idCardInfoInPage[info]
|
|
})
|
|
})
|
|
let currentCheckinInfo = {
|
|
let currentCheckinInfo = {
|
|
- name: that.name,
|
|
|
|
- idNumber: that.idNumber,
|
|
|
|
- faceData: mybase64,
|
|
|
|
- phone: that.phone,
|
|
|
|
|
|
+ name: this.name,
|
|
|
|
+ idNumber: this.idNumber,
|
|
|
|
+ faceData: photoBase64,
|
|
|
|
+ phone: this.phone,
|
|
...infoFromIdCard
|
|
...infoFromIdCard
|
|
}
|
|
}
|
|
//更新local storage 中的入住信息
|
|
//更新local storage 中的入住信息
|
|
- let checkinInfoToUpdate = that.checkinInfo
|
|
|
|
|
|
+ let checkinInfoToUpdate = this.checkinInfo
|
|
checkinInfoToUpdate.push(currentCheckinInfo)
|
|
checkinInfoToUpdate.push(currentCheckinInfo)
|
|
- that.updateCheckinInfo(checkinInfoToUpdate)
|
|
|
|
|
|
+ this.updateCheckinInfo(checkinInfoToUpdate)
|
|
//更新local storage 中的身份证信息
|
|
//更新local storage 中的身份证信息
|
|
- let idCardInfoToUpdate = that.idCardInfo
|
|
|
|
- idCardInfoToUpdate.push(that.idCardInfoInPage)
|
|
|
|
- that.updateIdCardInfo(idCardInfoToUpdate)
|
|
|
|
|
|
+ let idCardInfoToUpdate = this.idCardInfo
|
|
|
|
+ idCardInfoToUpdate.push(this.idCardInfoInPage)
|
|
|
|
+ this.updateIdCardInfo(idCardInfoToUpdate)
|
|
//如果上传过照片则更新服务器中的身份证信息
|
|
//如果上传过照片则更新服务器中的身份证信息
|
|
- if (that.idCardFrontDetectInfo.detected && that.idCardBackDetectInfo
|
|
|
|
- .detected) {
|
|
|
|
|
|
+ if (this.frontPassed && this.backPassed) {
|
|
uni.$http.post('/idCardInfo', {
|
|
uni.$http.post('/idCardInfo', {
|
|
- ...that.idCardInfoInPage,
|
|
|
|
- birthday: that.idCardInfoInPage.birth,
|
|
|
|
- idCardFrontBase64: that.idCardFrontPicPath.split(',')[1],
|
|
|
|
- idCardBackBase64: that.idCardBackPicPath.split(',')[1]
|
|
|
|
|
|
+ ...this.idCardInfoInPage,
|
|
|
|
+ birthday: this.idCardInfoInPage.birth,
|
|
|
|
+ idCardFrontBase64: this.idCardFrontBase64,
|
|
|
|
+ idCardBackBase64: this.idCardBackBase64
|
|
})
|
|
})
|
|
}
|
|
}
|
|
if (this.isMainCustomer) {
|
|
if (this.isMainCustomer) {
|
|
@@ -1123,16 +1128,8 @@
|
|
}), 1000)
|
|
}), 1000)
|
|
} else {
|
|
} else {
|
|
uni.hideLoading()
|
|
uni.hideLoading()
|
|
- uni.showModal({
|
|
|
|
- content: '身份核验失败,请重试',
|
|
|
|
- showCancel: false,
|
|
|
|
- success: function(res) {
|
|
|
|
- if (res.confirm) {
|
|
|
|
- console.log('用户点击确定');
|
|
|
|
- that.initData();
|
|
|
|
- }
|
|
|
|
- },
|
|
|
|
- });
|
|
|
|
|
|
+ this.isCheckingFace = false
|
|
|
|
+ this.checkPicTips = "身份核验失败,请重新进行"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
},
|