diff --git a/src/pages/common/groupbuy/order-coupon-confirm.vue b/src/pages/common/groupbuy/order-coupon-confirm.vue index 8e16042..de8fb70 100644 --- a/src/pages/common/groupbuy/order-coupon-confirm.vue +++ b/src/pages/common/groupbuy/order-coupon-confirm.vue @@ -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 = { diff --git a/src/pages/mall/subs/order/order-confirm.vue b/src/pages/mall/subs/order/order-confirm.vue index b402b85..8121d65 100644 --- a/src/pages/mall/subs/order/order-confirm.vue +++ b/src/pages/mall/subs/order/order-confirm.vue @@ -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); diff --git a/src/utils/order/index.ts b/src/utils/order/index.ts index 1a00e44..12442be 100644 --- a/src/utils/order/index.ts +++ b/src/utils/order/index.ts @@ -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(() => {