x1ongzhu hace 6 años
padre
commit
485684711c
Se han modificado 65 ficheros con 918 adiciones y 638 borrados
  1. BIN
      images/2x/home/设置.png
  2. BIN
      images/2x/icon_jifen_da.png
  3. BIN
      images/2x/icon_jinbi_qiandao.png
  4. BIN
      images/2x/icon_renshu.png
  5. BIN
      images/2x/icon_tanchuang_01.png
  6. BIN
      images/2x/icon_tanchuang_02.png
  7. BIN
      images/2x/icon_xiayiye.png
  8. BIN
      images/2x/icon_yiqiandao.png
  9. BIN
      images/2x/img_guangmang.png
  10. BIN
      images/2x/img_xuzhi_02.png
  11. BIN
      images/2x/img_xuzhi_03.png
  12. BIN
      images/2x/img_xuzhi_04.png
  13. BIN
      images/2x/qiandao_icon_gailv.png
  14. BIN
      images/2x/qiandao_icon_jiacheng.png
  15. BIN
      images/2x/spinner.png
  16. BIN
      images/2x/编组 3.png
  17. BIN
      images/2x/金币.png
  18. BIN
      images/3x/home/设置.png
  19. BIN
      images/3x/icon_jifen_da.png
  20. BIN
      images/3x/icon_jinbi_qiandao.png
  21. BIN
      images/3x/icon_renshu.png
  22. BIN
      images/3x/icon_tanchuang_01.png
  23. BIN
      images/3x/icon_tanchuang_02.png
  24. BIN
      images/3x/icon_xiayiye.png
  25. BIN
      images/3x/icon_yiqiandao.png
  26. BIN
      images/3x/img_guangmang.png
  27. BIN
      images/3x/img_xuzhi_02.png
  28. BIN
      images/3x/img_xuzhi_03.png
  29. BIN
      images/3x/img_xuzhi_04.png
  30. BIN
      images/3x/qiandao_icon_gailv.png
  31. BIN
      images/3x/qiandao_icon_jiacheng.png
  32. BIN
      images/3x/spinner.png
  33. BIN
      images/3x/编组 3.png
  34. BIN
      images/3x/金币.png
  35. BIN
      images/home/设置.png
  36. BIN
      images/icon_jifen_da.png
  37. BIN
      images/icon_jinbi_qiandao.png
  38. BIN
      images/icon_renshu.png
  39. BIN
      images/icon_tanchuang_01.png
  40. BIN
      images/icon_tanchuang_02.png
  41. BIN
      images/icon_xiayiye.png
  42. BIN
      images/icon_yiqiandao.png
  43. BIN
      images/img_guangmang.png
  44. BIN
      images/img_xuzhi_02.png
  45. BIN
      images/img_xuzhi_03.png
  46. BIN
      images/img_xuzhi_04.png
  47. BIN
      images/qiandao_icon_gailv.png
  48. BIN
      images/qiandao_icon_jiacheng.png
  49. BIN
      images/spinner.png
  50. BIN
      images/编组 3.png
  51. BIN
      images/金币.png
  52. 15 43
      lib/pages/CompetitionInformation.dart
  53. 354 0
      lib/pages/CompetitionNotice.dart
  54. 7 11
      lib/pages/CompetitionRooms.dart
  55. 8 2
      lib/pages/Competitions.dart
  56. 1 1
      lib/pages/HomePage.bak.dart
  57. 2 2
      lib/pages/RecordList.dart
  58. 192 402
      lib/pages/RoomInfo.dart
  59. 12 30
      lib/pages/SecondRoomInfo.dart
  60. 119 77
      lib/pages/StartWindow.dart
  61. 35 67
      lib/pages/TipInfo.dart
  62. 1 1
      lib/pages/openRoom.dart
  63. 1 1
      lib/styles/colors.dart
  64. 170 0
      lib/widget/CheckinDialog.dart
  65. 1 1
      lib/widget/RoomItem.dart

BIN
images/2x/home/设置.png


BIN
images/2x/icon_jifen_da.png


BIN
images/2x/icon_jinbi_qiandao.png


BIN
images/2x/icon_renshu.png


BIN
images/2x/icon_tanchuang_01.png


BIN
images/2x/icon_tanchuang_02.png


BIN
images/2x/icon_xiayiye.png


BIN
images/2x/icon_yiqiandao.png


BIN
images/2x/img_guangmang.png


BIN
images/2x/img_xuzhi_02.png


BIN
images/2x/img_xuzhi_03.png


BIN
images/2x/img_xuzhi_04.png


BIN
images/2x/qiandao_icon_gailv.png


BIN
images/2x/qiandao_icon_jiacheng.png


BIN
images/2x/spinner.png


BIN
images/2x/编组 3.png


BIN
images/2x/金币.png


BIN
images/3x/home/设置.png


BIN
images/3x/icon_jifen_da.png


BIN
images/3x/icon_jinbi_qiandao.png


BIN
images/3x/icon_renshu.png


BIN
images/3x/icon_tanchuang_01.png


BIN
images/3x/icon_tanchuang_02.png


BIN
images/3x/icon_xiayiye.png


BIN
images/3x/icon_yiqiandao.png


BIN
images/3x/img_guangmang.png


BIN
images/3x/img_xuzhi_02.png


BIN
images/3x/img_xuzhi_03.png


BIN
images/3x/img_xuzhi_04.png


BIN
images/3x/qiandao_icon_gailv.png


BIN
images/3x/qiandao_icon_jiacheng.png


BIN
images/3x/spinner.png


BIN
images/3x/编组 3.png


BIN
images/3x/金币.png


BIN
images/home/设置.png


BIN
images/icon_jifen_da.png


BIN
images/icon_jinbi_qiandao.png


BIN
images/icon_renshu.png


BIN
images/icon_tanchuang_01.png


BIN
images/icon_tanchuang_02.png


BIN
images/icon_xiayiye.png


BIN
images/icon_yiqiandao.png


BIN
images/img_guangmang.png


BIN
images/img_xuzhi_02.png


BIN
images/img_xuzhi_03.png


BIN
images/img_xuzhi_04.png


BIN
images/qiandao_icon_gailv.png


BIN
images/qiandao_icon_jiacheng.png


BIN
images/spinner.png


BIN
images/编组 3.png


BIN
images/金币.png


+ 15 - 43
lib/pages/CompetitionInformation.dart

@@ -4,7 +4,7 @@ import '../model/HouseInfo.dart';
 
 //竞赛须知
 class CompetitionInformation extends StatefulWidget {
-  HouseInfo houseInfo;
+  final HouseInfo houseInfo;
   CompetitionInformation(this.houseInfo);
   @override
   CompetitionInformationState createState() => CompetitionInformationState();
@@ -31,9 +31,7 @@ class CompetitionInformationState extends State<CompetitionInformation> {
                     layout: SwiperLayout.DEFAULT,
                     itemWidth: 270.0,
                     itemHeight: 422.0,
-                    control: SwiperControl(
-                        color: Color(0xFFC2524D),
-                        disableColor: Colors.transparent),
+                    control: SwiperControl(color: Color(0xFFC2524D), disableColor: Colors.transparent),
                     index: nowSwiperIndex,
                     itemCount: 4,
                     scrollDirection: Axis.horizontal,
@@ -60,8 +58,7 @@ class CompetitionInformationState extends State<CompetitionInformation> {
 typedef OnTapHomeMenu = int Function();
 
 class InfoBox extends StatelessWidget {
-  InfoBox({Key key, this.typeIndex, this.next, this.end, this.houseInfo})
-      : super(key: key);
+  InfoBox({Key key, this.typeIndex, this.next, this.end, this.houseInfo}) : super(key: key);
   final int typeIndex;
   final OnTapHomeMenu next;
   final OnTapHomeMenu end;
@@ -73,9 +70,7 @@ class InfoBox extends StatelessWidget {
         child: Container(
       width: 270,
       height: 422,
-      decoration: BoxDecoration(
-          border: Border.all(width: 1, color: Color(0xFFC2524D)),
-          color: Colors.black),
+      decoration: BoxDecoration(border: Border.all(width: 1, color: Color(0xFFC2524D)), color: Colors.black),
       child: Stack(
         children: <Widget>[
           Container(
@@ -83,11 +78,7 @@ class InfoBox extends StatelessWidget {
             padding: EdgeInsets.only(top: 25),
             child: Column(
               children: <Widget>[
-                Text('竞赛须知 ' + typeIndex.toString() + '/4',
-                    style: TextStyle(
-                        color: Color(0xFFFDC372),
-                        fontSize: 20,
-                        fontWeight: FontWeight.w600)),
+                Text('竞赛须知 ' + typeIndex.toString() + '/4', style: TextStyle(color: Color(0xFFFDC372), fontSize: 20, fontWeight: FontWeight.w600)),
                 _centerContent(typeIndex)
               ],
             ),
@@ -143,7 +134,7 @@ class InfoBox extends StatelessWidget {
   Widget _centerContent(int index) {
     Widget useContent = Container();
     TextStyle _text = TextStyle(color: Colors.white, fontSize: 14);
-    if (index == 1 && houseInfo.scoreType ==0) {
+    if (index == 1 && houseInfo.scoreType == 0) {
       useContent = Container(
         margin: EdgeInsets.only(top: 22),
         padding: EdgeInsets.symmetric(horizontal: 20),
@@ -157,8 +148,7 @@ class InfoBox extends StatelessWidget {
               '房间人数越多,总奖金就越多',
               style: _text,
             ),
-            Text('同房间内玩家进行竞赛,吃上鸡的评分前三名玩家获得相应奖励',
-                style: _text, textAlign: TextAlign.center),
+            Text('同房间内玩家进行竞赛,吃上鸡的评分前三名玩家获得相应奖励', style: _text, textAlign: TextAlign.center),
             //  Text('同房间内玩家进行竞赛', style: _text),
             Text.rich(TextSpan(children: [
               TextSpan(text: '第一名获得奖金池的', style: _text),
@@ -190,15 +180,11 @@ class InfoBox extends StatelessWidget {
                 children: <Widget>[
                   Text(
                     '注:奖金池的${houseInfo.houseLevel.feeRatio}%为平台方运营服务费',
-                    style: TextStyle(
-                        fontSize: 11, color: Color.fromARGB(50, 255, 255, 255)),
+                    style: TextStyle(fontSize: 11, color: Color.fromARGB(50, 255, 255, 255)),
                   ),
                   Padding(
                       padding: EdgeInsets.only(left: 20),
-                      child: Text(' 奖金池的${houseInfo.houseLevel.poolRatio}%流入赛季总奖金',
-                          style: TextStyle(
-                              fontSize: 11,
-                              color: Color.fromARGB(50, 255, 255, 255))))
+                      child: Text(' 奖金池的${houseInfo.houseLevel.poolRatio}%流入赛季总奖金', style: TextStyle(fontSize: 11, color: Color.fromARGB(50, 255, 255, 255))))
                 ],
               ),
             )
@@ -219,8 +205,7 @@ class InfoBox extends StatelessWidget {
               '房间人数越多,总奖金就越多',
               style: _text,
             ),
-            Text('同房间内的玩家进行竞赛,所有吃上鸡的玩家均可获得奖金',
-                style: _text, textAlign: TextAlign.center),
+            Text('同房间内的玩家进行竞赛,所有吃上鸡的玩家均可获得奖金', style: _text, textAlign: TextAlign.center),
             Text.rich(TextSpan(children: [
               TextSpan(text: '即平分总奖金池的', style: _text),
               TextSpan(
@@ -237,15 +222,11 @@ class InfoBox extends StatelessWidget {
                 children: <Widget>[
                   Text(
                     '注:奖金池的${houseInfo.houseLevel.feeRatio}%为平台方运营服务费',
-                    style: TextStyle(
-                        fontSize: 11, color: Color.fromARGB(50, 255, 255, 255)),
+                    style: TextStyle(fontSize: 11, color: Color.fromARGB(50, 255, 255, 255)),
                   ),
                   Padding(
                       padding: EdgeInsets.only(left: 20),
-                      child: Text(' 奖金池的${houseInfo.houseLevel.poolRatio}%流入赛季总奖金',
-                          style: TextStyle(
-                              fontSize: 11,
-                              color: Color.fromARGB(50, 255, 255, 255))))
+                      child: Text(' 奖金池的${houseInfo.houseLevel.poolRatio}%流入赛季总奖金', style: TextStyle(fontSize: 11, color: Color.fromARGB(50, 255, 255, 255))))
                 ],
               ),
             )
@@ -270,10 +251,7 @@ class InfoBox extends StatelessWidget {
                   ),
                   TextSpan(
                     text: '点击确认',
-                    style: TextStyle(
-                        color: Color(0xFFC2524D),
-                        fontSize: 14,
-                        fontWeight: FontWeight.w500),
+                    style: TextStyle(color: Color(0xFFC2524D), fontSize: 14, fontWeight: FontWeight.w500),
                   ),
                   TextSpan(
                     text: ',否则视为放弃此次竞赛,已支付金币概不退换',
@@ -302,10 +280,7 @@ class InfoBox extends StatelessWidget {
                   ),
                   TextSpan(
                     text: '点击“确定”',
-                    style: TextStyle(
-                        color: Color(0xFFC2524D),
-                        fontSize: 14,
-                        fontWeight: FontWeight.w500),
+                    style: TextStyle(color: Color(0xFFC2524D), fontSize: 14, fontWeight: FontWeight.w500),
                   ),
                   TextSpan(
                     text: '或“允许”此操作,否则竞赛判定失败',
@@ -334,10 +309,7 @@ class InfoBox extends StatelessWidget {
                   ),
                   TextSpan(
                     text: '请一定一定一定要点击“继续”按钮',
-                    style: TextStyle(
-                        color: Color(0xFFC2524D),
-                        fontSize: 14,
-                        fontWeight: FontWeight.w600),
+                    style: TextStyle(color: Color(0xFFC2524D), fontSize: 14, fontWeight: FontWeight.w600),
                   ),
                   TextSpan(
                     text: ',显示到上图所示画面,然后再切换到我们全民APP中,点击完成比赛,方可成功上传本次成绩,赢取大奖',

+ 354 - 0
lib/pages/CompetitionNotice.dart

@@ -0,0 +1,354 @@
+import 'package:flutter/material.dart';
+import 'package:flutter/cupertino.dart';
+import '../styles/colors.dart';
+import 'dart:math';
+
+void showNotice(BuildContext context) {
+  Navigator.of(context).push(
+    PageRouteBuilder(
+      opaque: false,
+      transitionDuration: Duration(milliseconds: 300),
+      transitionsBuilder: (BuildContext context, Animation<double> animation, Animation<double> secondaryAnimation, Widget child) {
+        return FadeTransition(
+          opacity: CurvedAnimation(parent: animation, curve: Curves.linear),
+          child: child,
+        );
+      },
+      pageBuilder: (BuildContext context, _, __) {
+        return CompetitionNotice();
+      },
+    ),
+  );
+}
+
+class CompetitionNotice extends StatefulWidget {
+  @override
+  State<StatefulWidget> createState() {
+    return CompetitionNoticeState();
+  }
+}
+
+class CompetitionNoticeState extends State<CompetitionNotice> {
+  final pageController = PageController(initialPage: 0);
+  bool showPrev = false;
+  bool showNext = true;
+
+  @override
+  Widget build(BuildContext context) {
+    final iconSize = (MediaQuery.of(context).size.width - 286) / 2;
+    return WillPopScope(
+      onWillPop: () {
+        return Future.value(true);
+      },
+      child: Scaffold(
+        backgroundColor: Color(0xb3000000),
+        body: Stack(
+          children: <Widget>[
+            PageView(
+              controller: pageController,
+              onPageChanged: (page) {
+                print(page);
+                if (page == 0) {
+                  setState(() {
+                    showPrev = false;
+                    showNext = true;
+                  });
+                } else if (page == 3) {
+                  setState(() {
+                    showPrev = true;
+                    showNext = false;
+                  });
+                } else {
+                  setState(() {
+                    showPrev = true;
+                    showNext = true;
+                  });
+                }
+              },
+              children: <Widget>[
+                _page(
+                  context,
+                  title: '竞赛须知 1/4',
+                  onNext: () {
+                    pageController.nextPage(duration: Duration(milliseconds: 500), curve: Curves.linearToEaseOut);
+                  },
+                  body: Container(
+                    margin: EdgeInsets.only(top: 65),
+                    child: Column(
+                      children: <Widget>[
+                        Image.asset('images/icon_jifen_da.png'),
+                        Container(
+                          width: 230,
+                          margin: EdgeInsets.only(top: 10),
+                          child: Text.rich(
+                            TextSpan(text: '每局比赛按照吃鸡单人游戏的', children: [
+                              TextSpan(text: '评分', style: TextStyle(color: Colors.yellow)),
+                              TextSpan(text: '进行排序,评分相同游戏时长短的优胜'),
+                            ]),
+                            textAlign: TextAlign.center,
+                            style: TextStyle(
+                              color: Colors.white,
+                              fontSize: 13,
+                            ),
+                          ),
+                        ),
+                        Container(
+                          margin: EdgeInsets.only(top: 10),
+                          child: Row(
+                            mainAxisAlignment: MainAxisAlignment.center,
+                            crossAxisAlignment: CrossAxisAlignment.start,
+                            children: <Widget>[
+                              Text(
+                                '注:',
+                                style: TextStyle(color: Color(0x66FFFFFF), fontSize: 12),
+                              ),
+                              Text(
+                                '第一名获得40积分\n剩余10%获得20积分\n剩余20%获得10积分\n剩余30%获得0积分\n剩余40%获得-10积分\n吃鸡选手额外获得10积分',
+                                style: TextStyle(color: Color(0x66FFFFFF), fontSize: 12),
+                              ),
+                            ],
+                          ),
+                        )
+                      ],
+                    ),
+                  ),
+                ),
+                _page(
+                  context,
+                  title: '竞赛须知 2/4',
+                  onNext: () {
+                    pageController.nextPage(duration: Duration(milliseconds: 500), curve: Curves.linearToEaseOut);
+                  },
+                  body:Container(
+                    margin: EdgeInsets.only(top: 75),
+                    child: Column(
+                      children: <Widget>[
+                        Image.asset('images/img_xuzhi_02.png'),
+                        Container(
+                          width: 230,
+                          margin: EdgeInsets.only(top: 10),
+                          child: Text.rich(
+                            TextSpan(text: '竞赛开始前请在此耐心等待,在开始时会有上图所示弹窗,', children: [
+                              TextSpan(text: '玩家必须在10秒内点击确认', style: TextStyle(color: Colors.yellow)),
+                              TextSpan(text: ',否则视为放弃此次竞赛'),
+                            ]),
+                            textAlign: TextAlign.center,
+                            style: TextStyle(
+                              color: Colors.white,
+                              fontSize: 13,
+                            ),
+                          ),
+                        ),
+                      ],
+                    ),
+                  ),
+                ),
+                _page(
+                  context,
+                  title: '竞赛须知 3/4',
+                  onNext: () {
+                    pageController.nextPage(duration: Duration(milliseconds: 500), curve: Curves.linearToEaseOut);
+                  },
+                  body:Container(
+                    margin: EdgeInsets.only(top: 75),
+                    child: Column(
+                      children: <Widget>[
+                        Image.asset('images/img_xuzhi_03.png'),
+                        Container(
+                          width: 230,
+                          margin: EdgeInsets.only(top: 10),
+                          child: Text.rich(
+                            TextSpan(text: '确认竞赛后会有弹窗提示授权进行录屏的操作,请一定', children: [
+                              TextSpan(text: '点击“确定”', style: TextStyle(color: Colors.yellow)),
+                              TextSpan(text: '或“允许”此操作,否则竞赛判定失败'),
+                            ]),
+                            textAlign: TextAlign.center,
+                            style: TextStyle(
+                              color: Colors.white,
+                              fontSize: 13,
+                            ),
+                          ),
+                        ),
+                      ],
+                    ),
+                  ),
+                ),
+                _page(
+                  context,
+                  title: '竞赛须知 4/4',
+                  nextText: '关闭',
+                  onNext: () {
+                    Navigator.of(context).pop();
+                  },
+                  showCancel: false,
+                  body: Container(
+                    margin: EdgeInsets.only(top: 75),
+                    child: Column(
+                      children: <Widget>[
+                        Image.asset('images/img_xuzhi_04.png'),
+                        Container(
+                          width: 230,
+                          margin: EdgeInsets.only(top: 10),
+                          child: Text.rich(
+                              TextSpan(text: '在游戏比赛结束后,', children: [
+                              TextSpan(text: '请一定要点击查看游戏最后的分数名次结算页面', style: TextStyle(color: Colors.yellow)),
+                              TextSpan(text: ',返回游戏主页,最后再切换到我们竞赛app中,点击完成比赛,方可成功长传本次成绩,赢取积分'),
+                            ]),
+                            textAlign: TextAlign.center,
+                            style: TextStyle(
+                              color: Colors.white,
+                              fontSize: 13,
+                            ),
+                          ),
+                        ),
+                      ],
+                    ),
+                  ),
+                ),
+              ],
+            ),
+            Align(
+              alignment: Alignment.centerLeft,
+              child: Container(
+                margin: EdgeInsets.only(left: 4),
+                child: showPrev
+                    ? GestureDetector(
+                        onTap: () {
+                          pageController.previousPage(duration: Duration(milliseconds: 500), curve: Curves.linearToEaseOut);
+                        },
+                        child: Transform.rotate(
+                          angle: pi,
+                          child: Image.asset('images/icon_xiayiye.png', width: iconSize),
+                        ),
+                      )
+                    : null,
+              ),
+            ),
+            Align(
+              alignment: Alignment.centerRight,
+              child: showNext
+                  ? Container(
+                      margin: EdgeInsets.only(left: 4),
+                      child: GestureDetector(
+                        onTap: () {
+                          pageController.nextPage(duration: Duration(milliseconds: 500), curve: Curves.linearToEaseOut);
+                        },
+                        child: Image.asset('images/icon_xiayiye.png', width: iconSize),
+                      ),
+                    )
+                  : null,
+            ),
+          ],
+        ),
+      ),
+    );
+  }
+}
+
+Widget _page(
+  BuildContext context, {
+  @required String title,
+  @required Widget body,
+  void Function() onNext,
+  String nextText = '下一个',
+  bool showCancel = true,
+}) {
+  return Stack(
+    children: <Widget>[
+      Center(
+        child: Container(
+          width: 270,
+          height: 422,
+          decoration: BoxDecoration(
+              color: Color(0xE6293559),
+              border: Border.all(
+                width: 1,
+                color: PRIMARY_COLOR,
+              )),
+          child: Stack(
+            children: <Widget>[
+              Align(
+                alignment: Alignment.topRight,
+                child: Container(
+                  margin: EdgeInsets.only(top: 7),
+                  child: Image.asset('images/icon_tanchuang_01.png'),
+                ),
+              ),
+              Align(
+                alignment: Alignment.bottomLeft,
+                child: Container(
+                  margin: EdgeInsets.only(bottom: 7),
+                  child: Image.asset('images/icon_tanchuang_02.png'),
+                ),
+              ),
+              Align(
+                alignment: Alignment.topCenter,
+                child: Container(
+                  margin: EdgeInsets.only(top: 27),
+                  child: Text(
+                    title,
+                    style: TextStyle(
+                      fontSize: 20,
+                      fontWeight: FontWeight.bold,
+                      color: Colors.white,
+                    ),
+                  ),
+                ),
+              ),
+              Align(
+                alignment: Alignment.topCenter,
+                child: body,
+              ),
+              Align(
+                alignment: Alignment.bottomCenter,
+                child: Container(
+                  margin: EdgeInsets.only(bottom: 62),
+                  child: MaterialButton(
+                    elevation: 0,
+                    highlightElevation: 0,
+                    minWidth: 200,
+                    color: PRIMARY_COLOR,
+                    child: Text(
+                      nextText,
+                      style: TextStyle(
+                        fontSize: 14,
+                        fontWeight: FontWeight.bold,
+                        color: Colors.white,
+                      ),
+                    ),
+                    onPressed: () {
+                      if (onNext != null) {
+                        onNext();
+                      }
+                    },
+                  ),
+                ),
+              ),
+              Align(
+                alignment: Alignment.bottomCenter,
+                child: Container(
+                  margin: EdgeInsets.only(bottom: 25),
+                  child: showCancel
+                      ? CupertinoButton(
+                          padding: EdgeInsets.fromLTRB(10, 7, 10, 7),
+                          child: Text(
+                            '取消',
+                            style: TextStyle(
+                              color: Color(0xB0FFFFFF),
+                              fontSize: 13,
+                            ),
+                          ),
+                          onPressed: () {
+                            Navigator.of(context).pop();
+                          },
+                        )
+                      : null,
+                ),
+              )
+            ],
+          ),
+        ),
+      ),
+    ],
+  );
+}

+ 7 - 11
lib/pages/CompetitionRooms.dart

@@ -8,7 +8,6 @@ import 'package:gradient_text/gradient_text.dart';
 import '../model/HouseInfo.dart';
 import '../net/HttpManager.dart';
 import '../net/Result.dart';
-import '../widget/Dialog.dart';
 import './RoomInfo.dart';
 
 class CompetitionRooms extends StatefulWidget {
@@ -18,14 +17,11 @@ class CompetitionRooms extends StatefulWidget {
 
   @override
   State<StatefulWidget> createState() {
-    return _CompetitionRoomsState(competitionInfo);
+    return _CompetitionRoomsState();
   }
 }
 
 class _CompetitionRoomsState extends State<CompetitionRooms> {
-  _CompetitionRoomsState(this.competitionInfo);
-
-  final CompetitionInfo competitionInfo;
   List<HouseInfo> houseList = [];
   int restTimes = 0;
 
@@ -42,7 +38,7 @@ class _CompetitionRoomsState extends State<CompetitionRooms> {
   Widget build(BuildContext context) {
     return Scaffold(
       appBar: AppBar(
-        title: Text(competitionInfo.competitionName),
+        title: Text(widget.competitionInfo.competitionName),
         centerTitle: true,
         elevation: 0,
         actions: <Widget>[
@@ -74,7 +70,7 @@ class _CompetitionRoomsState extends State<CompetitionRooms> {
                         ),
                         style: TextStyle(fontSize: 17),
                         textAlign: TextAlign.center),
-                    GradientText(competitionInfo.bonus.toString().replaceAllMapped(RegExp(r'(\d{1,3})(?=(\d{3})+(?!\d))'), (Match m) => '${m[1]},'),
+                    GradientText(widget.competitionInfo.bonus.toString().replaceAllMapped(RegExp(r'(\d{1,3})(?=(\d{3})+(?!\d))'), (Match m) => '${m[1]},'),
                         gradient: LinearGradient(
                           colors: [Color(0xFFFFC84B), Color(0xFFA26A23)],
                           begin: Alignment.topCenter,
@@ -99,7 +95,7 @@ class _CompetitionRoomsState extends State<CompetitionRooms> {
                 Container(
                   margin: EdgeInsets.only(top: 10),
                   child: Text(
-                    competitionInfo.intro ?? '',
+                    widget.competitionInfo.intro ?? '',
                     style: TextStyle(
                       color: Color(0xADFFFFFF),
                       fontSize: 13,
@@ -126,7 +122,7 @@ class _CompetitionRoomsState extends State<CompetitionRooms> {
   }
 
   Future<void> _getRooms() async {
-    final Result res = await HttpManager.get('houseInfo/all', data: {'competitionId': competitionInfo.id});
+    final Result res = await HttpManager.get('houseInfo/all', data: {'competitionId': widget.competitionInfo.id});
     final List<HouseInfo> list = [];
     if (res.success && res.data != null) {
       for (var item in res.data) {
@@ -144,7 +140,7 @@ class _CompetitionRoomsState extends State<CompetitionRooms> {
     if (res.success) {
       int rest = 0;
       UserPlayTimes userPlayTimes = UserPlayTimes.fromJson(res.data);
-      if (competitionInfo.type == 1) {
+      if (widget.competitionInfo.type == 1) {
         rest = userPlayTimes.totalNormal - userPlayTimes.usedNormal;
       } else {
         rest = userPlayTimes.totalAdvanced - userPlayTimes.usedAdvanced;
@@ -192,7 +188,7 @@ class _Room extends StatelessWidget {
     }
     return GestureDetector(
       onTap: () {
-        Navigator.push(context, CupertinoPageRoute(builder: (context) => RoomInfo(roomId: houseInfo.id.toString())));
+        Navigator.push(context, CupertinoPageRoute(builder: (context) => RoomInfo(houseInfo)));
       },
       child: Container(
         height: 43,

+ 8 - 2
lib/pages/Competitions.dart

@@ -9,6 +9,7 @@ import '../net/Result.dart';
 import '../net/HttpManager.dart';
 import '../model/CompetitionInfo.dart';
 import '../widget/Competition.dart';
+import '../widget/CheckinDialog.dart';
 
 class Competitions extends StatefulWidget {
   @override
@@ -100,7 +101,10 @@ class _CompetitionState extends State<Competitions> {
                                               Container(
                                                 margin: EdgeInsets.only(left: 2),
                                                 child: Text(
-                                                  '8888'.replaceAllMapped(RegExp(r'(\d{1,3})(?=(\d{3})+(?!\d))'), (Match m) => '${m[1]},'),
+                                                  userInfo.moneyCoin
+                                                      .floor()
+                                                      .toString()
+                                                      .replaceAllMapped(RegExp(r'(\d{1,3})(?=(\d{3})+(?!\d))'), (Match m) => '${m[1]},'),
                                                   style: TextStyle(
                                                     color: Colors.white,
                                                     fontWeight: FontWeight.bold,
@@ -144,7 +148,9 @@ class _CompetitionState extends State<Competitions> {
                                           ],
                                         ),
                                       ),
-                                      onTap: () {},
+                                      onTap: () {
+                                        showCheckinDialog(context);
+                                      },
                                     ),
                                   ),
                                 ],

+ 1 - 1
lib/pages/HomePage.bak.dart

@@ -76,7 +76,7 @@ class _HomePageState extends State<HomePage> with WidgetsBindingObserver {
     Toast.hide();
     if (res.success) {
       if (res.data != null) {
-        Navigator.push(context, CupertinoPageRoute(builder: (context) => RoomInfo(roomId: res.data['id'].toString())));
+        // Navigator.push(context, CupertinoPageRoute(builder: (context) => RoomInfo(roomId: res.data['id'].toString())));
       } else {
         showBackDialog();
       }

+ 2 - 2
lib/pages/RecordList.dart

@@ -189,7 +189,7 @@ class houseItem extends StatelessWidget {
                         ],
                       ),
                       Text(
-                        roomInfo.houseAbstract??'',
+                        roomInfo.houseAbstract ?? '',
                         style: TextStyle(fontSize: 12, fontWeight: FontWeight.w400, color: Color(0xFF9BA0AE)),
                         maxLines: 2,
                         overflow: TextOverflow.ellipsis,
@@ -202,7 +202,7 @@ class houseItem extends StatelessWidget {
             ),
           ),
           onTap: () {
-            Navigator.push(context, CupertinoPageRoute(builder: (context) => RoomInfo(roomId: roomInfo.id.toString())));
+            Navigator.push(context, CupertinoPageRoute(builder: (context) => RoomInfo(roomInfo)));
           },
         ),
       ),

+ 192 - 402
lib/pages/RoomInfo.dart

@@ -20,22 +20,20 @@ import 'SecondRoomInfo.dart';
 import 'package:flutter/cupertino.dart';
 import 'VideoPlayer.dart';
 import '../model/UserInfo.dart';
+import './CompetitionNotice.dart';
 
 class RoomInfo extends StatefulWidget {
-  RoomInfo({Key key, this.roomId}) : super(key: key);
-  final String roomId; // 用来储存传递过来的值
+  RoomInfo(this.houseInfo, {Key key}) : super(key: key);
+  final HouseInfo houseInfo; // 用来储存传递过来的值
 
   @override
   RoomInfoState createState() => RoomInfoState();
 }
 
-class RoomInfoState extends State<RoomInfo>
-    with SingleTickerProviderStateMixin {
-  List<Map> tabList;
+class RoomInfoState extends State<RoomInfo> with SingleTickerProviderStateMixin {
   TabController mController;
   Map roomInfo;
   HouseInfo houseInfo;
-  Map colorInfo;
   bool isJoin = true;
   PlayerInfo playerInfo;
   bool isPop = false;
@@ -45,41 +43,30 @@ class RoomInfoState extends State<RoomInfo>
   ScrollController _tipController;
   String _myUrl;
   int tabIndex = 0;
-  UserInfo userInfo;
   int myRank = 0;
 
-//获取房间信息
+  //获取房间信息
   Future<void> getRoomInfo() async {
-    Toast.show(context, '加载中', -1, 'loading');
-    Result res =
-        await HttpManager.get('houseInfo/getOne', data: {'id': widget.roomId});
-    Toast.hide();
+    Result res = await HttpManager.get('houseInfo/getOne', data: {'id': houseInfo.id});
     if (res.success) {
       setState(() {
         roomInfo = res.data;
         houseInfo = HouseInfo.fromJson(res.data);
       });
-      // showNotice();
-      if (houseInfo.statusFlag == 0) {
-        showNotice();
-      }
     } else {}
-
     checkJoinInfo();
   }
 
   //开始比赛
   Future<void> startGame() async {
     Toast.show(context, '加载中', -1, 'loading');
-    Result res = await HttpManager.post('houseInfo/handBegin',
-        data: {'id': widget.roomId});
+    Result res = await HttpManager.post('houseInfo/handBegin', data: {'id': houseInfo.id});
     Toast.hide();
   }
 
-//隔一秒检查是否开始
+  //隔一秒检查是否开始
   Future<void> getNowStatus() async {
-    Result res = await HttpManager.get('houseInfo/getPlayerNum',
-        data: {'id': widget.roomId});
+    Result res = await HttpManager.get('houseInfo/getPlayerNum', data: {'id': houseInfo.id});
     if (res.success) {
       if (houseInfo.statusFlag == 0 && res.data['statusFlag'] == 2) {
         showStart();
@@ -103,8 +90,7 @@ class RoomInfoState extends State<RoomInfo>
       PageRouteBuilder(
         opaque: false,
         transitionDuration: Duration(milliseconds: 300),
-        transitionsBuilder: (BuildContext context, Animation<double> animation,
-            Animation<double> secondaryAnimation, Widget child) {
+        transitionsBuilder: (BuildContext context, Animation<double> animation, Animation<double> secondaryAnimation, Widget child) {
           return FadeTransition(
             opacity: CurvedAnimation(parent: animation, curve: Curves.linear),
             child: child,
@@ -127,9 +113,7 @@ class RoomInfoState extends State<RoomInfo>
     } else {
       data['statusFlag'] = 6;
     }
-    Toast.show(context, '加载中', -1, 'loading');
     Result res = await HttpManager.post('playerInfo/update', data: data);
-    Toast.hide();
 
     // MyDialog.showDialog(context, '自动启动游戏失败,请手动切换到游戏app开始竞赛', submitText: '知道了');
     // Timer(Duration(seconds: 10), () {
@@ -145,8 +129,7 @@ class RoomInfoState extends State<RoomInfo>
             showSucessInfo();
           });
         } else {
-          showCustomDialog(context, '自动启动游戏失败,请手动切换到游戏app开始竞赛',
-              submitText: '知道了');
+          showCustomDialog(context, '自动启动游戏失败,请手动切换到游戏app开始竞赛', submitText: '知道了');
           Timer(Duration(seconds: 10), () {
             showSucessInfo();
           });
@@ -161,10 +144,8 @@ class RoomInfoState extends State<RoomInfo>
 
 //开始录屏提示框
   void showSucessInfo() {
-    showCustomDialog(context, '您已经完成比赛了吗,确认完成,那就点击下方完成竞赛按钮,上传本次成绩,祝您赢取大奖',
-        title: '完成比赛', submitText: '我已完成比赛', onsubmit: () async {
-      HttpManager.post('playerInfo/update',
-          data: {'id': playerInfo.id, 'statusFlag': 3});
+    showCustomDialog(context, '您已经完成比赛了吗,确认完成,那就点击下方完成竞赛按钮,上传本次成绩,祝您赢取大奖', title: '完成比赛', submitText: '我已完成比赛', onsubmit: () async {
+      HttpManager.post('playerInfo/update', data: {'id': playerInfo.id, 'statusFlag': 3});
       bool success = await ScreenStreamPlugin.stop();
 
       Timer(Duration(seconds: 1), () {
@@ -178,40 +159,25 @@ class RoomInfoState extends State<RoomInfo>
   }
 
   Future<void> getEndTips() async {
-    Result res = await HttpManager.get('playerInfo/endNum',
-        data: {'houseId': widget.roomId});
+    Result res = await HttpManager.get('playerInfo/endNum', data: {'houseId': houseInfo.id});
 
     if (res.success) {
-      int time = houseInfo.beginTime +
-          1 * 3600 * 1000 -
-          DateTime.now().millisecondsSinceEpoch;
+      int time = houseInfo.beginTime + 1 * 3600 * 1000 - DateTime.now().millisecondsSinceEpoch;
       var nowTime = (time ~/ 1000 ~/ 60) % 60;
       setState(() {
-        roomTipsList.add([
-          '你已完成本次比赛,当前完成人数 ',
-          res.data.toString(),
-          '人,比赛需要等待所有人完成后方可结算奖励',
-          '',
-          ',你可以先去参加其他竞赛,稍后在“个人中心-我的战绩”中可以查看本次竞赛排名及领取奖励'
-        ]);
-        changeScroll();
+        roomTipsList.add(['你已完成本次比赛,当前完成人数 ', res.data.toString(), '人,比赛需要等待所有人完成后方可结算奖励', '', ',你可以先去参加其他竞赛,稍后在“个人中心-我的战绩”中可以查看本次竞赛排名及领取奖励']);
       });
     }
   }
 
 //未确认比赛弹窗
   void showBackDialog(type) {
-    showCustomDialog(context,
-        (type == 1 ? '由于您未在十秒内点击开始按钮' : '由于您未授权录屏') + ',系统已经判定您放弃比赛,谢谢您的参与。',
-        title: '很遗憾');
+    showCustomDialog(context, (type == 1 ? '由于您未在十秒内点击开始按钮' : '由于您未授权录屏') + ',系统已经判定您放弃比赛,谢谢您的参与。', title: '很遗憾');
   }
 
 //检查加入信息
   Future<void> checkJoinInfo() async {
-    Result res = await HttpManager.get('playerInfo/getOne', data: {
-      'userId': StoreProvider.of<AppState>(context).state.userInfo.id,
-      'houseId': widget.roomId
-    });
+    Result res = await HttpManager.get('playerInfo/getOne', data: {'userId': StoreProvider.of<AppState>(context).state.userInfo.id, 'houseId': houseInfo.id});
     if (res.success) {
       if (res.data == null) {
         setState(() {
@@ -227,8 +193,6 @@ class RoomInfoState extends State<RoomInfo>
               '同房间内的玩家进行竞赛,所有吃上鸡的玩家均可获得奖金,即平分总奖金池的${houseInfo.houseLevel.avgRatio}%。注:奖金池的${houseInfo.houseLevel.feeRatio}%为平台方运营服务费, 奖金池的${houseInfo.houseLevel.poolRatio}%流入赛季总奖金。'
             ]);
           }
-
-          changeScroll();
         }
       } else {
         playerInfo = PlayerInfo.fromJson(res.data);
@@ -238,8 +202,7 @@ class RoomInfoState extends State<RoomInfo>
           print('本地视频' + playerInfo.id.toString());
           print(_myUrl);
 
-          Result rankRes = await HttpManager.get('playerInfo/userRank',
-              data: {'id': playerInfo.id});
+          Result rankRes = await HttpManager.get('playerInfo/userRank', data: {'id': playerInfo.id});
           if (rankRes.success) {
             myRank = rankRes.data + 1;
           }
@@ -249,21 +212,12 @@ class RoomInfoState extends State<RoomInfo>
           isJoin = true;
         });
         if (houseInfo.statusFlag == 0) {
-          if (houseInfo.createUser ==
-              StoreProvider.of<AppState>(context)
-                  .state
-                  .userInfo
-                  .id
-                  .toString()) {
-            roomTipsList.add([
-              '房间创建成功,待人数满员时会自动开启比赛,请在此页面耐心等待其他人的加入,退出房间则视为自动放弃比赛,已支付金币概不退换,快快点击右上角分享给好友加入战局吧'
-            ]);
-            changeScroll();
+          if (houseInfo.createUser == StoreProvider.of<AppState>(context).state.userInfo.id.toString()) {
+            roomTipsList.add(['房间创建成功,待人数满员时会自动开启比赛,请在此页面耐心等待其他人的加入,退出房间则视为自动放弃比赛,已支付金币概不退换,快快点击右上角分享给好友加入战局吧']);
           } else {
             // roomTipsList.add([
             //   '请在此页面耐心等待,竞赛即将开始,届时玩家有10秒的时间进行确认,点击确认方可正式进入竞赛,若没有点击,则视为自动放弃此次竞赛,已支付金币概不退换'
             // ]);
-            // changeScroll();
           }
           // Timer(Duration(seconds: 1), () {
           //   roomTipsList.add([
@@ -276,9 +230,7 @@ class RoomInfoState extends State<RoomInfo>
           //   changeScroll();
           // });
         } else if (houseInfo.statusFlag != 4) {
-          if (playerInfo.statusFlag == 3 ||
-              playerInfo.statusFlag == 8 ||
-              playerInfo.statusFlag == 9) {
+          if (playerInfo.statusFlag == 3 || playerInfo.statusFlag == 8 || playerInfo.statusFlag == 9) {
             getEndTips();
           }
         }
@@ -295,10 +247,7 @@ class RoomInfoState extends State<RoomInfo>
 //加入房间
   Future<void> joinRoom() async {
     Toast.show(context, '加载中', -1, 'loading');
-    Result res = await HttpManager.post('houseInfo/join', data: {
-      'houseId': widget.roomId,
-      'userId': StoreProvider.of<AppState>(context).state.userInfo.id
-    });
+    Result res = await HttpManager.post('houseInfo/join', data: {'houseId': houseInfo.id, 'userId': StoreProvider.of<AppState>(context).state.userInfo.id});
     Toast.hide();
     if (res.success) {
       Toast.show(context, '加入成功', 1500, 'success');
@@ -308,52 +257,21 @@ class RoomInfoState extends State<RoomInfo>
     }
   }
 
-//展示通知
-  void showNotice() {
-    Navigator.of(context).push(PageRouteBuilder(
-        opaque: false,
-        transitionDuration: Duration(milliseconds: 300),
-        transitionsBuilder: (BuildContext context, Animation<double> animation,
-            Animation<double> secondaryAnimation, Widget child) {
-          return FadeTransition(
-            opacity: CurvedAnimation(parent: animation, curve: Curves.linear),
-            child: child,
-          );
-        },
-        pageBuilder: (BuildContext context, _, __) {
-          return CompetitionInformation(houseInfo);
-        }));
-  }
-
-//改变滚动条
-  void changeScroll() {
-    Timer(Duration(seconds: 1), () {
-      _tipController.animateTo(context.size.height,
-          duration: Duration(milliseconds: 1500), curve: Curves.ease);
-    });
-  }
-
   //获取分秒
   String getSecondsMIn(int time) {
     if (time == null) {
       return '';
     } else {
-      return ((time ~/ 1000 ~/ 60) % 60).toString() +
-          '分' +
-          (time ~/ 1000 % 60).toString() +
-          '秒';
+      return ((time ~/ 1000 ~/ 60) % 60).toString() + '分' + (time ~/ 1000 % 60).toString() + '秒';
     }
   }
 
   @override
   void initState() {
     super.initState();
-    tabList = [
-      {'title': '房间信息', 'value': 1},
-      {'title': '人员列表', 'value': 2}
-    ];
+    houseInfo = widget.houseInfo;
     mController = TabController(
-      length: tabList.length,
+      length: 2,
       vsync: this,
     );
 
@@ -366,15 +284,8 @@ class RoomInfoState extends State<RoomInfo>
     _tipController = ScrollController();
     roomInfo = {};
 
-    colorInfo = {
-      '黄金': Color(0xFFF9D881),
-      '白银': Color(0xFFAFCAD8),
-      '青铜': Color(0xFFE18D50),
-    };
-
     Future.delayed(Duration.zero, () {
       getRoomInfo();
-      userInfo = StoreProvider.of<AppState>(context).state.userInfo;
     });
   }
 
@@ -397,21 +308,19 @@ class RoomInfoState extends State<RoomInfo>
     return WillPopScope(
       child: Scaffold(
         appBar: AppBar(
-          backgroundColor: PRIMARY_COLOR,
           title: Container(
             child: TabBar(
               controller: mController,
-              labelColor: Colors.white,
-              unselectedLabelColor: Colors.white.withOpacity(0.5),
+              labelColor: PRIMARY_COLOR,
+              unselectedLabelColor: Color(0xCCFFFFFF),
               labelStyle: TextStyle(fontSize: 16.0),
-              indicatorColor: Colors.white,
+              indicatorColor: PRIMARY_COLOR,
               indicatorWeight: 3,
               indicatorSize: TabBarIndicatorSize.label,
-              tabs: tabList.map((item) {
-                return Tab(
-                  text: item['title'],
-                );
-              }).toList(),
+              tabs: <Widget>[
+                Tab(text: '房间信息'),
+                Tab(text: '参赛成员'),
+              ],
             ),
           ),
           centerTitle: true,
@@ -430,10 +339,7 @@ class RoomInfoState extends State<RoomInfo>
             color: BG_SUB_COLOR,
             child: TabBarView(
               controller: mController,
-              children: [
-                _firstPage(),
-                SecondPage(roomId: widget.roomId, status: status)
-              ],
+              children: [_firstPage(), SecondPage(houseInfo)],
             )),
         floatingActionButton: _joinBtn(),
         floatingActionButtonLocation: FloatingActionButtonLocation.centerDocked,
@@ -456,24 +362,8 @@ class RoomInfoState extends State<RoomInfo>
   }
 
   Widget _firstPage() {
-    Map houseLevelInfo = roomInfo.isNotEmpty ? roomInfo['houseLevelInfo'] : {};
-
-    String levelName = houseLevelInfo.containsKey('levelName')
-        ? houseLevelInfo['levelName']
-        : '黄金';
-
-    int joinMoney =
-        houseLevelInfo.containsKey('feeRatio') && roomInfo.containsKey('bonus')
-            ? houseLevelInfo['feeRatio'] * roomInfo['bonus']
-            : 0;
-
-    String topImg =
-        'http://images.liqucn.com/img/h22/h70/img_localize_8e824debdd9ee29522690f36680e2d8e_600x337.png';
     int statuFlag = 0;
     if (houseInfo != null) {
-      if (houseInfo.video != null) {
-        topImg = houseInfo.video;
-      }
       if (houseInfo.statusFlag != null) {
         statuFlag = houseInfo.statusFlag;
       }
@@ -494,122 +384,96 @@ class RoomInfoState extends State<RoomInfo>
                   physics: AlwaysScrollableScrollPhysics(),
                   child: Column(
                     children: <Widget>[
-                      houseInfo != null
-                          ? VideoWidget(videoSrc: houseInfo.video)
-                          : Container(),
+                      houseInfo != null ? VideoWidget(videoSrc: houseInfo.video) : Container(),
                       // Image.network(topImg, width: double.infinity),
                       Container(
-                          padding: EdgeInsets.only(top: 10),
-                          child: Row(
-                            mainAxisAlignment: MainAxisAlignment.center,
-                            children: <Widget>[
-                              Container(
-                                margin: EdgeInsets.only(left: 30, right: 8),
-                                child: Text(
-                                  roomInfo.containsKey('houseName')
-                                      ? roomInfo['houseName']
-                                      : '',
-                                  style: TextStyle(
-                                      color: Colors.white,
-                                      fontSize: 16,
-                                      fontWeight: FontWeight.w500),
-                                ),
-                              ),
-                              Image.network(
-                                houseLevelInfo.containsKey('icon')
-                                    ? houseLevelInfo['icon']
-                                    : '',
-                                width: 14,
+                        height: 60,
+                        padding: EdgeInsets.fromLTRB(15, 0, 15, 0),
+                        child: Row(
+                          children: <Widget>[
+                            Expanded(
+                              child: Text(
+                                houseInfo.houseName,
+                                style: TextStyle(fontSize: 20, fontWeight: FontWeight.bold, color: Colors.white),
                               ),
-                              Text(
-                                houseLevelInfo.containsKey('levelName')
-                                    ? houseLevelInfo['levelName']
-                                    : '',
-                                style: TextStyle(color: colorInfo[levelName]),
-                              )
-                            ],
-                          )),
-                      Container(
-                        margin: EdgeInsets.only(top: 6),
-                        child: Text(
-                          roomInfo.containsKey('houseAbstract')
-                              ? roomInfo['houseAbstract']
-                              : '',
-                          style:
-                              TextStyle(color: Color(0xFF9BA0AE), fontSize: 12),
+                            ),
+                            Row(
+                              mainAxisAlignment: MainAxisAlignment.center,
+                              children: <Widget>[
+                                Image.asset(
+                                  'images/icon_renshu.png',
+                                  width: 20,
+                                ),
+                                Text(
+                                  (houseInfo != null ? (houseInfo.playerNumber ?? 0).toString() : '0') +
+                                      '/' +
+                                      (houseInfo != null ? houseInfo.maxNumber.toString() : '0'),
+                                  style: TextStyle(fontSize: 14, fontWeight: FontWeight.w500, color: Color(0xFFB1B2C0)),
+                                ),
+                              ],
+                            )
+                          ],
                         ),
                       ),
-                      Row(
-                        mainAxisAlignment: MainAxisAlignment.center,
-                        children: <Widget>[
-                          Image.asset(
-                            'images/icon_renshu.png',
-                            width: 20,
-                          ),
-                          Text(
-                            (houseInfo != null
-                                    ? (houseInfo.playerNumber ?? 0).toString()
-                                    : '0') +
-                                '/' +
-                                (houseInfo != null
-                                    ? houseInfo.maxNumber.toString()
-                                    : '0'),
-                            style: TextStyle(
-                                fontSize: 14,
-                                fontWeight: FontWeight.w500,
-                                color: Color(0xFFB1B2C0)),
-                          )
-                        ],
-                      ),
                       Container(
-                        margin: EdgeInsets.only(top: 14),
-                        width: 200,
                         height: 40,
-                        decoration: BoxDecoration(
-                          border: Border.all(
-                              width: 1,
-                              color: PRIMARY_COLOR,
-                              style: BorderStyle.solid),
-                          borderRadius: BorderRadius.all(Radius.circular(2)),
-                        ),
+                        margin: EdgeInsets.fromLTRB(15, 0, 15, 0),
+                        color: Color(0x1A1990F8),
                         child: Row(
-                          mainAxisAlignment: MainAxisAlignment.center,
                           children: <Widget>[
-                            Text(
-                              '奖金',
-                              style: TextStyle(
-                                color: PRIMARY_COLOR,
-                                fontSize: 13,
-                                fontWeight: FontWeight.w500,
+                            Expanded(
+                              flex: 1,
+                              child: CupertinoButton(
+                                padding: EdgeInsets.all(0),
+                                onPressed: () {},
+                                child: Text(
+                                  '返回锦标赛',
+                                  style: TextStyle(color: PRIMARY_COLOR, fontSize: 14, fontWeight: FontWeight.bold),
+                                ),
                               ),
                             ),
                             Container(
-                              padding: EdgeInsets.only(left: 10, right: 6),
-                              child: Image.asset(
-                                'images/icon_jinbi_da_hong.png',
-                                width: 20,
-                              ),
+                              width: 1,
+                              height: 12,
+                              color: PRIMARY_COLOR,
                             ),
-                            Text(
-                              '×' +
-                                  (houseInfo != null
-                                      ? houseInfo.bonus.toString()
-                                      : '0'),
-                              style: TextStyle(
-                                color: PRIMARY_COLOR,
-                                fontSize: 22,
-                                fontWeight: FontWeight.w900,
+                            Expanded(
+                              flex: 1,
+                              child: CupertinoButton(
+                                padding: EdgeInsets.all(0),
+                                onPressed: () {
+                                  showNotice(context);
+                                },
+                                child: Text(
+                                  '竞赛须知',
+                                  style: TextStyle(color: PRIMARY_COLOR, fontSize: 14, fontWeight: FontWeight.bold),
+                                ),
                               ),
-                            )
+                            ),
+                          ],
+                        ),
+                      ),
+                      Container(
+                        height: 40,
+                        margin: EdgeInsets.fromLTRB(15, 10, 15, 0),
+                        decoration: BoxDecoration(
+                            color: Color(0x1AFFFF00),
+                            border: Border.all(
+                              width: 1,
+                              color: Colors.yellow,
+                            )),
+                        child: Row(
+                          mainAxisAlignment: MainAxisAlignment.spaceAround,
+                          children: <Widget>[
+                            Text('积分 加成+0%', style: TextStyle(color: Colors.yellow, fontSize: 12)),
+                            Text('保底 0积分', style: TextStyle(color: Colors.yellow, fontSize: 12)),
                           ],
                         ),
                       ),
-
                       statuFlag != 4
-                          ? TipsListContent(
-                              tipsList: roomTipsList, houseInfo: houseInfo)
+                          ? TipsListContent(tipsList: roomTipsList, houseInfo: houseInfo)
                           : RankContent(
-                              roomId: widget.roomId,
+                              roomId: houseInfo.id.toString(),
                             ),
                       Container(
                         width: double.infinity,
@@ -623,7 +487,7 @@ class RoomInfoState extends State<RoomInfo>
   }
 
   Widget _joinBtn() {
-    int joinMoney = houseInfo != null ? houseInfo.houseLevel.entryCoin : 0;
+    int joinMoney = 0;
     int statusFlag = houseInfo != null ? houseInfo.statusFlag : 1;
     int playerStatus = playerInfo != null ? playerInfo.statusFlag : 0;
     if (!isJoin && statusFlag == 0) {
@@ -631,11 +495,7 @@ class RoomInfoState extends State<RoomInfo>
         color: BG_SUB_COLOR,
         width: ScreenUtil().setWidth(375),
         height: 48 + ScreenUtil().setHeight(40),
-        padding: EdgeInsets.only(
-            top: ScreenUtil().setHeight(20),
-            bottom: ScreenUtil().setHeight(20),
-            left: 15,
-            right: 15),
+        padding: EdgeInsets.only(top: ScreenUtil().setHeight(20), bottom: ScreenUtil().setHeight(20), left: 15, right: 15),
         child: RaisedButton(
             textColor: Colors.white,
             child: Row(
@@ -645,10 +505,7 @@ class RoomInfoState extends State<RoomInfo>
                     margin: EdgeInsets.only(left: 20),
                     child: Text(
                       '加入房间',
-                      style: TextStyle(
-                          color: Colors.white,
-                          fontSize: 16,
-                          fontWeight: FontWeight.w500),
+                      style: TextStyle(color: Colors.white, fontSize: 16, fontWeight: FontWeight.w500),
                     ))
               ],
             ),
@@ -672,17 +529,9 @@ class RoomInfoState extends State<RoomInfo>
     } else if (isJoin && statusFlag == 0) {
       int _time;
       if (houseInfo != null) {
-        _time = houseInfo.createTime +
-            600000 -
-            DateTime.now().millisecondsSinceEpoch;
+        _time = houseInfo.createTime + 600000 - DateTime.now().millisecondsSinceEpoch;
       }
-      if (houseInfo != null &&
-          houseInfo.createUser ==
-              StoreProvider.of<AppState>(context)
-                  .state
-                  .userInfo
-                  .id
-                  .toString()) {
+      if (houseInfo != null && houseInfo.createUser == StoreProvider.of<AppState>(context).state.userInfo.id.toString()) {
         return Container(
           width: double.infinity,
           padding: EdgeInsets.symmetric(horizontal: 15, vertical: 20),
@@ -699,8 +548,7 @@ class RoomInfoState extends State<RoomInfo>
               )
             ])),
             onPressed: () {
-              showCustomDialog(context, '确认要开始比赛吗?', isCancel: true,
-                  onsubmit: () {
+              showCustomDialog(context, '确认要开始比赛吗?', isCancel: true, onsubmit: () {
                 print('开始');
                 startGame();
               });
@@ -713,7 +561,7 @@ class RoomInfoState extends State<RoomInfo>
           padding: EdgeInsets.symmetric(horizontal: 15, vertical: 20),
           height: 88,
           child: RaisedButton(
-            disabledColor: Color(0xFF914244),
+            disabledColor: Color(0xFF1990F8),
             disabledTextColor: Color(0xFF252532),
             child: Text(
               '预计' + getSecondsMIn(_time) + '后开始',
@@ -729,7 +577,7 @@ class RoomInfoState extends State<RoomInfo>
         padding: EdgeInsets.symmetric(horizontal: 15, vertical: 20),
         height: 88,
         child: RaisedButton(
-          disabledColor: Color(0xFF914244),
+          disabledColor: Color(0xFF1990F8),
           disabledTextColor: Color(0xFF252532),
           child: Text(
             '正在努力解析视频中',
@@ -741,16 +589,14 @@ class RoomInfoState extends State<RoomInfo>
     } else if (isJoin && (statusFlag == 2 || statusFlag == 3)) {
       int _time;
       if (houseInfo != null) {
-        _time = houseInfo.beginTime +
-            3600000 -
-            DateTime.now().millisecondsSinceEpoch;
+        _time = houseInfo.beginTime + 3600000 - DateTime.now().millisecondsSinceEpoch;
       }
       return Container(
         width: double.infinity,
         padding: EdgeInsets.symmetric(horizontal: 15, vertical: 20),
         height: 88,
         child: RaisedButton(
-          disabledColor: Color(0xFF914244),
+          disabledColor: Color(0xFF1990F8),
           disabledTextColor: Color(0xFF252532),
           child: Text(
             '最迟在' + getSecondsMIn(_time) + '后结算',
@@ -765,7 +611,7 @@ class RoomInfoState extends State<RoomInfo>
         padding: EdgeInsets.symmetric(horizontal: 15, vertical: 20),
         height: 88,
         child: RaisedButton(
-          disabledColor: Color(0xFF727785),
+          disabledColor: Color(0xFF1990F8),
           disabledTextColor: Color(0xFF15151D),
           child: Text(
             '已结束',
@@ -775,64 +621,61 @@ class RoomInfoState extends State<RoomInfo>
         ),
       );
     } else if (statusFlag == 4 && tabIndex == 1) {
-      return Container(
-        height: 48,
-        padding: EdgeInsets.symmetric(vertical: 9, horizontal: 20),
-        color: Color(0xFFC2524D),
-        child: Row(
-          children: <Widget>[
-            Container(
-              width: 30,
-              height: 30,
-              margin: EdgeInsets.only(right: 10),
-              child: CircleAvatar(
-                backgroundImage: NetworkImage(userInfo.icon),
-              ),
-            ),
-            Expanded(
-              flex: 1,
-              child: Text(
-                userInfo.nickname,
-                style: TextStyle(
-                  fontSize: 14,
-                  color: Color(0xFF252532),
+      return Builder(
+        builder: (context) {
+          return Container(
+            height: 48,
+            padding: EdgeInsets.symmetric(vertical: 9, horizontal: 20),
+            color: SUB_COLOR,
+            child: Row(
+              children: <Widget>[
+                Container(
+                  width: 30,
+                  height: 30,
+                  margin: EdgeInsets.only(right: 10),
+                  child: CircleAvatar(
+                    backgroundImage: NetworkImage(StoreProvider.of<AppState>(context).state.userInfo.icon),
+                  ),
                 ),
-              ),
-            ),
-            _myUrl != null
-                ? Container(
-                    width: 68,
-                    height: 24,
-                    margin: EdgeInsets.only(right: 10),
-                    child: OutlineButton(
-                      textColor: BG_SUB_COLOR,
-                      borderSide: BorderSide(color: BG_SUB_COLOR),
-                      padding: EdgeInsets.all(0),
-                      highlightColor: PRIMARY_COLOR.withOpacity(0.8),
-                      highlightedBorderColor: BG_SUB_COLOR,
-                      child: Text(
-                        '查看回放',
-                        style: TextStyle(fontSize: 12),
-                      ),
-                      onPressed: () => {
-                            Navigator.push(
-                                context,
-                                CupertinoPageRoute(
-                                    builder: (context) => VideoPlayerPage(
-                                        videoUrl: _myUrl, fileType: 'file')))
-                          },
+                Expanded(
+                  flex: 1,
+                  child: Text(
+                    StoreProvider.of<AppState>(context).state.userInfo.nickname,
+                    style: TextStyle(
+                      fontSize: 14,
+                      color: Colors.white,
                     ),
-                  )
-                : Container(),
-            Text(
-              myRank != 0 ? '第${myRank}名' : '未上榜',
-              style: TextStyle(
-                  fontSize: 14,
-                  color: Color(0xFF252532),
-                  fontWeight: FontWeight.w500),
-            )
-          ],
-        ),
+                  ),
+                ),
+                _myUrl != null
+                    ? Container(
+                        width: 68,
+                        height: 24,
+                        margin: EdgeInsets.only(right: 10),
+                        child: OutlineButton(
+                          textColor: BG_SUB_COLOR,
+                          borderSide: BorderSide(color: BG_SUB_COLOR),
+                          padding: EdgeInsets.all(0),
+                          highlightColor: PRIMARY_COLOR.withOpacity(0.8),
+                          highlightedBorderColor: BG_SUB_COLOR,
+                          child: Text(
+                            '查看回放',
+                            style: TextStyle(fontSize: 12),
+                          ),
+                          onPressed: () {
+                            Navigator.push(context, CupertinoPageRoute(builder: (context) => VideoPlayerPage(videoUrl: _myUrl, fileType: 'file')));
+                          },
+                        ),
+                      )
+                    : Container(),
+                Text(
+                  myRank != 0 ? '第${myRank}名' : '未上榜',
+                  style: TextStyle(fontSize: 14, color: Colors.white, fontWeight: FontWeight.w500),
+                )
+              ],
+            ),
+          );
+        },
       );
     } else {
       return Container();
@@ -860,10 +703,7 @@ class TipsListContent extends StatelessWidget {
   List<Widget> _list() {
     List<Widget> myList = [];
     for (int i = 0; i < tipsList.length; i++) {
-      myList.add(Tips(
-          content: tipsList[i],
-          showTongzhi: (tipsList[i].length == 1 && i == 0) ? true : false,
-          houseInfo: houseInfo));
+      myList.add(Tips(content: tipsList[i], showTongzhi: (tipsList[i].length == 1 && i == 0) ? true : false, houseInfo: houseInfo));
     }
 
     return myList;
@@ -871,8 +711,7 @@ class TipsListContent extends StatelessWidget {
 }
 
 class Tips extends StatelessWidget {
-  Tips({Key key, this.content, this.showTongzhi, this.houseInfo})
-      : super(key: key);
+  Tips({Key key, this.content, this.showTongzhi, this.houseInfo}) : super(key: key);
   final List<String> content;
   final bool showTongzhi;
   final HouseInfo houseInfo;
@@ -881,15 +720,7 @@ class Tips extends StatelessWidget {
     return Container(
         padding: EdgeInsets.all(15),
         margin: EdgeInsets.fromLTRB(15, 10, 15, 0),
-        decoration: BoxDecoration(
-            gradient: LinearGradient(
-                colors: [Color(0xFF464B6A), Color(0xFF35395E)],
-                begin: Alignment.topCenter,
-                end: Alignment.bottomCenter),
-            borderRadius: BorderRadius.only(
-                topRight: Radius.circular(8),
-                bottomLeft: Radius.circular(8),
-                bottomRight: Radius.circular(8))),
+        color: Color(0xFF293354),
         child: Column(
           children: <Widget>[
             content.length == 1
@@ -910,24 +741,9 @@ class Tips extends StatelessWidget {
                         decoration: TextDecoration.underline,
                       ),
                     ),
-                    onPressed: () => {
-                          Navigator.of(context).push(PageRouteBuilder(
-                              opaque: false,
-                              transitionDuration: Duration(milliseconds: 300),
-                              transitionsBuilder: (BuildContext context,
-                                  Animation<double> animation,
-                                  Animation<double> secondaryAnimation,
-                                  Widget child) {
-                                return FadeTransition(
-                                  opacity: CurvedAnimation(
-                                      parent: animation, curve: Curves.linear),
-                                  child: child,
-                                );
-                              },
-                              pageBuilder: (BuildContext context, _, __) {
-                                return CompetitionInformation(houseInfo);
-                              }))
-                        },
+                    onPressed: () {
+                      showNotice(context);
+                    },
                   )
                 : Container()
           ],
@@ -935,34 +751,19 @@ class Tips extends StatelessWidget {
   }
 
   Widget _textList() {
-    return Text.rich(TextSpan(children: [
-      TextSpan(
-        text: content[0],
-        style: TextStyle(color: Colors.white, fontSize: 13),
-      ),
-      TextSpan(
-        text: content[1],
-        style: TextStyle(
-            color: Color(0xFFC2524D),
-            fontSize: 13,
-            fontWeight: FontWeight.w500),
-      ),
-      TextSpan(
-        text: content[2],
-        style: TextStyle(color: Colors.white, fontSize: 13),
-      ),
-      TextSpan(
-        text: content[3],
-        style: TextStyle(
-            color: Color(0xFFC2524D),
-            fontSize: 13,
-            fontWeight: FontWeight.w500),
-      ),
-      TextSpan(
-        text: content[4],
-        style: TextStyle(color: Colors.white, fontSize: 13),
-      )
-    ]));
+    return Text.rich(TextSpan(
+      style: TextStyle(color: Colors.white, fontSize: 13),
+      children: [
+        TextSpan(text: content[0]),
+        TextSpan(
+          text: content[1],
+          style: TextStyle(color: PRIMARY_COLOR, fontSize: 13, fontWeight: FontWeight.w500),
+        ),
+        TextSpan(text: content[2]),
+        TextSpan(text: content[3]),
+        TextSpan(text: content[4])
+      ],
+    ));
   }
 }
 
@@ -978,8 +779,7 @@ class RankContentState extends State<RankContent> {
   List<PlayerInfo> topList = [];
   Future<void> getTopList() async {
     Toast.show(context, '加载中', -1, 'loading');
-    Result res = await HttpManager.get('playerInfo/rankPage',
-        data: {'houseId': widget.roomId, 'currentPage': 1, 'pageNumber': 3});
+    Result res = await HttpManager.get('playerInfo/rankPage', data: {'houseId': widget.roomId, 'currentPage': 1, 'pageNumber': 3});
     Toast.hide();
     List<PlayerInfo> list = [];
     if (res.success) {
@@ -1051,19 +851,14 @@ class RankContentState extends State<RankContent> {
                   width: _num == 1 ? 70 : 60,
                   height: _num == 1 ? 70 : 60,
                   decoration: BoxDecoration(
-                    gradient: LinearGradient(
-                        colors: colorList[_num - 1],
-                        begin: Alignment.topLeft,
-                        end: Alignment.bottomRight),
+                    gradient: LinearGradient(colors: colorList[_num - 1], begin: Alignment.topLeft, end: Alignment.bottomRight),
                     borderRadius: BorderRadius.all(Radius.circular(100)),
                   ),
                   child: Center(
                       child: Container(
                     width: _num == 1 ? 60 : 50,
                     height: _num == 1 ? 60 : 50,
-                    child: CircleAvatar(
-                        backgroundImage:
-                            NetworkImage(topList[_num - 1].userInfo.icon)),
+                    child: CircleAvatar(backgroundImage: NetworkImage(topList[_num - 1].userInfo.icon)),
                   )),
                 ),
                 Positioned(
@@ -1094,12 +889,7 @@ class RankContentState extends State<RankContent> {
             mainAxisAlignment: MainAxisAlignment.center,
             children: <Widget>[
               Image.asset('images/icon_jinbi_xiao_hong.png', width: 20),
-              Text(
-                  '×' +
-                      (topList[_num - 1].bonus != null
-                          ? topList[_num - 1].bonus.toString()
-                          : '0'),
-                  style: TextStyle(color: PRIMARY_COLOR, fontSize: 12))
+              Text('×' + (topList[_num - 1].bonus != null ? topList[_num - 1].bonus.toString() : '0'), style: TextStyle(color: PRIMARY_COLOR, fontSize: 12))
             ],
           )
         ],

+ 12 - 30
lib/pages/SecondRoomInfo.dart

@@ -1,4 +1,5 @@
 import 'package:flutter/material.dart';
+import 'package:wanna_battle/model/HouseInfo.dart';
 import '../model/PlayerInfo.dart';
 import 'dart:async';
 import '../styles/totast.dart';
@@ -9,9 +10,8 @@ import 'package:flutter/cupertino.dart';
 import 'VideoPlayer.dart';
 
 class SecondPage extends StatefulWidget {
-  SecondPage({Key key, this.roomId, this.status}) : super(key: key);
-  final String roomId; // 用来储存传递过来的值
-  final int status;
+  SecondPage(this.houseInfo, {Key key}) : super(key: key);
+  final HouseInfo houseInfo; // 用来储存传递过来的值
   @override
   SecondPageState createState() => SecondPageState();
 }
@@ -26,11 +26,7 @@ class SecondPageState extends State<SecondPage> {
   Future<void> getPlayerPage() async {
     ismore = false;
     Toast.show(context, '加载中', -1, 'loading');
-    Result res = await HttpManager.get('playerInfo/rankPage', data: {
-      'houseId': widget.roomId,
-      'currentPage': currentPage,
-      'pageNumber': 20
-    });
+    Result res = await HttpManager.get('playerInfo/rankPage', data: {'houseId': widget.houseInfo.id, 'currentPage': currentPage, 'pageNumber': 20});
     Toast.hide();
     List<PlayerInfo> list = joinList;
     if (currentPage == 1) {
@@ -59,8 +55,7 @@ class SecondPageState extends State<SecondPage> {
     Future.delayed(Duration.zero, () {
       getPlayerPage();
       _perController.addListener(() {
-        if (_perController.position.pixels ==
-            _perController.position.maxScrollExtent) {
+        if (_perController.position.pixels == _perController.position.maxScrollExtent) {
           if (ismore) {
             currentPage++;
             getPlayerPage();
@@ -116,10 +111,7 @@ class SecondPageState extends State<SecondPage> {
       margin: EdgeInsets.only(top: index == 0 ? 10 : 0),
       padding: EdgeInsets.only(left: 15, right: 15),
       child: Container(
-        decoration: BoxDecoration(
-            border: Border(
-                bottom: BorderSide(
-                    width: 1, color: BG_SUB_COLOR, style: BorderStyle.solid))),
+        decoration: BoxDecoration(border: Border(bottom: BorderSide(width: 1, color: BG_SUB_COLOR, style: BorderStyle.solid))),
         child: Row(
           children: <Widget>[
             Container(
@@ -144,10 +136,7 @@ class SecondPageState extends State<SecondPage> {
                 overflow: TextOverflow.ellipsis,
               ),
             ),
-            widget.status == 4 &&
-                    index < 3 &&
-                    info.video != '' &&
-                    info.video != null
+            widget.houseInfo.statusFlag == 4 && index < 3 && info.video != '' && info.video != null
                 ? Container(
                     width: 68,
                     height: 24,
@@ -162,22 +151,15 @@ class SecondPageState extends State<SecondPage> {
                         '查看回放',
                         style: TextStyle(fontSize: 12),
                       ),
-                      onPressed: () => {
-                            Navigator.push(
-                                context,
-                                CupertinoPageRoute(
-                                    builder: (context) => VideoPlayerPage(
-                                        videoUrl: info.video,
-                                        fileType: 'netWork')))
-                          },
+                      onPressed: () {
+                        Navigator.push(context, CupertinoPageRoute(builder: (context) => VideoPlayerPage(videoUrl: info.video, fileType: 'netWork')));
+                      },
                     ),
                   )
                 : Container(),
-            widget.status == 4 && index < 3
+            widget.houseInfo.statusFlag == 4 && index < 3
                 ? Image.asset(
-                    'images/icon_paihangbang_0' +
-                        (index + 1).toString() +
-                        '.png',
+                    'images/icon_paihangbang_0' + (index + 1).toString() + '.png',
                     width: 32,
                   )
                 : Container()

+ 119 - 77
lib/pages/StartWindow.dart

@@ -1,40 +1,43 @@
 import 'package:flutter/material.dart';
 import 'package:flutter/cupertino.dart';
-import 'package:flutter_screenutil/flutter_screenutil.dart';
 import 'OpenRoom.dart'; //创建房间
 import 'dart:async';
+import '../styles/colors.dart';
 
 class StartWindow extends StatefulWidget {
   @override
   StartWindowState createState() => StartWindowState();
 }
 
-class StartWindowState extends State<StartWindow> {
+class StartWindowState extends State<StartWindow> with SingleTickerProviderStateMixin {
   int _num = 10;
   bool isNext = true;
   Timer timer;
- 
+  AnimationController animationController;
 
   @override
   void initState() {
     super.initState();
 
-    timer=Timer.periodic(Duration(seconds: 1), (timer){
-        if(_num==0){
-          Navigator.of(context).pop(false);
-          timer.cancel();
-        }
-        else {
-          setState(() {
-           _num--; 
-          });
-        }
+    animationController = AnimationController(
+      vsync: this,
+      duration: Duration(seconds: 10),
+    );
+    animationController.repeat();
+    timer = Timer.periodic(Duration(seconds: 1), (timer) {
+      if (_num == 0) {
+        Navigator.of(context).pop(false);
+        timer.cancel();
+      } else {
+        setState(() {
+          _num--;
+        });
+      }
     });
   }
 
   @override
   Widget build(BuildContext context) {
-    ScreenUtil.instance = ScreenUtil(width: 375, height: 667)..init(context);
     return GestureDetector(
       // onTap: () {
       //   Navigator.of(context).pop();
@@ -44,35 +47,57 @@ class StartWindowState extends State<StartWindow> {
           backgroundColor: Color(0xCC000000),
           body: Container(
             child: Center(
-                child: Container(
-              padding: EdgeInsets.only(top: 29, bottom: 21),
-              width: ScreenUtil().setWidth(272),
-              height: ScreenUtil().setWidth(319),
-              decoration: BoxDecoration(
-                  image: DecorationImage(
-                image: AssetImage('images/img_kaishiyouxi.png'),
-              )),
-              child: Column(
-                mainAxisAlignment: MainAxisAlignment.spaceBetween,
-                children: <Widget>[
-                  Text('点击确认开始游戏', style: TextStyle(color: Color(0xFFFDC372), fontSize: 20, fontWeight: FontWeight.w600)),
-                  _centerContent(),
-                  Container(
-                    width: double.infinity,
-                    margin: EdgeInsets.symmetric(horizontal: 42),
-                    height: 44,
-                    child: RaisedButton(
-                      textTheme: ButtonTextTheme.primary,
-                      child: Text('确认'),
-                      onPressed: () {
-                        timer.cancel();
-                       Navigator.of(context).pop(true);
-                      },
+              child: Container(
+                padding: EdgeInsets.only(top: 28, bottom: 30),
+                width: 270,
+                height: 334,
+                decoration: BoxDecoration(
+                  color: Color(0xE6293559),
+                  border: Border.all(width: 1, color: PRIMARY_COLOR),
+                  image: DecorationImage(image: AssetImage('images/img_guangmang.png'), fit: BoxFit.contain),
+                ),
+                child: Stack(
+                  children: <Widget>[
+                    Align(
+                      alignment: Alignment.topCenter,
+                      child: Text(
+                        '点击确认开始游戏',
+                        style: TextStyle(
+                          color: PRIMARY_COLOR,
+                          fontSize: 20,
+                          fontWeight: FontWeight.bold,
+                        ),
+                      ),
+                    ),
+                    _centerContent(),
+                    Align(
+                      alignment: Alignment.bottomCenter,
+                      child: Container(
+                        padding: EdgeInsets.fromLTRB(25, 0, 25, 0),
+                        width: double.infinity,
+                        child: MaterialButton(
+                          highlightElevation: 0,
+                          height: 36,
+                          color: PRIMARY_COLOR,
+                          child: Text(
+                            '确认',
+                            style: TextStyle(
+                              fontSize: 14,
+                              fontWeight: FontWeight.bold,
+                              color: Colors.white,
+                            ),
+                          ),
+                          onPressed: () {
+                            timer.cancel();
+                            Navigator.of(context).pop(true);
+                          },
+                        ),
+                      ),
                     ),
-                  )
-                ],
+                  ],
+                ),
               ),
-            )),
+            ),
           ),
         ),
         onWillPop: () {
@@ -83,47 +108,64 @@ class StartWindowState extends State<StartWindow> {
   }
 
   Widget _centerContent() {
-    return Container(
-      width: ScreenUtil().setWidth(131),
-      height: ScreenUtil().setWidth(131),
-      decoration: BoxDecoration(
-        borderRadius: BorderRadius.all(Radius.circular(100)),
-        gradient: LinearGradient(
-          colors: [Color(0xFFC18C4A), Color(0xFFE2AD5C)],
-          begin: Alignment.topCenter,
-          end: Alignment.bottomCenter,
+    return Stack(
+      children: <Widget>[
+        Center(
+          child: Container(
+            width: 128,
+            height: 128,
+            decoration: BoxDecoration(
+              borderRadius: BorderRadius.all(Radius.circular(100)),
+              color: PRIMARY_COLOR,
+              boxShadow: [
+                BoxShadow(
+                  color: Color(0xD41990F8),
+                  offset: Offset.zero,
+                  blurRadius: 17,
+                ),
+              ],
+            ),
+          ),
         ),
-      ),
-      child: Center(
-        child: Container(
-          width: ScreenUtil().setWidth(80),
-          height: ScreenUtil().setWidth(80),
-          decoration: BoxDecoration(
-            borderRadius: BorderRadius.all(Radius.circular(100)),
-            color: Color(0xFFF5C271),
+        Center(
+          child: Container(
+            width: 80,
+            height: 80,
+            decoration: BoxDecoration(
+              color: Color(0xFF26D1FB),
+              borderRadius: BorderRadius.all(Radius.circular(40)),
+            ),
           ),
-          child: Center(
-            child: Container(
-              width: ScreenUtil().setWidth(60),
-              height: ScreenUtil().setWidth(60),
-              decoration: BoxDecoration(
-                borderRadius: BorderRadius.all(Radius.circular(100)),
-                gradient: LinearGradient(
-                  colors: [Color(0xFFDF605C), Color(0xFFB34B48)],
-                  begin: Alignment.topLeft,
-                  end: Alignment.bottomRight,
-                ),
-              ),
-              child: Center(
-                child: Text(
-                  '$_num',
-                  style: TextStyle(color: Colors.white, fontSize: 32, fontWeight: FontWeight.w600),
-                ),
-              ),
+        ),
+        Center(
+          child: Container(
+            width: 64,
+            height: 64,
+            decoration: BoxDecoration(
+              color: Color(0xFF0E88CA),
+              borderRadius: BorderRadius.all(Radius.circular(32)),
             ),
           ),
         ),
-      ),
+        Center(
+          child: AnimatedBuilder(
+            animation: animationController,
+            child: Image.asset('images/spinner.png'),
+            builder: (context, widget) {
+              return Transform.rotate(
+                angle: -animationController.value * 6.3,
+                child: widget,
+              );
+            },
+          ),
+        ),
+        Center(
+          child: Text(
+            '$_num',
+            style: TextStyle(color: Colors.white, fontSize: 34, fontWeight: FontWeight.bold),
+          ),
+        ),
+      ],
     );
   }
 }

+ 35 - 67
lib/pages/TipInfo.dart

@@ -19,13 +19,11 @@ class TipInfo extends StatefulWidget {
 }
 
 class TipInfoState extends State<TipInfo> {
-  SystemNotice tipInfo = SystemNotice.fromJson(
-      {'content': '', 'createTime': DateTime.now().microsecondsSinceEpoch});
+  SystemNotice tipInfo = SystemNotice.fromJson({'content': '', 'createTime': DateTime.now().microsecondsSinceEpoch});
   HouseInfo houseInfo;
   Future<void> getInfo() async {
     Toast.show(context, '加载中', -1, 'loading');
-    Result res = await HttpManager.get('systemNotice/getOne',
-        data: {'id': widget.tipId});
+    Result res = await HttpManager.get('systemNotice/getOne', data: {'id': widget.tipId});
     Toast.hide();
     if (res.success) {
       setState(() {
@@ -35,19 +33,15 @@ class TipInfoState extends State<TipInfo> {
 
     print(tipInfo.bonus);
 
-    if (tipInfo.statusFlag == 0 &&
-        tipInfo.typeFlag != 2 &&
-        tipInfo.typeFlag != 3) {
-      HttpManager.post('systemNotice/update',
-          data: {'id': tipInfo.id, 'statusFlag': 1});
+    if (tipInfo.statusFlag == 0 && tipInfo.typeFlag != 2 && tipInfo.typeFlag != 3) {
+      HttpManager.post('systemNotice/update', data: {'id': tipInfo.id, 'statusFlag': 1});
     }
 
     if (tipInfo.typeFlag == 3) {
       return;
     }
 
-    Result res2 = await HttpManager.get('houseInfo/getOne',
-        data: {'id': tipInfo.houseId});
+    Result res2 = await HttpManager.get('houseInfo/getOne', data: {'id': tipInfo.houseId});
     if (res2.success) {
       setState(() {
         houseInfo = HouseInfo.fromJson(res2.data);
@@ -60,8 +54,7 @@ class TipInfoState extends State<TipInfo> {
       PageRouteBuilder(
         opaque: false,
         transitionDuration: Duration(milliseconds: 300),
-        transitionsBuilder: (BuildContext context, Animation<double> animation,
-            Animation<double> secondaryAnimation, Widget child) {
+        transitionsBuilder: (BuildContext context, Animation<double> animation, Animation<double> secondaryAnimation, Widget child) {
           return FadeTransition(
             opacity: CurvedAnimation(parent: animation, curve: Curves.linear),
             child: child,
@@ -109,11 +102,7 @@ class TipInfoState extends State<TipInfo> {
                     children: <Widget>[
                       Padding(
                         padding: EdgeInsets.symmetric(vertical: 12),
-                        child: Text(
-                            readTimestamp(
-                                tipInfo.createTime, 'yyyy.MM.dd HH:mm:ss'),
-                            style:
-                                TextStyle(color: Colors.white24, fontSize: 13)),
+                        child: Text(readTimestamp(tipInfo.createTime, 'yyyy.MM.dd HH:mm:ss'), style: TextStyle(color: Colors.white24, fontSize: 13)),
                       ),
                       Container(
                         height: 1,
@@ -129,9 +118,7 @@ class TipInfoState extends State<TipInfo> {
                     ],
                   ),
                 ),
-                houseInfo != null && type != 3
-                    ? houseItem(roomInfo: houseInfo, gameInfo: gameInfo)
-                    : Container(),
+                houseInfo != null && type != 3 ? houseItem(roomInfo: houseInfo, gameInfo: gameInfo) : Container(),
                 (type == 2 || type == 3)
                     ? Container(
                         width: double.infinity,
@@ -141,26 +128,26 @@ class TipInfoState extends State<TipInfo> {
                           textColor: Colors.white,
                           disabledColor: Color(0xFF763939),
                           disabledTextColor: Color(0xFF252532),
-                          child: Text(status==0?'立即领取':'已领取'),
-                          onPressed: status==0?() async {
-                            Toast.show(context, '加载中', -1, 'loading');
-                            Result res = type == 2
-                                ? await HttpManager.post('playerInfo/receive',
-                                    data: {'id': tipInfo.playerId})
-                                : await HttpManager.post('systemNotice/receive',
-                                    data: {'id': widget.tipId});
-                            Toast.hide();
-                            if (res.success) {
-                              if (tipInfo.playerInfo != null) {
-                                showSuccess(tipInfo.playerInfo.bonus);
-                              } else {
-                                showSuccess(tipInfo.bonus);
-                              }
-                              getInfo();
-                            } else {
-                              Toast.show(context, res.error, 1000, 'info');
-                            }
-                          }:null,
+                          child: Text(status == 0 ? '立即领取' : '已领取'),
+                          onPressed: status == 0
+                              ? () async {
+                                  Toast.show(context, '加载中', -1, 'loading');
+                                  Result res = type == 2
+                                      ? await HttpManager.post('playerInfo/receive', data: {'id': tipInfo.playerId})
+                                      : await HttpManager.post('systemNotice/receive', data: {'id': widget.tipId});
+                                  Toast.hide();
+                                  if (res.success) {
+                                    if (tipInfo.playerInfo != null) {
+                                      showSuccess(tipInfo.playerInfo.bonus);
+                                    } else {
+                                      showSuccess(tipInfo.bonus);
+                                    }
+                                    getInfo();
+                                  } else {
+                                    Toast.show(context, res.error, 1000, 'info');
+                                  }
+                                }
+                              : null,
                         ),
                       )
                     : Container(),
@@ -222,34 +209,26 @@ class houseItem extends StatelessWidget {
                             maxWidth: 170,
                             child: Text(
                               roomInfo.houseName,
-                              style: TextStyle(
-                                  color: Colors.white,
-                                  fontSize: 14,
-                                  fontWeight: FontWeight.w500),
+                              style: TextStyle(color: Colors.white, fontSize: 14, fontWeight: FontWeight.w500),
                               maxLines: 1,
                               overflow: TextOverflow.ellipsis,
                             ),
                           ),
                           Container(
                             margin: EdgeInsets.only(left: 6),
-                            child: Image.network(roomInfo.houseLevel.icon,
-                                width: 14),
+                            child: Image.network(roomInfo.houseLevel.icon, width: 14),
                           ),
                           Container(
                               margin: EdgeInsets.only(left: 1),
                               child: Text(
                                 roomInfo.houseLevel.levelName,
-                                style: TextStyle(
-                                    color: Color(0xFFF9D881), fontSize: 9),
+                                style: TextStyle(color: Color(0xFFF9D881), fontSize: 9),
                               )),
                         ],
                       ),
                       Text(
                         roomInfo.houseAbstract,
-                        style: TextStyle(
-                            fontSize: 12,
-                            fontWeight: FontWeight.w400,
-                            color: Color(0xFF9BA0AE)),
+                        style: TextStyle(fontSize: 12, fontWeight: FontWeight.w400, color: Color(0xFF9BA0AE)),
                         maxLines: 2,
                         overflow: TextOverflow.ellipsis,
                       )
@@ -261,15 +240,8 @@ class houseItem extends StatelessWidget {
                   children: <Widget>[
                     Image.asset('images/icon_renshu.png', width: 20),
                     Text(
-                      (roomInfo.playerNumber != null
-                              ? roomInfo.playerNumber.toString()
-                              : '0') +
-                          '/' +
-                          roomInfo.maxNumber.toString(),
-                      style: TextStyle(
-                          fontSize: 14,
-                          fontWeight: FontWeight.w500,
-                          color: Color(0xFFB1B2C0)),
+                      (roomInfo.playerNumber != null ? roomInfo.playerNumber.toString() : '0') + '/' + roomInfo.maxNumber.toString(),
+                      style: TextStyle(fontSize: 14, fontWeight: FontWeight.w500, color: Color(0xFFB1B2C0)),
                     )
                   ],
                 )
@@ -277,11 +249,7 @@ class houseItem extends StatelessWidget {
             ),
           ),
           onTap: () {
-            Navigator.push(
-                context,
-                CupertinoPageRoute(
-                    builder: (context) =>
-                        RoomInfo(roomId: roomInfo.id.toString())));
+            Navigator.push(context, CupertinoPageRoute(builder: (context) => RoomInfo(roomInfo)));
           },
         ),
       ),

+ 1 - 1
lib/pages/openRoom.dart

@@ -129,7 +129,7 @@ class OpenRoomState extends State<OpenRoom> {
       HttpManager.post('houseInfo/join', data: {'houseId': res.data, 'userId': StoreProvider.of<AppState>(context).state.userInfo.id});
       Toast.show(context, '创建成功', 1500, 'success');
       Future.delayed(Duration(milliseconds: 1500), () {
-        Navigator.pushReplacement(context, CupertinoPageRoute(builder: (context) => RoomInfo(roomId: res.data.toString())));
+        // Navigator.pushReplacement(context, CupertinoPageRoute(builder: (context) => RoomInfo(roomId: res.data.toString())));
       });
     } else {}
   }

+ 1 - 1
lib/styles/colors.dart

@@ -10,7 +10,7 @@ const SUB_COLOR = Color(0xFF293354);
 const BG_COLOR = Color(0XFF0E1D32);
 
 //辅助背景色
-const BG_SUB_COLOR = Color(0xFF222335);
+const BG_SUB_COLOR = Color(0XFF0E1D32);
 
 const PLACEHOLDER_COLOR = Color(0xFF727785);
 

+ 170 - 0
lib/widget/CheckinDialog.dart

@@ -0,0 +1,170 @@
+import 'package:flutter/material.dart';
+import 'package:flutter/cupertino.dart';
+import 'package:wanna_battle/styles/colors.dart';
+import 'package:wanna_battle/styles/totast.dart';
+import '../styles/colors.dart';
+import '../widget/Dialog.dart';
+
+void showCheckinDialog(BuildContext context) {
+  Navigator.of(context).push(
+    PageRouteBuilder(
+      opaque: false,
+      transitionDuration: Duration(milliseconds: 300),
+      transitionsBuilder: (BuildContext context, Animation<double> animation, Animation<double> secondaryAnimation, Widget child) {
+        return FadeTransition(
+          opacity: CurvedAnimation(parent: animation, curve: Curves.linear),
+          child: child,
+        );
+      },
+      pageBuilder: (BuildContext context, _, __) {
+        return _CheckinDialog1();
+      },
+    ),
+  );
+}
+
+class _CheckinDialog1 extends Dialog {
+  @override
+  Widget build(BuildContext context) {
+    return WillPopScope(
+      child: Scaffold(
+        backgroundColor: Color(0xb3000000),
+        body: Container(
+          child: SizedBox.expand(
+            child: UnconstrainedBox(
+              child: Container(
+                width: 330,
+                height: 390,
+                decoration: BoxDecoration(color: Color(0xE6293559), border: Border.all(width: 1, color: Color(0xFF1990F8))),
+                child: Column(
+                  crossAxisAlignment: CrossAxisAlignment.center,
+                  mainAxisAlignment: MainAxisAlignment.center,
+                  children: <Widget>[
+                    Text(
+                      '每日签到',
+                      style: TextStyle(color: Colors.white, fontSize: 18, fontWeight: FontWeight.bold),
+                    ),
+                    Container(
+                      margin: EdgeInsets.only(top: 30),
+                      child: Row(
+                        mainAxisAlignment: MainAxisAlignment.center,
+                        children: <Widget>[
+                          item('星期一', 1, '50金币', 1),
+                          item('星期二', 1, '50金币', 2),
+                          item('星期三', 1, '50金币', 3),
+                          item('星期四', 1, '50金币', 1),
+                        ],
+                      ),
+                    ),
+                    Container(
+                      margin: EdgeInsets.only(top: 25),
+                      child: Row(
+                        mainAxisAlignment: MainAxisAlignment.center,
+                        children: <Widget>[
+                          item('星期五', 1, '50金币', 2),
+                          item('星期六', 1, '50金币', 3),
+                          item('星期日', 1, '50金币', 1),
+                        ],
+                      ),
+                    ),
+                    Container(
+                      margin: EdgeInsets.only(top: 40),
+                      child: MaterialButton(
+                        minWidth: 220,
+                        elevation: 0,
+                        highlightElevation: 0,
+                        color: PRIMARY_COLOR,
+                        child: Text(
+                          '立即签到',
+                          style: TextStyle(color: Colors.white, fontSize: 14, fontWeight: FontWeight.bold),
+                        ),
+                        onPressed: () {
+                          Toast.show(context, '签到成功', 2000, 'info');
+                          Navigator.of(context).pop();
+                        },
+                      ),
+                    )
+                  ],
+                ),
+              ),
+            ),
+          ),
+        ),
+      ),
+      onWillPop: () {
+        return Future.value(true);
+      },
+    );
+  }
+
+  Widget item(String weekDay, int type, String name, int checked) {
+    List<Widget> list = [
+      Container(
+        decoration: BoxDecoration(
+          color: Color(0xFF253051),
+          border: Border.all(width: 1, color: PRIMARY_COLOR),
+          borderRadius: BorderRadius.circular(22),
+        ),
+      ),
+      Center(
+        child: Image.asset(
+          'images/icon_jinbi_qiandao.png',
+        ),
+      ),
+    ];
+    if (checked == 1) {
+      list.add(Center(
+        child: Image.asset(
+          'images/icon_yiqiandao.png',
+        ),
+      ));
+    } else if (checked == 2) {
+      list.add(Center(
+        child: Container(
+          decoration: BoxDecoration(
+            color: Color(0xFF4f5c87),
+            border: Border.all(width: 1, color: Color(0xFF4f5c87)),
+            borderRadius: BorderRadius.circular(22),
+          ),
+          child: Center(
+            child: Text(
+              '未签到',
+              style: TextStyle(color: Colors.white, fontSize: 10),
+            ),
+          ),
+        ),
+      ));
+    }
+    return Container(
+      width: 76,
+      child: Column(
+        children: <Widget>[
+          Container(
+            width: 44,
+            height: 44,
+            child: Stack(
+              children: list,
+            ),
+          ),
+          Container(
+            margin: EdgeInsets.only(top: 6),
+            child: Text(
+              weekDay,
+              style: TextStyle(color: Colors.white, fontSize: 14),
+            ),
+          ),
+          Container(
+            margin: EdgeInsets.only(top: 2),
+            child: Text(
+              '50金币',
+              style: TextStyle(
+                color: PRIMARY_COLOR,
+                fontSize: 12,
+              ),
+            ),
+          )
+        ],
+      ),
+    );
+  }
+}

+ 1 - 1
lib/widget/RoomItem.dart

@@ -91,7 +91,7 @@ class HouseItem extends StatelessWidget {
             ),
           ),
           onTap: () {
-            Navigator.push(context, CupertinoPageRoute(builder: (context) => RoomInfo(roomId: roomInfo.id.toString())));
+            Navigator.push(context, CupertinoPageRoute(builder: (context) => RoomInfo(roomInfo)));
           },
         ),
       ),