panhui 6 lat temu
rodzic
commit
a7141ec333
3 zmienionych plików z 22 dodań i 12 usunięć
  1. 14 3
      lib/pages/HomePage.dart
  2. 1 1
      lib/pages/TipList.dart
  3. 7 8
      lib/pages/roomInfo.dart

+ 14 - 3
lib/pages/HomePage.dart

@@ -114,6 +114,14 @@ class _HomePageState extends State<HomePage> with WidgetsBindingObserver {
     WidgetsBinding.instance.removeObserver(this);
   }
 
+
+  // @override
+  // void didChangeLocales(List<Locale> locale) {
+  //      print('1111111111111');
+  //   // TODO: implement didChangeLocales
+  //   super.didChangeLocales(locale);
+  // }
+
   @override
   void didChangeAppLifecycleState(AppLifecycleState state) {
     if (state == AppLifecycleState.resumed) {
@@ -336,8 +344,11 @@ class _HomePageState extends State<HomePage> with WidgetsBindingObserver {
                   HomeMenu(
                     "images/home_icon_youjian.png",
                     "邮件",
-                    onTapHomeMenu: () {
-                      Navigator.push(context, new CupertinoPageRoute(builder: (context) => new TipList()));
+                    onTapHomeMenu: () async{
+                      bool result=await Navigator.push(context, new CupertinoPageRoute(builder: (context) => new TipList()));
+                      if(result){
+                        getUnreadMsg();
+                      }
                     },
                     showBadge: showBadge,
                   ),
@@ -351,7 +362,7 @@ class _HomePageState extends State<HomePage> with WidgetsBindingObserver {
   }
 }
 
-typedef int OnTapHomeMenu();
+typedef void OnTapHomeMenu();
 
 class HomeMenu extends StatelessWidget {
   final String icon;

+ 1 - 1
lib/pages/TipList.dart

@@ -116,7 +116,7 @@ class TipListState extends State<TipList> {
             )),
         onWillPop: () {
           Toast.hide();
-          Navigator.pop(context);
+          Navigator.of(context).pop(true);
           return Future.value(false);
         });
   }

+ 7 - 8
lib/pages/roomInfo.dart

@@ -153,7 +153,9 @@ class RoomInfoState extends State<RoomInfo>
           data: {'id': playerInfo.id, 'statusFlag': 3});
       bool success = await ScreenStreamPlugin.stop();
 
-      getEndTips();
+      Timer(Duration(seconds: 1),(){
+        getEndTips();
+      });
 
       setState(() {
         playerInfo.statusFlag = 3;
@@ -658,11 +660,8 @@ class RoomInfoState extends State<RoomInfo>
           onPressed: null,
         ),
       );
-    } else if (isJoin && statusFlag == 2) {
-      int _time;
-        if(houseInfo!=null){
-          _time=houseInfo.beginTime+3600000-DateTime.now().millisecondsSinceEpoch;
-        }
+    } else if (isJoin && statusFlag == 8) {
+    
       return Container(
         width: double.infinity,
         padding: EdgeInsets.symmetric(horizontal: 15, vertical: 20),
@@ -671,13 +670,13 @@ class RoomInfoState extends State<RoomInfo>
           disabledColor: Color(0xFF914244),
           disabledTextColor: Color(0xFF252532),
           child: Text(
-             '预计'+getSecondsMIn(_time)+'后结算',
+             '正在结算中',
             style: TextStyle(fontSize: 16),
           ),
           onPressed: null,
         ),
       );
-    } else if (isJoin && statusFlag == 3) {
+    } else if (isJoin && (statusFlag == 2||statusFlag == 3)) {
       int _time;
         if(houseInfo!=null){
           _time=houseInfo.beginTime+3600000-DateTime.now().millisecondsSinceEpoch;