feat:新增快递归还相关接口
This commit is contained in:
+5
-34
@@ -500,41 +500,12 @@
|
||||
try {
|
||||
// 调用微信支付分小程序
|
||||
const payResult = await initiateWeChatScorePayment(res);
|
||||
// 支付成功后的逻辑处理 - 可以根据业务需求决定是否跳转或刷新页面
|
||||
// 成功则跳转等待页,轮询在等待页处理
|
||||
if (payResult.errCode == '0') {
|
||||
const res = await getOrderByOrderNoScorePayStatus(order.orderNo);
|
||||
console.log(res.data.orderStatus);
|
||||
if (res.data.orderStatus == 'in_used') {
|
||||
// 用户完成了支付流程,可以查询订单状态或跳转到订单页
|
||||
uni.showToast({
|
||||
title: '设备租借成功',
|
||||
icon: 'success'
|
||||
});
|
||||
|
||||
setTimeout(() => {
|
||||
// 延迟跳转到租用中页面或订单页
|
||||
uni.redirectTo({
|
||||
url: '/pages/order/index'
|
||||
});
|
||||
}, 1500);
|
||||
} else if (res.data.orderStatus == 'waiting_for_payment') {
|
||||
uni.showToast({
|
||||
title: '设备租借失败,订单已取消',
|
||||
icon: 'error'
|
||||
});
|
||||
|
||||
await cancelOrder({
|
||||
orderId: order.orderNo
|
||||
});
|
||||
// 延迟跳转到租用中页面或订单页
|
||||
setTimeout(() => {
|
||||
uni.switchTab({
|
||||
url: '/pages/index/index'
|
||||
});
|
||||
}, 1500)
|
||||
|
||||
}
|
||||
// 用户取消等其他情况,不做特殊处理
|
||||
uni.redirectTo({
|
||||
url: `/pages/waiting/index?orderNo=${order.orderNo}&deviceId=${deviceId.value}`
|
||||
});
|
||||
return;
|
||||
}
|
||||
// 用户取消等其他情况,不做特殊处理
|
||||
} catch (payError) {
|
||||
|
||||
Reference in New Issue
Block a user