Commit 8d98ef7038907d972148fedece25c231f21ff3b7

Authored by wdn127929
1 parent 3e3e6e92

小程序封面餐段中午bug && 多时段限制今天之前的日期置灰不可选择

... ... @@ -7370,7 +7370,7 @@ class DialogUtil {
TextEditingController controller = TextEditingController();
FocusNode focusNode = FocusNode();
bool showArea = true;
areas.remove('全部');
areas.remove('全部');
bool showPnumMin = true;
bool showPnumMax = true;
// String pnumMin = '';
... ... @@ -8740,12 +8740,15 @@ class DialogUtil {
}
static Widget _buildMultiDatePickerWithValue(
List<DateTime> _multiDatePickerValueWithDefaultValue,
CalendarDatePicker2Type calendarType,
ValueChanged valueChanged) {
List<DateTime> _multiDatePickerValueWithDefaultValue,
CalendarDatePicker2Type calendarType,
ValueChanged valueChanged, {
DateTime? firstDate,
}) {
final config = CalendarDatePicker2Config(
disableMonthPicker: true,
calendarType: calendarType,
firstDate: firstDate,
currentDate: DateTime.now(),
dynamicCalendarRows: true,
centerAlignModePicker: true,
... ... @@ -8758,6 +8761,7 @@ class DialogUtil {
Utils.getImgPath('date_m_r'),
width: w(8),
),
disabledDayTextStyle: TextStyle(color: MyColours.color_999999),
selectedDayHighlightColor: MyColours.color_438E93,
weekdayLabelBuilder: ({isScrollViewTopHeader, required weekday}) {
return Container(
... ... @@ -8801,7 +8805,9 @@ class DialogUtil {
? MyColours.color_F8F9FD
: isToday!
? MyColours.color_F8F9FD
: MyColours.color_353535,
: isDisabled ?? false
? MyColours.color_999999
: MyColours.color_353535,
fontWeight: FontWeight.bold)),
Text(
_parseDateDay(date),
... ... @@ -8814,7 +8820,9 @@ class DialogUtil {
? MyColours.color_F8F9FD
: isToday!
? MyColours.color_F8F9FD
: MyColours.color_353535),
: isDisabled ?? false
? MyColours.color_999999
: MyColours.color_353535),
),
],
),
... ... @@ -8947,7 +8955,7 @@ class DialogUtil {
_multiDatePickerValueWithDefaultValue, calendarType,
(value) {
_multiDatePickerValueWithDefaultValue = value;
}),
}, firstDate: DateTime.now()),
VEmptyView(120),
Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
... ...
... ... @@ -2553,7 +2553,7 @@ class Utils {
fontWeight: FontWeight.bold,
fontStyle: FontStyle.normal,
height: 1,
ellipsis:'...',
ellipsis: '...',
fontSize: 16 * scaleX));
pb.pushStyle(
ui.TextStyle(color: MyColours.color_FFEFC5, fontSize: 16 * scaleX));
... ... @@ -2681,7 +2681,7 @@ class Utils {
fontWeight: FontWeight.bold,
fontStyle: FontStyle.normal,
height: 1,
ellipsis:'...',
ellipsis: '...',
fontSize: 16 * scaleX));
pb.pushStyle(
ui.TextStyle(color: MyColours.color_FFEFC5, fontSize: 16 * scaleX));
... ... @@ -2820,7 +2820,7 @@ class Utils {
fontWeight: FontWeight.bold,
height: 1,
fontStyle: FontStyle.normal,
ellipsis:'...',
ellipsis: '...',
fontSize: 16 * scaleX));
pb.pushStyle(
ui.TextStyle(color: MyColours.color_FFEFC5, fontSize: 16 * scaleX));
... ... @@ -2961,7 +2961,7 @@ class Utils {
textAlign: TextAlign.center,
fontWeight: FontWeight.bold,
height: 1,
ellipsis:'...',
ellipsis: '...',
fontStyle: FontStyle.normal,
fontSize: scaleX * 16));
pb.pushStyle(
... ... @@ -3309,25 +3309,18 @@ class Utils {
) {
String dsoltStr = '${ddateHm == null || ddateHm == '' ? '' : ddateHm}';
if (liteStyle == '1') {
if (mname == '早餐' || mname == '午餐' || mname == '晚餐') {
dsoltStr = ddateSolt == '1'
? '早上'
: ddateSolt == '2'
? '中午'
: '晚上';
} else {
if (mname == '早餐') {
mname ='早上';
} else if (mname == '午餐') {
mname ='中午';
} else if (mname == '晚餐') {
mname = '晚上';
}
dsoltStr = mname;
}
} else if (liteStyle == '3') {
if (mname == '早餐' || mname == '午餐' || mname == '晚餐') {
dsoltStr = ddateSolt == '1'
? '早餐'
: ddateSolt == '2'
? '午餐'
: '晚餐';
} else {
dsoltStr = mname;
}
dsoltStr = mname;
}
return dsoltStr;
}
... ...
... ... @@ -206,6 +206,20 @@ class _CalendarViewState extends State<_CalendarView> {
);
}
// bool get _isDisplayingFirstYear {
// fsfdf
// return !_currentMonth.isAfter(
// DateTime(widget.config.firstDate.year, widget.config.firstDate.month),
// );
// }
// /// True if the latest allowable month is displayed.
// bool get _isDisplayingLastYear {
// return !_currentMonth.isBefore(
// DateTime(widget.config.lastDate.year, widget.config.lastDate.month),
// );
// }
/// Handler for when the overall day grid obtains or loses focus.
void _handleGridFocusChange(bool focused) {
setState(() {
... ... @@ -341,7 +355,7 @@ class _CalendarViewState extends State<_CalendarView> {
children: <Widget>[
if (widget.config.centerAlignModePicker != true) const Spacer(),
InkWell(
onTap: (() {
onTap: _isDisplayingFirstMonth ? null : (() {
widget.onChangedYearReduce(_currentMonth);
}),
child: Container(
... ... @@ -378,7 +392,7 @@ class _CalendarViewState extends State<_CalendarView> {
onPressed: _isDisplayingLastMonth ? null : _handleNextMonth,
),
InkWell(
onTap: (() {
onTap: _isDisplayingLastMonth ? null : (() {
widget.onChangedYearAdd(_currentMonth);
}),
child: Container(
... ...