|
...
|
...
|
@@ -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'],
|
|
|
|
);
|
|
|
|
}))
|
|
|
|
],
|
|
|
|
)),
|
|
|
|
));
|
|
|
|
});
|
|
|
|
});
|
...
|
...
|
|