优化错误提示
This commit is contained in:
@@ -138,19 +138,30 @@ const navigateTo = (e: any) => {
|
||||
},
|
||||
onFailure: (e: any) => {
|
||||
getApp().globalData?.logger?.error('coupon pay failure params: ', buildSqbParams.value, e);
|
||||
showToast('支付失败', {
|
||||
|
||||
uni.showToast({
|
||||
title: e,
|
||||
icon: 'none',
|
||||
complete: () => {
|
||||
uni.navigateBack();
|
||||
duration: 1500,
|
||||
complete(result) {
|
||||
}
|
||||
});
|
||||
|
||||
// showToast(e, {
|
||||
// icon: 'none',
|
||||
// complete: () => {
|
||||
// setTimeout(() => {
|
||||
// uni.navigateBack();
|
||||
// }, 1500);
|
||||
// }
|
||||
// });
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
const createOrder = () => {
|
||||
if(!terminalInfo.value) {
|
||||
utils_common_index.showToast('当前店铺未配置收款渠道,请联系商家');
|
||||
showToast('当前店铺未配置收款渠道,请联系商家');
|
||||
return;
|
||||
}
|
||||
const params = {
|
||||
|
@@ -163,7 +163,7 @@ const buildSqbParams = computed(() => {
|
||||
total_amount: Number(((totalPrice.value || 0) * 100).toFixed(2)),
|
||||
terminal_sn: terminalInfo.value?.terminalSn,
|
||||
subject: orderBean?.value?.orderGoods[0].name || '未知',
|
||||
subject_img: orderBean?.value?.orderGoods[0].images || '',
|
||||
subject_img: orderBean?.value?.orderGoods[0].images || 'xxx',
|
||||
merchant_name: terminalInfo.value?.companyName,
|
||||
notify_url: 'https://www.baidu.com'
|
||||
}, true);
|
||||
|
@@ -46,11 +46,16 @@ export const handlePayResult = (orderId: string | undefined, e: any, { onSuccess
|
||||
});
|
||||
}
|
||||
} else {
|
||||
getApp().globalData?.logger?.error('pay failure :', orderId, resultObj);
|
||||
if(onFailure) {
|
||||
onFailure(resultObj);
|
||||
getApp().globalData?.logger?.error('pay failure :', orderId, str, resultObj);
|
||||
let msg = '支付失败';
|
||||
if(resultObj) {
|
||||
msg = resultObj?.error_message || '支付失败';
|
||||
} else {
|
||||
msg = JSON.parse(str)?.error_message || '支付失败';
|
||||
}
|
||||
if(onFailure) {
|
||||
onFailure(msg);
|
||||
} else {
|
||||
const msg = resultObj?.error_message || '支付失败';
|
||||
showToast(msg, {
|
||||
complete: () => {
|
||||
setTimeout(() => {
|
||||
|
Reference in New Issue
Block a user