来访时段选择时间区间

This commit is contained in:
chenglijuan
2026-05-07 09:29:24 +08:00
parent 57243dfdf3
commit 7c59d18596
3 changed files with 67 additions and 9 deletions
+17 -2
View File
@@ -27,6 +27,8 @@ Page({
personNames: [],
personIndex: -1,
today: '',
timeStart: '',
timeEnd: '',
submitting: false
},
@@ -142,8 +144,21 @@ Page({
this.setData({ 'form.date': e.detail.value })
},
onTimeChange(e) {
this.setData({ 'form.time': e.detail.value })
onTimeStartChange(e) {
this.setData({ timeStart: e.detail.value }, this._updateTimeRange)
},
onTimeEndChange(e) {
this.setData({ timeEnd: e.detail.value }, this._updateTimeRange)
},
_updateTimeRange() {
const { timeStart, timeEnd } = this.data
if (timeStart && timeEnd) {
this.setData({ 'form.time': timeStart + '-' + timeEnd })
} else {
this.setData({ 'form.time': '' })
}
},
validateForm() {