|
@@ -394,12 +394,13 @@ class NotebookDetailPageState extends State<NotebookDetailPage> { |
|
@@ -394,12 +394,13 @@ class NotebookDetailPageState extends State<NotebookDetailPage> { |
|
394
|
_initTime(int dateSolt) {
|
394
|
_initTime(int dateSolt) {
|
|
395
|
ddateHm = detailModel!.detailModelAllSunModel!.ddateStr;
|
395
|
ddateHm = detailModel!.detailModelAllSunModel!.ddateStr;
|
|
396
|
// UserModel userModel = Provider.of<UserModel>(context, listen: false);
|
396
|
// UserModel userModel = Provider.of<UserModel>(context, listen: false);
|
|
397
|
- String str = detailModel!.detailModelAllSunModel!.mdate == null || detailModel!.detailModelAllSunModel!.mdate == ''
|
397
|
+ String str = detailModel!.detailModelAllSunModel!.mdate == null ||
|
|
|
|
398
|
+ detailModel!.detailModelAllSunModel!.mdate == ''
|
|
398
|
? "00:00-00:00"
|
399
|
? "00:00-00:00"
|
|
399
|
: detailModel!.detailModelAllSunModel!.mdate!;
|
400
|
: detailModel!.detailModelAllSunModel!.mdate!;
|
|
400
|
- str == "00:00-00:00"
|
|
|
|
401
|
- ? dailyList = []
|
|
|
|
402
|
- : dailyList = _getHourAndMinute(str, dateSolt );
|
401
|
+ str == "00:00-00:00"
|
|
|
|
402
|
+ ? dailyList = []
|
|
|
|
403
|
+ : dailyList = _getHourAndMinute(str, dateSolt);
|
|
403
|
// if (dateSolt == 1) {
|
404
|
// if (dateSolt == 1) {
|
|
404
|
// //早餐
|
405
|
// //早餐
|
|
405
|
|
406
|
|
|
@@ -1677,113 +1678,126 @@ class NotebookDetailPageState extends State<NotebookDetailPage> { |
|
@@ -1677,113 +1678,126 @@ class NotebookDetailPageState extends State<NotebookDetailPage> { |
|
1677
|
// if (item['isSelect'] == true) {
|
1678
|
// if (item['isSelect'] == true) {
|
|
1678
|
|
1679
|
|
|
1679
|
// }
|
1680
|
// }
|
|
1680
|
-
|
1681
|
+ ScrollController controller = ScrollController();
|
|
1681
|
final option = await showModalBottomSheet(
|
1682
|
final option = await showModalBottomSheet(
|
|
1682
|
context: context,
|
1683
|
context: context,
|
|
1683
|
isScrollControlled: true,
|
1684
|
isScrollControlled: true,
|
|
1684
|
backgroundColor: Colors.white,
|
1685
|
backgroundColor: Colors.white,
|
|
|
|
1686
|
+
|
|
1685
|
builder: (context) {
|
1687
|
builder: (context) {
|
|
1686
|
return StatefulBuilder(builder: (context, state) {
|
1688
|
return StatefulBuilder(builder: (context, state) {
|
|
1687
|
return SafeArea(
|
1689
|
return SafeArea(
|
|
|
|
1690
|
+
|
|
1688
|
child: Container(
|
1691
|
child: Container(
|
|
|
|
1692
|
+ constraints: BoxConstraints(
|
|
|
|
1693
|
+ maxHeight: ScreenUtil().screenHeight-w(100)
|
|
|
|
1694
|
+ ),
|
|
|
|
1695
|
+ // margin: EdgeInsets.only(top: w(50)),
|
|
1689
|
decoration: BoxDecoration(
|
1696
|
decoration: BoxDecoration(
|
|
1690
|
borderRadius:
|
1697
|
borderRadius:
|
|
1691
|
BorderRadius.circular(ScreenUtil().setWidth(10))),
|
1698
|
BorderRadius.circular(ScreenUtil().setWidth(10))),
|
|
1692
|
- child: Column(
|
|
|
|
1693
|
- mainAxisSize: MainAxisSize.min,
|
|
|
|
1694
|
- children: [
|
|
|
|
1695
|
- InkWell(
|
|
|
|
1696
|
- onTap: () {
|
|
|
|
1697
|
- if (Navigator.canPop(context)) {
|
|
|
|
1698
|
- Navigator.pop(context);
|
|
|
|
1699
|
- }
|
|
|
|
1700
|
- },
|
|
|
|
1701
|
- child: Align(
|
|
|
|
1702
|
- alignment: Alignment.centerRight,
|
|
|
|
1703
|
- child: Container(
|
|
|
|
1704
|
- padding: EdgeInsets.fromLTRB(
|
|
|
|
1705
|
- ScreenUtil().setWidth(40),
|
|
|
|
1706
|
- ScreenUtil().setWidth(40),
|
|
|
|
1707
|
- ScreenUtil().setWidth(40),
|
|
|
|
1708
|
- ScreenUtil().setWidth(10)),
|
|
|
|
1709
|
- child: Image.asset(
|
|
|
|
1710
|
- 'assets/close.png',
|
|
|
|
1711
|
- width: ScreenUtil().setWidth(32),
|
|
|
|
1712
|
- height: ScreenUtil().setWidth(32),
|
1699
|
+ child: SingleChildScrollView(
|
|
|
|
1700
|
+ controller: controller,
|
|
|
|
1701
|
+ child: Column(
|
|
|
|
1702
|
+
|
|
|
|
1703
|
+ mainAxisSize: MainAxisSize.min,
|
|
|
|
1704
|
+ children: [
|
|
|
|
1705
|
+ InkWell(
|
|
|
|
1706
|
+ onTap: () {
|
|
|
|
1707
|
+ if (Navigator.canPop(context)) {
|
|
|
|
1708
|
+ Navigator.pop(context);
|
|
|
|
1709
|
+ }
|
|
|
|
1710
|
+ },
|
|
|
|
1711
|
+ child: Align(
|
|
|
|
1712
|
+ alignment: Alignment.centerRight,
|
|
|
|
1713
|
+ child: Container(
|
|
|
|
1714
|
+ padding: EdgeInsets.fromLTRB(
|
|
|
|
1715
|
+ ScreenUtil().setWidth(40),
|
|
|
|
1716
|
+ ScreenUtil().setWidth(40),
|
|
|
|
1717
|
+ ScreenUtil().setWidth(40),
|
|
|
|
1718
|
+ ScreenUtil().setWidth(10)),
|
|
|
|
1719
|
+ child: Image.asset(
|
|
|
|
1720
|
+ 'assets/close.png',
|
|
|
|
1721
|
+ width: ScreenUtil().setWidth(32),
|
|
|
|
1722
|
+ height: ScreenUtil().setWidth(32),
|
|
|
|
1723
|
+ ),
|
|
|
|
1724
|
+ ),
|
|
1713
|
),
|
1725
|
),
|
|
1714
|
),
|
1726
|
),
|
|
1715
|
- ),
|
|
|
|
1716
|
- ),
|
|
|
|
1717
|
- Center(
|
|
|
|
1718
|
- child: Text(title,
|
|
|
|
1719
|
- style: TextStyle(
|
|
|
|
1720
|
- fontSize: ScreenUtil().setSp(34),
|
|
|
|
1721
|
- fontWeight: FontWeight.bold,
|
|
|
|
1722
|
- color: MyColours.color_353535)),
|
|
|
|
1723
|
- ),
|
|
|
|
1724
|
- Padding(
|
|
|
|
1725
|
- padding: EdgeInsets.symmetric(
|
|
|
|
1726
|
- horizontal: ScreenUtil().setWidth(60),
|
|
|
|
1727
|
- vertical: ScreenUtil().setWidth(40)),
|
|
|
|
1728
|
- child: GridView.builder(
|
|
|
|
1729
|
- padding:
|
|
|
|
1730
|
- EdgeInsets.only(top: ScreenUtil().setWidth(20)),
|
|
|
|
1731
|
- shrinkWrap: true,
|
|
|
|
1732
|
- cacheExtent: ScreenUtil().setWidth(0),
|
|
|
|
1733
|
- itemCount: dailyList.length,
|
|
|
|
1734
|
- gridDelegate:
|
|
|
|
1735
|
- SliverGridDelegateWithFixedCrossAxisCount(
|
|
|
|
1736
|
- crossAxisCount: 3,
|
|
|
|
1737
|
- childAspectRatio: 80 / 36,
|
|
|
|
1738
|
- mainAxisSpacing:
|
|
|
|
1739
|
- ScreenUtil().setWidth(15 * 2),
|
|
|
|
1740
|
- crossAxisSpacing:
|
|
|
|
1741
|
- ScreenUtil().setWidth(38 * 2)),
|
|
|
|
1742
|
- itemBuilder: (BuildContext context, int index) {
|
|
|
|
1743
|
- // locationState = state;
|
|
|
|
1744
|
- return CustomButton(
|
|
|
|
1745
|
- onTap: () async {
|
|
|
|
1746
|
- // state(() {
|
|
|
|
1747
|
- for (var item in dailyList) {
|
|
|
|
1748
|
- item['select'] = false;
|
|
|
|
1749
|
- if (item['title'] ==
|
|
|
|
1750
|
- dailyList[index]['title']) {
|
|
|
|
1751
|
- item['select'] = true;
|
|
|
|
1752
|
-
|
|
|
|
1753
|
- // _homeEnterModel.isSetDate = "1";
|
|
|
|
1754
|
- ddateHm = item['title'];
|
|
|
|
1755
|
- }
|
|
|
|
1756
|
- }
|
|
|
|
1757
|
-
|
|
|
|
1758
|
- detailModel!.notifyListeners();
|
|
|
|
1759
|
- if (Navigator.canPop(context)) {
|
|
|
|
1760
|
- Navigator.pop(context);
|
|
|
|
1761
|
- }
|
|
|
|
1762
|
- // setState(() {
|
|
|
|
1763
|
- // selectPnum = value.first;
|
|
|
|
1764
|
- // pnum = pnumlist[value.first];
|
|
|
|
1765
|
- // });
|
|
|
|
1766
|
- bool sucess = await detailModel!.upReserveInfo(
|
|
|
|
1767
|
- context, widget.rid,
|
|
|
|
1768
|
- dateStr: ddateHm,
|
|
|
|
1769
|
- ymd: detailModel!
|
|
|
|
1770
|
- .detailModelAllSunModel!.ddateYMD);
|
|
|
|
1771
|
-
|
|
|
|
1772
|
- if (sucess) {
|
|
|
|
1773
|
- bus.emit("refresh_book_list"); //刷新已预订列表
|
|
|
|
1774
|
- await getReserveDetailDataSet(
|
|
|
|
1775
|
- showCicle: false, isShowLoading: false);
|
|
|
|
1776
|
- }
|
|
|
|
1777
|
- },
|
|
|
|
1778
|
- width: 80,
|
|
|
|
1779
|
- height: 36,
|
|
|
|
1780
|
- dateText: dailyList[index]['title'].toString(),
|
|
|
|
1781
|
- dayText: '',
|
|
|
|
1782
|
- isSelect: dailyList[index]['select'],
|
|
|
|
1783
|
- );
|
|
|
|
1784
|
- }))
|
|
|
|
1785
|
- ],
|
|
|
|
1786
|
- ),
|
1727
|
+ Center(
|
|
|
|
1728
|
+ child: Text(title,
|
|
|
|
1729
|
+ style: TextStyle(
|
|
|
|
1730
|
+ fontSize: ScreenUtil().setSp(34),
|
|
|
|
1731
|
+ fontWeight: FontWeight.bold,
|
|
|
|
1732
|
+ color: MyColours.color_353535)),
|
|
|
|
1733
|
+ ),
|
|
|
|
1734
|
+ Padding(
|
|
|
|
1735
|
+ padding: EdgeInsets.symmetric(
|
|
|
|
1736
|
+ horizontal: ScreenUtil().setWidth(60),
|
|
|
|
1737
|
+ vertical: ScreenUtil().setWidth(40)),
|
|
|
|
1738
|
+ child: GridView.builder(
|
|
|
|
1739
|
+ controller: controller,
|
|
|
|
1740
|
+ padding: EdgeInsets.only(
|
|
|
|
1741
|
+ top: ScreenUtil().setWidth(20)),
|
|
|
|
1742
|
+ shrinkWrap: true,
|
|
|
|
1743
|
+ cacheExtent: ScreenUtil().setWidth(0),
|
|
|
|
1744
|
+ itemCount: dailyList.length,
|
|
|
|
1745
|
+ gridDelegate:
|
|
|
|
1746
|
+ SliverGridDelegateWithFixedCrossAxisCount(
|
|
|
|
1747
|
+ crossAxisCount: 3,
|
|
|
|
1748
|
+ childAspectRatio: 80 / 36,
|
|
|
|
1749
|
+ mainAxisSpacing:
|
|
|
|
1750
|
+ ScreenUtil().setWidth(15 * 2),
|
|
|
|
1751
|
+ crossAxisSpacing:
|
|
|
|
1752
|
+ ScreenUtil().setWidth(38 * 2)),
|
|
|
|
1753
|
+ itemBuilder: (BuildContext context, int index) {
|
|
|
|
1754
|
+ // locationState = state;
|
|
|
|
1755
|
+ return CustomButton(
|
|
|
|
1756
|
+ onTap: () async {
|
|
|
|
1757
|
+ // state(() {
|
|
|
|
1758
|
+ for (var item in dailyList) {
|
|
|
|
1759
|
+ item['select'] = false;
|
|
|
|
1760
|
+ if (item['title'] ==
|
|
|
|
1761
|
+ dailyList[index]['title']) {
|
|
|
|
1762
|
+ item['select'] = true;
|
|
|
|
1763
|
+
|
|
|
|
1764
|
+ // _homeEnterModel.isSetDate = "1";
|
|
|
|
1765
|
+ ddateHm = item['title'];
|
|
|
|
1766
|
+ }
|
|
|
|
1767
|
+ }
|
|
|
|
1768
|
+
|
|
|
|
1769
|
+ detailModel!.notifyListeners();
|
|
|
|
1770
|
+ if (Navigator.canPop(context)) {
|
|
|
|
1771
|
+ Navigator.pop(context);
|
|
|
|
1772
|
+ }
|
|
|
|
1773
|
+ // setState(() {
|
|
|
|
1774
|
+ // selectPnum = value.first;
|
|
|
|
1775
|
+ // pnum = pnumlist[value.first];
|
|
|
|
1776
|
+ // });
|
|
|
|
1777
|
+ bool sucess = await detailModel!
|
|
|
|
1778
|
+ .upReserveInfo(context, widget.rid,
|
|
|
|
1779
|
+ dateStr: ddateHm,
|
|
|
|
1780
|
+ ymd: detailModel!
|
|
|
|
1781
|
+ .detailModelAllSunModel!
|
|
|
|
1782
|
+ .ddateYMD);
|
|
|
|
1783
|
+
|
|
|
|
1784
|
+ if (sucess) {
|
|
|
|
1785
|
+ bus.emit("refresh_book_list"); //刷新已预订列表
|
|
|
|
1786
|
+ await getReserveDetailDataSet(
|
|
|
|
1787
|
+ showCicle: false,
|
|
|
|
1788
|
+ isShowLoading: false);
|
|
|
|
1789
|
+ }
|
|
|
|
1790
|
+ },
|
|
|
|
1791
|
+ width: 80,
|
|
|
|
1792
|
+ height: 36,
|
|
|
|
1793
|
+ dateText:
|
|
|
|
1794
|
+ dailyList[index]['title'].toString(),
|
|
|
|
1795
|
+ dayText: '',
|
|
|
|
1796
|
+ isSelect: dailyList[index]['select'],
|
|
|
|
1797
|
+ );
|
|
|
|
1798
|
+ }))
|
|
|
|
1799
|
+ ],
|
|
|
|
1800
|
+ )),
|
|
1787
|
));
|
1801
|
));
|
|
1788
|
});
|
1802
|
});
|
|
1789
|
});
|
1803
|
});
|