From 3c41f0e222c0626a1a8b0a9c48d5779074b00cea Mon Sep 17 00:00:00 2001 From: 777 <123@qwe.com> Date: Thu, 21 Aug 2025 01:14:58 +0800 Subject: [PATCH] 1231233 --- src/views/cai/anchorImCountDay/index.vue | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/views/cai/anchorImCountDay/index.vue b/src/views/cai/anchorImCountDay/index.vue index f3fdfd8..f9eec41 100644 --- a/src/views/cai/anchorImCountDay/index.vue +++ b/src/views/cai/anchorImCountDay/index.vue @@ -126,7 +126,7 @@ export default { pageSize: 10, mobile: undefined, usercode: undefined, - countDate: new Date(), + countDate: this.getYesterdayFormatted(), }, }; }, @@ -134,6 +134,17 @@ export default { this.getList(); }, methods: { + getYesterdayFormatted() { + const yesterday = new Date(); + yesterday.setDate(yesterday.getDate() - 1); // 日期减1天 + + const year = yesterday.getFullYear(); + // 月份和日期需要补零处理 + const month = String(yesterday.getMonth() + 1).padStart(2, '0'); + const day = String(yesterday.getDate()).padStart(2, '0'); + + return `${year}-${month}-${day}`; + }, /** 查询每日发言统计列表 */ getList() { this.loading = true;