Commit 8d98ef7038907d972148fedece25c231f21ff3b7
1 parent
3e3e6e92
小程序封面餐段中午bug && 多时段限制今天之前的日期置灰不可选择
Showing
3 changed files
with
45 additions
and
30 deletions
| @@ -7370,7 +7370,7 @@ class DialogUtil { | @@ -7370,7 +7370,7 @@ class DialogUtil { | ||
| 7370 | TextEditingController controller = TextEditingController(); | 7370 | TextEditingController controller = TextEditingController(); |
| 7371 | FocusNode focusNode = FocusNode(); | 7371 | FocusNode focusNode = FocusNode(); |
| 7372 | bool showArea = true; | 7372 | bool showArea = true; |
| 7373 | - areas.remove('全部'); | 7373 | + areas.remove('全部'); |
| 7374 | bool showPnumMin = true; | 7374 | bool showPnumMin = true; |
| 7375 | bool showPnumMax = true; | 7375 | bool showPnumMax = true; |
| 7376 | // String pnumMin = ''; | 7376 | // String pnumMin = ''; |
| @@ -8740,12 +8740,15 @@ class DialogUtil { | @@ -8740,12 +8740,15 @@ class DialogUtil { | ||
| 8740 | } | 8740 | } |
| 8741 | 8741 | ||
| 8742 | static Widget _buildMultiDatePickerWithValue( | 8742 | static Widget _buildMultiDatePickerWithValue( |
| 8743 | - List<DateTime> _multiDatePickerValueWithDefaultValue, | ||
| 8744 | - CalendarDatePicker2Type calendarType, | ||
| 8745 | - ValueChanged valueChanged) { | 8743 | + List<DateTime> _multiDatePickerValueWithDefaultValue, |
| 8744 | + CalendarDatePicker2Type calendarType, | ||
| 8745 | + ValueChanged valueChanged, { | ||
| 8746 | + DateTime? firstDate, | ||
| 8747 | + }) { | ||
| 8746 | final config = CalendarDatePicker2Config( | 8748 | final config = CalendarDatePicker2Config( |
| 8747 | disableMonthPicker: true, | 8749 | disableMonthPicker: true, |
| 8748 | calendarType: calendarType, | 8750 | calendarType: calendarType, |
| 8751 | + firstDate: firstDate, | ||
| 8749 | currentDate: DateTime.now(), | 8752 | currentDate: DateTime.now(), |
| 8750 | dynamicCalendarRows: true, | 8753 | dynamicCalendarRows: true, |
| 8751 | centerAlignModePicker: true, | 8754 | centerAlignModePicker: true, |
| @@ -8758,6 +8761,7 @@ class DialogUtil { | @@ -8758,6 +8761,7 @@ class DialogUtil { | ||
| 8758 | Utils.getImgPath('date_m_r'), | 8761 | Utils.getImgPath('date_m_r'), |
| 8759 | width: w(8), | 8762 | width: w(8), |
| 8760 | ), | 8763 | ), |
| 8764 | + disabledDayTextStyle: TextStyle(color: MyColours.color_999999), | ||
| 8761 | selectedDayHighlightColor: MyColours.color_438E93, | 8765 | selectedDayHighlightColor: MyColours.color_438E93, |
| 8762 | weekdayLabelBuilder: ({isScrollViewTopHeader, required weekday}) { | 8766 | weekdayLabelBuilder: ({isScrollViewTopHeader, required weekday}) { |
| 8763 | return Container( | 8767 | return Container( |
| @@ -8801,7 +8805,9 @@ class DialogUtil { | @@ -8801,7 +8805,9 @@ class DialogUtil { | ||
| 8801 | ? MyColours.color_F8F9FD | 8805 | ? MyColours.color_F8F9FD |
| 8802 | : isToday! | 8806 | : isToday! |
| 8803 | ? MyColours.color_F8F9FD | 8807 | ? MyColours.color_F8F9FD |
| 8804 | - : MyColours.color_353535, | 8808 | + : isDisabled ?? false |
| 8809 | + ? MyColours.color_999999 | ||
| 8810 | + : MyColours.color_353535, | ||
| 8805 | fontWeight: FontWeight.bold)), | 8811 | fontWeight: FontWeight.bold)), |
| 8806 | Text( | 8812 | Text( |
| 8807 | _parseDateDay(date), | 8813 | _parseDateDay(date), |
| @@ -8814,7 +8820,9 @@ class DialogUtil { | @@ -8814,7 +8820,9 @@ class DialogUtil { | ||
| 8814 | ? MyColours.color_F8F9FD | 8820 | ? MyColours.color_F8F9FD |
| 8815 | : isToday! | 8821 | : isToday! |
| 8816 | ? MyColours.color_F8F9FD | 8822 | ? MyColours.color_F8F9FD |
| 8817 | - : MyColours.color_353535), | 8823 | + : isDisabled ?? false |
| 8824 | + ? MyColours.color_999999 | ||
| 8825 | + : MyColours.color_353535), | ||
| 8818 | ), | 8826 | ), |
| 8819 | ], | 8827 | ], |
| 8820 | ), | 8828 | ), |
| @@ -8947,7 +8955,7 @@ class DialogUtil { | @@ -8947,7 +8955,7 @@ class DialogUtil { | ||
| 8947 | _multiDatePickerValueWithDefaultValue, calendarType, | 8955 | _multiDatePickerValueWithDefaultValue, calendarType, |
| 8948 | (value) { | 8956 | (value) { |
| 8949 | _multiDatePickerValueWithDefaultValue = value; | 8957 | _multiDatePickerValueWithDefaultValue = value; |
| 8950 | - }), | 8958 | + }, firstDate: DateTime.now()), |
| 8951 | VEmptyView(120), | 8959 | VEmptyView(120), |
| 8952 | Row( | 8960 | Row( |
| 8953 | mainAxisAlignment: MainAxisAlignment.spaceEvenly, | 8961 | mainAxisAlignment: MainAxisAlignment.spaceEvenly, |
| @@ -2553,7 +2553,7 @@ class Utils { | @@ -2553,7 +2553,7 @@ class Utils { | ||
| 2553 | fontWeight: FontWeight.bold, | 2553 | fontWeight: FontWeight.bold, |
| 2554 | fontStyle: FontStyle.normal, | 2554 | fontStyle: FontStyle.normal, |
| 2555 | height: 1, | 2555 | height: 1, |
| 2556 | - ellipsis:'...', | 2556 | + ellipsis: '...', |
| 2557 | fontSize: 16 * scaleX)); | 2557 | fontSize: 16 * scaleX)); |
| 2558 | pb.pushStyle( | 2558 | pb.pushStyle( |
| 2559 | ui.TextStyle(color: MyColours.color_FFEFC5, fontSize: 16 * scaleX)); | 2559 | ui.TextStyle(color: MyColours.color_FFEFC5, fontSize: 16 * scaleX)); |
| @@ -2681,7 +2681,7 @@ class Utils { | @@ -2681,7 +2681,7 @@ class Utils { | ||
| 2681 | fontWeight: FontWeight.bold, | 2681 | fontWeight: FontWeight.bold, |
| 2682 | fontStyle: FontStyle.normal, | 2682 | fontStyle: FontStyle.normal, |
| 2683 | height: 1, | 2683 | height: 1, |
| 2684 | - ellipsis:'...', | 2684 | + ellipsis: '...', |
| 2685 | fontSize: 16 * scaleX)); | 2685 | fontSize: 16 * scaleX)); |
| 2686 | pb.pushStyle( | 2686 | pb.pushStyle( |
| 2687 | ui.TextStyle(color: MyColours.color_FFEFC5, fontSize: 16 * scaleX)); | 2687 | ui.TextStyle(color: MyColours.color_FFEFC5, fontSize: 16 * scaleX)); |
| @@ -2820,7 +2820,7 @@ class Utils { | @@ -2820,7 +2820,7 @@ class Utils { | ||
| 2820 | fontWeight: FontWeight.bold, | 2820 | fontWeight: FontWeight.bold, |
| 2821 | height: 1, | 2821 | height: 1, |
| 2822 | fontStyle: FontStyle.normal, | 2822 | fontStyle: FontStyle.normal, |
| 2823 | - ellipsis:'...', | 2823 | + ellipsis: '...', |
| 2824 | fontSize: 16 * scaleX)); | 2824 | fontSize: 16 * scaleX)); |
| 2825 | pb.pushStyle( | 2825 | pb.pushStyle( |
| 2826 | ui.TextStyle(color: MyColours.color_FFEFC5, fontSize: 16 * scaleX)); | 2826 | ui.TextStyle(color: MyColours.color_FFEFC5, fontSize: 16 * scaleX)); |
| @@ -2961,7 +2961,7 @@ class Utils { | @@ -2961,7 +2961,7 @@ class Utils { | ||
| 2961 | textAlign: TextAlign.center, | 2961 | textAlign: TextAlign.center, |
| 2962 | fontWeight: FontWeight.bold, | 2962 | fontWeight: FontWeight.bold, |
| 2963 | height: 1, | 2963 | height: 1, |
| 2964 | - ellipsis:'...', | 2964 | + ellipsis: '...', |
| 2965 | fontStyle: FontStyle.normal, | 2965 | fontStyle: FontStyle.normal, |
| 2966 | fontSize: scaleX * 16)); | 2966 | fontSize: scaleX * 16)); |
| 2967 | pb.pushStyle( | 2967 | pb.pushStyle( |
| @@ -3309,25 +3309,18 @@ class Utils { | @@ -3309,25 +3309,18 @@ class Utils { | ||
| 3309 | ) { | 3309 | ) { |
| 3310 | String dsoltStr = '${ddateHm == null || ddateHm == '' ? '' : ddateHm}'; | 3310 | String dsoltStr = '${ddateHm == null || ddateHm == '' ? '' : ddateHm}'; |
| 3311 | if (liteStyle == '1') { | 3311 | if (liteStyle == '1') { |
| 3312 | - if (mname == '早餐' || mname == '午餐' || mname == '晚餐') { | ||
| 3313 | - dsoltStr = ddateSolt == '1' | ||
| 3314 | - ? '早上' | ||
| 3315 | - : ddateSolt == '2' | ||
| 3316 | - ? '中午' | ||
| 3317 | - : '晚上'; | ||
| 3318 | - } else { | 3312 | + if (mname == '早餐') { |
| 3313 | + mname ='早上'; | ||
| 3314 | + } else if (mname == '午餐') { | ||
| 3315 | + mname ='中午'; | ||
| 3316 | + } else if (mname == '晚餐') { | ||
| 3317 | + mname = '晚上'; | ||
| 3318 | + } | ||
| 3319 | dsoltStr = mname; | 3319 | dsoltStr = mname; |
| 3320 | - } | 3320 | + |
| 3321 | } else if (liteStyle == '3') { | 3321 | } else if (liteStyle == '3') { |
| 3322 | - if (mname == '早餐' || mname == '午餐' || mname == '晚餐') { | ||
| 3323 | - dsoltStr = ddateSolt == '1' | ||
| 3324 | - ? '早餐' | ||
| 3325 | - : ddateSolt == '2' | ||
| 3326 | - ? '午餐' | ||
| 3327 | - : '晚餐'; | ||
| 3328 | - } else { | ||
| 3329 | - dsoltStr = mname; | ||
| 3330 | - } | 3322 | + |
| 3323 | + dsoltStr = mname; | ||
| 3331 | } | 3324 | } |
| 3332 | return dsoltStr; | 3325 | return dsoltStr; |
| 3333 | } | 3326 | } |
| @@ -206,6 +206,20 @@ class _CalendarViewState extends State<_CalendarView> { | @@ -206,6 +206,20 @@ class _CalendarViewState extends State<_CalendarView> { | ||
| 206 | ); | 206 | ); |
| 207 | } | 207 | } |
| 208 | 208 | ||
| 209 | + // bool get _isDisplayingFirstYear { | ||
| 210 | + // fsfdf | ||
| 211 | + // return !_currentMonth.isAfter( | ||
| 212 | + // DateTime(widget.config.firstDate.year, widget.config.firstDate.month), | ||
| 213 | + // ); | ||
| 214 | + // } | ||
| 215 | + | ||
| 216 | + // /// True if the latest allowable month is displayed. | ||
| 217 | + // bool get _isDisplayingLastYear { | ||
| 218 | + // return !_currentMonth.isBefore( | ||
| 219 | + // DateTime(widget.config.lastDate.year, widget.config.lastDate.month), | ||
| 220 | + // ); | ||
| 221 | + // } | ||
| 222 | + | ||
| 209 | /// Handler for when the overall day grid obtains or loses focus. | 223 | /// Handler for when the overall day grid obtains or loses focus. |
| 210 | void _handleGridFocusChange(bool focused) { | 224 | void _handleGridFocusChange(bool focused) { |
| 211 | setState(() { | 225 | setState(() { |
| @@ -341,7 +355,7 @@ class _CalendarViewState extends State<_CalendarView> { | @@ -341,7 +355,7 @@ class _CalendarViewState extends State<_CalendarView> { | ||
| 341 | children: <Widget>[ | 355 | children: <Widget>[ |
| 342 | if (widget.config.centerAlignModePicker != true) const Spacer(), | 356 | if (widget.config.centerAlignModePicker != true) const Spacer(), |
| 343 | InkWell( | 357 | InkWell( |
| 344 | - onTap: (() { | 358 | + onTap: _isDisplayingFirstMonth ? null : (() { |
| 345 | widget.onChangedYearReduce(_currentMonth); | 359 | widget.onChangedYearReduce(_currentMonth); |
| 346 | }), | 360 | }), |
| 347 | child: Container( | 361 | child: Container( |
| @@ -378,7 +392,7 @@ class _CalendarViewState extends State<_CalendarView> { | @@ -378,7 +392,7 @@ class _CalendarViewState extends State<_CalendarView> { | ||
| 378 | onPressed: _isDisplayingLastMonth ? null : _handleNextMonth, | 392 | onPressed: _isDisplayingLastMonth ? null : _handleNextMonth, |
| 379 | ), | 393 | ), |
| 380 | InkWell( | 394 | InkWell( |
| 381 | - onTap: (() { | 395 | + onTap: _isDisplayingLastMonth ? null : (() { |
| 382 | widget.onChangedYearAdd(_currentMonth); | 396 | widget.onChangedYearAdd(_currentMonth); |
| 383 | }), | 397 | }), |
| 384 | child: Container( | 398 | child: Container( |
-
Please register or login to post a comment