fix:替换appID为7a9,修复支付分调用失败订单无法正确取消的问题
This commit is contained in:
+38
-18
@@ -73,7 +73,7 @@
|
||||
</view>
|
||||
|
||||
<!-- 手机号输入 -->
|
||||
<!-- <view class="card phone-card" v-if="!hasActiveOrder">
|
||||
<!-- <view class="card phone-card" v-if="!hasActiveOrder">
|
||||
<view class="card-header">
|
||||
<text class="card-title">联系方式</text>
|
||||
</view>
|
||||
@@ -144,7 +144,8 @@
|
||||
getOrderByOrderNoScore,
|
||||
getOrderByOrderNoScorePayStatus,
|
||||
getOrderByOrderNo,
|
||||
updateOrderPackage
|
||||
updateOrderPackage,
|
||||
cancelOrder
|
||||
} from '@/config/user.js'
|
||||
import {
|
||||
URL
|
||||
@@ -322,7 +323,7 @@
|
||||
url: `/pages/order/payment?orderId=${order.orderId}&packageTimeHours=${selectedPkg.time.replace('小时', '')}&packagePrice=${selectedPkg.price}&totalAmount=${totalAmount}&depositAmount=${depositAmount.value}${deviceInfo.value && deviceInfo.value.feeConfig ? '&feeConfig=' + encodeURIComponent(deviceInfo.value.feeConfig) : ''}`
|
||||
})
|
||||
|
||||
} else if ('wx-score-pay') {
|
||||
} else if (payWay == 'wx-score-pay') {
|
||||
// 当支付方式为支付分支付时
|
||||
uni.hideLoading()
|
||||
// 获取支付分所需参数
|
||||
@@ -333,22 +334,41 @@
|
||||
try {
|
||||
// 调用微信支付分小程序
|
||||
const payResult = await initiateWeChatScorePayment(res);
|
||||
|
||||
// 支付成功后的逻辑处理 - 可以根据业务需求决定是否跳转或刷新页面
|
||||
if (payResult.errCode == '0') {
|
||||
const res = await getOrderByOrderNoScorePayStatus(order.orderNo);
|
||||
// 用户完成了支付流程,可以查询订单状态或跳转到订单页
|
||||
uni.showToast({
|
||||
title: '设备租借成功',
|
||||
icon: 'success'
|
||||
});
|
||||
|
||||
setTimeout(() => {
|
||||
// 延迟跳转到租用中页面或订单页
|
||||
uni.redirectTo({
|
||||
url: '/pages/order/index'
|
||||
console.log(res.data.orderStatus);
|
||||
if (res.data.orderStatus == 'in_used') {
|
||||
// 用户完成了支付流程,可以查询订单状态或跳转到订单页
|
||||
uni.showToast({
|
||||
title: '设备租借成功',
|
||||
icon: 'success'
|
||||
});
|
||||
}, 1500);
|
||||
|
||||
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)
|
||||
|
||||
}
|
||||
// 用户取消等其他情况,不做特殊处理
|
||||
}
|
||||
// 用户取消等其他情况,不做特殊处理
|
||||
} catch (payError) {
|
||||
@@ -378,7 +398,7 @@
|
||||
.container {
|
||||
min-height: 100vh;
|
||||
background-color: #f5f7fa;
|
||||
padding: 30rpx 30rpx 240rpx;
|
||||
padding: 30rpx 30rpx 300rpx;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
@@ -580,7 +600,7 @@
|
||||
.rule-item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin-bottom: 20rpx;
|
||||
margin-bottom: 16rpx;
|
||||
|
||||
&:last-child {
|
||||
margin-bottom: 0;
|
||||
@@ -650,7 +670,7 @@
|
||||
.notice-item {
|
||||
display: flex;
|
||||
align-items: flex-start;
|
||||
margin-bottom: 16rpx;
|
||||
margin-bottom: 20rpx;
|
||||
|
||||
&:last-child {
|
||||
margin-bottom: 0;
|
||||
|
||||
Reference in New Issue
Block a user