Commit 219ef121 authored by FE-安焕焕's avatar FE-安焕焕 👣

ocr修改

parent cd086c0d
...@@ -206,6 +206,9 @@ export default { ...@@ -206,6 +206,9 @@ export default {
mounted() { mounted() {
this.orderNo = this.$route.query.orderNo || cookies.get('orderNo')?.orderNo; this.orderNo = this.$route.query.orderNo || cookies.get('orderNo')?.orderNo;
cookies.set('orderNo', { orderNo: this.orderNo }); cookies.set('orderNo', { orderNo: this.orderNo });
if (this.$route?.query?.ocrflag || cookies.get('ocrflag')) {
this.pay(cookies.get('paramsData'), 'ocr');
}
const vccToken = localStorage.get('vccToken'); const vccToken = localStorage.get('vccToken');
Current_Url = `${window.location.origin}/payWaiting?vccToken=${vccToken}&orderNo=${this.orderNo}`; Current_Url = `${window.location.origin}/payWaiting?vccToken=${vccToken}&orderNo=${this.orderNo}`;
this.queryPayInfo(); this.queryPayInfo();
...@@ -365,19 +368,19 @@ export default { ...@@ -365,19 +368,19 @@ export default {
this.accountS.fn(); this.accountS.fn();
}, 1000), }, 1000),
/* 预支付 */ /* 预支付 */
async pay(params) { async pay(params, isOcr) {
// 组合支付的提示和享花卡支付逻辑 // 组合支付的提示和享花卡支付逻辑
if (this.overtime) { if (this.overtime) {
this.$toast('订单已超时!'); this.$toast('订单已超时!');
return; return;
} }
this.error = ''; this.error = '';
if (this.isShowProtocol && !this.isCheckAgreement) { if (this.isShowProtocol && !this.isCheckAgreement && !isOcr) {
this.$toast('请仔细阅读并同意相关协议'); this.$toast('请仔细阅读并同意相关协议');
return; return;
} }
this.setAmount(); this.setAmount();
if (!params && !this.isDetention && IS_THIRD_PAY(this.payType)) { if (!params && !this.isDetention && IS_THIRD_PAY(this.payType) && !isOcr) {
this.isDetention = true; this.isDetention = true;
isDetentionFn.call(this); isDetentionFn.call(this);
return; return;
...@@ -400,7 +403,11 @@ export default { ...@@ -400,7 +403,11 @@ export default {
payCouponId: this.selectedCoupon.id || '', payCouponId: this.selectedCoupon.id || '',
mergePayPretreatmentId: this.mergePayPretreatmentInfo?.mergePayPretreatmentId mergePayPretreatmentId: this.mergePayPretreatmentInfo?.mergePayPretreatmentId
}; };
const [data, error] = params ? await pay(paramsData) : await prepay(paramsData); const [data, error] = params
? isOcr
? await pay(params)
: await pay(paramsData)
: await prepay(paramsData);
/* 支付失败 */ /* 支付失败 */
if (error) { if (error) {
if (error?.response?.businessCode === '3001') { if (error?.response?.businessCode === '3001') {
...@@ -457,6 +464,7 @@ export default { ...@@ -457,6 +464,7 @@ export default {
return; return;
} else if (creditPayStatus === FACE_VERIFICATION_CODE_PAY) { } else if (creditPayStatus === FACE_VERIFICATION_CODE_PAY) {
/* 人脸鉴权 */ /* 人脸鉴权 */
cookies.set('paramsData', paramsData);
this.goOcr(); this.goOcr();
} }
}, },
...@@ -530,11 +538,11 @@ export default { ...@@ -530,11 +538,11 @@ export default {
type: 'xyqb', type: 'xyqb',
orderNo: this.orderNo, orderNo: this.orderNo,
flowOrderNo: this.flowOrderNo, flowOrderNo: this.flowOrderNo,
callBackUrl: window.location.href callBackUrl: `${window.location.href}&ocrflag=1`
}); });
if (!res.url) return; cookies.set('ocrflag', 1);
console.log(res); if (!res.callBackUrl) return;
window.location.href = res.url; window.location.href = res.callBackUrl;
}, },
selectCouponItem(isSelected, couponInfo) { selectCouponItem(isSelected, couponInfo) {
registeredEvents('PD_YXMMACP_UserClickCouponPopupWindowCoupon', { registeredEvents('PD_YXMMACP_UserClickCouponPopupWindowCoupon', {
......
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