From 7dac4daa723b85bb393865aa4156780dcd990a91 Mon Sep 17 00:00:00 2001 From: woody Date: Mon, 1 Sep 2025 10:55:49 +0800 Subject: [PATCH] =?UTF-8?q?fix(bonus):=20=E4=BF=AE=E5=A4=8D=E5=A5=96?= =?UTF-8?q?=E9=87=91=E6=9F=A5=E8=AF=A2=E8=B7=A8=E6=9C=88=E6=9F=A5=E8=AF=A2?= =?UTF-8?q?=E6=97=A5=E6=9C=9F=E5=8C=BA=E9=97=B4=E4=B8=8D=E6=AD=A3=E7=A1=AE?= =?UTF-8?q?=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/bonus/index.vue | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/pages/bonus/index.vue b/pages/bonus/index.vue index 3d29c95..175e8a6 100644 --- a/pages/bonus/index.vue +++ b/pages/bonus/index.vue @@ -131,15 +131,13 @@ export default { }, methods: { setDefaultDateRange() { - const end = new Date() - const start = new Date() - end.setDate(end.getDate() - 1) - start.setDate(start.getDate() - 15) // 默认查询最近15天 + const end = dayjs().subtract(1, 'day') + const start = dayjs().subtract(15, 'day') + this.startDate = start.format('YYYY-MM-DD') + this.endDate = end.format('YYYY-MM-DD') - this.startDate = this.formatDate(start) - this.endDate = this.formatDate(end) - this.startDateValue = Number(start) - this.endDateValue = Number(end) + this.startDateValue = Number(start.toDate()) + this.endDateValue = Number(end.toDate()) }, formatDate(date) { return dayjs(date).format('YYYY-MM-DD')