From aab31329af4acfa8391947dddc410433120d6c3c Mon Sep 17 00:00:00 2001 From: erio Date: Wed, 8 Apr 2026 21:10:24 +0800 Subject: [PATCH] fix(payment): use global amount range for quick buttons, not per-method Quick amount buttons and custom input always use the global min/max range (union of all methods). Payment method availability is determined by whether the selected amount fits each method's limits. --- frontend/src/views/user/PaymentView.vue | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/frontend/src/views/user/PaymentView.vue b/frontend/src/views/user/PaymentView.vue index 9197856428..90422d48f1 100644 --- a/frontend/src/views/user/PaymentView.vue +++ b/frontend/src/views/user/PaymentView.vue @@ -43,8 +43,8 @@

{{ amountError }}

@@ -221,15 +221,9 @@ function amountFitsMethod(amt: number, methodType: string): boolean { return true } -// Amount range: use selected method's limits when available, fallback to global -const activeMinAmount = computed(() => { - const ml = selectedLimit.value - return ml?.single_min && ml.single_min > 0 ? ml.single_min : checkout.value.global_min -}) -const activeMaxAmount = computed(() => { - const ml = selectedLimit.value - return ml?.single_max && ml.single_max > 0 ? ml.single_max : checkout.value.global_max -}) +// Global range for AmountInput (union of all methods, precomputed by backend) +const globalMinAmount = computed(() => checkout.value.global_min) +const globalMaxAmount = computed(() => checkout.value.global_max) // Selected method's limits (for validation and error messages) const selectedLimit = computed(() => checkout.value.methods[selectedMethod.value])