소스 검색

弹出框

panhui 6 년 전
부모
커밋
13b2595089

BIN
images/icon_next.png


BIN
images/icon_pre.png


BIN
images/img_guangmang.png


BIN
images/img_guangmang_huang.png


BIN
images/img_xuzhi_02.png


BIN
images/img_xuzhi_03.png


BIN
images/img_xuzhi_04.png


BIN
images/tancuang_huang_shang.png


BIN
images/tancuang_huang_xia.png


BIN
images/tancuang_shang.png


BIN
images/tancuang_xia.png


+ 3 - 1
lib/main.dart

@@ -35,6 +35,7 @@ class MobileCyberGamesApp extends StatelessWidget {
           ChineseCupertinoLocalizations.delegate,
           ChineseCupertinoLocalizations.delegate,
         ],
         ],
         theme: ThemeData(
         theme: ThemeData(
+            // dialogBackgroundColor: Colors.orange,
             cardColor: Color(0xFF2B2B42),
             cardColor: Color(0xFF2B2B42),
             backgroundColor: Color(0xFF222335),
             backgroundColor: Color(0xFF222335),
             primaryColor: Color(0xFFC2524D),
             primaryColor: Color(0xFFC2524D),
@@ -68,7 +69,8 @@ void main() async {
     production: true,
     production: true,
     debug: true,
     debug: true,
   );
   );
-  jpush.applyPushAuthority(new NotificationSettingsIOS(sound: true, alert: true, badge: true));
+  jpush.applyPushAuthority(
+      new NotificationSettingsIOS(sound: true, alert: true, badge: true));
   final prefs = await SharedPreferences.getInstance();
   final prefs = await SharedPreferences.getInstance();
   print(prefs.getString('token'));
   print(prefs.getString('token'));
   HttpManager.token = prefs.getString('token') ?? "";
   HttpManager.token = prefs.getString('token') ?? "";

+ 2 - 1
lib/model/CompetitionSeason.g.dart

@@ -16,7 +16,8 @@ CompetitionSeason _$CompetitionSeasonFromJson(Map<String, dynamic> json) {
       json['bonus'] as int,
       json['bonus'] as int,
       json['statusFlag'] as int,
       json['statusFlag'] as int,
       json['gameId'] as int,
       json['gameId'] as int,
-      GameInfo.fromJson((json['gameInfo'] as Map))
+
+      json['gameInfo']!=null?GameInfo.fromJson(json['gameInfo']):GameInfo.empty()
       );
       );
 }
 }
 
 

+ 3 - 1
lib/model/GameInfo.dart

@@ -4,11 +4,13 @@ part 'GameInfo.g.dart';
 
 
 @JsonSerializable()
 @JsonSerializable()
 class GameInfo {
 class GameInfo {
-  GameInfo(this.id, this.gameName, this.icon, this.typeFlag);
+  GameInfo(this.id, this.gameName, this.icon, this.typeFlag,this.shortName,this.profile);
   int id;
   int id;
   String gameName;//名称
   String gameName;//名称
   String icon;//图标
   String icon;//图标
   int typeFlag;//类型
   int typeFlag;//类型
+  String shortName;//简称
+  String profile;//简介
   factory GameInfo.fromJson(Map<String, dynamic> json) =>
   factory GameInfo.fromJson(Map<String, dynamic> json) =>
       _$GameInfoFromJson(json);
       _$GameInfoFromJson(json);
 
 

+ 11 - 2
lib/model/GameInfo.g.dart

@@ -7,17 +7,26 @@ part of 'GameInfo.dart';
 // **************************************************************************
 // **************************************************************************
 
 
 GameInfo _$GameInfoFromJson(Map<String, dynamic> json) {
 GameInfo _$GameInfoFromJson(Map<String, dynamic> json) {
-  return GameInfo(json['id'] as int, json['gameName'] as String,
-      json['icon'] as String, json['typeFlag'] as int);
+  return GameInfo(
+      json['id'] as int,
+      json['gameName'] as String,
+      json['icon'] as String,
+      json['typeFlag'] as int,
+      json['shortName'] as String,
+      json['profile'] as String);
 }
 }
 
 
 //  int id;
 //  int id;
 //   String gameName;//名称
 //   String gameName;//名称
 //   String icon;//图标
 //   String icon;//图标
 //   int typeFlag;//类型
 //   int typeFlag;//类型
+// String shortName;//简称
+// String profile;//简介
 Map<String, dynamic> _$GameInfoToJson(GameInfo instance) => <String, dynamic>{
 Map<String, dynamic> _$GameInfoToJson(GameInfo instance) => <String, dynamic>{
       'id': instance.id,
       'id': instance.id,
       'gameName': instance.gameName,
       'gameName': instance.gameName,
       'icon': instance.icon,
       'icon': instance.icon,
       'typeFlag': instance.typeFlag,
       'typeFlag': instance.typeFlag,
+      'shortName': instance.shortName,
+      'profile': instance.profile
     };
     };

+ 24 - 0
lib/model/GameInfoSeasons.dart

@@ -0,0 +1,24 @@
+import 'package:json_annotation/json_annotation.dart';
+import 'CompetitionSeason.dart';
+
+part 'GameInfoSeasons.g.dart';
+
+@JsonSerializable()
+class GameInfoSeasons {
+  GameInfoSeasons(this.id, this.gameName, this.typeFlag,this.competitionSeason);
+  int id;
+  String gameName;//名称
+  int typeFlag;//类型
+  CompetitionSeason competitionSeason;
+  factory GameInfoSeasons.fromJson(Map<String, dynamic> json) =>
+      _$GameInfoSeasonsFromJson(json);
+
+  Map<String, dynamic> toJson() => _$GameInfoSeasonsToJson(this);
+  // 命名构造函数
+  GameInfoSeasons.empty();
+  @override
+  String toString() {
+    return _$GameInfoSeasonsToJson(this).toString();
+  }
+}
+  

+ 29 - 0
lib/model/GameInfoSeasons.g.dart

@@ -0,0 +1,29 @@
+// GENERATED CODE - DO NOT MODIFY BY HAND
+
+part of 'GameInfoSeasons.dart';
+
+// **************************************************************************
+// JsonSerializableGenerator
+// **************************************************************************
+
+GameInfoSeasons _$GameInfoSeasonsFromJson(Map<String, dynamic> json) {
+  return GameInfoSeasons(
+      json['id'] as int,
+      json['gameName'] as String,
+      json['typeFlag'] as int,
+      json['competitionSeason'] != null
+          ? CompetitionSeason.fromJson(json['competitionSeason'])
+          : CompetitionSeason.empty());
+}
+
+// int id;
+// String gameName; //名称
+// int typeFlag; //类型
+// CompetitionSeason competitionSeason;
+Map<String, dynamic> _$GameInfoSeasonsToJson(GameInfoSeasons instance) =>
+    <String, dynamic>{
+      'id': instance.id,
+      'gameName': instance.gameName,
+      'typeFlag': instance.typeFlag,
+      'competitionSeason': instance.competitionSeason
+    };

+ 6 - 2
lib/model/HouseInfo.dart

@@ -22,7 +22,9 @@ class HouseInfo {
       this.houseLevel,
       this.houseLevel,
       this.gameHouseId,
       this.gameHouseId,
       this.gameHousePassword,
       this.gameHousePassword,
-      this.statusFlag);
+      this.statusFlag,
+      this.createUser,
+      this.beginTime);
   int id;
   int id;
   int gameId; //游戏ID
   int gameId; //游戏ID
   int userId; //用户ID
   int userId; //用户ID
@@ -31,7 +33,7 @@ class HouseInfo {
   String houseAbstract; //房间描述
   String houseAbstract; //房间描述
   String video; //视频
   String video; //视频
   GameInfo gameInfo; //游戏信息
   GameInfo gameInfo; //游戏信息
-  int playerNumber;//加入人数
+  int playerNumber; //加入人数
   int maxNumber; //最大加入人数
   int maxNumber; //最大加入人数
   int bonus; //奖金
   int bonus; //奖金
   int houseType; //0为个人1为官方
   int houseType; //0为个人1为官方
@@ -39,6 +41,8 @@ class HouseInfo {
   String gameHouseId; //游戏房间号
   String gameHouseId; //游戏房间号
   String gameHousePassword; //游戏密码
   String gameHousePassword; //游戏密码
   int statusFlag; //状态
   int statusFlag; //状态
+  String createUser; //创建人
+  int beginTime; //开始时间
   factory HouseInfo.fromJson(Map<String, dynamic> json) =>
   factory HouseInfo.fromJson(Map<String, dynamic> json) =>
       _$HouseInfoFromJson(json);
       _$HouseInfoFromJson(json);
 
 

+ 23 - 20
lib/model/HouseInfo.g.dart

@@ -8,25 +8,26 @@ part of 'HouseInfo.dart';
 
 
 HouseInfo _$HouseInfoFromJson(Map<String, dynamic> json) {
 HouseInfo _$HouseInfoFromJson(Map<String, dynamic> json) {
   return HouseInfo(
   return HouseInfo(
-    json['id'] as int,
-    json['gameId'] as int,
-    json['userId'] as int,
-    json['seasonId'] as int,
-    json['houseName'] as String,
-    json['houseAbstract'] as String,
-    json['video'] as String,
-    json['gameInfo'] != null ? GameInfo.fromJson(json['gameInfo']) : null,
-    json['playerNumber'] as int,
-    json['maxNumber'] as int,
-    json['bonus'] as int,
-    json['houseType'] as int,
-    json['houseLevelInfo'] != null
-        ? HouseLevel.fromJson(json['houseLevelInfo'])
-        : null,
-    json['gameHouseId'] as String,
-    json['gameHousePassword'] as String,
-    json['statusFlag'] as int,
-  );
+      json['id'] as int,
+      json['gameId'] as int,
+      json['userId'] as int,
+      json['seasonId'] as int,
+      json['houseName'] as String,
+      json['houseAbstract'] as String,
+      json['video'] as String,
+      json['gameInfo'] != null ? GameInfo.fromJson(json['gameInfo']) : null,
+      json['playerNumber'] as int,
+      json['maxNumber'] as int,
+      json['bonus'] as int,
+      json['houseType'] as int,
+      json['houseLevelInfo'] != null
+          ? HouseLevel.fromJson(json['houseLevelInfo'])
+          : null,
+      json['gameHouseId'] as String,
+      json['gameHousePassword'] as String,
+      json['statusFlag'] as int,
+      json['createUser'] as String,
+      json['beginTime'] as int);
 }
 }
 
 
 //  int id;
 //  int id;
@@ -61,5 +62,7 @@ Map<String, dynamic> _$HouseInfoToJson(HouseInfo instance) => <String, dynamic>{
       'houseLevel': instance.houseLevel,
       'houseLevel': instance.houseLevel,
       'gameHouseId': instance.gameHouseId,
       'gameHouseId': instance.gameHouseId,
       'gameHousePassword': instance.gameHousePassword,
       'gameHousePassword': instance.gameHousePassword,
-      'statusFlag': instance.statusFlag
+      'statusFlag': instance.statusFlag,
+      'createUser': instance.createUser,
+      'beginTime':instance.beginTime
     };
     };

+ 2 - 1
lib/model/UserInfo.dart

@@ -5,7 +5,7 @@ part 'UserInfo.g.dart';
 @JsonSerializable()
 @JsonSerializable()
 class UserInfo {
 class UserInfo {
   UserInfo(this.id, this.nickname, this.username, this.icon, this.phone,
   UserInfo(this.id, this.nickname, this.username, this.icon, this.phone,
-      this.sex, this.moneyCoin, this.moneyPoint,this.birthday,this.noticeFlag);
+      this.sex, this.moneyCoin, this.moneyPoint,this.birthday,this.noticeFlag,this.remindFlag);
   int id;
   int id;
   String nickname;
   String nickname;
   String username;
   String username;
@@ -16,6 +16,7 @@ class UserInfo {
   double moneyPoint; //积分
   double moneyPoint; //积分
   int birthday;
   int birthday;
   bool noticeFlag;//是否通知
   bool noticeFlag;//是否通知
+   bool remindFlag;//是否通知
   factory UserInfo.fromJson(Map<String, dynamic> json) =>
   factory UserInfo.fromJson(Map<String, dynamic> json) =>
       _$UserInfoFromJson(json);
       _$UserInfoFromJson(json);
 
 

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

@@ -17,7 +17,8 @@ UserInfo _$UserInfoFromJson(Map<String, dynamic> json) {
       (json['moneyCoin'] as num)?.toInt(),
       (json['moneyCoin'] as num)?.toInt(),
       (json['moneyPoint'] as num)?.toDouble(),
       (json['moneyPoint'] as num)?.toDouble(),
       json['birthday'] as int,
       json['birthday'] as int,
-      json['noticeFlag']=='Y');
+      json['noticeFlag']=='Y',
+      json['remindFlag']=='Y');
 }
 }
 
 
 Map<String, dynamic> _$UserInfoToJson(UserInfo instance) => <String, dynamic>{
 Map<String, dynamic> _$UserInfoToJson(UserInfo instance) => <String, dynamic>{
@@ -30,5 +31,6 @@ Map<String, dynamic> _$UserInfoToJson(UserInfo instance) => <String, dynamic>{
       'moneyCoin': instance.moneyCoin,
       'moneyCoin': instance.moneyCoin,
       'moneyPoint': instance.moneyPoint,
       'moneyPoint': instance.moneyPoint,
       'birthday': instance.birthday,
       'birthday': instance.birthday,
-      'noticeFlag':instance.noticeFlag
+      'noticeFlag':instance.noticeFlag,
+      'remindFlag':instance.remindFlag
     };
     };

+ 278 - 0
lib/pages/CompetitionInformation.dart

@@ -0,0 +1,278 @@
+import 'package:flutter/material.dart';
+import 'package:flutter_swiper/flutter_swiper.dart';
+import 'package:flutter_redux/flutter_redux.dart';
+import '../redux/AppState.dart';
+import '../net/Result.dart';
+import '../net/HttpManager.dart';
+import '../redux/UserRedux.dart';
+import '../model/UserInfo.dart';
+
+//竞赛须知
+class CompetitionInformation extends StatefulWidget {
+  @override
+  CompetitionInformationState createState() => CompetitionInformationState();
+}
+
+class CompetitionInformationState extends State<CompetitionInformation> {
+  int nowSwiperIndex = 0;
+  SwiperController _swiperController;
+  @override
+  void initState() {
+    super.initState();
+    _swiperController = SwiperController();
+  }
+
+  @override
+  Widget build(BuildContext context) {
+    return WillPopScope(
+      child: Scaffold(
+        backgroundColor: Colors.black87,
+        body: Container(
+            child: Center(
+                child: Swiper(
+                    controller: _swiperController,
+                    layout: SwiperLayout.TINDER,
+                    itemWidth: 270.0,
+                    itemHeight: 422.0,
+                    control: SwiperControl(
+                        color: Color(0xFFC2524D),
+                        disableColor: Colors.transparent),
+                    index: nowSwiperIndex,
+                    itemCount: 4,
+                    scrollDirection: Axis.horizontal,
+                    loop: false,
+                    itemBuilder: (context, index) {
+                      return InfoBox(
+                          typeIndex: index + 1,
+                          next: () {
+                            _swiperController.next();
+                          },
+                          end: () {
+                            Navigator.of(context).pop();
+                          });
+                    }))),
+      ),
+      onWillPop: () {
+        return Future.value(false);
+      },
+    );
+  }
+}
+
+typedef int OnTapHomeMenu();
+
+class InfoBox extends StatelessWidget {
+  InfoBox({Key key, this.typeIndex, this.next, this.end}) : super(key: key);
+  final int typeIndex;
+  final OnTapHomeMenu next;
+  final OnTapHomeMenu end;
+  @override
+  Widget build(BuildContext context) {
+    return UnconstrainedBox(
+        child: Container(
+      width: 270,
+      height: 422,
+      decoration: BoxDecoration(
+          border: Border.all(width: 1, color: Color(0xFFC2524D)),
+          color: Colors.black),
+      child: Stack(
+        children: <Widget>[
+          Container(
+            width: 270,
+            padding: EdgeInsets.only(top: 25),
+            child: Column(
+              children: <Widget>[
+                Text('竞赛须知 ' + typeIndex.toString() + '/4',
+                    style: TextStyle(
+                        color: Color(0xFFFDC372),
+                        fontSize: 20,
+                        fontWeight: FontWeight.w600)),
+                _centerContent(typeIndex)
+              ],
+            ),
+          ),
+          Positioned(
+            top: 0,
+            left: 0,
+            child: Image.asset(
+              'images/tancuang_shang.png',
+              width: 131,
+            ),
+          ),
+          Positioned(
+            bottom: 0,
+            right: 4,
+            child: Image.asset(
+              'images/tancuang_xia.png',
+              width: 148,
+            ),
+          ),
+          Positioned(
+            bottom: 15,
+            left: 25,
+            child: Column(
+              children: <Widget>[
+                Container(
+                  width: 220,
+                  height: 36,
+                  child: RaisedButton(
+                    textColor: Colors.white,
+                    child: Text(typeIndex != 4 ? '下一个' : '结束'),
+                    onPressed: typeIndex != 4 ? next : end,
+                  ),
+                ),
+                FlatButton(
+                  textColor: Color(0xFF727785),
+                  highlightColor: Colors.transparent,
+                  splashColor: Colors.transparent,
+                  child: Text('不再提醒'),
+                  onPressed: () async {
+                    Result res =
+                        await HttpManager.post('userInfo/update', data: {
+                      "id":
+                          StoreProvider.of<AppState>(context).state.userInfo.id,
+                      'remindFlag': 'N'
+                    });
+                    if (res.success) {
+                      Result res2 =
+                          await HttpManager.get("userInfo/getUserInfo");
+                      if (res2.success) {
+                        StoreProvider.of<AppState>(context).dispatch(
+                            UpdateUserAction(UserInfo.fromJson(res2.data)));
+                      }
+                    }
+
+                    Navigator.of(context).pop();
+                  },
+                )
+              ],
+            ),
+          )
+        ],
+      ),
+    ));
+  }
+
+  Widget _centerContent(int index) {
+    Widget useContent = Container();
+    TextStyle _text = TextStyle(color: Colors.white, fontSize: 14);
+    if (index == 1) {
+      useContent = Container(
+        margin: EdgeInsets.only(top: 42),
+        child: Column(
+          children: <Widget>[
+            Image.asset('images/icon_jinbi_da_hong.png', width: 30),
+            Container(
+              height: 20,
+            ),
+            Text(
+              '房间人数越多,总奖金就越多',
+              style: _text,
+            ),
+            Text('第一名获得50%', style: _text),
+            Text('第二名获得30%', style: _text),
+            Text('第三名获得20%', style: _text),
+            Text('其他名次没有奖励', style: _text)
+          ],
+        ),
+      );
+    } else if (index == 2) {
+      useContent = Container(
+        margin: EdgeInsets.only(top: 20),
+        padding: EdgeInsets.symmetric(horizontal: 20),
+        child: Column(
+          children: <Widget>[
+            Image.asset('images/img_xuzhi_02.png', width: 136),
+            Container(
+              height: 10,
+            ),
+            Text.rich(
+                TextSpan(children: [
+                  TextSpan(
+                    text: '竞赛开始前请在此耐心等待,在开始时会有上图所示弹窗,玩家必须在10秒内',
+                    style: _text,
+                  ),
+                  TextSpan(
+                    text: '点击确认',
+                    style: TextStyle(
+                        color: Color(0xFFC2524D),
+                        fontSize: 14,
+                        fontWeight: FontWeight.w500),
+                  ),
+                  TextSpan(
+                    text: ',否则视为放弃此次竞赛,已支付金币概不退换',
+                    style: _text,
+                  )
+                ]),
+                textAlign: TextAlign.center)
+          ],
+        ),
+      );
+    } else if (index == 3) {
+      useContent = Container(
+        margin: EdgeInsets.only(top: 20),
+        padding: EdgeInsets.symmetric(horizontal: 20),
+        child: Column(
+          children: <Widget>[
+            Image.asset('images/img_xuzhi_03.png', width: 176),
+            Container(
+              height: 10,
+            ),
+            Text.rich(
+                TextSpan(children: [
+                  TextSpan(
+                    text: '确认竞赛后会有弹窗提示授权进行录屏的操作,请一定',
+                    style: _text,
+                  ),
+                  TextSpan(
+                    text: '点击“确定”',
+                    style: TextStyle(
+                        color: Color(0xFFC2524D),
+                        fontSize: 14,
+                        fontWeight: FontWeight.w500),
+                  ),
+                  TextSpan(
+                    text: '或“允许”此操作,否则竞赛判定失败',
+                    style: _text,
+                  )
+                ]),
+                textAlign: TextAlign.center)
+          ],
+        ),
+      );
+    } else if (index == 4) {
+      useContent = Container(
+        margin: EdgeInsets.only(top: 20),
+        padding: EdgeInsets.symmetric(horizontal: 20),
+        child: Column(
+          children: <Widget>[
+            Image.asset('images/img_xuzhi_04.png', width: 216),
+            Container(
+              height: 10,
+            ),
+            Text.rich(
+                TextSpan(children: [
+                  TextSpan(
+                    text: '在游戏比赛结束后,',
+                    style: _text,
+                  ),
+                  TextSpan(
+                    text: '请一定要点击查看游戏最后的分数名次结算页面',
+                    style: TextStyle(
+                        color: Color(0xFFC2524D),
+                        fontSize: 14,
+                        fontWeight: FontWeight.w500),
+                  ),
+                  TextSpan(
+                    text: ',返回游戏主页,最后再切换到我们竞赛app中,点击完成比赛,方可成功长传本次成绩,赢取大奖',
+                    style: _text,
+                  )
+                ]),
+                textAlign: TextAlign.center)
+          ],
+        ),
+      );
+    }
+    return useContent;
+  }
+}

+ 48 - 11
lib/pages/CreateRoom.dart

@@ -16,11 +16,11 @@ class CreateRoom extends StatelessWidget {
             child: Column(
             child: Column(
               mainAxisAlignment: MainAxisAlignment.center,
               mainAxisAlignment: MainAxisAlignment.center,
               children: <Widget>[
               children: <Widget>[
-                _CreateRoomBtn("创建普通房间"),
+                _CreateRoomBtn("创建普通房间",0),
                 SizedBox(
                 SizedBox(
                   height: 36,
                   height: 36,
                 ),
                 ),
-                _CreateRoomBtn("创建官方房间")
+                _CreateRoomBtn("创建官方房间", 1)
               ],
               ],
             ),
             ),
           ),
           ),
@@ -32,24 +32,61 @@ class CreateRoom extends StatelessWidget {
 
 
 class _CreateRoomBtn extends StatelessWidget {
 class _CreateRoomBtn extends StatelessWidget {
   final String title;
   final String title;
-  _CreateRoomBtn(this.title);
+  final int btnIndex;
+  _CreateRoomBtn(this.title, this.btnIndex);
+
+  List<Color> colorList=[Color(0xFFC2524D),Color(0xFFFDC372)];
+  List<List<String>> imageList=[[
+    'images/tancuang_shang.png',
+    'images/tancuang_xia.png'
+  ],[
+    'images/tancuang_huang_shang.png',
+    'images/tancuang_huang_xia.png'
+  ]];
+
   @override
   @override
   Widget build(BuildContext context) {
   Widget build(BuildContext context) {
     return GestureDetector(
     return GestureDetector(
       onTap: () {
       onTap: () {
-        Navigator.push(context, new CupertinoPageRoute(builder: (context) => new OpenRoom(roomFlag: this.title == '创建普通房间' ? '0' : '1')));
+        Navigator.push(
+            context,
+            new CupertinoPageRoute(
+                builder: (context) => new OpenRoom(
+                    roomFlag: this.title == '创建普通房间' ? '0' : '1')));
       },
       },
       child: Container(
       child: Container(
         width: 250,
         width: 250,
         height: 96,
         height: 96,
         decoration: BoxDecoration(
         decoration: BoxDecoration(
-            border: Border.all(width: 1, color: Color(0x80000000)),
-            gradient: LinearGradient(colors: [Color(0xFF626C85), Color(0xFF3D3E6C)], begin: Alignment.topCenter, end: Alignment.bottomCenter)),
-        child: Center(
-          child: Text(
-            title,
-            style: TextStyle(color: Colors.white, fontSize: 22),
-          ),
+            border: Border.all(width: 1, color: colorList[btnIndex]),
+            image: DecorationImage(
+                image: AssetImage('images/img_guangmang.png'),
+                fit: BoxFit.cover)),
+        child: Stack(
+          children: <Widget>[
+            Center(
+              child: Text(
+                title,
+                style: TextStyle(color: colorList[btnIndex], fontSize: 22),
+              ),
+            ),
+            Positioned(
+              top: 0,
+              left: 0,
+              child: Image.asset(
+                imageList[btnIndex][0],
+                width: 131,
+              ),
+            ),
+            Positioned(
+              bottom: 0,
+              right: 4,
+              child: Image.asset(
+                imageList[btnIndex][1],
+                width: 148,
+              ),
+            )
+          ],
         ),
         ),
       ),
       ),
     );
     );

+ 28 - 29
lib/pages/HomePage.dart

@@ -1,13 +1,12 @@
 import 'package:flutter/material.dart';
 import 'package:flutter/material.dart';
 import '../widget/HomeDrawer.dart';
 import '../widget/HomeDrawer.dart';
-import 'Setting.dart';
 import 'CreateRoom.dart';
 import 'CreateRoom.dart';
 import 'RoomList.dart';
 import 'RoomList.dart';
 import 'rankList.dart';
 import 'rankList.dart';
 import 'roomInfo.dart';
 import 'roomInfo.dart';
 import 'package:flutter/cupertino.dart';
 import 'package:flutter/cupertino.dart';
 import 'package:flutter_swiper/flutter_swiper.dart';
 import 'package:flutter_swiper/flutter_swiper.dart';
-import '../model/CompetitionSeason.dart';
+import '../model/GameInfoSeasons.dart';
 import '../styles/totast.dart';
 import '../styles/totast.dart';
 import '../net/HttpManager.dart';
 import '../net/HttpManager.dart';
 import '../net/Result.dart';
 import '../net/Result.dart';
@@ -21,19 +20,19 @@ class HomePage extends StatefulWidget {
 }
 }
 
 
 class _HomePageState extends State<HomePage> with WidgetsBindingObserver {
 class _HomePageState extends State<HomePage> with WidgetsBindingObserver {
-  List<CompetitionSeason> seasonList = [];
+  List<GameInfoSeasons> seasonList = [];
   int nowIndex = 0;
   int nowIndex = 0;
   PageController _pageController;
   PageController _pageController;
   bool showBadge = false;
   bool showBadge = false;
 
 
   void getSeasonInfo() async {
   void getSeasonInfo() async {
     Toast.show(context, '加载中', -1, 'loading');
     Toast.show(context, '加载中', -1, 'loading');
-    Result res = await HttpManager.get("competitionSeason/all");
+    Result res = await HttpManager.get("gameInfo/seasons");
     Toast.hide();
     Toast.hide();
     if (res.success) {
     if (res.success) {
-      List<CompetitionSeason> list = [];
+      List<GameInfoSeasons> list = [];
       for (var item in res.data) {
       for (var item in res.data) {
-        list.add(CompetitionSeason.fromJson(item));
+        list.add(GameInfoSeasons.fromJson(item));
       }
       }
       setState(() {
       setState(() {
         seasonList = list;
         seasonList = list;
@@ -148,9 +147,9 @@ class _HomePageState extends State<HomePage> with WidgetsBindingObserver {
                           index: nowIndex,
                           index: nowIndex,
                           itemCount: seasonList.length,
                           itemCount: seasonList.length,
                           scrollDirection: Axis.horizontal,
                           scrollDirection: Axis.horizontal,
-                          loop: true,
+                          loop: false,
                           onTap: (index) {
                           onTap: (index) {
-                            Navigator.push(context, new CupertinoPageRoute(builder: (context) => new RankList(raceId: seasonList[index].id)));
+                            Navigator.push(context, new CupertinoPageRoute(builder: (context) => new RankList(raceId: seasonList[index].id,gameId:seasonList[index].competitionSeason.gameId)));
                           },
                           },
                           onIndexChanged: (index) {
                           onIndexChanged: (index) {
                             setState(() {
                             setState(() {
@@ -172,7 +171,7 @@ class _HomePageState extends State<HomePage> with WidgetsBindingObserver {
                                           textBaseline: TextBaseline.alphabetic,
                                           textBaseline: TextBaseline.alphabetic,
                                           children: <Widget>[
                                           children: <Widget>[
                                             Text(
                                             Text(
-                                              (seasonList[index].bonus / 1000).toStringAsFixed(1),
+                                              (seasonList[index].competitionSeason.bonus / 1000).toStringAsFixed(1),
                                               style: TextStyle(
                                               style: TextStyle(
                                                 color: Colors.white,
                                                 color: Colors.white,
                                                 fontSize: 68,
                                                 fontSize: 68,
@@ -235,24 +234,24 @@ class _HomePageState extends State<HomePage> with WidgetsBindingObserver {
                   ),
                   ),
                 ),
                 ),
               ),
               ),
-              Positioned(
-                right: 0,
-                top: 0,
-                width: 48,
-                height: 48,
-                child: Material(
-                  color: Colors.transparent,
-                  child: InkWell(
-                    onTap: () {
-                      Navigator.push(context, new CupertinoPageRoute(builder: (context) => new Setting()));
-                    },
-                    child: Padding(
-                      padding: EdgeInsets.all(12),
-                      child: Image.asset("images/home_icon_shezhi.png"),
-                    ),
-                  ),
-                ),
-              ),
+              // Positioned(
+              //   right: 0,
+              //   top: 0,
+              //   width: 48,
+              //   height: 48,
+              //   child: Material(
+              //     color: Colors.transparent,
+              //     child: InkWell(
+              //       onTap: () {
+              //         Navigator.push(context, new CupertinoPageRoute(builder: (context) => new Setting()));
+              //       },
+              //       child: Padding(
+              //         padding: EdgeInsets.all(12),
+              //         child: Image.asset("images/home_icon_shezhi.png"),
+              //       ),
+              //     ),
+              //   ),
+              // ),
               Positioned(
               Positioned(
                 bottom: 11,
                 bottom: 11,
                 left: 0,
                 left: 0,
@@ -262,11 +261,11 @@ class _HomePageState extends State<HomePage> with WidgetsBindingObserver {
                   crossAxisAlignment: CrossAxisAlignment.center,
                   crossAxisAlignment: CrossAxisAlignment.center,
                   children: <Widget>[
                   children: <Widget>[
                     Text(
                     Text(
-                      seasonList.length > 0 ? seasonList[nowIndex].season : '',
+                      seasonList.length > 0 ? seasonList[nowIndex].competitionSeason.season : '',
                       style: TextStyle(color: Colors.white, fontSize: 14),
                       style: TextStyle(color: Colors.white, fontSize: 14),
                     ),
                     ),
                     Text(
                     Text(
-                      seasonList.length > 0 ? seasonList[nowIndex].gameInfo.gameName : '',
+                      seasonList.length > 0 ? seasonList[nowIndex].gameName : '',
                       style: TextStyle(color: Colors.white, fontSize: 14),
                       style: TextStyle(color: Colors.white, fontSize: 14),
                     )
                     )
                   ],
                   ],

+ 9 - 3
lib/pages/TipInfo.dart

@@ -33,11 +33,17 @@ class TipInfoState extends State<TipInfo> {
       });
       });
     }
     }
 
 
-    if (tipInfo.statusFlag == 0 && tipInfo.typeFlag != 2) {
+    if (tipInfo.statusFlag == 0 &&
+        tipInfo.typeFlag != 2 &&
+        tipInfo.typeFlag != 3) {
       HttpManager.post("systemNotice/update",
       HttpManager.post("systemNotice/update",
           data: {'id': tipInfo.id, "statusFlag": 1});
           data: {'id': tipInfo.id, "statusFlag": 1});
     }
     }
 
 
+    if (tipInfo.typeFlag == 3) {
+      return;
+    }
+
     Result res2 = await HttpManager.get("houseInfo/getOne",
     Result res2 = await HttpManager.get("houseInfo/getOne",
         data: {'id': tipInfo.houseId});
         data: {'id': tipInfo.houseId});
     if (res2.success) {
     if (res2.success) {
@@ -121,10 +127,10 @@ class TipInfoState extends State<TipInfo> {
                     ],
                     ],
                   ),
                   ),
                 ),
                 ),
-                houseInfo != null
+                houseInfo != null && type != 3
                     ? houseItem(roomInfo: houseInfo, gameInfo: gameInfo)
                     ? houseItem(roomInfo: houseInfo, gameInfo: gameInfo)
                     : Container(),
                     : Container(),
-                type == 2 && status == 0
+                (type == 2 || type == 3) && status == 0
                     ? Container(
                     ? Container(
                         width: double.infinity,
                         width: double.infinity,
                         height: 48,
                         height: 48,

+ 301 - 175
lib/pages/openRoom.dart

@@ -14,6 +14,8 @@ import '../redux/AppState.dart';
 import '../net/HttpManager.dart';
 import '../net/HttpManager.dart';
 import '../net/Result.dart';
 import '../net/Result.dart';
 import 'package:dio/dio.dart';
 import 'package:dio/dio.dart';
+import '../model/GameInfo.dart';
+import '../model/HouseLevel.dart';
 
 
 class OpenRoom extends StatefulWidget {
 class OpenRoom extends StatefulWidget {
   OpenRoom({Key key, this.roomFlag}) : super(key: key);
   OpenRoom({Key key, this.roomFlag}) : super(key: key);
@@ -24,11 +26,16 @@ class OpenRoom extends StatefulWidget {
 
 
 class OpenRoomState extends State<OpenRoom> {
 class OpenRoomState extends State<OpenRoom> {
   TextStyle titleStyle = TextStyle(color: Colors.white, fontSize: 14);
   TextStyle titleStyle = TextStyle(color: Colors.white, fontSize: 14);
-  TextStyle valStyle = TextStyle(color: Colors.white, fontSize: 15, fontWeight: FontWeight.w500);
+  TextStyle valStyle =
+      TextStyle(color: Colors.white, fontSize: 15, fontWeight: FontWeight.w500);
 
 
-  Map<String, dynamic> editRoomInfo = {"gameId": 1, "houseLevel": 1, "maxNumber": 10};
-  List gameList = [];
-  List levelList = [];
+  Map<String, dynamic> editRoomInfo = {
+    "gameId": 1,
+    "houseLevel": 1,
+    "maxNumber": 10
+  };
+  List<GameInfo> gameList = [];
+  List<HouseLevel> levelList = [];
 
 
   void getFilePath() async {
   void getFilePath() async {
     String filePath = await FilePicker.getFilePath(type: FileType.ANY);
     String filePath = await FilePicker.getFilePath(type: FileType.ANY);
@@ -58,74 +65,99 @@ class OpenRoomState extends State<OpenRoom> {
       Toast.show(context, '请选择房间等级', 1500, 'info');
       Toast.show(context, '请选择房间等级', 1500, 'info');
       return;
       return;
     }
     }
-    if (editRoomInfo['houseType'] == '1' && (editRoomInfo['gameHouseId'] == null || editRoomInfo['gameHouseId'] == '')) {
+    if (editRoomInfo['houseType'] == '1' &&
+        (editRoomInfo['gameHouseId'] == null ||
+            editRoomInfo['gameHouseId'] == '')) {
       Toast.show(context, '请录入游戏房间号', 1500, 'info');
       Toast.show(context, '请录入游戏房间号', 1500, 'info');
       return;
       return;
     }
     }
-    if (editRoomInfo['houseType'] == '1' && (editRoomInfo['gameHousePassword'] == null || editRoomInfo['gameHousePassword'] == '')) {
+    if (editRoomInfo['houseType'] == '1' &&
+        (editRoomInfo['gameHousePassword'] == null ||
+            editRoomInfo['gameHousePassword'] == '')) {
       Toast.show(context, '请录入游戏房间密码', 1500, 'info');
       Toast.show(context, '请录入游戏房间密码', 1500, 'info');
       return;
       return;
     }
     }
-    editRoomInfo['userId'] = StoreProvider.of<AppState>(context).state.userInfo.id;
+    editRoomInfo['createUser'] =
+        StoreProvider.of<AppState>(context).state.userInfo.id;
     Toast.show(context, '加载中', -1, 'loading');
     Toast.show(context, '加载中', -1, 'loading');
     Result res = await HttpManager.post("houseInfo/save", data: editRoomInfo);
     Result res = await HttpManager.post("houseInfo/save", data: editRoomInfo);
     Toast.hide();
     Toast.hide();
     if (res.success) {
     if (res.success) {
-      HttpManager.post("houseInfo/join", data: {"houseId": res.data, "userId": StoreProvider.of<AppState>(context).state.userInfo.id});
-     Toast.show(context, '创建成功', 1500, 'success');
+      HttpManager.post("houseInfo/join", data: {
+        "houseId": res.data,
+        "userId": StoreProvider.of<AppState>(context).state.userInfo.id
+      });
+      Toast.show(context, '创建成功', 1500, 'success');
       Future.delayed(Duration(milliseconds: 1500), () {
       Future.delayed(Duration(milliseconds: 1500), () {
         Navigator.pushAndRemoveUntil(
         Navigator.pushAndRemoveUntil(
-            context, new CupertinoPageRoute(builder: (context) => new RoomInfo(roomId: res.data.toString())), ModalRoute.withName('/'));
+            context,
+            new CupertinoPageRoute(
+                builder: (context) =>
+                    new RoomInfo(roomId: res.data.toString())),
+            ModalRoute.withName('/'));
       });
       });
     } else {}
     } else {}
   }
   }
 
 
-  @override
-  void initState() {
-    super.initState();
-    editRoomInfo['houseType'] = widget.roomFlag;
-
-    Future.delayed(Duration.zero, () {
-      getInfo();
-    });
-  }
-
-  getInfo() async {
+  void getInfo() async {
     Toast.show(context, '加载中', -1, 'loading');
     Toast.show(context, '加载中', -1, 'loading');
     Result res = await HttpManager.get("gameInfo/all");
     Result res = await HttpManager.get("gameInfo/all");
     if (res.success) {
     if (res.success) {
+      List<GameInfo> _list = [];
+      for (var item in res.data) {
+        _list.add(GameInfo.fromJson(item));
+      }
       setState(() {
       setState(() {
-        gameList = res.data;
+        gameList = _list;
         if (res.data.length > 0) {
         if (res.data.length > 0) {
           editRoomInfo['gameId'] = res.data[0]['id'];
           editRoomInfo['gameId'] = res.data[0]['id'];
+          editRoomInfo['houseName'] =
+              StoreProvider.of<AppState>(context).state.userInfo.nickname +'的'+
+                  res.data[0]['shortName']+'房间';
+                  editRoomInfo['houseAbstract']=res.data[0]['profile']??'';
         }
         }
       });
       });
     } else {}
     } else {}
 
 
+
     Result res2 = await HttpManager.get("houseLevel/all");
     Result res2 = await HttpManager.get("houseLevel/all");
     Toast.hide();
     Toast.hide();
     if (res2.success) {
     if (res2.success) {
+      List<HouseLevel> _list = [];
+      for (var item in res2.data) {
+        _list.add(HouseLevel.fromJson(item));
+      }
       setState(() {
       setState(() {
-        levelList = res2.data;
+        levelList = _list;
         if (levelList.length > 0) {
         if (levelList.length > 0) {
-          editRoomInfo['houseLevel'] = levelList[0]['id'];
+          editRoomInfo['houseLevel'] = res2.data[0]['id'];
         }
         }
       });
       });
     } else {}
     } else {}
   }
   }
 
 
+  @override
+  void initState() {
+    super.initState();
+    editRoomInfo['houseType'] = widget.roomFlag;
+
+    Future.delayed(Duration.zero, () {
+      getInfo();
+    });
+  }
+
   @override
   @override
   Widget build(BuildContext context) {
   Widget build(BuildContext context) {
-    Map chooseGameInfo = {};
+    GameInfo chooseGameInfo = GameInfo.empty();
     for (var item in gameList) {
     for (var item in gameList) {
-      if (item['id'].toString() == editRoomInfo['gameId'].toString()) {
+      if (item.id.toString() == editRoomInfo['gameId'].toString()) {
         chooseGameInfo = item;
         chooseGameInfo = item;
       }
       }
     }
     }
 
 
-    Map chooseLevelInfo = {};
+    HouseLevel chooseLevelInfo = HouseLevel.empty();
     for (var item in levelList) {
     for (var item in levelList) {
-      if (item['id'].toString() == editRoomInfo['houseLevel'].toString()) {
+      if (item.id.toString() == editRoomInfo['houseLevel'].toString()) {
         chooseLevelInfo = item;
         chooseLevelInfo = item;
       }
       }
     }
     }
@@ -143,7 +175,8 @@ class OpenRoomState extends State<OpenRoom> {
                 child: FlatButton(
                 child: FlatButton(
                   highlightColor: PRIMARY_COLOR,
                   highlightColor: PRIMARY_COLOR,
                   padding: EdgeInsets.only(right: 0),
                   padding: EdgeInsets.only(right: 0),
-                  child: Text('规则', style: TextStyle(color: Colors.white, fontSize: 13)),
+                  child: Text('规则',
+                      style: TextStyle(color: Colors.white, fontSize: 13)),
                   onPressed: () {},
                   onPressed: () {},
                 ),
                 ),
               )
               )
@@ -158,29 +191,13 @@ class OpenRoomState extends State<OpenRoom> {
                 color: BG_COLOR,
                 color: BG_COLOR,
                 child: Column(
                 child: Column(
                   children: <Widget>[
                   children: <Widget>[
-                    Container(
-                        padding: EdgeInsets.symmetric(horizontal: 15),
-                        color: BG_COLOR,
-                        height: 60,
-                        child: GestureDetector(
-                          child: Row(
-                            children: <Widget>[
-                              Text('选择游戏', style: titleStyle),
-                              Expanded(
-                                flex: 1,
-                                child: Text(
-                                  chooseGameInfo.containsKey('gameName') ? chooseGameInfo['gameName'] : '',
-                                  textAlign: TextAlign.right,
-                                  style: valStyle,
-                                ),
-                              ),
-                              Image.asset('images/icon_inter.png', width: 24)
-                            ],
-                          ),
-                          onTap: () {
-                            showPicker(context);
-                          },
-                        )),
+                    ChooseContent(
+                      title: '选择游戏',
+                      val: chooseGameInfo.gameName,
+                      onTapHomeMenu: () {
+                        showPicker(context);
+                      },
+                    ),
                     Container(
                     Container(
                       width: double.infinity,
                       width: double.infinity,
                       color: BG_SUB_COLOR,
                       color: BG_SUB_COLOR,
@@ -220,138 +237,107 @@ class OpenRoomState extends State<OpenRoom> {
                           Padding(
                           Padding(
                             padding: EdgeInsets.only(top: 12),
                             padding: EdgeInsets.only(top: 12),
                             child: Text(
                             child: Text(
-                              editRoomInfo.containsKey('video') ? '已选择' : '不上传则自动使用官方默认视频',
-                              style: TextStyle(color: Color(0xFF9BA0AE), fontSize: 13),
+                              editRoomInfo.containsKey('video')
+                                  ? '已选择'
+                                  : '不上传则自动使用官方默认视频',
+                              style: TextStyle(
+                                  color: Color(0xFF9BA0AE), fontSize: 13),
                             ),
                             ),
                           )
                           )
                         ],
                         ],
                       ),
                       ),
                     ),
                     ),
                     //房间标题
                     //房间标题
-                    Container(
-                      height: 60,
-                      color: BG_COLOR,
-                      padding: EdgeInsets.symmetric(horizontal: 15, vertical: 8),
-                      child: TextField(
-                        textAlign: TextAlign.end,
-                        style: valStyle,
-                        maxLength: 10,
-                        decoration: InputDecoration(
-                            hintText: "请输入房间标题",
-                            hintStyle: TextStyle(color: Color(0xFF727785), fontSize: 13),
-                            prefixIcon: Padding(
-                              padding: EdgeInsets.symmetric(vertical: 12),
-                              child: Text('房间标题', style: titleStyle),
-                            ),
-                            border: InputBorder.none,
-                            counterStyle: TextStyle(fontSize: 0)),
-                        onChanged: (value) {
+                    // Container(
+                    //   height: 60,
+                    //   color: BG_COLOR,
+                    //   padding:
+                    //       EdgeInsets.symmetric(horizontal: 15, vertical: 8),
+                    //   child: TextField(
+                    //     textAlign: TextAlign.end,
+                    //     style: valStyle,
+                    //     maxLength: 10,
+                    //     decoration: InputDecoration(
+                    //         hintText: "请输入房间标题",
+                    //         hintStyle: TextStyle(
+                    //             color: Color(0xFF727785), fontSize: 13),
+                    //         prefixIcon: Padding(
+                    //           padding: EdgeInsets.symmetric(vertical: 12),
+                    //           child: Text('房间标题', style: titleStyle),
+                    //         ),
+                    //         border: InputBorder.none,
+                    //         counterStyle: TextStyle(fontSize: 0)),
+                    //     onChanged: (value) {
+                    //       editRoomInfo['houseName'] = value;
+                    //     },
+                    //   ),
+                    // ),
+                    InputContent(
+                        title: '房间标题',
+                        value: editRoomInfo['houseName'],
+                        onTextChange: (value) {
                           editRoomInfo['houseName'] = value;
                           editRoomInfo['houseName'] = value;
-                        },
-                      ),
-                    ),
+                        }),
                     Container(
                     Container(
                       height: 1,
                       height: 1,
                       color: BG_SUB_COLOR,
                       color: BG_SUB_COLOR,
                     ),
                     ),
                     //房间简介
                     //房间简介
-                    Container(
-                      height: 60,
-                      color: BG_COLOR,
-                      padding: EdgeInsets.symmetric(horizontal: 15, vertical: 8),
-                      child: TextField(
-                        textAlign: TextAlign.end,
-                        style: valStyle,
-                        maxLength: 15,
-                        decoration: InputDecoration(
-                            hintText: "请输入房间简介",
-                            hintStyle: TextStyle(color: Color(0xFF727785), fontSize: 13),
-                            prefixIcon: Padding(
-                              padding: EdgeInsets.symmetric(vertical: 12),
-                              child: Text('房间简介', style: titleStyle),
-                            ),
-                            border: InputBorder.none,
-                            counterStyle: TextStyle(fontSize: 0)),
-                        onChanged: (value) {
+                     InputContent(
+                        title: '房间简介',
+                        value: editRoomInfo['houseAbstract'],
+                        onTextChange: (value) {
                           editRoomInfo['houseAbstract'] = value;
                           editRoomInfo['houseAbstract'] = value;
-                        },
-                      ),
-                    ),
+                        }),
+                    // Container(
+                    //   height: 60,
+                    //   color: BG_COLOR,
+                    //   padding:
+                    //       EdgeInsets.symmetric(horizontal: 15, vertical: 8),
+                    //   child: TextField(
+                    //     textAlign: TextAlign.end,
+                    //     style: valStyle,
+                    //     maxLength: 15,
+                    //     decoration: InputDecoration(
+                    //         hintText: "请输入房间简介",
+                    //         hintStyle: TextStyle(
+                    //             color: Color(0xFF727785), fontSize: 13),
+                    //         prefixIcon: Padding(
+                    //           padding: EdgeInsets.symmetric(vertical: 12),
+                    //           child: Text('房间简介', style: titleStyle),
+                    //         ),
+                    //         border: InputBorder.none,
+                    //         counterStyle: TextStyle(fontSize: 0)),
+                    //     onChanged: (value) {
+                    //       editRoomInfo['houseAbstract'] = value;
+                    //     },
+                    //   ),
+                    // ),
                     Container(
                     Container(
                       height: 1,
                       height: 1,
                       color: BG_SUB_COLOR,
                       color: BG_SUB_COLOR,
                     ),
                     ),
                     //房间等级
                     //房间等级
-                    Container(
-                        height: 60,
-                        color: BG_COLOR,
-                        padding: EdgeInsets.symmetric(horizontal: 15),
-                        child: GestureDetector(
-                          child: Row(
-                            children: <Widget>[
-                              Text(
-                                '房间等级',
-                                style: titleStyle,
-                              ),
-                              Expanded(
-                                flex: 1,
-                                child: Row(
-                                  mainAxisAlignment: MainAxisAlignment.end,
-                                  children: <Widget>[
-                                    Image.network(
-                                      chooseLevelInfo.containsKey('icon') ? chooseLevelInfo['icon'] : '',
-                                      width: 22,
-                                    ),
-                                    Text(
-                                      chooseLevelInfo.containsKey('levelName') ? chooseLevelInfo['levelName'] : '',
-                                      style: TextStyle(color: Color(0xFFF9D881)),
-                                    ),
-                                    Padding(
-                                      padding: EdgeInsets.only(left: 20, right: 2),
-                                      child: Image.asset('images/icon_jinbi_da_bai.png', width: 20),
-                                    ),
-                                    Text(
-                                      'X' + (chooseLevelInfo.containsKey('entryCoin') ? chooseLevelInfo['entryCoin'].toString() : ''),
-                                      style: TextStyle(color: Colors.white, fontSize: 15, fontWeight: FontWeight.w500),
-                                    )
-                                  ],
-                                ),
-                              ),
-                              Padding(padding: EdgeInsets.only(left: 4), child: Image.asset('images/icon_inter.png', width: 24))
-                            ],
-                          ),
-                          onTap: () {
-                            showLevelPicker(context);
-                          },
-                        )),
+                    ChooseContent(
+                      title: '房间等级',
+                      chooseLevelInfo: chooseLevelInfo,
+                      isLevel: true,
+                      onTapHomeMenu: () {
+                        showLevelPicker(context);
+                      },
+                    ),
                     Container(
                     Container(
                       height: 1,
                       height: 1,
                       color: BG_SUB_COLOR,
                       color: BG_SUB_COLOR,
                     ),
                     ),
                     //房间人数
                     //房间人数
-                    Container(
-                        padding: EdgeInsets.symmetric(horizontal: 15),
-                        color: BG_COLOR,
-                        height: 60,
-                        child: GestureDetector(
-                          child: Row(
-                            children: <Widget>[
-                              Text('房间人数', style: titleStyle),
-                              Expanded(
-                                flex: 1,
-                                child: Text(
-                                  editRoomInfo['maxNumber'].toString(),
-                                  textAlign: TextAlign.right,
-                                  style: valStyle,
-                                ),
-                              ),
-                              Image.asset('images/icon_inter.png', width: 24)
-                            ],
-                          ),
-                          onTap: () {
-                            showNumPicker(chooseLevelInfo);
-                          },
-                        )),
+                    ChooseContent(
+                      title: '房间人数',
+                      val: editRoomInfo['maxNumber'].toString(),
+                      onTapHomeMenu: () {
+                        showNumPicker(context);
+                      },
+                    ),
                     _bottomWidget(),
                     _bottomWidget(),
                     //创建房间
                     //创建房间
                     Container(
                     Container(
@@ -365,17 +351,24 @@ class OpenRoomState extends State<OpenRoom> {
                           children: <Widget>[
                           children: <Widget>[
                             Padding(
                             Padding(
                               padding: EdgeInsets.only(right: 6),
                               padding: EdgeInsets.only(right: 6),
-                              child: Image.asset('images/icon_jinbi_da_bai.png', width: 20),
+                              child: Image.asset('images/icon_jinbi_da_bai.png',
+                                  width: 20),
                             ),
                             ),
                             Text(
                             Text(
-                              'X' + (chooseLevelInfo.containsKey('entryCoin') ? chooseLevelInfo['entryCoin'].toString() : ''),
-                              style: TextStyle(color: Colors.white, fontSize: 16, fontWeight: FontWeight.w500),
+                              'X' + (chooseLevelInfo.entryCoin ?? 0).toString(),
+                              style: TextStyle(
+                                  color: Colors.white,
+                                  fontSize: 16,
+                                  fontWeight: FontWeight.w500),
                             ),
                             ),
                             Padding(
                             Padding(
                               padding: EdgeInsets.only(left: 20),
                               padding: EdgeInsets.only(left: 20),
                               child: Text(
                               child: Text(
                                 '创建房间',
                                 '创建房间',
-                                style: TextStyle(color: Colors.white, fontSize: 16, fontWeight: FontWeight.w500),
+                                style: TextStyle(
+                                    color: Colors.white,
+                                    fontSize: 16,
+                                    fontWeight: FontWeight.w500),
                               ),
                               ),
                             )
                             )
                           ],
                           ],
@@ -464,26 +457,29 @@ class OpenRoomState extends State<OpenRoom> {
   }
   }
 
 
   showPicker(BuildContext context) {
   showPicker(BuildContext context) {
-    List _list = [];
+    List<String> _list = [];
     for (var item in gameList) {
     for (var item in gameList) {
-      _list.add(item['gameName']);
+      _list.add(item.gameName);
     }
     }
     String PickerData = json.encode(_list);
     String PickerData = json.encode(_list);
     new Picker(
     new Picker(
         confirmText: '确定',
         confirmText: '确定',
         cancelText: "取消",
         cancelText: "取消",
-        adapter: PickerDataAdapter<String>(pickerdata: new JsonDecoder().convert(PickerData)),
+        adapter: PickerDataAdapter<String>(
+            pickerdata: new JsonDecoder().convert(PickerData)),
         changeToFirst: true,
         changeToFirst: true,
         textAlign: TextAlign.left,
         textAlign: TextAlign.left,
         columnPadding: const EdgeInsets.all(8.0),
         columnPadding: const EdgeInsets.all(8.0),
         onConfirm: (Picker picker, List value) {
         onConfirm: (Picker picker, List value) {
           setState(() {
           setState(() {
-            editRoomInfo['gameId'] = gameList[value[0]]['id'];
+            editRoomInfo['gameId'] = gameList[value[0]].id;
+            editRoomInfo['houseName']=StoreProvider.of<AppState>(context).state.userInfo.nickname +'的'+gameList[value[0]].shortName+'房间';
+            editRoomInfo['houseAbstract']=gameList[value[0]].profile??'';
           });
           });
         }).showModal(this.context);
         }).showModal(this.context);
   }
   }
 
 
-  showNumPicker(Map info) {
+  showNumPicker(BuildContext context) {
     List _list = [];
     List _list = [];
     for (var i = 10; i <= 100; i = i + 10) {
     for (var i = 10; i <= 100; i = i + 10) {
       _list.add(i);
       _list.add(i);
@@ -493,7 +489,8 @@ class OpenRoomState extends State<OpenRoom> {
     new Picker(
     new Picker(
         confirmText: '确定',
         confirmText: '确定',
         cancelText: "取消",
         cancelText: "取消",
-        adapter: PickerDataAdapter<String>(pickerdata: new JsonDecoder().convert(PickerData)),
+        adapter: PickerDataAdapter<String>(
+            pickerdata: new JsonDecoder().convert(PickerData)),
         changeToFirst: true,
         changeToFirst: true,
         textAlign: TextAlign.left,
         textAlign: TextAlign.left,
         columnPadding: const EdgeInsets.all(8.0),
         columnPadding: const EdgeInsets.all(8.0),
@@ -505,22 +502,151 @@ class OpenRoomState extends State<OpenRoom> {
   }
   }
 
 
   showLevelPicker(BuildContext context) {
   showLevelPicker(BuildContext context) {
-    List _list = [];
+    List<String> _list = [];
     for (var item in levelList) {
     for (var item in levelList) {
-      _list.add(item['levelName']);
+      _list.add(item.levelName);
     }
     }
     String PickerData = json.encode(_list);
     String PickerData = json.encode(_list);
     new Picker(
     new Picker(
         confirmText: '确定',
         confirmText: '确定',
         cancelText: "取消",
         cancelText: "取消",
-        adapter: PickerDataAdapter<String>(pickerdata: new JsonDecoder().convert(PickerData)),
+        adapter: PickerDataAdapter<String>(
+            pickerdata: new JsonDecoder().convert(PickerData)),
         changeToFirst: true,
         changeToFirst: true,
         textAlign: TextAlign.left,
         textAlign: TextAlign.left,
         columnPadding: const EdgeInsets.all(8.0),
         columnPadding: const EdgeInsets.all(8.0),
         onConfirm: (Picker picker, List value) {
         onConfirm: (Picker picker, List value) {
           setState(() {
           setState(() {
-            editRoomInfo['houseLevel'] = levelList[value[0]]['id'];
+            editRoomInfo['houseLevel'] = levelList[value[0]].id;
           });
           });
         }).showModal(this.context);
         }).showModal(this.context);
   }
   }
 }
 }
+
+typedef int OnTapHomeMenu();
+typedef ValueChanged<T> = void Function(T value);
+
+class ChooseContent extends StatelessWidget {
+  ChooseContent(
+      {Key key,
+      this.title,
+      this.val,
+      this.chooseLevelInfo,
+      this.isLevel = false,
+      this.onTapHomeMenu})
+      : super(key: key);
+  final String title;
+  final String val;
+  final OnTapHomeMenu onTapHomeMenu;
+  final HouseLevel chooseLevelInfo;
+  final bool isLevel;
+  @override
+  Widget build(BuildContext context) {
+    return Container(
+        child: InkWell(
+      child: Container(
+        height: 60,
+        padding: EdgeInsets.symmetric(horizontal: 15),
+        child: Row(
+          mainAxisAlignment: MainAxisAlignment.spaceBetween,
+          children: <Widget>[
+            Text(title, style: TextStyle(fontSize: 14, color: Colors.white)),
+            Expanded(
+              flex: 1,
+              child: isLevel
+                  ? Row(
+                      mainAxisAlignment: MainAxisAlignment.end,
+                      children: <Widget>[
+                        chooseLevelInfo.icon != null
+                            ? Image.network(
+                                chooseLevelInfo.icon,
+                                width: 22,
+                              )
+                            : Container(),
+                        Text(
+                          chooseLevelInfo.levelName ?? '',
+                          style: TextStyle(color: Color(0xFFF9D881)),
+                        ),
+                        Padding(
+                          padding: EdgeInsets.only(left: 20, right: 2),
+                          child: Image.asset('images/icon_jinbi_da_bai.png',
+                              width: 20),
+                        ),
+                        Text(
+                          'X' + (chooseLevelInfo.entryCoin ?? 0).toString(),
+                          style: TextStyle(
+                              color: Colors.white,
+                              fontSize: 15,
+                              fontWeight: FontWeight.w500),
+                        )
+                      ],
+                    )
+                  : Text(val ?? '',
+                      style: TextStyle(
+                          fontSize: 15,
+                          color: Colors.white,
+                          fontWeight: FontWeight.w500),
+                      textAlign: TextAlign.right),
+            ),
+            Image.asset('images/icon_inter.png', width: 24)
+          ],
+        ),
+      ),
+      onTap: onTapHomeMenu,
+    ));
+  }
+}
+
+class InputContent extends StatefulWidget {
+  InputContent({Key key, this.title, this.value, this.onTextChange})
+      : super(key: key);
+  final String title;
+  final String value;
+  final ValueChanged onTextChange;
+  @override
+  InputContentState createState() => InputContentState();
+}
+
+class InputContentState extends State<InputContent> {
+  TextEditingController _controller;
+
+  @override
+  void initState() {
+    super.initState();
+    _controller = new TextEditingController();
+  }
+
+  @override
+  void didUpdateWidget(InputContent oldWidget) {
+    // TODO: implement didUpdateWidget
+    super.didUpdateWidget(oldWidget);
+    _controller.text = widget.value ?? '';
+  }
+
+  @override
+  Widget build(BuildContext context) {
+    return Container(
+      height: 60,
+      color: BG_COLOR,
+      padding: EdgeInsets.symmetric(horizontal: 15, vertical: 8),
+      child: TextField(
+        controller: _controller,
+        textAlign: TextAlign.end,
+        style: TextStyle(
+            fontSize: 15, color: Colors.white, fontWeight: FontWeight.w500),
+        maxLength: 10,
+        decoration: InputDecoration(
+            hintText: "请输入" + widget.title,
+            hintStyle: TextStyle(color: Color(0xFF727785), fontSize: 13),
+            prefixIcon: Padding(
+              padding: EdgeInsets.symmetric(vertical: 12),
+              child: Text(widget.title,
+                  style: TextStyle(fontSize: 14, color: Colors.white)),
+            ),
+            border: InputBorder.none,
+            counterStyle: TextStyle(fontSize: 0)),
+        onChanged: widget.onTextChange,
+      ),
+    );
+  }
+}

+ 3 - 2
lib/pages/rankList.dart

@@ -10,8 +10,9 @@ import '../redux/AppState.dart';
 import '../model/CompetitionSeason.dart';
 import '../model/CompetitionSeason.dart';
 
 
 class RankList extends StatefulWidget {
 class RankList extends StatefulWidget {
-  RankList({Key key, this.raceId}) : super(key: key);
+  RankList({Key key, this.raceId,this.gameId}) : super(key: key);
   final int raceId; // 用来储存传递过来的值
   final int raceId; // 用来储存传递过来的值
+  final int gameId;
   @override
   @override
   RankListState createState() => RankListState();
   RankListState createState() => RankListState();
 }
 }
@@ -29,7 +30,7 @@ class RankListState extends State<RankList> {
 
 
   void getUserRank() async {
   void getUserRank() async {
     Result res =
     Result res =
-        await HttpManager.get("playerInfo/seasonUserRank", data: {"seasonId": raceId, "userId": StoreProvider.of<AppState>(context).state.userInfo.id});
+        await HttpManager.get("playerInfo/seasonUserRank", data: {"seasonId": raceId, "userId": StoreProvider.of<AppState>(context).state.userInfo.id,'gameId':widget.gameId});
     if (res.success && res.data != null) {
     if (res.success && res.data != null) {
       setState(() {
       setState(() {
         myPlayInfo = PlayerInfo.fromJson(res.data);
         myPlayInfo = PlayerInfo.fromJson(res.data);

+ 362 - 248
lib/pages/roomInfo.dart

@@ -14,6 +14,8 @@ import 'StartWindow.dart';
 import '../model/PlayerInfo.dart';
 import '../model/PlayerInfo.dart';
 import '../widget/VideoWidget.dart';
 import '../widget/VideoWidget.dart';
 import 'dart:async';
 import 'dart:async';
+import '../widget/Dialog.dart';
+import 'CompetitionInformation.dart';
 
 
 class RoomInfo extends StatefulWidget {
 class RoomInfo extends StatefulWidget {
   RoomInfo({Key key, this.roomId}) : super(key: key);
   RoomInfo({Key key, this.roomId}) : super(key: key);
@@ -35,6 +37,7 @@ class RoomInfoState extends State<RoomInfo>
   bool isPop = false;
   bool isPop = false;
   bool showBack = false;
   bool showBack = false;
   Timer timer;
   Timer timer;
+  List<List<String>> roomTipsList = [];
 
 
 //获取房间信息
 //获取房间信息
   void getRoomInfo() async {
   void getRoomInfo() async {
@@ -43,9 +46,6 @@ class RoomInfoState extends State<RoomInfo>
         await HttpManager.get("houseInfo/getOne", data: {"id": widget.roomId});
         await HttpManager.get("houseInfo/getOne", data: {"id": widget.roomId});
     Toast.hide();
     Toast.hide();
     if (res.success) {
     if (res.success) {
-      if (isPop) {
-        return;
-      }
       setState(() {
       setState(() {
         roomInfo = res.data;
         roomInfo = res.data;
         houseInfo = HouseInfo.fromJson(res.data);
         houseInfo = HouseInfo.fromJson(res.data);
@@ -54,8 +54,18 @@ class RoomInfoState extends State<RoomInfo>
         timer = Timer.periodic(new Duration(seconds: 1), (timer) {
         timer = Timer.periodic(new Duration(seconds: 1), (timer) {
           getNowStatus();
           getNowStatus();
         });
         });
+
+        if (StoreProvider.of<AppState>(context).state.userInfo.remindFlag) {
+          showNotice();
+        }
       }
       }
     } else {}
     } else {}
+
+    print('开始时间:' + houseInfo.beginTime.toString());
+    print((1 * 3600 * 1000).toString());
+    print(DateTime.now().millisecondsSinceEpoch.toString());
+
+    checkJoinInfo();
   }
   }
 
 
 //隔一秒检查是否开始
 //隔一秒检查是否开始
@@ -71,6 +81,7 @@ class RoomInfoState extends State<RoomInfo>
         houseInfo.playerNumber = res.data["playerNumber"];
         houseInfo.playerNumber = res.data["playerNumber"];
         houseInfo.statusFlag = res.data["statusFlag"];
         houseInfo.statusFlag = res.data["statusFlag"];
         houseInfo.bonus = res.data["bonus"];
         houseInfo.bonus = res.data["bonus"];
+        houseInfo.beginTime = res.data['beginTime'];
       });
       });
     }
     }
   }
   }
@@ -117,22 +128,17 @@ class RoomInfoState extends State<RoomInfo>
     Toast.hide();
     Toast.hide();
     if (res.success) {
     if (res.success) {
       if (data['statusFlag'] == 2) {
       if (data['statusFlag'] == 2) {
-        showSucessInfo();
-        int _num = 10;
-        Timer.periodic(new Duration(seconds: 1), (timer) async {
-          if (_num > 0) {
-            Toast.show(context, _num.toString(), 500, 'num');
-            _num--;
-          } else {
-            timer.cancel();
-            const url = 'pubgmhd1106467070://';
-            if (await canLaunch(url)) {
-              await launch(url);
-            } else {
-              throw 'Could not launch $url';
-            }
-          }
-        });
+        const url = 'pubgmhd1106467070://';
+        if (await canLaunch(url)) {
+          Timer(Duration(seconds: 1), () async {
+            await launch(url);
+            showSucessInfo();
+          });
+        } else {
+          MyDialog.showDialog(context, '自动启动游戏失败,请手动切换到游戏app开始竞赛',
+              submitText: '知道了');
+          throw 'Could not launch $url';
+        }
       } else {
       } else {
         showBackDialog(success ? 1 : 0);
         showBackDialog(success ? 1 : 0);
       }
       }
@@ -141,81 +147,44 @@ class RoomInfoState extends State<RoomInfo>
 
 
 //开始录屏提示框
 //开始录屏提示框
   showSucessInfo() {
   showSucessInfo() {
-    showDialog<Null>(
-      context: context,
-      barrierDismissible: false,
-      builder: (BuildContext context) {
-        return new AlertDialog(
-          content: Container(
-            height: 150,
-            child: Column(
-              children: <Widget>[
-                Text(
-                  '已经成功开启录屏,请保留当前页面。10秒倒计时之后将自动打开游戏,未自动打开请您手动打开,祝您取得好成绩!',
-                  style: TextStyle(color: Colors.black, fontSize: 14),
-                ),
-                Text(
-                  '完成游戏后返回App,点击下方按钮,结束此次竞赛!',
-                  style: TextStyle(color: Colors.black, fontSize: 14),
-                )
-              ],
-            ),
-          ),
-          actions: <Widget>[
-            Container(
-              width: 260,
-              height: 54,
-              padding: EdgeInsets.only(left: 42, right: 42, bottom: 10),
-              child: RaisedButton(
-                color: PRIMARY_COLOR,
-                textColor: Colors.white,
-                child: new Text('完成比赛'),
-                onPressed: () async {
-                  Toast.show(context, '加载中', -1, 'loading');
-                  HttpManager.post("playerInfo/update",
-                      data: {'id': playerInfo.id, 'statusFlag': 3});
-                  bool success = await ScreenStreamPlugin.stop();
-                  Toast.hide();
-                  Navigator.of(context).pop();
-                },
-              ),
-            )
-          ],
-        );
-      },
-    ).then((val) {
-      Navigator.of(context).pop();
+    MyDialog.showDialog(context, '您已经完成比赛了吗,确认完成,那就点击下方完成竞赛按钮,上传本次成绩,祝您赢取大奖',
+        title: '完成比赛', submitText: '我已完成比赛', onsubmit: () async {
+      HttpManager.post("playerInfo/update",
+          data: {'id': playerInfo.id, 'statusFlag': 3});
+      bool success = await ScreenStreamPlugin.stop();
+
+      getEndTips();
     });
     });
   }
   }
 
 
+  getEndTips() async {
+    Result res = await HttpManager.get("playerInfo/endNum",
+        data: {"houseId": widget.roomId});
+
+    if (res.success) {
+      print('结束比赛' + res.data.toString());
+      int time = houseInfo.beginTime +
+          1 * 3600 * 1000 -
+          DateTime.now().millisecondsSinceEpoch;
+      var nowTime = (time ~/ 1000 ~/ 60) % 60;
+      setState(() {
+        roomTipsList.insert(0, [
+          '你已完成本次比赛,当前完成人数 ',
+          res.data.toString(),
+          '人,比赛需要等待所有人完成后方可结算奖励 最迟结算时间还剩',
+          nowTime.toString() + '分钟',
+          ',你可以先去参加其他竞赛,稍后在“个人中心-我的战绩”中可以查看本次竞赛排名及领取奖励'
+        ]);
+      });
+      print('111111' + roomTipsList.length.toString());
+    }
+  }
+
 //未确认比赛弹窗
 //未确认比赛弹窗
   showBackDialog(type) {
   showBackDialog(type) {
-    showDialog<Null>(
-      context: context,
-      barrierDismissible: false,
-      builder: (BuildContext context) {
-        return new AlertDialog(
-          content: Container(
-            height: 50,
-            child: Text(
-              (type == 1 ? '您未在十秒内点击开始按钮' : '您未允许录屏') +
-                  ',系统已经判定您放弃比赛,参赛奖金不予退还。',
-              style: TextStyle(color: Colors.black),
-            ),
-          ),
-          actions: <Widget>[
-            new FlatButton(
-              child: new Text('确定'),
-              onPressed: () {
-                Navigator.of(context).pop();
-              },
-            ),
-          ],
-        );
-      },
-    ).then((val) {
-      Navigator.of(context).pop();
-    });
+    MyDialog.showDialog(context,
+        (type == 1 ? '由于您未在十秒内点击开始按钮' : '由于您未授权录屏') + ',系统已经判定您放弃比赛,谢谢您的参与。',
+        title: '很遗憾');
   }
   }
 
 
 //检查加入信息
 //检查加入信息
@@ -232,6 +201,11 @@ class RoomInfoState extends State<RoomInfo>
         setState(() {
         setState(() {
           isJoin = false;
           isJoin = false;
         });
         });
+        if (houseInfo.statusFlag == 0) {
+          roomTipsList.insert(0, [
+            '上方奖金为当前本次竞赛的总奖金,根据当前人数的增加,奖金也就越多,竞赛的第一名获得50%,第二名获得30%,第三名获得20%,其他名次算作失败没有奖励,祝你取得好成绩'
+          ]);
+        }
       } else {
       } else {
         playerInfo = PlayerInfo.fromJson(res.data);
         playerInfo = PlayerInfo.fromJson(res.data);
         if (isPop) {
         if (isPop) {
@@ -240,15 +214,40 @@ class RoomInfoState extends State<RoomInfo>
         setState(() {
         setState(() {
           isJoin = true;
           isJoin = true;
         });
         });
+        if (houseInfo.statusFlag == 0) {
+          if (houseInfo.createUser ==
+              StoreProvider.of<AppState>(context)
+                  .state
+                  .userInfo
+                  .id
+                  .toString()) {
+            roomTipsList.insert(0, [
+              '房间创建成功,待人数满员时会自动开启比赛,请在此页面耐心等待其他人的加入,退出房间则视为自动放弃比赛,已支付金币概不退换,快快点击右上角分享给好友加入战局吧'
+            ]);
+          } else {
+            roomTipsList.insert(0, [
+              '请在此页面耐心等待,竞赛即将开始,届时玩家有10秒的时间进行确认,点击确认方可正式进入竞赛,若没有点击,则视为自动放弃此次竞赛,已支付金币概不退换'
+            ]);
+          }
+          Timer(Duration(seconds: 1), () {
+            roomTipsList.insert(0, [
+              '游戏开始后会有弹窗提示授权进行录屏的操作,',
+              '请一定点击“确定”或“允许”此操作',
+              ',系统会自动跳转打开游戏app,若长时间没有自动跳转,请手动打开游戏app进行比赛,在游戏比赛结束后,请',
+              '一定要点击查看游戏最后的分数名次结算页面',
+              ',返回游戏主页,最后再切换到我们竞赛app中,点击完成比赛,方可成功长传本次成绩,赢取大奖,感谢你的配合'
+            ]);
+          });
+
+         
+        }
+        else if(houseInfo.statusFlag!=4){
+          if (playerInfo.statusFlag == 3) {
+            getEndTips();
+          }
+        }
       }
       }
     }
     }
-    // if (res.success) {
-    //
-    // } else if (res.error == '玩家已存在') {
-    //   setState(() {
-    //     isJoin = true;
-    //   });
-    // }
   }
   }
 
 
 //加入房间
 //加入房间
@@ -260,6 +259,19 @@ class RoomInfoState extends State<RoomInfo>
     });
     });
     Toast.hide();
     Toast.hide();
     if (res.success) {
     if (res.success) {
+      roomTipsList.insert(0, [
+        '请在此页面耐心等待,竞赛即将开始,届时玩家有10秒的时间进行确认,点击确认方可正式进入竞赛,若没有点击,则视为自动放弃此次竞赛,已支付金币概不退换'
+      ]);
+      Timer(Duration(seconds: 1), () {
+        roomTipsList.insert(0, [
+          '游戏开始后会有弹窗提示授权进行录屏的操作,',
+          '请一定点击“确定”或“允许”此操作',
+          ',系统会自动跳转打开游戏app,若长时间没有自动跳转,请手动打开游戏app进行比赛,在游戏比赛结束后,请',
+          '一定要点击查看游戏最后的分数名次结算页面',
+          ',返回游戏主页,最后再切换到我们竞赛app中,点击完成比赛,方可成功长传本次成绩,赢取大奖,感谢你的配合'
+        ]);
+      });
+
       Toast.show(context, '加入成功', 1500, 'success');
       Toast.show(context, '加入成功', 1500, 'success');
       if (isPop) {
       if (isPop) {
         return;
         return;
@@ -273,6 +285,23 @@ class RoomInfoState extends State<RoomInfo>
     }
     }
   }
   }
 
 
+//展示通知
+  showNotice() {
+    Navigator.of(context).push(PageRouteBuilder(
+        opaque: false,
+        transitionDuration: Duration(milliseconds: 300),
+        transitionsBuilder: (BuildContext context, Animation<double> animation,
+            Animation<double> secondaryAnimation, Widget child) {
+          return FadeTransition(
+            opacity: CurvedAnimation(parent: animation, curve: Curves.linear),
+            child: child,
+          );
+        },
+        pageBuilder: (BuildContext context, _, __) {
+          return CompetitionInformation();
+        }));
+  }
+
   @override
   @override
   void initState() {
   void initState() {
     super.initState();
     super.initState();
@@ -294,11 +323,6 @@ class RoomInfoState extends State<RoomInfo>
 
 
     Future.delayed(Duration.zero, () {
     Future.delayed(Duration.zero, () {
       getRoomInfo();
       getRoomInfo();
-      checkJoinInfo();
-
-      // showSucessInfo();
-      // showBackDialog();
-      // showStart();
     });
     });
   }
   }
 
 
@@ -401,160 +425,153 @@ class RoomInfoState extends State<RoomInfo>
       }
       }
     }
     }
 
 
-    return Container(
-      child: RefreshIndicator(
-          color: PRIMARY_COLOR,
-          backgroundColor: Colors.white,
-          displacement: 10,
-          onRefresh: () async {
-            await new Future.delayed(const Duration(seconds: 1));
-          },
-          child: SingleChildScrollView(
-            physics: AlwaysScrollableScrollPhysics(),
-            child: Container(
-              child: Column(
-                children: <Widget>[
-                  houseInfo != null
-                      ? VideoWidget(videoSrc: houseInfo.video)
-                      : Container(),
-                  // Image.network(topImg, width: double.infinity),
-                  Container(
-                      padding: EdgeInsets.only(top: 10),
-                      child: Row(
-                        mainAxisAlignment: MainAxisAlignment.center,
+    return LayoutBuilder(
+      builder: (BuildContext context, BoxConstraints viewportConstraints) {
+        return Container(
+          child: RefreshIndicator(
+              color: PRIMARY_COLOR,
+              backgroundColor: Colors.white,
+              displacement: 10,
+              onRefresh: () async {
+                await new Future.delayed(const Duration(seconds: 1));
+              },
+              child: SingleChildScrollView(
+                  physics: AlwaysScrollableScrollPhysics(),
+                  child: ConstrainedBox(
+                    constraints: BoxConstraints(
+                        minHeight: viewportConstraints.maxHeight,
+                        maxHeight: viewportConstraints.maxHeight),
+                    child: IntrinsicHeight(
+                      child: Column(
                         children: <Widget>[
                         children: <Widget>[
+                          houseInfo != null
+                              ? VideoWidget(videoSrc: houseInfo.video)
+                              : Container(),
+                          // Image.network(topImg, width: double.infinity),
+                          Container(
+                              padding: EdgeInsets.only(top: 10),
+                              child: Row(
+                                mainAxisAlignment: MainAxisAlignment.center,
+                                children: <Widget>[
+                                  Container(
+                                    margin: EdgeInsets.only(left: 30, right: 8),
+                                    child: Text(
+                                      roomInfo.containsKey("houseName")
+                                          ? roomInfo["houseName"]
+                                          : '',
+                                      style: TextStyle(
+                                          color: Colors.white,
+                                          fontSize: 16,
+                                          fontWeight: FontWeight.w500),
+                                    ),
+                                  ),
+                                  Image.network(
+                                    houseLevelInfo.containsKey("icon")
+                                        ? houseLevelInfo["icon"]
+                                        : '',
+                                    width: 14,
+                                  ),
+                                  Text(
+                                    houseLevelInfo.containsKey("levelName")
+                                        ? houseLevelInfo["levelName"]
+                                        : '',
+                                    style:
+                                        TextStyle(color: colorInfo[levelName]),
+                                  )
+                                ],
+                              )),
                           Container(
                           Container(
-                            margin: EdgeInsets.only(left: 30, right: 8),
+                            margin: EdgeInsets.only(top: 6),
                             child: Text(
                             child: Text(
-                              roomInfo.containsKey("houseName")
-                                  ? roomInfo["houseName"]
-                                  : '',
+                              roomInfo.containsKey('houseAbstract')
+                                  ? roomInfo["houseAbstract"]
+                                  : "",
                               style: TextStyle(
                               style: TextStyle(
-                                  color: Colors.white,
-                                  fontSize: 16,
-                                  fontWeight: FontWeight.w500),
+                                  color: Color(0xFF9BA0AE), fontSize: 12),
                             ),
                             ),
                           ),
                           ),
-                          Image.network(
-                            houseLevelInfo.containsKey("icon")
-                                ? houseLevelInfo["icon"]
-                                : '',
-                            width: 14,
+                          Row(
+                            mainAxisAlignment: MainAxisAlignment.center,
+                            children: <Widget>[
+                              Image.asset(
+                                'images/icon_renshu.png',
+                                width: 20,
+                              ),
+                              Text(
+                                (houseInfo != null
+                                        ? houseInfo.playerNumber.toString()
+                                        : '0') +
+                                    '/' +
+                                    (houseInfo != null
+                                        ? houseInfo.maxNumber.toString()
+                                        : '0'),
+                                style: TextStyle(
+                                    fontSize: 14,
+                                    fontWeight: FontWeight.w500,
+                                    color: Color(0xFFB1B2C0)),
+                              )
+                            ],
+                          ),
+                          Container(
+                            margin: EdgeInsets.only(top: 14),
+                            width: 200,
+                            height: 40,
+                            decoration: BoxDecoration(
+                              border: Border.all(
+                                  width: 1,
+                                  color: PRIMARY_COLOR,
+                                  style: BorderStyle.solid),
+                              borderRadius:
+                                  BorderRadius.all(Radius.circular(2)),
+                            ),
+                            child: Row(
+                              mainAxisAlignment: MainAxisAlignment.center,
+                              children: <Widget>[
+                                Text(
+                                  '奖金',
+                                  style: TextStyle(
+                                    color: PRIMARY_COLOR,
+                                    fontSize: 13,
+                                    fontWeight: FontWeight.w500,
+                                  ),
+                                ),
+                                Container(
+                                  padding: EdgeInsets.only(left: 10, right: 6),
+                                  child: Image.asset(
+                                    "images/icon_jinbi_da_hong.png",
+                                    width: 20,
+                                  ),
+                                ),
+                                Text(
+                                  'X' +
+                                      (houseInfo != null
+                                          ? houseInfo.bonus.toString()
+                                          : '0'),
+                                  style: TextStyle(
+                                    color: PRIMARY_COLOR,
+                                    fontSize: 22,
+                                    fontWeight: FontWeight.w900,
+                                  ),
+                                )
+                              ],
+                            ),
                           ),
                           ),
-                          Text(
-                            houseLevelInfo.containsKey("levelName")
-                                ? houseLevelInfo["levelName"]
-                                : '',
-                            style: TextStyle(color: colorInfo[levelName]),
+
+                          statuFlag != 4
+                              ? TipsListContent(tipsList: roomTipsList)
+                              : RankContent(
+                                  roomId: widget.roomId,
+                                ),
+                          Container(
+                            width: double.infinity,
+                            height: 78,
                           )
                           )
                         ],
                         ],
-                      )),
-                  Container(
-                    margin: EdgeInsets.only(top: 6),
-                    child: Text(
-                      roomInfo.containsKey('houseAbstract')
-                          ? roomInfo["houseAbstract"]
-                          : "",
-                      style: TextStyle(color: Color(0xFF9BA0AE), fontSize: 12),
-                    ),
-                  ),
-                  Row(
-                    mainAxisAlignment: MainAxisAlignment.center,
-                    children: <Widget>[
-                      Image.asset(
-                        'images/icon_renshu.png',
-                        width: 20,
                       ),
                       ),
-                      Text(
-                        (houseInfo != null
-                                ? houseInfo.playerNumber.toString()
-                                : '0') +
-                            '/' +
-                            (houseInfo != null
-                                ? houseInfo.maxNumber.toString()
-                                : '0'),
-                        style: TextStyle(
-                            fontSize: 14,
-                            fontWeight: FontWeight.w500,
-                            color: Color(0xFFB1B2C0)),
-                      )
-                    ],
-                  ),
-                  Container(
-                    margin: EdgeInsets.only(top: 14),
-                    width: 200,
-                    height: 40,
-                    decoration: BoxDecoration(
-                      border: Border.all(
-                          width: 1,
-                          color: PRIMARY_COLOR,
-                          style: BorderStyle.solid),
-                      borderRadius: BorderRadius.all(Radius.circular(2)),
-                    ),
-                    child: Row(
-                      mainAxisAlignment: MainAxisAlignment.center,
-                      children: <Widget>[
-                        Text(
-                          '奖金',
-                          style: TextStyle(
-                            color: PRIMARY_COLOR,
-                            fontSize: 13,
-                            fontWeight: FontWeight.w500,
-                          ),
-                        ),
-                        Container(
-                          padding: EdgeInsets.only(left: 10, right: 6),
-                          child: Image.asset(
-                            "images/icon_jinbi_da_hong.png",
-                            width: 20,
-                          ),
-                        ),
-                        Text(
-                          'X' +
-                              (houseInfo != null
-                                  ? houseInfo.bonus.toString()
-                                  : '0'),
-                          style: TextStyle(
-                            color: PRIMARY_COLOR,
-                            fontSize: 22,
-                            fontWeight: FontWeight.w900,
-                          ),
-                        )
-                      ],
                     ),
                     ),
-                  ),
-                  statuFlag != 4
-                      ? Container(
-                          width: double.infinity,
-                          margin: EdgeInsets.only(top: 25, left: 15, right: 15),
-                          padding: EdgeInsets.only(
-                              top: 15, left: 15, right: 10, bottom: 15),
-                          decoration: BoxDecoration(
-                              borderRadius: BorderRadius.only(
-                                  topLeft: Radius.circular(0),
-                                  topRight: Radius.circular(8),
-                                  bottomLeft: Radius.circular(8),
-                                  bottomRight: Radius.circular(8)),
-                              gradient: LinearGradient(
-                                begin: Alignment.topRight,
-                                colors: [Color(0xFF464B6A), Color(0xFF35395E)],
-                              )),
-                          child: Text(
-                            '加入房间后,请在此页面耐心等待,竞赛即将开始时,玩家有10秒的时间进行确认,点击确认方可正式进入竞赛,若没有点击,则视为自动放弃此次竞赛,已支付金币概不退换',
-                            style: TextStyle(color: Colors.white, fontSize: 13),
-                          ),
-                        )
-                      : RankContent(
-                          roomId: widget.roomId,
-                        ),
-                  Container(
-                    width: double.infinity,
-                    height: 48 + ScreenUtil().setHeight(40),
-                  )
-                ],
-              ),
-            ),
-          )),
+                  ))),
+        );
+      },
     );
     );
   }
   }
 
 
@@ -565,13 +582,11 @@ class RoomInfoState extends State<RoomInfo>
 
 
     if (!isJoin && statusFlag == 0) {
     if (!isJoin && statusFlag == 0) {
       return Container(
       return Container(
+        color: BG_SUB_COLOR,
         width: ScreenUtil().setWidth(375),
         width: ScreenUtil().setWidth(375),
         height: 48 + ScreenUtil().setHeight(40),
         height: 48 + ScreenUtil().setHeight(40),
         padding: EdgeInsets.only(
         padding: EdgeInsets.only(
-            top: ScreenUtil().setHeight(20),
-            bottom: ScreenUtil().setHeight(20),
-            left: 15,
-            right: 15),
+            bottom: ScreenUtil().setHeight(20), left: 15, right: 15),
         child: RaisedButton(
         child: RaisedButton(
             textColor: Colors.white,
             textColor: Colors.white,
             child: Row(
             child: Row(
@@ -685,6 +700,105 @@ class RoomInfoState extends State<RoomInfo>
   }
   }
 }
 }
 
 
+class TipsListContent extends StatefulWidget {
+  TipsListContent({Key key, this.tipsList}) : super(key: key);
+  final List<List<String>> tipsList;
+  @override
+  TipsListContentState createState() => TipsListContentState();
+}
+
+class TipsListContentState extends State<TipsListContent> {
+  @override
+  void didUpdateWidget(TipsListContent oldWidget) {
+    // TODO: implement didChangeDependencies
+    super.didUpdateWidget(oldWidget);
+    print('updtae:' + widget.tipsList.length.toString());
+  }
+
+  @override
+  Widget build(BuildContext context) {
+    return Expanded(
+        flex: 1,
+        child: Container(
+          margin: EdgeInsets.only(top: 15),
+          width: double.infinity,
+          child: SingleChildScrollView(
+            child: Column(
+              children: _list(),
+            ),
+          ),
+        ));
+  }
+
+  List<Widget> _list() {
+    List<Tips> myList = [];
+    for (var item in widget.tipsList) {
+      myList.add(Tips(
+        content: item,
+      ));
+    }
+    return myList;
+  }
+}
+
+class Tips extends StatelessWidget {
+  Tips({Key key, this.content}) : super(key: key);
+  final List<String> content;
+  @override
+  Widget build(BuildContext context) {
+    return Container(
+      padding: EdgeInsets.all(15),
+      margin: EdgeInsets.fromLTRB(15, 10, 15, 0),
+      decoration: BoxDecoration(
+          gradient: LinearGradient(
+              colors: [Color(0xFF464B6A), Color(0xFF35395E)],
+              begin: Alignment.topCenter,
+              end: Alignment.bottomCenter),
+          borderRadius: BorderRadius.only(
+              topRight: Radius.circular(8),
+              bottomLeft: Radius.circular(8),
+              bottomRight: Radius.circular(8))),
+      child: content.length == 1
+          ? Text(
+              content[0],
+              style: TextStyle(color: Colors.white, fontSize: 13),
+            )
+          : _textList(),
+    );
+  }
+
+  Widget _textList() {
+    return Text.rich(TextSpan(children: [
+      TextSpan(
+        text: content[0],
+        style: TextStyle(color: Colors.white, fontSize: 13),
+      ),
+      TextSpan(
+        text: content[1],
+        style: TextStyle(
+            color: Color(0xFFC2524D),
+            fontSize: 13,
+            fontWeight: FontWeight.w500),
+      ),
+      TextSpan(
+        text: content[2],
+        style: TextStyle(color: Colors.white, fontSize: 13),
+      ),
+      TextSpan(
+        text: content[3],
+        style: TextStyle(
+            color: Color(0xFFC2524D),
+            fontSize: 13,
+            fontWeight: FontWeight.w500),
+      ),
+      TextSpan(
+        text: content[4],
+        style: TextStyle(color: Colors.white, fontSize: 13),
+      )
+    ]));
+  }
+}
+
 class RankContent extends StatefulWidget {
 class RankContent extends StatefulWidget {
   RankContent({Key key, this.roomId}) : super(key: key);
   RankContent({Key key, this.roomId}) : super(key: key);
   final String roomId; // 用来储存传递过来的值
   final String roomId; // 用来储存传递过来的值

+ 174 - 0
lib/widget/Dialog.dart

@@ -0,0 +1,174 @@
+import 'package:flutter/material.dart';
+
+//  void showSuccess(text) {
+
+//   }
+
+class MyDialog {
+  static void showDialog(context, text,
+      {String title,
+      bool isCancel = false,
+      String submitText = '确认',
+      OnTapHomeMenu onsubmit,
+      OnTapHomeMenu oncancel}) {
+    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 LoadingDialog(
+              title: title,
+              text: text,
+              submitText: submitText,
+              cancel: isCancel,
+              onsubmit: onsubmit,
+              oncancel: oncancel);
+        },
+      ),
+    );
+  }
+}
+
+typedef void OnTapHomeMenu();
+
+// ignore: must_be_immutable
+class LoadingDialog extends Dialog {
+  String title;
+  String text;
+  String submitText;
+  bool cancel = false;
+  OnTapHomeMenu onsubmit = () {};
+  OnTapHomeMenu oncancel = () {};
+
+  LoadingDialog(
+      {Key key,
+      @required this.text,
+      this.cancel,
+      this.onsubmit,
+      this.oncancel,
+      this.title,
+      this.submitText})
+      : super(key: key);
+
+  @override
+  Widget build(BuildContext context) {
+    return WillPopScope(
+      child: Scaffold(
+        backgroundColor: Color(0xCC000000),
+        body: Container(
+          child: SizedBox.expand(
+            child: UnconstrainedBox(
+              child: Container(
+                width: 270,
+                // padding: EdgeInsets.symmetric(horizontal: 20, vertical: 25),
+                decoration: BoxDecoration(
+                    color: Color(0xFF15151D),
+                    border: Border.all(width: 1, color: Color(0xFFC2524D))),
+                child: Stack(
+                  children: <Widget>[
+                    Padding(
+                      padding:
+                          EdgeInsets.symmetric(horizontal: 20, vertical: 25),
+                      child: Column(
+                        mainAxisAlignment: MainAxisAlignment.center,
+                        children: <Widget>[
+                          Text(title ?? '提示',
+                              style: TextStyle(
+                                  color: Colors.white,
+                                  fontSize: 18,
+                                  fontWeight: FontWeight.w600)),
+                          Container(
+                            height: 20,
+                          ),
+                          Text(text,
+                              style:
+                                  TextStyle(color: Colors.white, fontSize: 14),
+                              textAlign: TextAlign.center),
+                          Container(
+                            height: 30,
+                          ),
+                          cancel
+                              ? Row(
+                                  mainAxisAlignment:
+                                      MainAxisAlignment.spaceBetween,
+                                  children: <Widget>[
+                                    Container(
+                                      width: 100,
+                                      child: RaisedButton(
+                                        color: Color(0xFF3A3D5C),
+                                        highlightColor:
+                                            Color(0xFF3A3D5C).withOpacity(0.8),
+                                        textColor: Colors.white,
+                                        child: Text('取消'),
+                                        onPressed: () {
+                                          Navigator.of(context).pop();
+                                          oncancel();
+                                        },
+                                      ),
+                                    ),
+                                    Container(
+                                      width: 100,
+                                      child: RaisedButton(
+                                        textColor: Colors.white,
+                                        child: Text(submitText),
+                                        onPressed: () {
+                                          Navigator.of(context).pop();
+                                          onsubmit();
+                                        },
+                                      ),
+                                    )
+                                  ],
+                                )
+                              : Container(
+                                  width: double.infinity,
+                                  child: RaisedButton(
+                                    textColor: Colors.white,
+                                    child: Text(submitText),
+                                    onPressed: () {
+                                      Navigator.of(context).pop();
+                                      onsubmit();
+                                    },
+                                  ),
+                                ),
+                          Container(
+                            height: 5,
+                          )
+                        ],
+                      ),
+                    ),
+                    Positioned(
+                      top: 0,
+                      left: 0,
+                      child: Image.asset(
+                        'images/tancuang_shang.png',
+                        width: 131,
+                      ),
+                    ),
+                    Positioned(
+                      bottom: 0,
+                      right: 4,
+                      child: Image.asset(
+                        'images/tancuang_xia.png',
+                        width: 148,
+                      ),
+                    ),
+                  ],
+                ),
+              ),
+            ),
+          ),
+        ),
+      ),
+      onWillPop: () {
+        return Future.value(false);
+      },
+    );
+  }
+}

+ 6 - 1
lib/widget/HomeDrawer.dart

@@ -10,6 +10,7 @@ import '../pages/RecordList.dart';
 import '../net/HttpManager.dart';
 import '../net/HttpManager.dart';
 import '../net/Result.dart';
 import '../net/Result.dart';
 import '../redux/UserRedux.dart';
 import '../redux/UserRedux.dart';
+import '../pages/setting.dart';
 
 
 class HomeDrawer extends StatefulWidget {
 class HomeDrawer extends StatefulWidget {
   @override
   @override
@@ -117,7 +118,11 @@ class HomeDrawerState extends State<HomeDrawer> {
                         onTap: () {
                         onTap: () {
                           Navigator.push(context, new CupertinoPageRoute(builder: (context) => new BindGame()));
                           Navigator.push(context, new CupertinoPageRoute(builder: (context) => new BindGame()));
                         },
                         },
-                      )
+                      ),
+                      Divder(),
+                      DrawerMenu('images/home_icon_shezhi.png', '个人设置',onTap: (){
+                         Navigator.push(context, new CupertinoPageRoute(builder: (context) => new Setting()));
+                      },)
                     ],
                     ],
                   ),
                   ),
                 ),
                 ),