| | |
| | | this.endDate = curDates[1]; |
| | | }, |
| | | handleStartDateChange(date) { |
| | | if (date && this.endDate) { |
| | | const startTime = new Date(date); |
| | | const endTime = new Date(this.endDate); |
| | | if (startTime > endTime) { |
| | | Taro.showToast({ |
| | | title: '开始日期不能晚于结束日期!', |
| | | icon: 'none', |
| | | mask: true, |
| | | duration: 2000, |
| | | }); |
| | | return; |
| | | } |
| | | } |
| | | this.startDate = date; |
| | | }, |
| | | handleEndDateChange(date) { |
| | | if (date && this.startDate) { |
| | | const startTime = new Date(this.startDate); |
| | | const endTime = new Date(date); |
| | | if (startTime > endTime) { |
| | | Taro.showToast({ |
| | | title: '结束日期不能早于开始日期!', |
| | | icon: 'none', |
| | | mask: true, |
| | | duration: 2000, |
| | | }); |
| | | return; |
| | | } |
| | | } |
| | | this.endDate = date; |
| | | }, |
| | | handleFinish() { |