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

ocr修改

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