feat: 为所有模块添加输入框校验

- 八字模块:姓名、日期、时间、性别校验
- 六爻模块:姓名、占事、日期、时间校验
- 梅花模块:姓名、占事、日期、时间校验
- 奇门模块:姓名、占事、日期、时间校验
- 大六壬模块:姓名、占事、日期、时间校验
- 占星模块:姓名、日期、时间、出生地点校验
- 塔罗模块:问题校验
This commit is contained in:
H1d3rOne committed 2026-03-07 18:42:55 +08:00
1 parent 5345fd1399
commit b65ffcdb1e
6 files changed
+189

No files matched your search

@@ -139,6 +139,42 @@ export default {
async calculate() {
if (this.loading) return
if (!this.name || this.name.trim() === '') {
uni.showToast({
title: '请输入姓名',
icon: 'none',
duration: 2000
})
return
}
if (!this.occupy || this.occupy.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({
@@ -135,6 +135,42 @@ export default {
async calculate() {
if (this.loading) return
if (!this.name || this.name.trim() === '') {
uni.showToast({
title: '请输入姓名',
icon: 'none',
duration: 2000
})
return
}
if (!this.occupy || this.occupy.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({
@@ -153,6 +153,42 @@ export default {
async calculate() {
if (this.loading) return
if (!this.name || this.name.trim() === '') {
uni.showToast({
title: '请输入姓名',
icon: 'none',
duration: 2000
})
return
}
if (!this.occupy || this.occupy.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({
@@ -171,6 +171,42 @@ export default {
async calculate() {
if (this.loading) return
if (!this.name || this.name.trim() === '') {
uni.showToast({
title: '请输入姓名',
icon: 'none',
duration: 2000
})
return
}
if (!this.occupy || this.occupy.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({
@@ -78,6 +78,15 @@ export default {
async startDivine() {
if (this.loading) return
if (!this.question || this.question.trim() === '') {
uni.showToast({
title: '请输入您的问题',
icon: 'none',
duration: 2000
})
return
}
this.loading = true
uni.showLoading({
@@ -91,6 +91,42 @@ 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
}
if (!this.birthPlace || this.birthPlace.trim() === '') {
uni.showToast({
title: '请输入出生地点',
icon: 'none',
duration: 2000
})
return
}
this.loading = true
uni.showLoading({