修复购买微信团购券不到帐问题
This commit is contained in:
@@ -33,9 +33,10 @@ export const handlePayResult = (orderId: string | undefined, e: any, { onSuccess
|
||||
const str = url.split('?')[1];
|
||||
const resultObj = JSON.parse(str.replaceAll('result=', ''));
|
||||
|
||||
getApp().globalData?.logger?.info('pay reuslt : ', orderId, resultObj);
|
||||
if(resultObj?.is_success === true) {
|
||||
if(onSuccess) {
|
||||
onSuccess();
|
||||
onSuccess(resultObj);
|
||||
} else {
|
||||
showToast('支付成功', {
|
||||
icon: 'success',
|
||||
@@ -45,14 +46,18 @@ export const handlePayResult = (orderId: string | undefined, e: any, { onSuccess
|
||||
});
|
||||
}
|
||||
} else {
|
||||
getApp().globalData?.logger?.error('pay failure :', resultObj);
|
||||
if(onFailure) {
|
||||
onFailure();
|
||||
} else {
|
||||
const msg = resultObj?.error_message || '支付失败';
|
||||
showToast(msg, {
|
||||
complete: () => {
|
||||
setTimeout(() => {
|
||||
uni.navigateBack();
|
||||
}, 1500);
|
||||
}
|
||||
});
|
||||
}
|
||||
const msg = resultObj?.error_message || '支付失败';
|
||||
showToast(msg, {
|
||||
complete: () => {
|
||||
uni.navigateBack();
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
Reference in New Issue
Block a user