测试修复15分钟bug

This commit is contained in:
yml2213
2026-06-07 20:05:56 +08:00
parent 9740ff8799
commit a5e55bc045
7 changed files with 178 additions and 45 deletions
@@ -30,6 +30,7 @@ export interface Order {
handoff_status: HandoffStatus
settlement_status: SettlementStatus
checkout?: Checkout
payment_deadline_at?: string
created_at: string
updated_at: string
}
@@ -38,7 +38,7 @@ export function usePaymentPolling() {
checkingPayment.value = true
try {
const updated = await queryOrderPayment(activePayment.value.id)
const updated = await queryOrderPayment(activePayment.value.order_id)
if (updated.paid) {
stopPaymentPolling()
onSuccess?.()
@@ -26,6 +26,7 @@ const statusTabs = [
]
const tabKeys = new Set(statusTabs.map((item) => item.key))
const activeTab = ref(readTab(route.query.tab))
const fallbackPendingPaymentMinutes = 15
const displayOrders = computed(() => {
let filtered = orders.value
@@ -152,9 +153,12 @@ async function copyOrderNo(orderNo: string) {
function getPaymentDeadline(order: Order) {
if (order.status !== 'pending_payment' || !order.created_at) return null
if (order.payment_deadline_at) {
const serverDeadline = new Date(order.payment_deadline_at)
if (!Number.isNaN(serverDeadline.getTime())) return serverDeadline
}
const created = new Date(order.created_at)
const deadline = new Date(created.getTime() + 30 * 60 * 1000)
return deadline
return new Date(created.getTime() + fallbackPendingPaymentMinutes * 60 * 1000)
}
function getCountdownMinutes(order: Order) {