fix(支付): 修复微信小程序支付后支付状态显示不正确的bug

Signed-off-by: 王佳星 <417783514@qq.com>
pull/155/head
王佳星 2025-07-11 13:18:11 +00:00 committed by Gitee
parent 817b2ec5ce
commit 82b0127fab
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
1 changed files with 2 additions and 12 deletions

View File

@ -17,7 +17,7 @@
<view class="tip-text ss-m-b-30" v-if="payResult === 'success'"></view>
<view class="tip-text ss-m-b-30" v-if="payResult === 'failed'"></view>
<view class="tip-text ss-m-b-30" v-if="payResult === 'closed'"></view>
<view class="tip-text ss-m-b-30" v-if="payResult === 'waiting'">...</view>
<view class="tip-text ss-m-b-30" v-if="payResult === 'waiting'">...</view>
<view class="pay-total-num ss-flex" v-if="payResult === 'success'">
<view>{{ fen2yuan(state.orderInfo.price) }}</view>
</view>
@ -101,7 +101,7 @@
async function getOrderInfo(id) {
state.counter++;
// 1.
const { data, code } = await PayOrderApi.getOrder(id);
const { data, code } = await PayOrderApi.getOrder(id, true);
if (code === 0) {
state.orderInfo = data;
if (!state.orderInfo || state.orderInfo.status === 30) {
@ -137,16 +137,6 @@
return;
}
}
// 2.1
if (state.counter < 3 && state.result === 'unpaid') {
setTimeout(() => {
getOrderInfo(id);
}, 1500);
}
// 2.2
if (state.counter >= 3) {
state.result = 'failed';
}
}
function onOrder() {