feat: H5 延期订单可作废,未完成订单直接进入详情继续支付或作废
Some checks failed
构建并部署前端到测试环境 / build-and-deploy (push) Has been cancelled

- 延期订单详情待支付时显示作废订单,作废后可重新办理延期
- 延期页有未完成订单时直接打开该订单详情;作废返回后重新查资格
This commit is contained in:
邹进
2026-11-07 20:33:42 +09:00
parent 0136615502
commit 06ca8af218
3 changed files with 59 additions and 2 deletions

View File

@@ -16,6 +16,9 @@
</view>
</view>
<view v-if="canContinuePay" class="btn-apple btn-primary pay-btn" @tap="continuePay">继续支付</view>
<view v-if="canCancel" class="btn-apple btn-secondary cancel-btn" @tap="cancelOrder">
{{ cancelling ? '作废中...' : '作废订单' }}
</view>
</template>
</view>
</template>
@@ -50,6 +53,29 @@
});
const canContinuePay = computed(() => order.value?.status === 'pending_payment' && !!order.value?.qr_content);
const canCancel = computed(() => order.value?.status === 'pending_payment');
const cancelling = ref(false);
const cancelOrder = () => {
if (cancelling.value || !order.value) return;
uni.showModal({
title: '作废延期订单',
content: '作废后该订单不能再支付,可以重新办理延期。确定作废吗?',
success: async (res) => {
if (!res.confirm) return;
cancelling.value = true;
try {
order.value = await packageSilenceApi.cancelOrder(order.value.id);
uni.showToast({ title: '已作废', icon: 'success' });
} catch (error) {
uni.showToast({ title: getSilenceErrorMessage(error, '作废失败,请稍后重试'), icon: 'none', duration: 2500 });
await load();
} finally {
cancelling.value = false;
}
}
});
};
const load = async () => {
if (!orderId.value) return;
@@ -125,7 +151,8 @@
}
}
.pay-btn {
.pay-btn,
.cancel-btn {
margin-top: 32rpx;
text-align: center;
}