From 09918d03e33c78fa642f129213869f29df7e0022 Mon Sep 17 00:00:00 2001 From: shiran Date: Tue, 21 Jul 2026 18:12:21 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E6=96=B0=E8=B4=AD=E8=AE=A2=E5=8D=95?= =?UTF-8?q?=E8=87=AA=E5=8A=A8=E8=AE=A1=E7=AE=97=E5=88=B0=E6=9C=9F=E6=97=B6?= =?UTF-8?q?=E9=97=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/order/OrderList.vue | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/views/order/OrderList.vue b/src/views/order/OrderList.vue index 063d8a9..4f6dab3 100644 --- a/src/views/order/OrderList.vue +++ b/src/views/order/OrderList.vue @@ -1405,6 +1405,19 @@ const handleDurationChange = (value) => { orderForm.pay_num = duration } +const calculateExpireTime = (months) => { + const duration = Math.max(1, Math.floor(Number(months) || 1)) + const expireDate = new Date() + const originalDay = expireDate.getDate() + + expireDate.setDate(1) + expireDate.setMonth(expireDate.getMonth() + duration) + const lastDay = new Date(expireDate.getFullYear(), expireDate.getMonth() + 1, 0).getDate() + expireDate.setDate(Math.min(originalDay, lastDay)) + + return expireDate.getTime() +} + // 分步导航 const handleNextStep = async () => { if (currentStep.value === 0) { @@ -1420,6 +1433,7 @@ const handleNextStep = async () => { if (isAutoPriceMode.value) { const priced = await fetchOrderPrice() if (!priced) return + orderForm.expire_time = calculateExpireTime(orderForm.pay_num) } } currentStep.value++