Commit 73b14eb4237be807d0a86caf636eb04ff720a58c

Authored by wdn127929
1 parent 6f980388

到店时间UI限制最大高度

... ... @@ -394,12 +394,13 @@ class NotebookDetailPageState extends State<NotebookDetailPage> {
_initTime(int dateSolt) {
ddateHm = detailModel!.detailModelAllSunModel!.ddateStr;
// UserModel userModel = Provider.of<UserModel>(context, listen: false);
String str = detailModel!.detailModelAllSunModel!.mdate == null || detailModel!.detailModelAllSunModel!.mdate == ''
String str = detailModel!.detailModelAllSunModel!.mdate == null ||
detailModel!.detailModelAllSunModel!.mdate == ''
? "00:00-00:00"
: detailModel!.detailModelAllSunModel!.mdate!;
str == "00:00-00:00"
? dailyList = []
: dailyList = _getHourAndMinute(str, dateSolt );
str == "00:00-00:00"
? dailyList = []
: dailyList = _getHourAndMinute(str, dateSolt);
// if (dateSolt == 1) {
// //早餐
... ... @@ -1677,113 +1678,126 @@ class NotebookDetailPageState extends State<NotebookDetailPage> {
// if (item['isSelect'] == true) {
// }
ScrollController controller = ScrollController();
final option = await showModalBottomSheet(
context: context,
isScrollControlled: true,
backgroundColor: Colors.white,
builder: (context) {
return StatefulBuilder(builder: (context, state) {
return SafeArea(
child: Container(
constraints: BoxConstraints(
maxHeight: ScreenUtil().screenHeight-w(100)
),
// margin: EdgeInsets.only(top: w(50)),
decoration: BoxDecoration(
borderRadius:
BorderRadius.circular(ScreenUtil().setWidth(10))),
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
InkWell(
onTap: () {
if (Navigator.canPop(context)) {
Navigator.pop(context);
}
},
child: Align(
alignment: Alignment.centerRight,
child: Container(
padding: EdgeInsets.fromLTRB(
ScreenUtil().setWidth(40),
ScreenUtil().setWidth(40),
ScreenUtil().setWidth(40),
ScreenUtil().setWidth(10)),
child: Image.asset(
'assets/close.png',
width: ScreenUtil().setWidth(32),
height: ScreenUtil().setWidth(32),
child: SingleChildScrollView(
controller: controller,
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
InkWell(
onTap: () {
if (Navigator.canPop(context)) {
Navigator.pop(context);
}
},
child: Align(
alignment: Alignment.centerRight,
child: Container(
padding: EdgeInsets.fromLTRB(
ScreenUtil().setWidth(40),
ScreenUtil().setWidth(40),
ScreenUtil().setWidth(40),
ScreenUtil().setWidth(10)),
child: Image.asset(
'assets/close.png',
width: ScreenUtil().setWidth(32),
height: ScreenUtil().setWidth(32),
),
),
),
),
),
),
Center(
child: Text(title,
style: TextStyle(
fontSize: ScreenUtil().setSp(34),
fontWeight: FontWeight.bold,
color: MyColours.color_353535)),
),
Padding(
padding: EdgeInsets.symmetric(
horizontal: ScreenUtil().setWidth(60),
vertical: ScreenUtil().setWidth(40)),
child: GridView.builder(
padding:
EdgeInsets.only(top: ScreenUtil().setWidth(20)),
shrinkWrap: true,
cacheExtent: ScreenUtil().setWidth(0),
itemCount: dailyList.length,
gridDelegate:
SliverGridDelegateWithFixedCrossAxisCount(
crossAxisCount: 3,
childAspectRatio: 80 / 36,
mainAxisSpacing:
ScreenUtil().setWidth(15 * 2),
crossAxisSpacing:
ScreenUtil().setWidth(38 * 2)),
itemBuilder: (BuildContext context, int index) {
// locationState = state;
return CustomButton(
onTap: () async {
// state(() {
for (var item in dailyList) {
item['select'] = false;
if (item['title'] ==
dailyList[index]['title']) {
item['select'] = true;
// _homeEnterModel.isSetDate = "1";
ddateHm = item['title'];
}
}
detailModel!.notifyListeners();
if (Navigator.canPop(context)) {
Navigator.pop(context);
}
// setState(() {
// selectPnum = value.first;
// pnum = pnumlist[value.first];
// });
bool sucess = await detailModel!.upReserveInfo(
context, widget.rid,
dateStr: ddateHm,
ymd: detailModel!
.detailModelAllSunModel!.ddateYMD);
if (sucess) {
bus.emit("refresh_book_list"); //刷新已预订列表
await getReserveDetailDataSet(
showCicle: false, isShowLoading: false);
}
},
width: 80,
height: 36,
dateText: dailyList[index]['title'].toString(),
dayText: '',
isSelect: dailyList[index]['select'],
);
}))
],
),
Center(
child: Text(title,
style: TextStyle(
fontSize: ScreenUtil().setSp(34),
fontWeight: FontWeight.bold,
color: MyColours.color_353535)),
),
Padding(
padding: EdgeInsets.symmetric(
horizontal: ScreenUtil().setWidth(60),
vertical: ScreenUtil().setWidth(40)),
child: GridView.builder(
controller: controller,
padding: EdgeInsets.only(
top: ScreenUtil().setWidth(20)),
shrinkWrap: true,
cacheExtent: ScreenUtil().setWidth(0),
itemCount: dailyList.length,
gridDelegate:
SliverGridDelegateWithFixedCrossAxisCount(
crossAxisCount: 3,
childAspectRatio: 80 / 36,
mainAxisSpacing:
ScreenUtil().setWidth(15 * 2),
crossAxisSpacing:
ScreenUtil().setWidth(38 * 2)),
itemBuilder: (BuildContext context, int index) {
// locationState = state;
return CustomButton(
onTap: () async {
// state(() {
for (var item in dailyList) {
item['select'] = false;
if (item['title'] ==
dailyList[index]['title']) {
item['select'] = true;
// _homeEnterModel.isSetDate = "1";
ddateHm = item['title'];
}
}
detailModel!.notifyListeners();
if (Navigator.canPop(context)) {
Navigator.pop(context);
}
// setState(() {
// selectPnum = value.first;
// pnum = pnumlist[value.first];
// });
bool sucess = await detailModel!
.upReserveInfo(context, widget.rid,
dateStr: ddateHm,
ymd: detailModel!
.detailModelAllSunModel!
.ddateYMD);
if (sucess) {
bus.emit("refresh_book_list"); //刷新已预订列表
await getReserveDetailDataSet(
showCicle: false,
isShowLoading: false);
}
},
width: 80,
height: 36,
dateText:
dailyList[index]['title'].toString(),
dayText: '',
isSelect: dailyList[index]['select'],
);
}))
],
)),
));
});
});
... ...
... ... @@ -232,7 +232,7 @@ class _MyCustomerOrderPageState extends State<MyCustomerOrderPage> {
color: MyColours.color_353535),
),
Text(
'${customerProvider.guestReserveSunModel!.count!.countMoney} ',
'${customerProvider.guestReserveSunModel!.count!.countMoney??0} ',
style: TextStyle(
fontSize: ScreenUtil().setSp(24),
color: MyColours.color_353535),
... ... @@ -251,7 +251,7 @@ class _MyCustomerOrderPageState extends State<MyCustomerOrderPage> {
color: MyColours.color_353535),
),
Text(
'${customerProvider.guestReserveSunModel!.count!.countPnum} ',
'${customerProvider.guestReserveSunModel!.count!.countPnum??0} ',
style: TextStyle(
fontSize: ScreenUtil().setSp(24),
color: MyColours.color_353535),
... ...
... ... @@ -107,7 +107,9 @@ class NoteBookPageState extends State<NoteBookPage> {
}
WidgetsBinding.instance.addPostFrameCallback((_) {
getMealSectionByDay(first: true);
getMealSectionByDay(
first: true,
);
noteBookModel.isSimple = App.sp!.getBool("isSimple") ?? true;
setState(() {});
... ... @@ -117,7 +119,7 @@ class NoteBookPageState extends State<NoteBookPage> {
});
}
getMealSectionByDay({bool needInit = true, bool first = false}) async {
getMealSectionByDay({ bool first = false}) async {
Map<String, String?> pramas = {
'sellerid': Provider.of<UserModel>(context, listen: false).user!.sellerid,
'day':
... ... @@ -125,7 +127,7 @@ class NoteBookPageState extends State<NoteBookPage> {
};
await storeBaseIndoProvider.getMealSectionByDay(context, pramas,
showLoading: false);
_initTime(first: first, needInit: needInit);
_initTime(first: first);
}
getSellerVersion() async {
... ... @@ -162,7 +164,7 @@ class NoteBookPageState extends State<NoteBookPage> {
}
//初始化时间
_initTime({bool needInit = true, bool first = false}) {
_initTime({bool first = false}) {
if (first && widget.date != null) {
_refreshPageCalendar(dateTimeNow);
}
... ... @@ -179,8 +181,14 @@ class NoteBookPageState extends State<NoteBookPage> {
meal2 = element.mdate;
}
});
if ((first && (widget.solt == null || widget.solt == "null")) || needInit) {
initCurruntIndex();
if (first ) {
//
if ( widget.solt == null || widget.solt == "null") {
initCurruntIndex();
} else {
currTimeIndex = int.parse(widget.solt!);
}
} else {
if (first) {
bool has = storeBaseIndoProvider.dayDateData!
... ... @@ -439,8 +447,7 @@ class NoteBookPageState extends State<NoteBookPage> {
print(days);
/// _focusedDay
if ((days.inDays == 0 ) ||
(days.inDays > 0 && days.inDays <7)) {
if ((days.inDays == 0) || (days.inDays > 0 && days.inDays < 7)) {
// _calendarController.setSelectedDay(day);
dateText = '更多\n日期';
clearSel = false;
... ... @@ -458,7 +465,7 @@ class NoteBookPageState extends State<NoteBookPage> {
if (Utils.isOneDay(day, dateTimeNow!)) return; //日期没变
_refreshPageCalendar(day);
ddateSoltSelect = currTimeIndex.toString();
getMealSectionByDay(needInit: false);
getMealSectionByDay();
_reserveCountDay();
}
... ... @@ -753,7 +760,7 @@ class NoteBookPageState extends State<NoteBookPage> {
dateText = '更多\n日期';
});
ddateSoltSelect = currTimeIndex.toString();
getMealSectionByDay(needInit: false);
getMealSectionByDay();
_reserveCountDay();
}
... ... @@ -819,7 +826,7 @@ class NoteBookPageState extends State<NoteBookPage> {
});
ddateSoltSelect =
currTimeIndex.toString();
getMealSectionByDay(needInit: false);
getMealSectionByDay();
_reserveCountDay();
}
... ...