From 8442584d4ff076a2a80ced7e4aebf2b27c8c4d83 Mon Sep 17 00:00:00 2001 From: H1d3rOne Date: Sun, 8 Mar 2026 09:05:00 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=85=AD=E7=88=BB=E7=BB=93=E6=9E=9C?= =?UTF-8?q?=E9=A1=B5=E5=85=AC=E5=8E=86=E6=97=B6=E9=97=B4=E5=8F=AA=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E5=88=B0=E5=88=86=E9=92=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 添加formatSolar计算属性格式化公历时间 - 移除秒数显示,只保留年月日时分 - 提升用户体验,时间显示更简洁 --- xuan-deduct-uniapp/src/pages/liuyao/result.vue | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/xuan-deduct-uniapp/src/pages/liuyao/result.vue b/xuan-deduct-uniapp/src/pages/liuyao/result.vue index 2e9074a..b167345 100644 --- a/xuan-deduct-uniapp/src/pages/liuyao/result.vue +++ b/xuan-deduct-uniapp/src/pages/liuyao/result.vue @@ -16,7 +16,7 @@ 公历 - {{ result.solar || '-' }} + {{ formatSolar }} @@ -186,6 +186,22 @@ export default { } }, computed: { + formatSolar() { + if (!this.result.solar) return '-' + const solar = this.result.solar + if (solar.includes(':')) { + const parts = solar.split(' ') + if (parts.length === 2) { + const datePart = parts[0] + const timePart = parts[1] + const timeParts = timePart.split(':') + if (timeParts.length >= 2) { + return `${datePart} ${timeParts[0]}:${timeParts[1]}` + } + } + } + return solar + }, liuYaoData() { if (!this.result.benGuaLiuYaoName) return []