From 520a3231961352c47d76e38c7877499467546031 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=B4=E6=98=8A=E5=A4=A9?= <442384644@qq.com> Date: Tue, 27 Oct 2026 09:09:51 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E4=BC=98=E6=83=A0=E5=88=B8):=20=E4=BD=BF?= =?UTF-8?q?=E7=94=A8=E6=97=B6=E9=97=B4=E6=94=B9=E4=B8=BA=E5=B9=B4=E6=9C=88?= =?UTF-8?q?=E6=97=A5=E7=B4=A7=E5=87=91=E5=B1=95=E7=A4=BA=EF=BC=8C=E9=81=BF?= =?UTF-8?q?=E5=85=8D=E5=88=97=E5=AE=BD=E6=8D=A2=E8=A1=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Cursor --- .../src/pages/marketing/storeCoupon/index.vue | 40 ++++++++++++++++--- 1 file changed, 34 insertions(+), 6 deletions(-) diff --git a/frontend/admin/src/pages/marketing/storeCoupon/index.vue b/frontend/admin/src/pages/marketing/storeCoupon/index.vue index ebd2051b7..9291c2229 100644 --- a/frontend/admin/src/pages/marketing/storeCoupon/index.vue +++ b/frontend/admin/src/pages/marketing/storeCoupon/index.vue @@ -113,13 +113,12 @@ 不限时 - + @@ -262,6 +261,32 @@ onActivated(() => { getList(); }); +/** + * 时间戳格式化为仅年月日(YYYY/MM/DD),兼容秒/毫秒 + * @param {number|string} data + * @returns {string} + */ +function formatDay(data) { + if (data === null || data === undefined || data === '' || Number(data) === 0) { + return ''; + } + let ts = Number(data); + if (!Number.isFinite(ts)) { + return ''; + } + if (ts > 0 && ts < 1e12) { + ts *= 1000; + } + const date = new Date(ts); + if (Number.isNaN(date.getTime())) { + return ''; + } + const y = date.getFullYear(); + const m = String(date.getMonth() + 1).padStart(2, '0'); + const d = String(date.getDate()).padStart(2, '0'); + return `${y}/${m}/${d}`; +} + const isMobile = computed(() => mediaStore.isMobile); const labelWidth = computed(() => (isMobile.value ? undefined : '90px')); const labelPosition = computed(() => (isMobile.value ? 'top' : 'right')); @@ -367,6 +392,9 @@ function openChange(data) {