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;
|
||||
|
||||
@@ -80,7 +80,7 @@
|
||||
<view class="step-icon">
|
||||
<text class="step-number">1</text>
|
||||
</view>
|
||||
<text class="step-text">扫码开锁</text>
|
||||
<text class="step-text">扫码弹出</text>
|
||||
</view>
|
||||
<view class="step-arrow"></view>
|
||||
<view class="step-item">
|
||||
@@ -94,7 +94,13 @@
|
||||
<view class="step-icon">
|
||||
<text class="step-number">3</text>
|
||||
</view>
|
||||
<text class="step-text">归还结算</text>
|
||||
<text class="step-text">插入归还</text>
|
||||
</view><view class="step-arrow"></view>
|
||||
<view class="step-item">
|
||||
<view class="step-icon">
|
||||
<text class="step-number">4</text>
|
||||
</view>
|
||||
<text class="step-text">结束订单</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@@ -382,7 +388,7 @@
|
||||
/* 扫码区域 */
|
||||
.scan-section {
|
||||
padding: 0 30rpx;
|
||||
margin-top: -60rpx;
|
||||
// margin-top: -60rpx;
|
||||
|
||||
.scan-card {
|
||||
background: #ffffff;
|
||||
|
||||
@@ -90,10 +90,10 @@
|
||||
</view>
|
||||
|
||||
<!-- 同步订单状态按钮 -->
|
||||
<view v-if="order.status === 'waiting_for_payment' || order.orderStatus === 'waiting_for_payment'" class="action-item secondary"
|
||||
<!-- <view v-if="order.status === 'waiting_for_payment' || order.orderStatus === 'waiting_for_payment'" class="action-item secondary"
|
||||
@click="getOrderStatus(order)">
|
||||
同步状态
|
||||
</view>
|
||||
</view> -->
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@@ -312,7 +312,7 @@
|
||||
title: '处理中'
|
||||
});
|
||||
|
||||
const res = await confirmPaymentAndRent(order.orderId);
|
||||
const res = await confirmPaymentAndRent(order.orderNo);
|
||||
if (res.code === 200) {
|
||||
uni.hideLoading();
|
||||
uni.showToast({
|
||||
@@ -347,10 +347,10 @@
|
||||
});
|
||||
|
||||
const result = await cancelOrder({
|
||||
orderId: order.orderId
|
||||
orderId: order.orderNo
|
||||
});
|
||||
|
||||
if (result.code === 200) {
|
||||
if (result) {
|
||||
uni.hideLoading();
|
||||
uni.showToast({
|
||||
title: '订单已取消',
|
||||
@@ -358,7 +358,7 @@
|
||||
});
|
||||
|
||||
// 刷新订单列表
|
||||
await loadOrderList(orderStatusTabs[currentTab.value].status);
|
||||
await loadOrderList();
|
||||
} else {
|
||||
throw new Error(result.msg || '取消订单失败');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user