panhui 6 лет назад
Родитель
Сommit
6cd4728d31
100 измененных файлов с 1112 добавлено и 1055 удалено
  1. 1 1
      android/app/build.gradle
  2. BIN
      images/0.png
  3. BIN
      images/1.png
  4. BIN
      images/2.png
  5. BIN
      images/2x/0.png
  6. BIN
      images/2x/1.png
  7. BIN
      images/2x/2.png
  8. BIN
      images/2x/3.png
  9. BIN
      images/2x/4.png
  10. BIN
      images/2x/5.png
  11. BIN
      images/2x/6.png
  12. BIN
      images/2x/7.png
  13. BIN
      images/2x/8.png
  14. BIN
      images/2x/9.png
  15. BIN
      images/2x/home_icon_01.png
  16. BIN
      images/2x/home_icon_02.png
  17. BIN
      images/2x/home_icon_03.png
  18. BIN
      images/2x/home_icon_04.png
  19. BIN
      images/2x/icon_haoli.png
  20. BIN
      images/2x/icon_menpiao.png
  21. BIN
      images/2x/icon_shangwu.png
  22. BIN
      images/2x/jiangpai_baiyin.png
  23. BIN
      images/2x/jiangpai_baiyin_xiao.png
  24. BIN
      images/2x/jiangpai_bojin_xiao.png
  25. BIN
      images/2x/jiangpai_huangjin.png
  26. BIN
      images/2x/jiangpai_jinpai_xiao.png
  27. BIN
      images/2x/jiangpai_qingtong.png
  28. BIN
      images/2x/jiangpai_qingtong_xiao.png
  29. BIN
      images/2x/tancuang_shang.png
  30. BIN
      images/2x/tancuang_xia.png
  31. BIN
      images/3.png
  32. BIN
      images/3x/0.png
  33. BIN
      images/3x/1.png
  34. BIN
      images/3x/2.png
  35. BIN
      images/3x/3.png
  36. BIN
      images/3x/4.png
  37. BIN
      images/3x/5.png
  38. BIN
      images/3x/6.png
  39. BIN
      images/3x/7.png
  40. BIN
      images/3x/8.png
  41. BIN
      images/3x/9.png
  42. BIN
      images/3x/home_icon_01.png
  43. BIN
      images/3x/home_icon_02.png
  44. BIN
      images/3x/home_icon_03.png
  45. BIN
      images/3x/home_icon_04.png
  46. BIN
      images/3x/icon_haoli.png
  47. BIN
      images/3x/icon_menpiao.png
  48. BIN
      images/3x/icon_shangwu.png
  49. BIN
      images/3x/jiangpai_baiyin.png
  50. BIN
      images/3x/jiangpai_baiyin_xiao.png
  51. BIN
      images/3x/jiangpai_bojin_xiao.png
  52. BIN
      images/3x/jiangpai_huangjin.png
  53. BIN
      images/3x/jiangpai_jinpai_xiao.png
  54. BIN
      images/3x/jiangpai_qingtong.png
  55. BIN
      images/3x/jiangpai_qingtong_xiao.png
  56. BIN
      images/3x/tancuang_shang.png
  57. BIN
      images/3x/tancuang_xia.png
  58. BIN
      images/4.png
  59. BIN
      images/5.png
  60. BIN
      images/6.png
  61. BIN
      images/7.png
  62. BIN
      images/8.png
  63. BIN
      images/9.png
  64. BIN
      images/home_icon_01.png
  65. BIN
      images/home_icon_02.png
  66. BIN
      images/home_icon_03.png
  67. BIN
      images/home_icon_04.png
  68. BIN
      images/icon_haoli.png
  69. BIN
      images/icon_menpiao.png
  70. BIN
      images/icon_shangwu.png
  71. BIN
      images/jiangpai_baiyin.png
  72. BIN
      images/jiangpai_baiyin_xiao.png
  73. BIN
      images/jiangpai_bojin_xiao.png
  74. BIN
      images/jiangpai_huangjin.png
  75. BIN
      images/jiangpai_jinpai_xiao.png
  76. BIN
      images/jiangpai_qingtong.png
  77. BIN
      images/jiangpai_qingtong_xiao.png
  78. BIN
      images/tancuang_shang.png
  79. BIN
      images/tancuang_xia.png
  80. 6 6
      lib/main.dart
  81. 19 1
      lib/model/PlayerInfo.dart
  82. 14 2
      lib/model/PlayerInfo.g.dart
  83. 2 1
      lib/model/UserInfo.dart
  84. 4 2
      lib/model/UserInfo.g.dart
  85. 2 2
      lib/net/HttpManager.dart
  86. 2 2
      lib/pages/BindGame.dart
  87. 13 122
      lib/pages/CompetitionInformation.dart
  88. 5 4
      lib/pages/CreateRoom.dart
  89. 0 516
      lib/pages/HomePage.1.dart
  90. 635 0
      lib/pages/HomePage.2.dart
  91. 214 308
      lib/pages/HomePage.dart
  92. 4 4
      lib/pages/MyTeam.dart
  93. 27 12
      lib/pages/RecordList.dart
  94. 1 1
      lib/pages/ShoppingMall.dart
  95. 1 1
      lib/pages/StartWindow.dart
  96. 156 67
      lib/pages/TipInfo.dart
  97. 1 1
      lib/pages/TipList.dart
  98. 3 0
      lib/pages/changeUserInfo.dart
  99. 1 1
      lib/pages/loginSecond.dart
  100. 1 1
      lib/pages/myWallet.dart

+ 1 - 1
android/app/build.gradle

@@ -45,7 +45,7 @@ android {
         multiDexEnabled true
         testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
         ndk {
-            abiFilters 'armeabi-v7a'
+            // abiFilters 'armeabi-v7a'
         }
         manifestPlaceholders = [
                 JPUSH_PKGNAME: applicationId,




BIN
images/2x/0.png


BIN
images/2x/1.png


BIN
images/2x/2.png


BIN
images/2x/3.png


BIN
images/2x/4.png


BIN
images/2x/5.png


BIN
images/2x/6.png


BIN
images/2x/7.png


BIN
images/2x/8.png


BIN
images/2x/9.png


BIN
images/2x/home_icon_01.png


BIN
images/2x/home_icon_02.png


BIN
images/2x/home_icon_03.png


BIN
images/2x/home_icon_04.png


BIN
images/2x/icon_haoli.png


BIN
images/2x/icon_menpiao.png


BIN
images/2x/icon_shangwu.png


BIN
images/2x/jiangpai_baiyin.png


BIN
images/2x/jiangpai_baiyin_xiao.png


BIN
images/2x/jiangpai_bojin_xiao.png


BIN
images/2x/jiangpai_huangjin.png


BIN
images/2x/jiangpai_jinpai_xiao.png


BIN
images/2x/jiangpai_qingtong.png


BIN
images/2x/jiangpai_qingtong_xiao.png


BIN
images/2x/tancuang_shang.png


BIN
images/2x/tancuang_xia.png



BIN
images/3x/0.png


BIN
images/3x/1.png


BIN
images/3x/2.png


BIN
images/3x/3.png


BIN
images/3x/4.png


BIN
images/3x/5.png


BIN
images/3x/6.png


BIN
images/3x/7.png


BIN
images/3x/8.png


BIN
images/3x/9.png


BIN
images/3x/home_icon_01.png


BIN
images/3x/home_icon_02.png


BIN
images/3x/home_icon_03.png


BIN
images/3x/home_icon_04.png


BIN
images/3x/icon_haoli.png


BIN
images/3x/icon_menpiao.png


BIN
images/3x/icon_shangwu.png


BIN
images/3x/jiangpai_baiyin.png


BIN
images/3x/jiangpai_baiyin_xiao.png


BIN
images/3x/jiangpai_bojin_xiao.png


BIN
images/3x/jiangpai_huangjin.png


BIN
images/3x/jiangpai_jinpai_xiao.png


BIN
images/3x/jiangpai_qingtong.png


BIN
images/3x/jiangpai_qingtong_xiao.png


BIN
images/3x/tancuang_shang.png


BIN
images/3x/tancuang_xia.png








BIN
images/home_icon_01.png


BIN
images/home_icon_02.png


BIN
images/home_icon_03.png


BIN
images/home_icon_04.png


BIN
images/icon_haoli.png


BIN
images/icon_menpiao.png


BIN
images/icon_shangwu.png


BIN
images/jiangpai_baiyin.png


BIN
images/jiangpai_baiyin_xiao.png


BIN
images/jiangpai_bojin_xiao.png


BIN
images/jiangpai_huangjin.png


BIN
images/jiangpai_jinpai_xiao.png


BIN
images/jiangpai_qingtong.png


BIN
images/jiangpai_qingtong_xiao.png


BIN
images/tancuang_shang.png


BIN
images/tancuang_xia.png


+ 6 - 6
lib/main.dart

@@ -37,9 +37,9 @@ class MobileCyberGamesApp extends StatelessWidget {
         theme: ThemeData(
             cardColor: Color(0xFF2B2B42),
             backgroundColor: Color(0xFF222335),
-            primaryColor: Color(0xFFF4B011),
-            buttonColor: Color(0xFFF4B011),
-            accentColor: Color(0xFFF4B011),
+            primaryColor: Color(0xFFC2524D),
+            buttonColor: Color(0xFFC2524D),
+            accentColor: Color(0xFFC2524D),
             textSelectionColor: Colors.white,
             textTheme: TextTheme(
               subhead: TextStyle(color: Colors.white),
@@ -50,9 +50,9 @@ class MobileCyberGamesApp extends StatelessWidget {
             ),
             primaryIconTheme:IconThemeData(color: Colors.white),
             buttonTheme: ButtonThemeData(
-              buttonColor: Color(0xFFF4B011),
-              highlightColor: Color(0xFFF2A433),
-              splashColor: Color(0xFFF2A433),
+              buttonColor: Color(0xFFC2524D),
+              highlightColor: Color(0xFF8E3B36),
+              splashColor: Color(0xFF8E3B36),
               shape: RoundedRectangleBorder(borderRadius: BorderRadius.all(Radius.circular(0))),
             )),
         home: store.state.userInfo != null ? HomePage() : LoginFirst(),

+ 19 - 1
lib/model/PlayerInfo.dart

@@ -8,7 +8,7 @@ part 'PlayerInfo.g.dart';
 @JsonSerializable()
 class PlayerInfo {
   PlayerInfo(
-      this.id, this.houseId, this.userId, this.statusFlag, this.userInfo,this.bonus,this.gameInfo,this.houseInfo,this.rank,this.houseRank,this.video);
+      this.id, this.houseId, this.userId, this.statusFlag, this.userInfo,this.bonus,this.gameInfo,this.houseInfo,this.rank,this.houseRank,this.video,this.platinum,this.gold,this.silver,this.bronze);
   int id;
   int houseId; //房间id
   int userId; //用户id
@@ -20,6 +20,10 @@ class PlayerInfo {
   int rank;//名次
   int houseRank;//房间比赛名次
   String video;//视频地址
+  int platinum; //铂金
+  int gold;//金牌
+  int  silver;//银牌
+  int bronze;//铜牌
   
   factory PlayerInfo.fromJson(Map<String, dynamic> json) =>
       _$PlayerInfoFromJson(json);
@@ -27,6 +31,20 @@ class PlayerInfo {
   Map<String, dynamic> toJson() => _$PlayerInfoToJson(this);
   // 命名构造函数
   PlayerInfo.empty();
+
+  String getPlatinum() {
+    return this.platinum.toString();
+  }
+   String getGold() {
+    return this.gold.toString();
+  }
+   String getSilver() {
+    return this.silver.toString();
+  }
+   String getBronze() {
+    return this.bronze.toString();
+  }
+
   @override
   String toString() {
     return _$PlayerInfoToJson(this).toString();

+ 14 - 2
lib/model/PlayerInfo.g.dart

@@ -18,7 +18,11 @@ PlayerInfo _$PlayerInfoFromJson(Map<String, dynamic> json) {
       json['houseInfo'] != null ? HouseInfo.fromJson(json['houseInfo']) : null,
       json['rank'] ?? null,
       json['houseRank'] ?? null,
-      json['video']??'');
+      json['video']??'',
+      json['platinum'] as int,
+      json['gold'] as int,
+      json['silver'] as int,
+      json['bronze'] as int,);
 }
 
 //  int id;
@@ -26,6 +30,10 @@ PlayerInfo _$PlayerInfoFromJson(Map<String, dynamic> json) {
 //   int userId;//用户id
 //   int statusFlag;//状态 0加入 1准备 2开始 3结束 6未比赛
 //   UserInfo userInfo;
+  // int platinum; //铂金
+  // int gold;//金牌
+  // int  silver;//银牌
+  // int bronze;//铜牌
 Map<String, dynamic> _$PlayerInfoToJson(PlayerInfo instance) =>
     <String, dynamic>{
       'id': instance.id,
@@ -38,5 +46,9 @@ Map<String, dynamic> _$PlayerInfoToJson(PlayerInfo instance) =>
       'houseInfo': instance.houseInfo,
       'rank': instance.rank,
       'houseRank': instance.houseRank,
-      'video':instance.video
+      'video':instance.video,
+      'platinum': instance.platinum,
+      'gold': instance.gold,
+      'silver': instance.silver,
+      'bronze':instance.bronze
     };

+ 2 - 1
lib/model/UserInfo.dart

@@ -5,7 +5,7 @@ part 'UserInfo.g.dart';
 @JsonSerializable()
 class UserInfo {
   UserInfo(this.id, this.nickname, this.username, this.icon, this.phone,
-      this.sex, this.moneyCoin, this.moneyPoint,this.birthday,this.noticeFlag,this.remindFlag,this.createFlag,this.houseCard,this.recommender,this.levelId);
+      this.sex, this.moneyCoin, this.moneyPoint,this.birthday,this.noticeFlag,this.remindFlag,this.createFlag,this.houseCard,this.recommender,this.levelId,this.moneyTicket);
   int id;
   String nickname;
   String username;
@@ -21,6 +21,7 @@ class UserInfo {
    int houseCard;
    int recommender;//上级ID
    int levelId;//用户级别ID
+   int moneyTicket;//门票数量
   factory UserInfo.fromJson(Map<String, dynamic> json) =>
       _$UserInfoFromJson(json);
 

+ 4 - 2
lib/model/UserInfo.g.dart

@@ -22,7 +22,8 @@ UserInfo _$UserInfoFromJson(Map<String, dynamic> json) {
       json['createFlag'] == 'Y',
       json['houseCard'] != null ? json['houseCard'] as int : 0,
       json['recommender'] != null ? json['recommender'] as int : null,
-      json['levelId'] != null ? json['levelId'] as int : 0);
+      json['levelId'] != null ? json['levelId'] as int : 0,
+      json['moneyTicket'] as int);
 }
 
 Map<String, dynamic> _$UserInfoToJson(UserInfo instance) => <String, dynamic>{
@@ -40,5 +41,6 @@ Map<String, dynamic> _$UserInfoToJson(UserInfo instance) => <String, dynamic>{
       'createFlag': instance.createFlag,
       'houseCard': instance.houseCard,
       'recommender': instance.recommender,
-      'levelId': instance.levelId
+      'levelId': instance.levelId,
+      'moneyTicket':instance.moneyTicket
     };

+ 2 - 2
lib/net/HttpManager.dart

@@ -3,8 +3,8 @@ import 'Result.dart';
 import 'package:intl/intl.dart';
 
 class HttpManager {
-  static String baseUrl = 'http://47.96.141.102:8202/';
-  // static String baseUrl='http://192.168.50.226:8080/';
+  // static String baseUrl = 'http://47.96.141.102:8202/';
+  static String baseUrl='http://192.168.50.226:8080/';
   static String token;
   static bool debug;
 

+ 2 - 2
lib/pages/BindGame.dart

@@ -165,8 +165,8 @@ class BindGameState extends State<BindGame> {
                 height: 30,
                 child: OutlineButton(
                   padding: EdgeInsets.all(0),
-                  borderSide: BorderSide(color: Color(0xFFFFB726), width: 1),
-                  textColor: Color(0xFFFFB726),
+                  borderSide: BorderSide(color:  Theme.of(context).primaryColor, width: 1),
+                  textColor: Theme.of(context).primaryColor,
                   highlightColor: Color(0xFF16161C),
                   child: Text('解绑'),
                   onPressed: () => cancelBind(),

+ 13 - 122
lib/pages/CompetitionInformation.dart

@@ -33,10 +33,10 @@ class CompetitionInformationState extends State<CompetitionInformation> {
                     itemWidth: 270.0,
                     itemHeight: 422.0,
                     control: SwiperControl(
-                        color: Color(0xFFFFB726),
+                        color: Theme.of(context).primaryColor,
                         disableColor: Colors.transparent),
                     index: nowSwiperIndex,
-                    itemCount: 4,
+                    itemCount: 3,
                     scrollDirection: Axis.horizontal,
                     loop: false,
                     itemBuilder: (context, index) {
@@ -75,7 +75,7 @@ class InfoBox extends StatelessWidget {
       width: 270,
       height: 422,
       decoration: BoxDecoration(
-          border: Border.all(width: 1, color: Color(0xFFFFB726)),
+          border: Border.all(width: 1, color: Theme.of(context).primaryColor),
           color: Colors.black),
       child: Stack(
         children: <Widget>[
@@ -84,12 +84,12 @@ class InfoBox extends StatelessWidget {
             padding: EdgeInsets.only(top: 25),
             child: Column(
               children: <Widget>[
-                Text('竞赛须知 ' + typeIndex.toString() + '/4',
+                Text('竞赛须知 ' + typeIndex.toString() + '/3',
                     style: TextStyle(
                         color: Color(0xFFFDC372),
                         fontSize: 20,
                         fontWeight: FontWeight.w600)),
-                _centerContent(typeIndex)
+                _centerContent(typeIndex,context)
               ],
             ),
           ),
@@ -119,7 +119,7 @@ class InfoBox extends StatelessWidget {
                   height: 36,
                   child:
                   LinearButton(
-                    btntext: typeIndex != 4 ? '下一个' : '结束',
+                    btntext: typeIndex != 3 ? '下一个' : '知道了',
                     onTapHomeMenu:typeIndex != 4 ? next : end ,
                     
                   )
@@ -147,119 +147,10 @@ class InfoBox extends StatelessWidget {
   }
 
 // 第一名获得${houseInfo.houseLevel.firstRatio}%,第二名获得${houseInfo.houseLevel.secondRatio}%,第三名获得${houseInfo.houseLevel.thirdRatio}%
-  Widget _centerContent(int index) {
+  Widget _centerContent(int index,BuildContext context) {
     Widget useContent = Container();
     TextStyle _text = TextStyle(color: Colors.white, fontSize: 14);
-    if (index == 1 && houseInfo.scoreType ==0) {
-      useContent = Container(
-        margin: EdgeInsets.only(top: 22),
-        padding: EdgeInsets.symmetric(horizontal: 20),
-        child: Column(
-          children: <Widget>[
-            Image.asset('images/icon_jinbi_da_hong.png', width: 30),
-            Container(
-              height: 20,
-            ),
-            Text(
-              '房间人数越多,总奖金就越多',
-              style: _text,
-            ),
-            Text('同房间内玩家进行竞赛,吃上鸡的评分前三名玩家获得相应奖励',
-                style: _text, textAlign: TextAlign.center),
-            //  Text('同房间内玩家进行竞赛', style: _text),
-            Text.rich(TextSpan(children: [
-              TextSpan(text: '第一名获得奖金池的', style: _text),
-              TextSpan(
-                text: '${houseInfo.houseLevel.firstRatio}%',
-                style: TextStyle(color: Color(0xFFFFB726), fontSize: 13),
-              ),
-            ])),
-            Text.rich(TextSpan(children: [
-              TextSpan(text: '第二名获得奖金池的', style: _text),
-              TextSpan(
-                text: '${houseInfo.houseLevel.secondRatio}%',
-                style: TextStyle(color: Color(0xFFFFB726), fontSize: 13),
-              ),
-            ])),
-            Text.rich(TextSpan(children: [
-              TextSpan(text: '第三名获得奖金池的', style: _text),
-              TextSpan(
-                text: '${houseInfo.houseLevel.thirdRatio}%',
-                style: TextStyle(color: Color(0xFFFFB726), fontSize: 13),
-              ),
-            ])),
-            Container(
-              margin: EdgeInsets.only(top: 10),
-              width: double.infinity,
-              child: Column(
-                mainAxisAlignment: MainAxisAlignment.start,
-                crossAxisAlignment: CrossAxisAlignment.start,
-                children: <Widget>[
-                  Text(
-                    '注:奖金池的${houseInfo.houseLevel.feeRatio}%为平台方运营服务费',
-                    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))))
-                ],
-              ),
-            )
-          ],
-        ),
-      );
-    } else if (index == 1 && houseInfo.scoreType == 1) {
-      useContent = Container(
-        margin: EdgeInsets.only(top: 22),
-        padding: EdgeInsets.symmetric(horizontal: 20),
-        child: Column(
-          children: <Widget>[
-            Image.asset('images/icon_jinbi_da_hong.png', width: 30),
-            Container(
-              height: 20,
-            ),
-            Text(
-              '房间人数越多,总奖金就越多',
-              style: _text,
-            ),
-            Text('同房间内的玩家进行竞赛,所有吃上鸡的玩家均可获得奖金',
-                style: _text, textAlign: TextAlign.center),
-            Text.rich(TextSpan(children: [
-              TextSpan(text: '即平分总奖金池的', style: _text),
-              TextSpan(
-                text: '${houseInfo.houseLevel.avgRatio}%',
-                style: TextStyle(color: Color(0xFFFFB726), fontSize: 13),
-              ),
-            ])),
-            Container(
-              margin: EdgeInsets.only(top: 44),
-              width: double.infinity,
-              child: Column(
-                mainAxisAlignment: MainAxisAlignment.start,
-                crossAxisAlignment: CrossAxisAlignment.start,
-                children: <Widget>[
-                  Text(
-                    '注:奖金池的${houseInfo.houseLevel.feeRatio}%为平台方运营服务费',
-                    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))))
-                ],
-              ),
-            )
-          ],
-        ),
-      );
-    } else if (index == 2) {
+     if (index == 1) {
       useContent = Container(
         margin: EdgeInsets.only(top: 20),
         padding: EdgeInsets.symmetric(horizontal: 20),
@@ -278,7 +169,7 @@ class InfoBox extends StatelessWidget {
                   TextSpan(
                     text: '点击确认',
                     style: TextStyle(
-                        color: Color(0xFFFFB726),
+                        color: Theme.of(context).primaryColor,
                         fontSize: 14,
                         fontWeight: FontWeight.w500),
                   ),
@@ -291,7 +182,7 @@ class InfoBox extends StatelessWidget {
           ],
         ),
       );
-    } else if (index == 3) {
+    } else if (index ==2) {
       useContent = Container(
         margin: EdgeInsets.only(top: 20),
         padding: EdgeInsets.symmetric(horizontal: 20),
@@ -310,7 +201,7 @@ class InfoBox extends StatelessWidget {
                   TextSpan(
                     text: '点击“确定”',
                     style: TextStyle(
-                        color: Color(0xFFFFB726),
+                        color: Theme.of(context).primaryColor,
                         fontSize: 14,
                         fontWeight: FontWeight.w500),
                   ),
@@ -323,7 +214,7 @@ class InfoBox extends StatelessWidget {
           ],
         ),
       );
-    } else if (index == 4) {
+    } else if (index == 3) {
       useContent = Container(
         margin: EdgeInsets.only(top: 20),
         padding: EdgeInsets.symmetric(horizontal: 20),
@@ -342,7 +233,7 @@ class InfoBox extends StatelessWidget {
                   TextSpan(
                     text: '请一定一定一定要点击“继续”按钮',
                     style: TextStyle(
-                        color: Color(0xFFFFB726),
+                        color: Theme.of(context).primaryColor,
                         fontSize: 14,
                         fontWeight: FontWeight.w600),
                   ),

+ 5 - 4
lib/pages/CreateRoom.dart

@@ -35,7 +35,11 @@ class _CreateRoomBtn extends StatelessWidget {
   final int btnIndex;
   _CreateRoomBtn(this.title, this.btnIndex);
 
-  List<Color> colorList=[Color(0xFFFFB726),Color(0xFFFDC372)];
+  
+
+  @override
+  Widget build(BuildContext context) {
+    List<Color> colorList=[Theme.of(context).primaryColor,Color(0xFFFDC372)];
   List<List<String>> imageList=[[
     'images/tancuang_shang.png',
     'images/tancuang_xia.png'
@@ -43,9 +47,6 @@ class _CreateRoomBtn extends StatelessWidget {
     'images/tancuang_huang_shang.png',
     'images/tancuang_huang_xia.png'
   ]];
-
-  @override
-  Widget build(BuildContext context) {
     return GestureDetector(
       onTap: () {
         Navigator.pushReplacement(

+ 0 - 516
lib/pages/HomePage.1.dart

@@ -1,516 +0,0 @@
-import 'package:flutter/material.dart';
-import '../widget/HomeDrawer.dart';
-import 'CreateRoom.dart';
-import 'RoomList.dart';
-import 'RankList.dart';
-import 'RoomInfo.dart';
-import 'ShoppingMall.dart';
-import 'package:flutter/cupertino.dart';
-import 'package:flutter_swiper/flutter_swiper.dart';
-import '../model/GameInfoSeasons.dart';
-import '../styles/totast.dart';
-import '../net/HttpManager.dart';
-import '../net/Result.dart';
-import 'TipList.dart';
-import 'package:flutter_redux/flutter_redux.dart';
-import '../redux/AppState.dart';
-import 'Setting.dart';
-import '../widget/Dialog.dart';
-
-class HomePage extends StatefulWidget {
-  @override
-  _HomePageState createState() => _HomePageState();
-}
-
-class _HomePageState extends State<HomePage> with WidgetsBindingObserver {
-  List<GameInfoSeasons> seasonList = [];
-  int nowIndex = 0;
-  PageController _pageController;
-  bool showBadge = false;
-
-  Future<void> getSeasonInfo() async {
-    Toast.show(context, '加载中', -1, 'loading');
-    Result res = await HttpManager.get('gameInfo/seasons');
-    Toast.hide();
-    if (res.success) {
-      List<GameInfoSeasons> list = [];
-      for (var item in res.data) {
-        list.add(GameInfoSeasons.fromJson(item));
-      }
-      setState(() {
-        seasonList = list;
-      });
-    } else {}
-  }
-
-  void showBackDialog() {
-    MyDialog.showDialog(context, '暂时没有进行中的房间,敬请期待...');
-    // showDialog<Null>(
-    //   context: context,
-    //   barrierDismissible: false,
-    //   builder: (BuildContext context) {
-    //     return AlertDialog(
-    //       content: Container(
-    //         height: 50,
-    //         child: Text(
-
-    //           style: TextStyle(color: Colors.black),
-    //         ),
-    //       ),
-    //       actions: <Widget>[
-    //         FlatButton(
-    //           child: Text('确定'),
-    //           onPressed: () {
-    //             Navigator.of(context).pop();
-    //           },
-    //         ),
-    //       ],
-    //     );
-    //   },
-    // ).then((val) {});
-  }
-
-  Future<void> getOneRoom() async {
-    Toast.show(context, '加载中', -1, 'loading');
-    Result res = await HttpManager.get('houseInfo/getOne', data: {'statusFlag': 0});
-    Toast.hide();
-    if (res.success) {
-      if (res.data != null) {
-        Navigator.push(context, CupertinoPageRoute(builder: (context) => RoomInfo(roomId: res.data['id'].toString())));
-      } else {
-        showBackDialog();
-      }
-    }
-  }
-
-  Future<void> getUnreadMsg() async {
-    Result res = await HttpManager.get('systemNotice/unread', data: {'userId': StoreProvider.of<AppState>(context).state.userInfo.id, 'statusFlag': 0});
-    if (res.success && res.data != null) {
-      if (res.data > 0) {
-        setState(() {
-          showBadge = true;
-        });
-      } else {
-        setState(() {
-          showBadge = false;
-        });
-      }
-    }
-  }
-
-  @override
-  void initState() {
-    super.initState();
-    WidgetsBinding.instance.addObserver(this);
-    _pageController = PageController(initialPage: 0);
-    Future.delayed(Duration.zero, () {
-      getSeasonInfo();
-      getUnreadMsg();
-    });
-  }
-
-  @override
-  void dispose() {
-    super.dispose();
-    WidgetsBinding.instance.removeObserver(this);
-  }
-
-  @override
-  void didChangeAppLifecycleState(AppLifecycleState state) {
-    if (state == AppLifecycleState.resumed) {
-      getUnreadMsg();
-    }
-  }
-
-  @override
-  Widget build(BuildContext context) {
-    return Scaffold(
-      drawer: HomeDrawer(),
-      body: WillPopScope(
-        child: Container(
-          width: double.infinity,
-          height: double.infinity,
-          decoration: BoxDecoration(
-              gradient: LinearGradient(
-                  colors: [Color.fromARGB(255, 177, 59, 56), Color.fromARGB(255, 147, 64, 61)], begin: Alignment.topCenter, end: Alignment.bottomCenter)),
-          child: SafeArea(
-            child: centerWidget(context),
-          ),
-        ),
-        onWillPop: () {
-          Future.value(true);
-        },
-      ),
-      floatingActionButton: floatWidget(),
-      floatingActionButtonLocation: FloatingActionButtonLocation.centerDocked,
-    );
-  }
-
-  Widget floatWidget() {
-    return Container(
-      decoration: BoxDecoration(borderRadius: BorderRadius.all(Radius.circular(100)), border: Border.all(width: 1, color: Color(0xFF1B1C28))),
-      width: 166,
-      height: 166,
-      margin: EdgeInsets.only(bottom: 84),
-      child: CircleAvatar(
-          backgroundImage: AssetImage('images/centerBtn.png'),
-          child: ClipOval(
-              child: Material(
-                  color: Colors.transparent,
-                  child: InkWell(
-                    child: Container(
-                      width: 166,
-                      height: 166,
-                      child: Center(
-                        child: UnconstrainedBox(
-                          child: Image.asset('images/join.png', width: 85),
-                        ),
-                      ),
-                    ),
-                    onTap: () {
-                      getOneRoom();
-                    },
-                  )))),
-    );
-  }
-
-  Widget centerWidget(BuildContext context) {
-    double width = MediaQuery.of(context).size.width;
-    double height = MediaQuery.of(context).size.height;
-    String endSTring = '';
-    if (seasonList.isNotEmpty) {
-      int _time = seasonList[nowIndex].competitionSeason.endTime - DateTime.now().millisecondsSinceEpoch;
-      _time = _time ~/ 1000 ~/ 3600 ~/ 24;
-      endSTring = '倒计时 ' + _time.toString() + ' 天';
-    }
-
-    return Column(
-      children: <Widget>[
-        Expanded(
-          child: Stack(
-            children: <Widget>[
-              Container(
-                  child: seasonList.isNotEmpty
-                      ? Swiper(
-                          index: nowIndex,
-                          itemCount: seasonList.length,
-                          scrollDirection: Axis.horizontal,
-                          loop: false,
-                          onTap: (index) {
-                            Navigator.push(
-                                context,
-                                CupertinoPageRoute(
-                                    builder: (context) =>
-                                        RankList(raceId: seasonList[index].competitionSeason.id, gameId: seasonList[index].competitionSeason.gameId)));
-                          },
-                          onIndexChanged: (index) {
-                            setState(() {
-                              nowIndex = index;
-                            });
-                          },
-                          itemBuilder: (context, index) {
-                            return Center(
-                                child: Container(
-                              width: 0.64 * (height - 334),
-                              height: 0.64 * (height - 334),
-                              decoration: BoxDecoration(image: DecorationImage(image: AssetImage('images/home_icon_yuan.png'), fit: BoxFit.contain)),
-                              child: Column(
-                                mainAxisAlignment: MainAxisAlignment.center,
-                                children: <Widget>[
-                                  Text('赛季奖金', style: TextStyle(color: Color(0xFFFFFFFF), fontSize: 13)),
-                                  Container(
-                                    height: 0.1 * (height - 334),
-                                  ),
-                                  Row(
-                                    mainAxisAlignment: MainAxisAlignment.center,
-                                    crossAxisAlignment: CrossAxisAlignment.end,
-                                    children: _moneyList(),
-                                  ),
-                                  Container(
-                                    height: 0.06 * (height - 334),
-                                  ),
-                                  // Column(
-                                  //   children: <Widget>[
-                                  //     Text('当前排名',
-                                  //         style: TextStyle(
-                                  //             color: Color(0xFFFFFFFF),
-                                  //             fontSize: 13)),
-                                  //     Text('2',
-                                  //         style: TextStyle(
-                                  //             color: Color(0xFFFFFFFF),
-                                  //             fontSize: 13))
-                                  //   ],
-                                  // )
-                                ],
-                              ),
-                            ));
-                          },
-                        )
-                      : Container()),
-              Positioned(
-                left: 10,
-                top: 0,
-                width: 48,
-                height: 48,
-                child: Material(
-                  color: Colors.transparent,
-                  child: Builder(
-                    builder: (context) => InkWell(
-                          onTap: () {
-                            Scaffold.of(context).openDrawer();
-                          },
-                          child: Padding(
-                            padding: EdgeInsets.all(12),
-                            child: Image.asset(
-                              'images/person.png',
-                              width: 24,
-                            ),
-                          ),
-                        ),
-                  ),
-                ),
-              ),
-              Positioned(
-                right: 10,
-                top: 0,
-                width: 48,
-                height: 48,
-                child: Material(
-                  color: Colors.transparent,
-                  child: InkWell(
-                    onTap: () {
-                      Navigator.push(context, CupertinoPageRoute(builder: (context) => Setting()));
-                    },
-                    child: Padding(
-                      padding: EdgeInsets.all(12),
-                      child: Image.asset('images/setting.png', width: 24),
-                    ),
-                  ),
-                ),
-              ),
-              Positioned(
-                top: 15,
-                left: 0,
-                right: 0,
-                child: Column(
-                  mainAxisAlignment: MainAxisAlignment.center,
-                  crossAxisAlignment: CrossAxisAlignment.center,
-                  children: <Widget>[
-                    // Text(
-                    //   seasonList.length > 0
-                    //       ? seasonList[nowIndex].competitionSeason.season
-                    //       : '',
-                    //   style: TextStyle(color: Colors.white, fontSize: 14),
-                    // ),
-                    Text(
-                      seasonList.isNotEmpty ? seasonList[nowIndex].gameName : '',
-                      style: TextStyle(color: Colors.white, fontSize: 14),
-                    )
-                  ],
-                ),
-              ),
-              Positioned(
-                bottom: 20,
-                left: 0,
-                right: 0,
-                child: Column(
-                  mainAxisAlignment: MainAxisAlignment.center,
-                  crossAxisAlignment: CrossAxisAlignment.center,
-                  children: <Widget>[
-                    Text(
-                      endSTring,
-                      style: TextStyle(color: Colors.white, fontSize: 14),
-                    )
-                  ],
-                ),
-              ),
-            ],
-          ),
-        ),
-        Builder(
-          builder: (BuildContext context) {
-            double aspectRatio = 1;
-            aspectRatio = width / 334;
-            return Container(
-              child: GridView.count(
-                physics: BouncingScrollPhysics(),
-                shrinkWrap: true,
-                crossAxisCount: 2,
-                childAspectRatio: aspectRatio,
-                children: <Widget>[
-                  HomeMenu(
-                    'images/Create.png',
-                    57,
-                    onTapHomeMenu: () {
-                      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 CreateRoom();
-                          }));
-                    },
-                  ),
-                  HomeMenu(
-                    'images/search.png',
-                    31,
-                    onTapHomeMenu: () {
-                      Navigator.push(context, CupertinoPageRoute(builder: (context) => RoomList()));
-                    },
-                  ),
-                  HomeMenu(
-                    'images/email.png',
-                    41,
-                    onTapHomeMenu: () async {
-                      bool result = await Navigator.push(context, CupertinoPageRoute(builder: (context) => TipList()));
-                      if (result) {
-                        getUnreadMsg();
-                      }
-                    },
-                    showBadge: showBadge,
-                  ),
-                  HomeMenu(
-                    'images/shoppingmall.png',
-                    39,
-                    onTapHomeMenu: () {
-                      Navigator.push(context, CupertinoPageRoute(builder: (context) => ShoppingMall()));
-                    },
-                  ),
-                ],
-              ),
-            );
-          },
-        ),
-      ],
-    );
-  }
-
-  List<Widget> _moneyList() {
-    double height = MediaQuery.of(context).size.height;
-    List<Widget> _list = [];
-
-    String bouns = (seasonList[nowIndex].competitionSeason.bonus / 1000).toStringAsFixed(1);
-
-    // String bouns = (900000000100 / 1000).toStringAsFixed(1);
-    // print(bouns);
-    // print(bouns.indexOf('.0'));
-    if (bouns.indexOf('.0') != -1 || num.parse(bouns) > 999) {
-      bouns = bouns.substring(0, bouns.length - 2);
-    }
-
-    List<String> _bounsList = bouns.split('');
-    List<String> _imageList = [];
-    for (var item in _bounsList) {
-      switch (item) {
-        case '0':
-          _imageList.add('images/0.png');
-          break;
-        case '1':
-          _imageList.add('images/1.png');
-          break;
-        case '2':
-          _imageList.add('images/2.png');
-          break;
-        case '3':
-          _imageList.add('images/3.png');
-          break;
-        case '4':
-          _imageList.add('images/4.png');
-          break;
-        case '5':
-          _imageList.add('images/5.png');
-          break;
-        case '6':
-          _imageList.add('images/6.png');
-          break;
-        case '7':
-          _imageList.add('images/7.png');
-          break;
-        case '8':
-          _imageList.add('images/8.png');
-          break;
-        case '9':
-          _imageList.add('images/9.png');
-          break;
-        case '.':
-          _imageList.add('.');
-          break;
-      }
-    }
-    if (_bounsList.isEmpty) {
-      _imageList.add('images/0.png');
-    }
-
-    for (var item in _imageList) {
-      if (item != '.') {
-        if (_imageList.length > 4) {
-          double _scale = 1 - (_imageList.length - 4) * 0.2;
-          _list.add(Image.asset(item, height: 0.18 * 0.64 * (height - 334) * _scale));
-        } else {
-          _list.add(Image.asset(item, height: 0.18 * 0.64 * (height - 334)));
-        }
-
-        _list.add(Container(width: 5));
-      } else {
-        _list.add(Text(
-          '.',
-          style: TextStyle(color: Colors.white, fontSize: 36, fontFamily: 'DINEngschrift', height: 0),
-        ));
-      }
-    }
-    _list.add(Text(
-      'K',
-      style: TextStyle(color: Colors.white, fontSize: 24, fontFamily: 'DINEngschrift', height: .5),
-    ));
-    return _list;
-  }
-}
-
-typedef void OnTapHomeMenu();
-
-class HomeMenu extends StatelessWidget {
-  final String icon;
-  final double _width;
-  final OnTapHomeMenu onTapHomeMenu;
-  final bool showBadge;
-  HomeMenu(this.icon, this._width, {this.onTapHomeMenu, this.showBadge = false});
-  @override
-  Widget build(BuildContext context) {
-    return Container(
-      decoration: BoxDecoration(
-          gradient: LinearGradient(
-              begin: Alignment.topCenter,
-              end: Alignment.bottomCenter,
-              stops: [0.0, 0.01, 0.8],
-              colors: [Color(0xFF7E89B7), Color(0xFF4E536F), Color(0xFF333558)])),
-      child: Container(
-        decoration: BoxDecoration(
-            border: Border(
-                // top: BorderSide(width: 2,color: Color(0xFF7E89B7)),
-                left: BorderSide(width: 0.5, color: Color(0x80000000)),
-                right: BorderSide(width: 0.5, color: Color(0x80000000)),
-                bottom: BorderSide(width: 1, color: Color(0x80000000)))),
-        child: Material(
-          color: Colors.transparent,
-          child: InkWell(
-            onTap: onTapHomeMenu,
-            child: Container(
-              child: Center(
-                child: Image.asset(
-                  icon,
-                  fit: BoxFit.contain,
-                  width: _width,
-                ),
-              ),
-            ),
-          ),
-        ),
-      ),
-    );
-  }
-}

+ 635 - 0
lib/pages/HomePage.2.dart

@@ -0,0 +1,635 @@
+import 'package:flutter/material.dart';
+import '../widget/HomeDrawer.dart';
+import 'CreateRoom.dart';
+import 'RoomList.dart';
+import 'RankList.dart';
+import 'RoomInfo.dart';
+import 'ShoppingMall.dart';
+import 'package:flutter/cupertino.dart';
+import 'package:flutter_swiper/flutter_swiper.dart';
+import '../model/GameInfoSeasons.dart';
+import '../styles/totast.dart';
+import '../net/HttpManager.dart';
+import '../net/Result.dart';
+import 'TipList.dart';
+import 'package:flutter_redux/flutter_redux.dart';
+import '../redux/AppState.dart';
+import 'Setting.dart';
+import '../widget/Dialog.dart';
+import 'package:redux/redux.dart';
+import '../model/UserInfo.dart';
+import '../pages/openRoom.dart';
+
+class HomePage extends StatefulWidget {
+  @override
+  _HomePageState createState() => _HomePageState();
+}
+
+class _HomePageState extends State<HomePage> with WidgetsBindingObserver {
+  List<GameInfoSeasons> seasonList = [];
+  int nowIndex = 0;
+  PageController _pageController;
+  bool showBadge = false;
+
+  Future<void> getSeasonInfo() async {
+    Toast.show(context, '加载中', -1, 'loading');
+    Result res = await HttpManager.get('gameInfo/seasons', data: {
+      'userId': StoreProvider.of<AppState>(context).state.userInfo.id,
+    });
+    Toast.hide();
+    if (res.success) {
+      List<GameInfoSeasons> list = [];
+      for (var item in res.data) {
+        list.add(GameInfoSeasons.fromJson(item));
+      }
+      setState(() {
+        seasonList = list;
+      });
+    } else {}
+  }
+
+  void showBackDialog() {
+    MyDialog.showDialog(context, '暂时没有进行中的房间,敬请期待...');
+  }
+
+  Future<void> getOneRoom() async {
+    Toast.show(context, '加载中', -1, 'loading');
+    Result res =
+        await HttpManager.get('houseInfo/getOne', data: {'statusFlag': 0});
+    Toast.hide();
+    if (res.success) {
+      if (res.data != null) {
+        Navigator.push(
+            context,
+            CupertinoPageRoute(
+                builder: (context) =>
+                    RoomInfo(roomId: res.data['id'].toString())));
+      } else {
+        showBackDialog();
+      }
+    }
+  }
+
+  Future<void> getUnreadMsg() async {
+    Result res = await HttpManager.get('systemNotice/unread', data: {
+      'userId': StoreProvider.of<AppState>(context).state.userInfo.id,
+      'statusFlag': 0
+    });
+    if (res.success && res.data != null) {
+      if (res.data > 0) {
+        setState(() {
+          showBadge = true;
+        });
+      } else {
+        setState(() {
+          showBadge = false;
+        });
+      }
+    }
+  }
+
+  @override
+  void initState() {
+    super.initState();
+    WidgetsBinding.instance.addObserver(this);
+    _pageController = PageController(initialPage: 0);
+    Future.delayed(Duration.zero, () {
+      getSeasonInfo();
+      getUnreadMsg();
+    });
+  }
+
+  @override
+  void dispose() {
+    super.dispose();
+    WidgetsBinding.instance.removeObserver(this);
+  }
+
+  @override
+  void didChangeAppLifecycleState(AppLifecycleState state) {
+    if (state == AppLifecycleState.resumed) {
+      getUnreadMsg();
+    }
+  }
+
+  @override
+  Widget build(BuildContext context) {
+    return StoreConnector<AppState, UserInfo>(
+        converter: (Store store) => store.state.userInfo,
+        builder: (context, userInfo) {
+          return Scaffold(
+            drawer: HomeDrawer(),
+            body: WillPopScope(
+              child: Container(
+                width: double.infinity,
+                height: double.infinity,
+                decoration: BoxDecoration(
+                    gradient: LinearGradient(
+                        colors: [
+                          Color(0xFFC0C0C0),
+                          Color(0xFF3D4043),
+                          Color(0xFF383C40)
+                        ],
+                        begin: Alignment.topCenter,
+                        end: Alignment.bottomCenter,
+                        stops: [0.0, 0.15, 1.0])),
+                child: SafeArea(
+                  child: centerWidget(context, userInfo),
+                ),
+              ),
+              onWillPop: () {
+                Future.value(true);
+              },
+            ),
+            // floatingActionButton: floatWidget(),
+            // floatingActionButtonLocation:
+            //     FloatingActionButtonLocation.centerDocked,
+          );
+        });
+  }
+
+  Widget floatWidget() {
+    return Container(
+      decoration: BoxDecoration(
+          borderRadius: BorderRadius.all(Radius.circular(100)),
+          border: Border.all(width: 1, color: Color(0xFF1B1C28))),
+      width: 166,
+      height: 166,
+      margin: EdgeInsets.only(bottom: 84),
+      child: CircleAvatar(
+          backgroundImage: AssetImage('images/centerBtn.png'),
+          child: ClipOval(
+              child: Material(
+                  color: Colors.transparent,
+                  child: InkWell(
+                    child: Container(
+                      width: 166,
+                      height: 166,
+                      child: Center(
+                        child: UnconstrainedBox(
+                          child: Image.asset('images/join.png', width: 85),
+                        ),
+                      ),
+                    ),
+                    onTap: () {
+                      getOneRoom();
+                    },
+                  )))),
+    );
+  }
+
+  Widget centerWidget(BuildContext context, UserInfo userInfo) {
+    double width = MediaQuery.of(context).size.width;
+    double height = MediaQuery.of(context).size.height;
+    String endSTring = '';
+    if (seasonList.isNotEmpty) {
+      int _time = seasonList[nowIndex].competitionSeason.endTime -
+          DateTime.now().millisecondsSinceEpoch;
+      _time = _time ~/ 1000 ~/ 3600 ~/ 24;
+      endSTring = _time.toString();
+    }
+
+    return Column(
+      children: <Widget>[
+        Expanded(
+          child: Stack(
+            children: <Widget>[
+              Container(
+                  child: seasonList.isNotEmpty
+                      ? Swiper(
+                          index: nowIndex,
+                          itemCount: seasonList.length,
+                          scrollDirection: Axis.horizontal,
+                          loop: false,
+                          onTap: (index) {
+                            Navigator.push(
+                                context,
+                                CupertinoPageRoute(
+                                    builder: (context) => RankList(
+                                        raceId: seasonList[index]
+                                            .competitionSeason
+                                            .id,
+                                        gameId: seasonList[index]
+                                            .competitionSeason
+                                            .gameId)));
+                          },
+                          onIndexChanged: (index) {
+                            setState(() {
+                              nowIndex = index;
+                            });
+                          },
+                          itemBuilder: (context, index) {
+                            return Center(
+                                child: Container(
+                              // width: 0.64 * (height - 334),
+                              // height: 0.64 * (height - 334),
+
+                              // decoration: BoxDecoration(image: DecorationImage(image: AssetImage('images/home_icon_yuan.png'), fit: BoxFit.contain)),
+                              child: Column(
+                                mainAxisAlignment: MainAxisAlignment.center,
+                                children: <Widget>[
+                                  Container(
+                                    width: double.infinity,
+                                    height: 52,
+                                    decoration: BoxDecoration(
+                                        image: DecorationImage(
+                                            image: AssetImage(
+                                                'images/img_guang_home.png'))),
+                                    child: Text(
+                                      '赛季奖金',
+                                      style: TextStyle(
+                                        color: Color(0xFFFFFFFF),
+                                        fontSize: 26,
+                                        fontFamily: 'Pangmen',
+                                      ),
+                                      textAlign: TextAlign.center,
+                                    ),
+                                  ),
+                                  Row(
+                                    mainAxisAlignment: MainAxisAlignment.center,
+                                    crossAxisAlignment: CrossAxisAlignment.end,
+                                    children: _moneyList(),
+                                  ),
+                                  Container(
+                                    height: 15,
+                                  ),
+                                  seasonList[index]
+                                              .competitionSeason
+                                              .playerInfo
+                                              .rank !=
+                                          null
+                                      ? Text(
+                                          '当前排名 ' +
+                                              seasonList[index]
+                                                  .competitionSeason
+                                                  .playerInfo
+                                                  .rank
+                                                  .toString(),
+                                          style: TextStyle(
+                                              color: Color(0xFFFFFFFF),
+                                              fontSize: 24,
+                                              fontFamily: 'Pangmen'))
+                                      : Container(),
+                                  Container(
+                                    height: 12,
+                                  ),
+                                  Text.rich(TextSpan(
+                                      children: [
+                                        TextSpan(text: "倒计时 "),
+                                        TextSpan(
+                                          text: endSTring,
+                                          style: TextStyle(fontSize: 27),
+                                        ),
+                                        TextSpan(
+                                          text: ' 天',
+                                        ),
+                                      ],
+                                      style: TextStyle(
+                                          color: Color(0xFFFFFFFF),
+                                          fontSize: 16,
+                                          fontFamily: 'Pangmen')))
+                                  // Container(
+                                  //   height: 0.06 * (height - 334),
+                                  // ),
+                                  // Column(
+                                  //   children: <Widget>[
+                                  //     Text('当前排名',
+                                  //         style: TextStyle(
+                                  //             color: Color(0xFFFFFFFF),
+                                  //             fontSize: 13)),
+                                  //     Text('2',
+                                  //         style: TextStyle(
+                                  //             color: Color(0xFFFFFFFF),
+                                  //             fontSize: 13))
+                                  //   ],
+                                  // )
+                                ],
+                              ),
+                            ));
+                          },
+                        )
+                      : Container()),
+              Positioned(
+                left: 26,
+                top: 10,
+                width: 48,
+                height: 48,
+                child: Material(
+                  color: Colors.transparent,
+                  child: Builder(
+                    builder: (context) => InkWell(
+                        onTap: () {
+                          Scaffold.of(context).openDrawer();
+                        },
+                        child: Container(
+                          width: 48,
+                          height: 48,
+                          padding: EdgeInsets.all(5),
+                          decoration: BoxDecoration(
+                              gradient: LinearGradient(
+                                colors: [Color(0xFFFEFEFE), Color(0xFFBFBFBF)],
+                                begin: Alignment.topCenter,
+                                end: Alignment.bottomCenter,
+                              ),
+                              borderRadius:
+                                  BorderRadius.all(Radius.circular(100)),
+                              boxShadow: [
+                                //阴影
+                                BoxShadow(
+                                    color: Colors.black45,
+                                    offset: Offset(0, 2.0),
+                                    blurRadius: 6.0)
+                              ]),
+                          child: CircleAvatar(
+                            backgroundImage: NetworkImage(userInfo.icon),
+                          ),
+                        )),
+                  ),
+                ),
+              ),
+              Positioned(
+                right: 12,
+                top: 0,
+                width: 48,
+                height: 48,
+                child: Material(
+                  color: Colors.transparent,
+                  child: InkWell(
+                    onTap: () {
+                      Navigator.push(context,
+                          CupertinoPageRoute(builder: (context) => Setting()));
+                    },
+                    child: Padding(
+                      padding: EdgeInsets.all(12),
+                      child: Image.asset('images/setting.png', width: 19),
+                    ),
+                  ),
+                ),
+              ),
+            ],
+          ),
+        ),
+        Builder(
+          builder: (BuildContext context) {
+            double aspectRatio = 1;
+            aspectRatio = width / 334;
+            return Container(
+              height: 338,
+              padding: EdgeInsets.fromLTRB(16, 34, 16, 26),
+              width: double.infinity,
+              decoration: BoxDecoration(
+                  gradient: LinearGradient(
+                colors: [
+                  Color(0xFF394247),
+                  Color(0xFF1C272D),
+                  Color(0xFF08141A)
+                ],
+                begin: Alignment.topCenter,
+                end: Alignment.bottomCenter,
+              )),
+              child: Column(
+                children: <Widget>[
+                  Container(
+                    width: double.infinity,
+                    height: 108,
+                    child: HomeMenu(
+                      '开始游戏',
+                      onTapHomeMenu: () {
+                        Navigator.push(
+                            context,
+                            CupertinoPageRoute(
+                                builder: (context) => RoomList()));
+                      },
+                    ),
+                  ),
+                  Container(
+                    height: 28,
+                  ),
+                  Row(
+                    children: <Widget>[
+                      Expanded(
+                        flex: 1,
+                        child: Column(
+                          children: <Widget>[
+                            Container(
+                              height: 67,
+                              child: HomeMenu(
+                                '新增',
+                                onTapHomeMenu: () {
+                                  // 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 CreateRoom();
+                                  //     }));
+
+                                   Navigator.push(
+                                      context,
+                                      CupertinoPageRoute(
+                                          builder: (context) => OpenRoom(
+                                            roomFlag: '0'
+                                          )));
+                                },
+                              ),
+                            ),
+                            Container(
+                              height: 8,
+                            ),
+                            Container(
+                              height: 67,
+                              child: HomeMenu(
+                                '邮件',
+                                onTapHomeMenu: () {
+                                  Navigator.push(
+                                      context,
+                                      CupertinoPageRoute(
+                                          builder: (context) => TipList()));
+                                },
+                              ),
+                            )
+                          ],
+                        ),
+                      ),
+                      Container(
+                        width: 14,
+                      ),
+                      Expanded(
+                        flex: 1,
+                        child: Container(
+                          height: 142,
+                          child: HomeMenu(
+                            '商城',
+                            onTapHomeMenu: () {
+                              Navigator.push(
+                                  context,
+                                  CupertinoPageRoute(
+                                      builder: (context) => ShoppingMall()));
+                            },
+                          ),
+                        ),
+                      )
+                    ],
+                  )
+                ],
+              ),
+            );
+          },
+        ),
+      ],
+    );
+  }
+
+  List<Widget> _moneyList() {
+    double height = MediaQuery.of(context).size.height;
+    List<Widget> _list = [];
+
+    String bouns = (seasonList[nowIndex].competitionSeason.bonus / 1000)
+        .toStringAsFixed(1);
+
+    // String bouns = (6002222100 / 1000).toStringAsFixed(1);
+    // print(bouns);
+    // print(bouns.indexOf('.0'));
+    if (bouns.indexOf('.0') != -1 || num.parse(bouns) > 99) {
+      bouns = bouns.substring(0, bouns.length - 2);
+    }
+
+    List<String> _bounsList = bouns.split('');
+    List<String> _imageList = [];
+    for (var item in _bounsList) {
+      switch (item) {
+        case '0':
+          _imageList.add('images/0.png');
+          break;
+        case '1':
+          _imageList.add('images/1.png');
+          break;
+        case '2':
+          _imageList.add('images/2.png');
+          break;
+        case '3':
+          _imageList.add('images/3.png');
+          break;
+        case '4':
+          _imageList.add('images/4.png');
+          break;
+        case '5':
+          _imageList.add('images/5.png');
+          break;
+        case '6':
+          _imageList.add('images/6.png');
+          break;
+        case '7':
+          _imageList.add('images/7.png');
+          break;
+        case '8':
+          _imageList.add('images/8.png');
+          break;
+        case '9':
+          _imageList.add('images/9.png');
+          break;
+        case '.':
+          _imageList.add('kong');
+          _imageList.add('images/dian.png');
+          _imageList.add('kong');
+          break;
+      }
+    }
+    if (_bounsList.isEmpty) {
+      _imageList.add('images/0.png');
+    }
+
+    for (var item in _imageList) {
+      if (item == 'kong') {
+        _list.add(Container(
+          width: 5,
+        ));
+      } else {
+        if (_bounsList.length > 4) {
+          _list.add(Image.asset(item, height: 300 / _bounsList.length));
+        } else {
+          _list.add(Image.asset(item));
+        }
+      }
+
+      // if (item != '.') {
+      //   // if (_imageList.length > 4) {
+      //   //   double _scale = 1 - (_imageList.length - 4) * 0.2;
+      //   //   _list.add(Image.asset(item, height: 0.18 * 0.64 * (height - 334) * _scale));
+      //   // } else {
+      //   //   _list.add(Image.asset(item, height: 0.18 * 0.64 * (height - 334)));
+      //   // }
+      //   _list.add(Image.asset(item));
+
+      // } else {
+      //   _list.add(Text(
+      //     '.',
+      //     style: TextStyle(color: Colors.white, fontSize: 36, fontFamily: 'DINEngschrift', height: 0),
+      //   ));
+      // }
+    }
+    _list.add(Container(width: 5));
+    if (_bounsList.length > 4) {
+      _list.add(Image.asset('images/K.png', height: 300 / _bounsList.length));
+    } else {
+      _list.add(Image.asset('images/K.png'));
+    }
+
+    return _list;
+  }
+}
+
+typedef void OnTapHomeMenu();
+
+class HomeMenu extends StatelessWidget {
+  final String title;
+  final OnTapHomeMenu onTapHomeMenu;
+  final bool showBadge;
+  HomeMenu(this.title, {this.onTapHomeMenu, this.showBadge = false});
+  @override
+  Widget build(BuildContext context) {
+    return Container(
+      padding: EdgeInsets.all(5),
+      decoration: BoxDecoration(
+          gradient: LinearGradient(
+              begin: Alignment.topCenter,
+              end: Alignment.bottomCenter,
+              colors: [Color(0xFFDFCF74), Color(0xFF6FB692)])),
+      child: Container(
+        decoration: BoxDecoration(
+            gradient: LinearGradient(
+                begin: Alignment.topCenter,
+                end: Alignment.bottomCenter,
+                colors: [Color(0xFFFFC30F), Color(0xFFFFA54C)])),
+        child: Material(
+          color: Colors.transparent,
+          child: InkWell(
+            onTap: onTapHomeMenu,
+            child: Container(
+              child: Center(
+                  child: Text(
+                title,
+                style: TextStyle(
+                    color: Color(0xFFFFFFFF),
+                    fontSize: 43,
+                    fontFamily: 'Pangmen'),
+              )),
+            ),
+          ),
+        ),
+      ),
+    );
+  }
+}

+ 214 - 308
lib/pages/HomePage.dart

@@ -16,8 +16,7 @@ import 'package:flutter_redux/flutter_redux.dart';
 import '../redux/AppState.dart';
 import 'Setting.dart';
 import '../widget/Dialog.dart';
-import 'package:redux/redux.dart';
-import '../model/UserInfo.dart';
+import '../pages/openRoom.dart';
 
 class HomePage extends StatefulWidget {
   @override
@@ -37,7 +36,7 @@ class _HomePageState extends State<HomePage> with WidgetsBindingObserver {
     });
     Toast.hide();
     if (res.success) {
-      List<GameInfoSeasons> list = [];
+     List<GameInfoSeasons> list = [];
       for (var item in res.data) {
         list.add(GameInfoSeasons.fromJson(item));
       }
@@ -49,20 +48,38 @@ class _HomePageState extends State<HomePage> with WidgetsBindingObserver {
 
   void showBackDialog() {
     MyDialog.showDialog(context, '暂时没有进行中的房间,敬请期待...');
+    // showDialog<Null>(
+    //   context: context,
+    //   barrierDismissible: false,
+    //   builder: (BuildContext context) {
+    //     return AlertDialog(
+    //       content: Container(
+    //         height: 50,
+    //         child: Text(
+
+    //           style: TextStyle(color: Colors.black),
+    //         ),
+    //       ),
+    //       actions: <Widget>[
+    //         FlatButton(
+    //           child: Text('确定'),
+    //           onPressed: () {
+    //             Navigator.of(context).pop();
+    //           },
+    //         ),
+    //       ],
+    //     );
+    //   },
+    // ).then((val) {});
   }
 
   Future<void> getOneRoom() async {
     Toast.show(context, '加载中', -1, 'loading');
-    Result res =
-        await HttpManager.get('houseInfo/getOne', data: {'statusFlag': 0});
+    Result res = await HttpManager.get('houseInfo/getOne', data: {'statusFlag': 0});
     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();
       }
@@ -70,10 +87,7 @@ class _HomePageState extends State<HomePage> with WidgetsBindingObserver {
   }
 
   Future<void> getUnreadMsg() async {
-    Result res = await HttpManager.get('systemNotice/unread', data: {
-      'userId': StoreProvider.of<AppState>(context).state.userInfo.id,
-      'statusFlag': 0
-    });
+    Result res = await HttpManager.get('systemNotice/unread', data: {'userId': StoreProvider.of<AppState>(context).state.userInfo.id, 'statusFlag': 0});
     if (res.success && res.data != null) {
       if (res.data > 0) {
         setState(() {
@@ -113,45 +127,31 @@ class _HomePageState extends State<HomePage> with WidgetsBindingObserver {
 
   @override
   Widget build(BuildContext context) {
-    return StoreConnector<AppState, UserInfo>(
-        converter: (Store store) => store.state.userInfo,
-        builder: (context, userInfo) {
-          return Scaffold(
-            drawer: HomeDrawer(),
-            body: WillPopScope(
-              child: Container(
-                width: double.infinity,
-                height: double.infinity,
-                decoration: BoxDecoration(
-                    gradient: LinearGradient(
-                        colors: [
-                          Color(0xFFC0C0C0),
-                          Color(0xFF3D4043),
-                          Color(0xFF383C40)
-                        ],
-                        begin: Alignment.topCenter,
-                        end: Alignment.bottomCenter,
-                        stops: [0.0, 0.15, 1.0])),
-                child: SafeArea(
-                  child: centerWidget(context, userInfo),
-                ),
-              ),
-              onWillPop: () {
-                Future.value(true);
-              },
-            ),
-            // floatingActionButton: floatWidget(),
-            // floatingActionButtonLocation:
-            //     FloatingActionButtonLocation.centerDocked,
-          );
-        });
+    return Scaffold(
+      drawer: HomeDrawer(),
+      body: WillPopScope(
+        child: Container(
+          width: double.infinity,
+          height: double.infinity,
+          decoration: BoxDecoration(
+              gradient: LinearGradient(
+                  colors: [Color.fromARGB(255, 177, 59, 56), Color.fromARGB(255, 147, 64, 61)], begin: Alignment.topCenter, end: Alignment.bottomCenter)),
+          child: SafeArea(
+            child: centerWidget(context),
+          ),
+        ),
+        onWillPop: () {
+          Future.value(true);
+        },
+      ),
+      // floatingActionButton: floatWidget(),
+      // floatingActionButtonLocation: FloatingActionButtonLocation.centerDocked,
+    );
   }
 
   Widget floatWidget() {
     return Container(
-      decoration: BoxDecoration(
-          borderRadius: BorderRadius.all(Radius.circular(100)),
-          border: Border.all(width: 1, color: Color(0xFF1B1C28))),
+      decoration: BoxDecoration(borderRadius: BorderRadius.all(Radius.circular(100)), border: Border.all(width: 1, color: Color(0xFF1B1C28))),
       width: 166,
       height: 166,
       margin: EdgeInsets.only(bottom: 84),
@@ -177,15 +177,14 @@ class _HomePageState extends State<HomePage> with WidgetsBindingObserver {
     );
   }
 
-  Widget centerWidget(BuildContext context, UserInfo userInfo) {
+  Widget centerWidget(BuildContext context) {
     double width = MediaQuery.of(context).size.width;
     double height = MediaQuery.of(context).size.height;
     String endSTring = '';
     if (seasonList.isNotEmpty) {
-      int _time = seasonList[nowIndex].competitionSeason.endTime -
-          DateTime.now().millisecondsSinceEpoch;
+      int _time = seasonList[nowIndex].competitionSeason.endTime - DateTime.now().millisecondsSinceEpoch;
       _time = _time ~/ 1000 ~/ 3600 ~/ 24;
-      endSTring = _time.toString();
+      endSTring = '倒计时 ' + _time.toString() + ' 天';
     }
 
     return Column(
@@ -204,13 +203,8 @@ class _HomePageState extends State<HomePage> with WidgetsBindingObserver {
                             Navigator.push(
                                 context,
                                 CupertinoPageRoute(
-                                    builder: (context) => RankList(
-                                        raceId: seasonList[index]
-                                            .competitionSeason
-                                            .id,
-                                        gameId: seasonList[index]
-                                            .competitionSeason
-                                            .gameId)));
+                                    builder: (context) =>
+                                        RankList(raceId: seasonList[index].competitionSeason.id, gameId: seasonList[index].competitionSeason.gameId)));
                           },
                           onIndexChanged: (index) {
                             setState(() {
@@ -220,29 +214,15 @@ class _HomePageState extends State<HomePage> with WidgetsBindingObserver {
                           itemBuilder: (context, index) {
                             return Center(
                                 child: Container(
-                              // width: 0.64 * (height - 334),
-                              // height: 0.64 * (height - 334),
-
-                              // decoration: BoxDecoration(image: DecorationImage(image: AssetImage('images/home_icon_yuan.png'), fit: BoxFit.contain)),
+                              width: 0.64 * (height - 334),
+                              height: 0.64 * (height - 334),
+                              decoration: BoxDecoration(image: DecorationImage(image: AssetImage('images/home_icon_yuan.png'), fit: BoxFit.contain)),
                               child: Column(
                                 mainAxisAlignment: MainAxisAlignment.center,
                                 children: <Widget>[
+                                  Text('赛季奖金', style: TextStyle(color: Color(0xFFFFFFFF), fontSize: 13)),
                                   Container(
-                                    width: double.infinity,
-                                    height: 52,
-                                    decoration: BoxDecoration(
-                                        image: DecorationImage(
-                                            image: AssetImage(
-                                                'images/img_guang_home.png'))),
-                                    child: Text(
-                                      '赛季奖金',
-                                      style: TextStyle(
-                                        color: Color(0xFFFFFFFF),
-                                        fontSize: 26,
-                                        fontFamily: 'Pangmen',
-                                      ),
-                                      textAlign: TextAlign.center,
-                                    ),
+                                    height: 0.1 * (height - 334),
                                   ),
                                   Row(
                                     mainAxisAlignment: MainAxisAlignment.center,
@@ -250,58 +230,24 @@ class _HomePageState extends State<HomePage> with WidgetsBindingObserver {
                                     children: _moneyList(),
                                   ),
                                   Container(
-                                    height: 15,
+                                    height: 0.06 * (height - 334),
                                   ),
-                                  seasonList[index]
-                                              .competitionSeason
-                                              .playerInfo
-                                              .rank !=
-                                          null
-                                      ? Text(
-                                          '当前排名 ' +
-                                              seasonList[index]
+                                  Column(
+                                    children: <Widget>[
+                                      Text('当前排名',
+                                          style: TextStyle(
+                                              color: Color(0xFFFFFFFF),
+                                              fontSize: 13)),
+                                      Text( seasonList[index]
                                                   .competitionSeason
                                                   .playerInfo
                                                   .rank
                                                   .toString(),
                                           style: TextStyle(
                                               color: Color(0xFFFFFFFF),
-                                              fontSize: 24,
-                                              fontFamily: 'Pangmen'))
-                                      : Container(),
-                                  Container(
-                                    height: 12,
-                                  ),
-                                  Text.rich(TextSpan(
-                                      children: [
-                                        TextSpan(text: "倒计时 "),
-                                        TextSpan(
-                                          text: endSTring,
-                                          style: TextStyle(fontSize: 27),
-                                        ),
-                                        TextSpan(
-                                          text: ' 天',
-                                        ),
-                                      ],
-                                      style: TextStyle(
-                                          color: Color(0xFFFFFFFF),
-                                          fontSize: 16,
-                                          fontFamily: 'Pangmen')))
-                                  // Container(
-                                  //   height: 0.06 * (height - 334),
-                                  // ),
-                                  // Column(
-                                  //   children: <Widget>[
-                                  //     Text('当前排名',
-                                  //         style: TextStyle(
-                                  //             color: Color(0xFFFFFFFF),
-                                  //             fontSize: 13)),
-                                  //     Text('2',
-                                  //         style: TextStyle(
-                                  //             color: Color(0xFFFFFFFF),
-                                  //             fontSize: 13))
-                                  //   ],
-                                  // )
+                                              fontSize: 13))
+                                    ],
+                                  )
                                 ],
                               ),
                             ));
@@ -309,45 +255,30 @@ class _HomePageState extends State<HomePage> with WidgetsBindingObserver {
                         )
                       : Container()),
               Positioned(
-                left: 26,
-                top: 10,
+                left: 10,
+                top: 0,
                 width: 48,
                 height: 48,
                 child: Material(
                   color: Colors.transparent,
                   child: Builder(
                     builder: (context) => InkWell(
-                        onTap: () {
-                          Scaffold.of(context).openDrawer();
-                        },
-                        child: Container(
-                          width: 48,
-                          height: 48,
-                          padding: EdgeInsets.all(5),
-                          decoration: BoxDecoration(
-                              gradient: LinearGradient(
-                                colors: [Color(0xFFFEFEFE), Color(0xFFBFBFBF)],
-                                begin: Alignment.topCenter,
-                                end: Alignment.bottomCenter,
-                              ),
-                              borderRadius:
-                                  BorderRadius.all(Radius.circular(100)),
-                              boxShadow: [
-                                //阴影
-                                BoxShadow(
-                                    color: Colors.black45,
-                                    offset: Offset(0, 2.0),
-                                    blurRadius: 6.0)
-                              ]),
-                          child: CircleAvatar(
-                            backgroundImage: NetworkImage(userInfo.icon),
+                          onTap: () {
+                            Scaffold.of(context).openDrawer();
+                          },
+                          child: Padding(
+                            padding: EdgeInsets.all(12),
+                            child: Image.asset(
+                              'images/person.png',
+                              width: 24,
+                            ),
                           ),
-                        )),
+                        ),
                   ),
                 ),
               ),
               Positioned(
-                right: 12,
+                right: 10,
                 top: 0,
                 width: 48,
                 height: 48,
@@ -355,16 +286,51 @@ class _HomePageState extends State<HomePage> with WidgetsBindingObserver {
                   color: Colors.transparent,
                   child: InkWell(
                     onTap: () {
-                      Navigator.push(context,
-                          CupertinoPageRoute(builder: (context) => Setting()));
+                      Navigator.push(context, CupertinoPageRoute(builder: (context) => Setting()));
                     },
                     child: Padding(
                       padding: EdgeInsets.all(12),
-                      child: Image.asset('images/setting.png', width: 19),
+                      child: Image.asset('images/setting.png', width: 24),
                     ),
                   ),
                 ),
               ),
+              Positioned(
+                top: 15,
+                left: 0,
+                right: 0,
+                child: Column(
+                  mainAxisAlignment: MainAxisAlignment.center,
+                  crossAxisAlignment: CrossAxisAlignment.center,
+                  children: <Widget>[
+                    // Text(
+                    //   seasonList.length > 0
+                    //       ? seasonList[nowIndex].competitionSeason.season
+                    //       : '',
+                    //   style: TextStyle(color: Colors.white, fontSize: 14),
+                    // ),
+                    Text(
+                      seasonList.isNotEmpty ? seasonList[nowIndex].gameName : '',
+                      style: TextStyle(color: Colors.white, fontSize: 14),
+                    )
+                  ],
+                ),
+              ),
+              Positioned(
+                bottom: 20,
+                left: 0,
+                right: 0,
+                child: Column(
+                  mainAxisAlignment: MainAxisAlignment.center,
+                  crossAxisAlignment: CrossAxisAlignment.center,
+                  children: <Widget>[
+                    Text(
+                      endSTring,
+                      style: TextStyle(color: Colors.white, fontSize: 14),
+                    )
+                  ],
+                ),
+              ),
             ],
           ),
         ),
@@ -373,108 +339,57 @@ class _HomePageState extends State<HomePage> with WidgetsBindingObserver {
             double aspectRatio = 1;
             aspectRatio = width / 334;
             return Container(
-              height: 338,
-              padding: EdgeInsets.fromLTRB(16, 34, 16, 26),
-              width: double.infinity,
-              decoration: BoxDecoration(
-                  gradient: LinearGradient(
-                colors: [
-                  Color(0xFF394247),
-                  Color(0xFF1C272D),
-                  Color(0xFF08141A)
-                ],
-                begin: Alignment.topCenter,
-                end: Alignment.bottomCenter,
-              )),
-              child: Column(
+              child: GridView.count(
+                physics: BouncingScrollPhysics(),
+                shrinkWrap: true,
+                crossAxisCount: 2,
+                childAspectRatio: aspectRatio,
                 children: <Widget>[
-                  Container(
-                    width: double.infinity,
-                    height: 108,
-                    child: HomeMenu(
-                      '开始游戏',
-                      onTapHomeMenu: () {
-                        Navigator.push(
-                            context,
-                            CupertinoPageRoute(
-                                builder: (context) => RoomList()));
-                      },
-                    ),
+                  HomeMenu(
+                    'images/home_icon_01.png',
+                    '加入比赛',
+                    onTapHomeMenu: () {
+                      // 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 CreateRoom();
+                      //     }));
+
+                      Navigator.push(context, CupertinoPageRoute(builder: (context) => OpenRoom(roomFlag: '0')));
+                    },
                   ),
-                  Container(
-                    height: 28,
+                  HomeMenu(
+                    'images/home_icon_02.png',
+                    '发起赛事',
+                    onTapHomeMenu: () {
+                      Navigator.push(context, CupertinoPageRoute(builder: (context) => RoomList()));
+                    },
+                  ),
+                  HomeMenu(
+                    'images/home_icon_03.png',
+                    '系统通知',
+                    onTapHomeMenu: () async {
+                      bool result = await Navigator.push(context, CupertinoPageRoute(builder: (context) => TipList()));
+                      if (result) {
+                        getUnreadMsg();
+                      }
+                    },
+                    showBadge: showBadge,
+                  ),
+                  HomeMenu(
+                    'images/home_icon_04.png',
+                    '充值',
+                    onTapHomeMenu: () {
+                      Navigator.push(context, CupertinoPageRoute(builder: (context) => ShoppingMall()));
+                    },
                   ),
-                  Row(
-                    children: <Widget>[
-                      Expanded(
-                        flex: 1,
-                        child: Column(
-                          children: <Widget>[
-                            Container(
-                              height: 67,
-                              child: HomeMenu(
-                                '新增',
-                                onTapHomeMenu: () {
-                                  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 CreateRoom();
-                                      }));
-                                },
-                              ),
-                            ),
-                            Container(
-                              height: 8,
-                            ),
-                            Container(
-                              height: 67,
-                              child: HomeMenu(
-                                '邮件',
-                                onTapHomeMenu: () {
-                                  Navigator.push(
-                                      context,
-                                      CupertinoPageRoute(
-                                          builder: (context) => TipList()));
-                                },
-                              ),
-                            )
-                          ],
-                        ),
-                      ),
-                      Container(
-                        width: 14,
-                      ),
-                      Expanded(
-                        flex: 1,
-                        child: Container(
-                          height: 142,
-                          child: HomeMenu(
-                            '商城',
-                            onTapHomeMenu: () {
-                              Navigator.push(
-                                  context,
-                                  CupertinoPageRoute(
-                                      builder: (context) => ShoppingMall()));
-                            },
-                          ),
-                        ),
-                      )
-                    ],
-                  )
                 ],
               ),
             );
@@ -488,13 +403,12 @@ class _HomePageState extends State<HomePage> with WidgetsBindingObserver {
     double height = MediaQuery.of(context).size.height;
     List<Widget> _list = [];
 
-    String bouns = (seasonList[nowIndex].competitionSeason.bonus / 1000)
-        .toStringAsFixed(1);
+    String bouns = (seasonList[nowIndex].competitionSeason.bonus / 1000).toStringAsFixed(1);
 
-    // String bouns = (6002222100 / 1000).toStringAsFixed(1);
+    // String bouns = (900000000100 / 1000).toStringAsFixed(1);
     // print(bouns);
     // print(bouns.indexOf('.0'));
-    if (bouns.indexOf('.0') != -1 || num.parse(bouns) > 99) {
+    if (bouns.indexOf('.0') != -1 || num.parse(bouns) > 999) {
       bouns = bouns.substring(0, bouns.length - 2);
     }
 
@@ -533,9 +447,7 @@ class _HomePageState extends State<HomePage> with WidgetsBindingObserver {
           _imageList.add('images/9.png');
           break;
         case '.':
-          _imageList.add('kong');
-          _imageList.add('images/dian.png');
-          _imageList.add('kong');
+          _imageList.add('.');
           break;
       }
     }
@@ -544,41 +456,26 @@ class _HomePageState extends State<HomePage> with WidgetsBindingObserver {
     }
 
     for (var item in _imageList) {
-      if (item == 'kong') {
-        _list.add(Container(
-          width: 5,
-        ));
-      } else {
-        if (_bounsList.length > 4) {
-          _list.add(Image.asset(item, height: 300 / _bounsList.length));
+      if (item != '.') {
+        if (_imageList.length > 4) {
+          double _scale = 1 - (_imageList.length - 4) * 0.2;
+          _list.add(Image.asset(item, height: 0.18 * 0.64 * (height - 334) * _scale));
         } else {
-          _list.add(Image.asset(item));
+          _list.add(Image.asset(item, height: 0.18 * 0.64 * (height - 334)));
         }
-      }
-
-      // if (item != '.') {
-      //   // if (_imageList.length > 4) {
-      //   //   double _scale = 1 - (_imageList.length - 4) * 0.2;
-      //   //   _list.add(Image.asset(item, height: 0.18 * 0.64 * (height - 334) * _scale));
-      //   // } else {
-      //   //   _list.add(Image.asset(item, height: 0.18 * 0.64 * (height - 334)));
-      //   // }
-      //   _list.add(Image.asset(item));
 
-      // } else {
-      //   _list.add(Text(
-      //     '.',
-      //     style: TextStyle(color: Colors.white, fontSize: 36, fontFamily: 'DINEngschrift', height: 0),
-      //   ));
-      // }
-    }
-    _list.add(Container(width: 5));
-    if (_bounsList.length > 4) {
-      _list.add(Image.asset('images/K.png', height: 300 / _bounsList.length));
-    } else {
-      _list.add(Image.asset('images/K.png'));
+        // _list.add(Container(width: 5));
+      } else {
+        _list.add(Text(
+          '.',
+          style: TextStyle(color: Colors.white, fontSize: 36, fontFamily: 'DINEngschrift', height: 1),
+        ));
+      }
     }
-
+    _list.add(Text(
+      'K',
+      style: TextStyle(color: Colors.white, fontSize: 24, fontFamily: 'DINEngschrift', height: .5),
+    ));
     return _list;
   }
 }
@@ -586,38 +483,47 @@ class _HomePageState extends State<HomePage> with WidgetsBindingObserver {
 typedef void OnTapHomeMenu();
 
 class HomeMenu extends StatelessWidget {
-  final String title;
+  final String icon;
+  final String name;
   final OnTapHomeMenu onTapHomeMenu;
   final bool showBadge;
-  HomeMenu(this.title, {this.onTapHomeMenu, this.showBadge = false});
+  HomeMenu(this.icon, this.name, {this.onTapHomeMenu, this.showBadge = false});
   @override
   Widget build(BuildContext context) {
     return Container(
-      padding: EdgeInsets.all(5),
       decoration: BoxDecoration(
           gradient: LinearGradient(
               begin: Alignment.topCenter,
               end: Alignment.bottomCenter,
-              colors: [Color(0xFFDFCF74), Color(0xFF6FB692)])),
+              stops: [0.0, 0.01, 0.8],
+              colors: [Color(0xFF7E89B7), Color(0xFF4E536F), Color(0xFF333558)])),
       child: Container(
         decoration: BoxDecoration(
-            gradient: LinearGradient(
-                begin: Alignment.topCenter,
-                end: Alignment.bottomCenter,
-                colors: [Color(0xFFFFC30F), Color(0xFFFFA54C)])),
+            border: Border(
+                // top: BorderSide(width: 2,color: Color(0xFF7E89B7)),
+                left: BorderSide(width: 0.5, color: Color(0x80000000)),
+                right: BorderSide(width: 0.5, color: Color(0x80000000)),
+                bottom: BorderSide(width: 1, color: Color(0x80000000)))),
         child: Material(
           color: Colors.transparent,
           child: InkWell(
             onTap: onTapHomeMenu,
             child: Container(
-              child: Center(
-                  child: Text(
-                title,
-                style: TextStyle(
-                    color: Color(0xFFFFFFFF),
-                    fontSize: 43,
-                    fontFamily: 'Pangmen'),
-              )),
+              child: Column(
+                mainAxisAlignment: MainAxisAlignment.center,
+                crossAxisAlignment: CrossAxisAlignment.center,
+                  children: <Widget>[
+                    Image.asset(
+                      icon,
+                      fit: BoxFit.contain,
+                    ),
+                    Container(height: 5,),
+                    Text(
+                      name,
+                      style: TextStyle(color: Colors.white, fontSize: 13),
+                    )
+                  ],
+                ),
             ),
           ),
         ),

+ 4 - 4
lib/pages/MyTeam.dart

@@ -147,7 +147,7 @@ class MyTeamState extends State<MyTeam> {
                                   Text(
                                     '我的上级',
                                     style: TextStyle(
-                                        color: Color(0xFFFFB726),
+                                        color: Theme.of(context).primaryColor,
                                         fontSize: 14,
                                         fontWeight: FontWeight.w500),
                                   ),
@@ -190,7 +190,7 @@ class MyTeamState extends State<MyTeam> {
                           Text(
                             '我的下级',
                             style: TextStyle(
-                                color: Color(0xFFFFB726),
+                                color:Theme.of(context).primaryColor,
                                 fontSize: 14,
                                 fontWeight: FontWeight.w500),
                           ),
@@ -275,11 +275,11 @@ class MyTeamState extends State<MyTeam> {
       _w = Container(
         child: Text(
           name,
-          style: TextStyle(fontSize: 12, color: Color(0xFFFFB726)),
+          style: TextStyle(fontSize: 12, color: Theme.of(context).primaryColor),
         ),
         padding: EdgeInsets.symmetric(vertical: 4, horizontal: 5),
         decoration: BoxDecoration(
-            border: Border.all(width: 1, color: Color(0xFFFFB726))),
+            border: Border.all(width: 1, color: Theme.of(context).primaryColor)),
       );
     }
 

+ 27 - 12
lib/pages/RecordList.dart

@@ -184,7 +184,8 @@ class RecordInfoState extends State<RecordInfo> {
                       }
                       return houseItem(
                           roomInfo: houseList[index],
-                          gameInfo: houseList[index].gameInfo);
+                          gameInfo: houseList[index].gameInfo,
+                          type:1);
                     })
                 : ListView.builder(
                     physics: AlwaysScrollableScrollPhysics(),
@@ -202,7 +203,7 @@ class RecordInfoState extends State<RecordInfo> {
                       return houseItem(
                           roomInfo: playerList[index].houseInfo,
                           gameInfo: playerList[index].gameInfo,
-                          playerInfo: playerList[index]);
+                          playerInfo: playerList[index],type:2);
                     }),
           )),
     );
@@ -210,22 +211,24 @@ class RecordInfoState extends State<RecordInfo> {
 }
 
 class houseItem extends StatelessWidget {
-  houseItem({Key key, this.roomInfo, this.gameInfo, this.playerInfo})
+  houseItem({Key key, this.roomInfo, this.gameInfo, this.playerInfo,this.type=0})
       : super(key: key);
   final HouseInfo roomInfo;
   final GameInfo gameInfo;
   final PlayerInfo playerInfo;
+  final int type;
 
   @override
   Widget build(BuildContext context) {
     List imageList = [
-      'images/zhanji_icon_01.png',
-      'images/zhanji_icon_02.png',
-      'images/zhanji_icon_03.png',
+      'images/jiangpai_huangjin.png',
+      'images/jiangpai_baiyin.png',
+      'images/jiangpai_qingtong.png',
       'images/zhanji_icon_04.png'
     ];
     String imageSrc = '';
     String tishiStr = '';
+    Color tishiColor;
     bool isImport = false;
     if (playerInfo != null) {
       if (playerInfo.houseRank != null) {
@@ -249,13 +252,16 @@ class houseItem extends StatelessWidget {
     } else {
       if (roomInfo.statusFlag == 0) {
         tishiStr = '未开始';
-        isImport = true;
+        tishiColor=Theme.of(context).primaryColor;
       } else if (roomInfo.statusFlag == 2) {
-        tishiStr = '比赛中';
+        tishiStr = '进行中';
+         tishiColor=Color(0xFFA9AABA);
       } else if (roomInfo.statusFlag == 4) {
-        tishiStr = '已完成';
+        tishiStr = '已结束';
+        tishiColor=Color(0xFF595B77);
       } else {
         tishiStr = '结算中';
+        tishiColor=Color(0xFF595B77);
       }
     }
 
@@ -334,12 +340,21 @@ class houseItem extends StatelessWidget {
                       ),
                     ),
                     imageSrc != ''
-                        ? Image.asset(imageSrc, width: 70)
-                        : Text(tishiStr,
+                        ? Image.asset(imageSrc)
+                        : (
+                          type==2?Text(tishiStr,
                             style: TextStyle(
                                 color:
                                     isImport ? PRIMARY_COLOR : Colors.white54,
-                                fontSize: 14))
+                                fontSize: 14)):Container(
+                                  color: tishiColor,
+                                  padding: EdgeInsets.symmetric(vertical: 4,horizontal: 9),
+                                  child: Text(tishiStr,style: TextStyle(
+                                    color: Color(0xFF252532),
+                                    fontSize: 12
+                                  ),),
+                                )
+                        )
                   ],
                 ),
               ),

+ 1 - 1
lib/pages/ShoppingMall.dart

@@ -184,7 +184,7 @@ class RechargeState extends State<Recharge> {
                           right: 0,
                           bottom: 0,
                           child: isChoose
-                              ? Image.asset('images/icon_xuanzhongl.png')
+                              ? Image.asset('images/icon_xuanzhong.png')
                               : Container(),
                         )
                       ],

+ 1 - 1
lib/pages/StartWindow.dart

@@ -51,7 +51,7 @@ class StartWindowState extends State<StartWindow> {
                   image: DecorationImage(
                     image: AssetImage('images/img_guangmang2.png'),
                   ),
-                  border: Border.all(width: 1, color: Color(0xFFFFB726))),
+                  border: Border.all(width: 1, color: Theme.of(context).primaryColor)),
               child: Stack(
                 children: <Widget>[
                   Padding(

+ 156 - 67
lib/pages/TipInfo.dart

@@ -11,6 +11,7 @@ import '../model/GameInfo.dart';
 import '../pages/RoomInfo.dart';
 import '../widget/SuccessfulReception.dart';
 import '../widget/LinearButton.dart';
+import '../model/PlayerInfo.dart';
 
 class TipInfo extends StatefulWidget {
   TipInfo({Key key, this.tipId}) : super(key: key);
@@ -20,13 +21,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(() {
@@ -34,20 +33,15 @@ class TipInfoState extends State<TipInfo> {
       });
     }
 
-
-    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);
@@ -62,8 +56,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,
@@ -80,7 +73,6 @@ class TipInfoState extends State<TipInfo> {
   void initState() {
     super.initState();
     Future.delayed(Duration.zero, () => getInfo());
-    
   }
 
   @override
@@ -106,35 +98,31 @@ class TipInfoState extends State<TipInfo> {
             child: Column(
               children: <Widget>[
                 Padding(
-                  padding: EdgeInsets.only(left: 15, right: 45),
+                  padding: EdgeInsets.only(left: 15, right: 15),
                   child: Column(
                     crossAxisAlignment: CrossAxisAlignment.start,
                     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,
                         color: Colors.black26,
                       ),
                       Padding(
-                        padding: EdgeInsets.only(top: 10, bottom: 17),
+                        padding: EdgeInsets.only(top: 10, bottom: 0),
                         child: Text(
                           tipInfo.content,
                           style: TextStyle(color: Colors.white, fontSize: 14),
                         ),
-                      )
+                      ),
+                       houseInfo != null ?Text('下方为优胜用户:',style:TextStyle(color: Colors.white, fontSize: 14)):Container(),
                     ],
                   ),
                 ),
-                houseInfo != null && type != 3
-                    ? houseItem(roomInfo: houseInfo, gameInfo: gameInfo)
-                    : Container(),
+                houseInfo != null ? RankContent(roomId: houseInfo.id.toString()) : Container(),
+                houseInfo != null && type != 3 ? houseItem(roomInfo: houseInfo, gameInfo: gameInfo) : Container(),
                 (type == 2 || type == 3)
                     ? Container(
                         width: double.infinity,
@@ -146,12 +134,8 @@ class TipInfoState extends State<TipInfo> {
                                 onTapHomeMenu: () 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});
+                                      ? 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) {
@@ -161,18 +145,11 @@ class TipInfoState extends State<TipInfo> {
                                     }
                                     getInfo();
                                   } else {
-                                    Toast.show(
-                                        context, res.error, 1000, 'info');
+                                    Toast.show(context, res.error, 1000, 'info');
                                   }
                                 },
                               )
-                            : LinearButton(
-                                btntext: '已领取',
-                                colorList: [
-                                  Color(0xFFC99C09),
-                                  Color(0xFFC7873E)
-                                ],
-                                textColor: Color(0xFF252532)),
+                            : LinearButton(btntext: '已领取', colorList: [Color(0xFFC99C09), Color(0xFFC7873E)], textColor: Color(0xFF252532)),
                       )
 
                     // RaisedButton(
@@ -260,34 +237,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,
                       )
@@ -299,15 +268,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)),
                     )
                   ],
                 )
@@ -315,14 +277,141 @@ class houseItem extends StatelessWidget {
             ),
           ),
           onTap: () {
-            Navigator.push(
-                context,
-                CupertinoPageRoute(
-                    builder: (context) =>
-                        RoomInfo(roomId: roomInfo.id.toString())));
+            Navigator.push(context, CupertinoPageRoute(builder: (context) => RoomInfo(roomId: roomInfo.id.toString())));
           },
         ),
       ),
     );
   }
 }
+
+//比赛结束排名
+class RankContent extends StatefulWidget {
+  RankContent({Key key, this.roomId}) : super(key: key);
+  final String roomId; // 用来储存传递过来的值
+  @override
+  RankContentState createState() => RankContentState();
+}
+
+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});
+    Toast.hide();
+    List<PlayerInfo> list = [];
+    if (res.success) {
+      for (var item in res.data['pp']) {
+        PlayerInfo jonPlayer = PlayerInfo.fromJson(item);
+        list.add(jonPlayer);
+      }
+    } else {}
+    setState(() {
+      topList = list;
+    });
+  }
+
+  @override
+  void initState() {
+    super.initState();
+    Future.delayed(Duration.zero, () {
+      getTopList();
+    });
+  }
+
+  @override
+  Widget build(BuildContext context) {
+    return Container(
+      width: double.infinity,
+      height: 180,
+      margin: EdgeInsets.only(top: 15),
+      child: Row(
+        mainAxisAlignment: MainAxisAlignment.center,
+        crossAxisAlignment: CrossAxisAlignment.end,
+        children: <Widget>[_rankItem(2), _rankItem(1), _rankItem(3)],
+      ),
+    );
+  }
+
+  Widget _rankItem(int _num) {
+    if (_num > topList.length) {
+      return Container(
+        width: 107,
+        height: 60,
+      );
+    }
+    List colorList = [
+      [Color(0xFFD48E00), Color(0xFFFECF01)],
+      [Color(0xFFC5C5C5), Color(0xFFE3E3E3)],
+      [Color(0xFFE77023), Color(0xFFF89E58)]
+    ];
+    List imgList = ['images/jiangpai_huangjin.png', 'images/jiangpai_baiyin.png', 'images/jiangpai_qingtong.png'];
+    return Container(
+      padding: EdgeInsets.only(left: 15, right: 15, top: _num == 1 ? 0 : 15),
+      width: 107,
+      child: Column(
+        crossAxisAlignment: CrossAxisAlignment.center,
+        children: <Widget>[
+          Container(
+            child: Stack(
+              children: <Widget>[
+                Container(
+                  margin: EdgeInsets.only(top: 17, bottom: 20),
+                  width: _num == 1 ? 70 : 60,
+                  height: _num == 1 ? 70 : 60,
+                  decoration: BoxDecoration(
+                    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)),
+                  )),
+                ),
+                Positioned(
+                  bottom: 0,
+                  child: Center(
+                    child: Image.asset(
+                      'images/ph_yinpai_no' + '$_num.png',
+                      width: 67,
+                    ),
+                  ),
+                ),
+                Positioned(
+                  top: 0,
+                  left: _num == 1 ? 19 : 14,
+                  child: Center(
+                    child: Image.asset(
+                      imgList[_num - 1],
+                    ),
+                  ),
+                ),
+              ],
+            ),
+          ),
+          Text(
+            topList[_num - 1].userInfo.nickname,
+            style: TextStyle(
+              color: Color(0xFFFDC372),
+              fontSize: 12,
+            ),
+            overflow: TextOverflow.ellipsis,
+            textAlign: TextAlign.center,
+          ),
+          SizedBox(
+            height: 5,
+          ),
+          Row(
+            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))
+            ],
+          )
+        ],
+      ),
+    );
+  }
+}

+ 1 - 1
lib/pages/TipList.dart

@@ -155,7 +155,7 @@ class TipItem extends StatelessWidget {
                     children: <Widget>[
                       Text(readTimestamp(tipInfo.createTime, 'yyyy.MM.dd HH:mm:ss'), style: TextStyle(color: Color(0xFF9BA0AE), fontSize: 13)),
                       tipInfo.statusFlag == 0
-                          ? Text('未读', style: TextStyle(color: Color(0xFFFFB726), fontSize: 13, fontWeight: FontWeight.w600))
+                          ? Text('未读', style: TextStyle(color:Theme.of(context).primaryColor, fontSize: 13, fontWeight: FontWeight.w600))
                           : Text('已读', style: TextStyle(color: Color(0xFF000000), fontSize: 13, fontWeight: FontWeight.w600))
                     ],
                   ),

+ 3 - 0
lib/pages/changeUserInfo.dart

@@ -76,6 +76,9 @@ class ChangeUserInfoState extends State<ChangeUserInfo> {
                           ),
                         ),
                         Container(
+
+
+                          
                           margin: EdgeInsets.only(top: 30),
                           width: double.infinity,
                           height: 48,

+ 1 - 1
lib/pages/loginSecond.dart

@@ -75,7 +75,7 @@ class LoginSecondState extends State<LoginSecond> {
                                 children: <Widget>[
                                   Text(widget.phone,
                                       style: TextStyle(
-                                          color: Color(0xFFFFB726),
+                                          color: Theme.of(context).primaryColor,
                                           fontSize: 20,
                                           fontWeight: FontWeight.w500)),
                                   FlatButton(

+ 1 - 1
lib/pages/myWallet.dart

@@ -149,7 +149,7 @@ class MyWalletState extends State<MyWallet> {
               //背景装饰
               gradient: LinearGradient(
             begin: Alignment.bottomRight,
-            colors: [Color(0xFFFFE6B5),Color(0xFFFFB726), PRIMARY_COLOR],
+            colors: [Color(0xFFFFE6B5),Theme.of(context).primaryColor, PRIMARY_COLOR],
           )),
           child: Stack(
             overflow: Overflow.visible,

Некоторые файлы не были показаны из-за большого количества измененных файлов