Commit fd42dd7446a25874dd011a74285d045430b20b2c

Authored by wdn127929
1 parent 9002f6aa

null

@@ -183,6 +183,7 @@ class HomePageState extends State<HomePage> with WidgetsBindingObserver { @@ -183,6 +183,7 @@ class HomePageState extends State<HomePage> with WidgetsBindingObserver {
183 }, showToast: false); 183 }, showToast: false);
184 } 184 }
185 }); 185 });
  186 +
186 timer = Timer.periodic(Duration(minutes: 3), (_) { 187 timer = Timer.periodic(Duration(minutes: 3), (_) {
187 _getAllUnMessages(); 188 _getAllUnMessages();
188 }); 189 });
@@ -101,9 +101,7 @@ class NoteBookPageState extends State<NoteBookPage> { @@ -101,9 +101,7 @@ class NoteBookPageState extends State<NoteBookPage> {
101 userModel.user.morning.isEmpty ? "00:00-00:00" : userModel.user.morning; 101 userModel.user.morning.isEmpty ? "00:00-00:00" : userModel.user.morning;
102 noon = userModel.user.noon.isEmpty ? "00:00-00:00" : userModel.user.noon; 102 noon = userModel.user.noon.isEmpty ? "00:00-00:00" : userModel.user.noon;
103 night = userModel.user.night.isEmpty ? "00:00-00:00" : userModel.user.night; 103 night = userModel.user.night.isEmpty ? "00:00-00:00" : userModel.user.night;
104 - if (widget.solt != null) {  
105 - currTimeIndex = int.parse(widget.solt);  
106 - } else { 104 + if (widget.solt == null || widget.solt == "null") {
107 if (morning != '' && 105 if (morning != '' &&
108 dateTimeNow.isBefore(DateTime.parse(dateTimeNow.year.toString() + 106 dateTimeNow.isBefore(DateTime.parse(dateTimeNow.year.toString() +
109 "-" + 107 "-" +
@@ -157,6 +155,8 @@ class NoteBookPageState extends State<NoteBookPage> { @@ -157,6 +155,8 @@ class NoteBookPageState extends State<NoteBookPage> {
157 //过了晚市 155 //过了晚市
158 currTimeIndex = 3; 156 currTimeIndex = 3;
159 } 157 }
  158 + } else {
  159 + currTimeIndex = int.parse(widget.solt);
160 } 160 }
161 } 161 }
162 162
@@ -60,9 +60,15 @@ class NavigatorUtil { @@ -60,9 +60,15 @@ class NavigatorUtil {
60 mine = false, 60 mine = false,
61 int dateTime, 61 int dateTime,
62 String solt}) { 62 String solt}) {
63 - _navigateTo(context,  
64 - "${Routes.home}?initialIndex=$initialIndex&needRefresh=$needRefresh&mine=$mine&dateTime=$dateTime&solt=$solt",  
65 - clearStack: true); 63 + // if (dateTime == null) {
  64 + // _navigateTo(context,
  65 + // "${Routes.home}?initialIndex=$initialIndex&needRefresh=$needRefresh&mine=$mine&dateTime=&solt=$solt",
  66 + // clearStack: true);
  67 + // } else {
  68 + _navigateTo(context,
  69 + "${Routes.home}?initialIndex=$initialIndex&needRefresh=$needRefresh&mine=$mine&dateTime=$dateTime&solt=$solt",
  70 + clearStack: true);
  71 + // }
66 } 72 }
67 73
68 /// 订单详情 74 /// 订单详情
@@ -151,8 +151,11 @@ var homeHandler = new Handler( @@ -151,8 +151,11 @@ var homeHandler = new Handler(
151 151
152 String solt = params["solt"].first; 152 String solt = params["solt"].first;
153 153
154 - DateTime dateTime =  
155 - DateTime.fromMillisecondsSinceEpoch(int.parse(params["dateTime"].first)); 154 +
  155 + DateTime dateTime = params["dateTime"].first == "null"
  156 + ? null
  157 + : DateTime.fromMillisecondsSinceEpoch(
  158 + int.parse(params["dateTime"].first));
156 159
157 return HomePage( 160 return HomePage(
158 initialIndex: int.parse(initialIndex), 161 initialIndex: int.parse(initialIndex),