Просмотр исходного кода

有未完成比赛的房间打开bug&ios配置帮助按钮删除

panhui 6 лет назад
Родитель
Сommit
ffac25aa40
2 измененных файлов с 80 добавлено и 74 удалено
  1. 22 20
      lib/pages/HomePage.dart
  2. 58 54
      lib/pages/MatchPage.dart

+ 22 - 20
lib/pages/HomePage.dart

@@ -77,6 +77,24 @@ class _HomePageState extends State<HomePage> with SingleTickerProviderStateMixin
   }
 
   Future<void> checkErrorPlayerInfo() async {
+    popNoticeList = [];
+    Result res1 = await HttpManager.get('popNotice/all');
+    if (res1.success) {
+      for (var item in res1.data) {
+        popNoticeList.add(PopNotice.fromJson(item));
+      }
+    }
+
+    final prefs = await SharedPreferences.getInstance();
+    var now = new DateTime.now();
+    var timeStr = now.year.toString() + '/' + now.month.toString() + '/' + now.day.toString();
+    bool show = false;
+    if (prefs.getString('showPhoneInfo') != timeStr) {
+      await getPhoneInfo();
+    }
+
+    showGruide(context, popNoticeList);
+
     final Result res = await HttpManager.get('playerInfo/getErrorPlayerInfo');
     print('&********');
     print(res.error);
@@ -96,32 +114,16 @@ class _HomePageState extends State<HomePage> with SingleTickerProviderStateMixin
           context,
           CupertinoPageRoute(
             builder: (context) => RoomInfo(
-                  roomId: res1.data['id'].toString(),
-                  // playerInfo: playerInfo,
-                  // interrupted: true,
-                ),
+              roomId: res1.data['id'].toString(),
+              // playerInfo: playerInfo,
+              // interrupted: true,
+            ),
           ),
         );
       }
     } else {
       //引导页
-      popNoticeList = [];
-      Result res = await HttpManager.get('popNotice/all');
-      if (res.success) {
-        for (var item in res.data) {
-          popNoticeList.add(PopNotice.fromJson(item));
-        }
-      }
-
-      final prefs = await SharedPreferences.getInstance();
-      var now = new DateTime.now();
-      var timeStr = now.year.toString() + '/' + now.month.toString() + '/' + now.day.toString();
-      bool show = false;
-      if (prefs.getString('showPhoneInfo') != timeStr) {
-        await getPhoneInfo();
-      }
 
-      showGruide(context, popNoticeList);
     }
   }
 

+ 58 - 54
lib/pages/MatchPage.dart

@@ -1,3 +1,5 @@
+import 'dart:io';
+
 import 'package:flutter/material.dart';
 import 'package:flutter/painting.dart';
 import 'package:flutter_swiper/flutter_swiper.dart';
@@ -254,7 +256,7 @@ class _MatchPageState extends State<MatchPage> with WidgetsBindingObserver {
       getBannerInfo();
       getGame();
       getRoomInfo();
-      
+
       if (timer != null) {
         timer.cancel();
       }
@@ -292,67 +294,69 @@ class _MatchPageState extends State<MatchPage> with WidgetsBindingObserver {
               color: Colors.transparent,
               child: Builder(
                 builder: (context) => InkWell(
-                      onTap: () async {
-                        if (timer != null) {
-                          timer.cancel();
-                        }
-                        bool result = await Navigator.push(context, CupertinoPageRoute(builder: (context) => TipList()));
-                        if (result) {
-                          timer = Timer.periodic(Duration(seconds: 2), (timer) {
-                            getUnreadMsg();
-                          });
-                        }
-                      },
-                      child: Container(
-                        width: 30,
-                        height: 30,
-                        child: Stack(
-                          children: <Widget>[
-                            Center(
-                              child: Image.asset('images/home_icon_xiaoxi.png'),
-                            ),
-                            showBadge
-                                ? Positioned(
-                                    right: 10,
-                                    top: 12,
+                  onTap: () async {
+                    if (timer != null) {
+                      timer.cancel();
+                    }
+                    bool result = await Navigator.push(context, CupertinoPageRoute(builder: (context) => TipList()));
+                    if (result) {
+                      timer = Timer.periodic(Duration(seconds: 2), (timer) {
+                        getUnreadMsg();
+                      });
+                    }
+                  },
+                  child: Container(
+                    width: 30,
+                    height: 30,
+                    child: Stack(
+                      children: <Widget>[
+                        Center(
+                          child: Image.asset('images/home_icon_xiaoxi.png'),
+                        ),
+                        showBadge
+                            ? Positioned(
+                                right: 10,
+                                top: 12,
+                                child: Container(
+                                  padding: EdgeInsets.all(1),
+                                  decoration: BoxDecoration(color: Colors.white, borderRadius: BorderRadius.all(Radius.circular(100))),
+                                  child: Center(
                                     child: Container(
-                                      padding: EdgeInsets.all(1),
-                                      decoration: BoxDecoration(color: Colors.white, borderRadius: BorderRadius.all(Radius.circular(100))),
+                                      padding: EdgeInsets.symmetric(horizontal: 3),
+                                      height: 12,
+                                      decoration: BoxDecoration(color: Color(0xFFD4504B), borderRadius: BorderRadius.all(Radius.circular(12))),
                                       child: Center(
-                                        child: Container(
-                                          padding: EdgeInsets.symmetric(horizontal: 3),
-                                          height: 12,
-                                          decoration: BoxDecoration(color: Color(0xFFD4504B), borderRadius: BorderRadius.all(Radius.circular(12))),
-                                          child: Center(
-                                            child: Text('${tipNum}', style: TextStyle(color: Colors.white, fontSize: 10)),
-                                          ),
-                                        ),
+                                        child: Text('${tipNum}', style: TextStyle(color: Colors.white, fontSize: 10)),
                                       ),
                                     ),
-                                  )
-                                : Container()
-                          ],
-                        ),
-                      ),
+                                  ),
+                                ),
+                              )
+                            : Container()
+                      ],
                     ),
+                  ),
+                ),
               ),
             ),
             actions: <Widget>[
-              Container(
-                width: 102,
-                padding: EdgeInsets.all(15),
-                child: LinearButton(
-                  btntext: '配置帮助',
-                  textColor: Color(0xFF2E3049),
-                  btnHeight: 26.0,
-                  colorList: [Color(0xFFFFB726), Color(0xFFFFB726)],
-                  textSize: 12.0,
-                  onTapHomeMenu: () {
-                    // showNotice();
-                    getPhoneInfo();
-                  },
-                ),
-              )
+              Platform.isIOS
+                  ? Container()
+                  : Container(
+                      width: 102,
+                      padding: EdgeInsets.all(15),
+                      child: LinearButton(
+                        btntext: '配置帮助',
+                        textColor: Color(0xFF2E3049),
+                        btnHeight: 26.0,
+                        colorList: [Color(0xFFFFB726), Color(0xFFFFB726)],
+                        textSize: 12.0,
+                        onTapHomeMenu: () {
+                          // showNotice();
+                          getPhoneInfo();
+                        },
+                      ),
+                    )
             ],
           ),
           body: Container(