From 5345fd1399a3ec77853548f284d12e8be5e64c2c Mon Sep 17 00:00:00 2001 From: H1d3rOne Date: Sat, 7 Mar 2026 18:34:27 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E7=B4=AB=E5=BE=AE=E6=96=97=E6=95=B0?= =?UTF-8?q?=E6=A8=A1=E5=9D=97=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 标题改为'紫微斗数' - 按钮文字改为'开始测算' - 添加姓名、日期、时间输入框校验 - 结果页公历时间只显示到分钟 --- xuan-deduct-uniapp/src/pages/ziwei/result.vue | 23 ++++++++++++- xuan-deduct-uniapp/src/pages/ziwei/ziwei.vue | 33 +++++++++++++++++-- 2 files changed, 52 insertions(+), 4 deletions(-) diff --git a/xuan-deduct-uniapp/src/pages/ziwei/result.vue b/xuan-deduct-uniapp/src/pages/ziwei/result.vue index 5ddca3b..3cfdc50 100644 --- a/xuan-deduct-uniapp/src/pages/ziwei/result.vue +++ b/xuan-deduct-uniapp/src/pages/ziwei/result.vue @@ -4,7 +4,7 @@ 公历 - {{ result.solar || '-' }} + {{ formatSolarTime }} @@ -144,6 +144,27 @@ export default { markdownHtml() { if (!this.result.aiAnalysis) return '' return markdownToHtml(this.result.aiAnalysis) + }, + formatSolarTime() { + if (this.result.solar) { + let time = this.result.solar + if (time.includes(':')) { + const parts = time.split(' ') + if (parts.length === 2) { + const datePart = parts[0] + const timePart = parts[1] + const timeComponents = timePart.split(':') + if (timeComponents.length >= 2) { + return `${datePart} ${timeComponents[0]}:${timeComponents[1]}` + } + } + } + if (time.includes('秒')) { + return time.replace(/\d{2}秒$/, '') + } + return time.replace(/:\d{2}$/, '') + } + return '-' } }, onLoad() { diff --git a/xuan-deduct-uniapp/src/pages/ziwei/ziwei.vue b/xuan-deduct-uniapp/src/pages/ziwei/ziwei.vue index 85bb308..5fb9c4e 100644 --- a/xuan-deduct-uniapp/src/pages/ziwei/ziwei.vue +++ b/xuan-deduct-uniapp/src/pages/ziwei/ziwei.vue @@ -4,7 +4,7 @@ 紫 - 紫微斗数排盘 + 紫微斗数 帝王之学 · 推演命理 @@ -83,7 +83,7 @@ @@ -113,10 +113,37 @@ export default { async calculate() { if (this.loading) return + if (!this.name || this.name.trim() === '') { + uni.showToast({ + title: '请输入姓名', + icon: 'none', + duration: 2000 + }) + return + } + + if (!this.solarDate) { + uni.showToast({ + title: '请选择出生日期', + icon: 'none', + duration: 2000 + }) + return + } + + if (!this.birthTime) { + uni.showToast({ + title: '请选择出生时间', + icon: 'none', + duration: 2000 + }) + return + } + this.loading = true uni.showLoading({ - title: '排盘中...', + title: '测算中...', mask: true })