ソースを参照

Merge branch 'master' of http://git.izouma.com/panhui/mobileCyberGamesApp

x1ongzhu 7 年 前
コミット
bd2e0d0c21

BIN
images/2x/img_chijizhanchang.png


BIN
images/3x/img_chijizhanchang.png


BIN
images/img_chijizhanchang.png


+ 5 - 0
lib/main.dart

@@ -43,6 +43,11 @@ class MobileCyberGamesApp extends StatelessWidget {
               textSelectionColor: Colors.white,
               textTheme: TextTheme(
                 subhead: TextStyle(color: Colors.white),
+              ),
+              buttonTheme: ButtonThemeData(
+                buttonColor: Color(0xFFC2524D),
+                highlightColor: Color(0xFF9B4040),
+                splashColor: Color(0xFF9B4040),
               )),
           home: store.state.isLogin ? HomePage() : LoginFirst(),
         ));

+ 24 - 0
lib/model/BindGameInfo.dart

@@ -0,0 +1,24 @@
+import 'package:json_annotation/json_annotation.dart';
+import 'GameInfo.dart';
+
+part 'BindGameInfo.g.dart';
+
+@JsonSerializable()
+class BindGameInfo {
+  BindGameInfo(this.id, this.gameId, this.userId, this.nickName,this.gameInfo);
+  int id;
+  int gameId;//游戏ID
+  int userId;//用户ID
+  String nickName;//用户昵称
+  GameInfo gameInfo;//游戏信息
+  factory BindGameInfo.fromJson(Map<String, dynamic> json) =>
+      _$BindGameInfoFromJson(json);
+
+  Map<String, dynamic> toJson() => _$BindGameInfoToJson(this);
+  // 命名构造函数
+  BindGameInfo.empty();
+  @override
+  String toString() {
+    return _$BindGameInfoToJson(this).toString();
+  }
+}

+ 30 - 0
lib/model/BindGameInfo.g.dart

@@ -0,0 +1,30 @@
+// GENERATED CODE - DO NOT MODIFY BY HAND
+
+part of 'BindGameInfo.dart';
+
+// **************************************************************************
+// JsonSerializableGenerator
+// **************************************************************************
+
+BindGameInfo _$BindGameInfoFromJson(Map<String, dynamic> json) {
+  return BindGameInfo(
+      json['id'] as int,
+      json['gameId'] as int,
+      json['userId'] as int,
+      json['nickName'] as String,
+      GameInfo.fromJson(json['gameInfo'] as Map));
+}
+
+// int id;
+// int gameId;//游戏ID
+// int userId;//用户ID
+// String nickName;//用户昵称
+//  GameInfo gameInfo;//游戏信息
+Map<String, dynamic> _$BindGameInfoToJson(BindGameInfo instance) =>
+    <String, dynamic>{
+      'id': instance.id,
+      'gameId': instance.gameId,
+      'userId': instance.userId,
+      'nickName': instance.nickName,
+      'gameInfo': instance.gameInfo
+    };

+ 30 - 0
lib/model/CompetitionSeason.dart

@@ -0,0 +1,30 @@
+import 'package:json_annotation/json_annotation.dart';
+import 'GameInfo.dart';
+
+part 'CompetitionSeason.g.dart';
+
+@JsonSerializable()
+class CompetitionSeason {
+  CompetitionSeason(this.id, this.season, this.shortName, this.beginTime, this.endTime,
+      this.bonus, this.statusFlag, this.gameId,this.gameInfo);
+  int id;
+  String season;//名称
+  String shortName;//简称
+  int beginTime;//开始时间
+  int endTime;//结束时间
+  int bonus;//奖金数
+  int statusFlag;//状态
+  int gameId; //游戏ID
+  GameInfo gameInfo;//游戏信息
+  
+  factory CompetitionSeason.fromJson(Map<String, dynamic> json) =>
+      _$CompetitionSeasonFromJson(json);
+
+  Map<String, dynamic> toJson() => _$CompetitionSeasonToJson(this);
+  // 命名构造函数
+  CompetitionSeason.empty();
+  @override
+  String toString() {
+    return _$CompetitionSeasonToJson(this).toString();
+  }
+}

+ 42 - 0
lib/model/CompetitionSeason.g.dart

@@ -0,0 +1,42 @@
+// GENERATED CODE - DO NOT MODIFY BY HAND
+
+part of 'CompetitionSeason.dart';
+
+// **************************************************************************
+// JsonSerializableGenerator
+// **************************************************************************
+
+CompetitionSeason _$CompetitionSeasonFromJson(Map<String, dynamic> json) {
+  return CompetitionSeason(
+      json['id'] as int,
+      json['season'] as String,
+      json['shortName'] as String,
+      json['beginTime'] as int,
+      json['endTime'] as int,
+      json['bonus'] as int,
+      json['statusFlag'] as int,
+      json['gameId'] as int,
+      GameInfo.fromJson((json['gameInfo'] as Map))
+      );
+}
+
+//  int id;
+//   String season;//名称
+//   String shortName;//简称
+//   int beginTime;//开始时间
+//   int endTime;//结束时间
+//   int bonus;//奖金数
+//   int statusFlag;//状态
+//   int gameId; //游戏ID
+Map<String, dynamic> _$CompetitionSeasonToJson(CompetitionSeason instance) =>
+    <String, dynamic>{
+      'id': instance.id,
+      'season': instance.season,
+      'shortName': instance.shortName,
+      'beginTime': instance.beginTime,
+      'endTime': instance.endTime,
+      'bonus': instance.bonus,
+      'statusFlag': instance.statusFlag,
+      'gameId': instance.gameId,
+      'gameInfo':instance.gameInfo
+    };

+ 22 - 0
lib/model/GameInfo.dart

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

+ 27 - 0
lib/model/GameInfo.g.dart

@@ -0,0 +1,27 @@
+// GENERATED CODE - DO NOT MODIFY BY HAND
+
+part of 'GameInfo.dart';
+
+// **************************************************************************
+// JsonSerializableGenerator
+// **************************************************************************
+
+GameInfo _$GameInfoFromJson(Map<String, dynamic> json) {
+  return GameInfo(
+      json['id'] as int,
+      json['gameName'] as String,
+      json['icon'] as String,
+      json['typeFlag'] as int);
+}
+
+//  int id;
+//   String gameName;//名称
+//   String icon;//图标
+//   int typeFlag;//类型
+Map<String, dynamic> _$GameInfoToJson(GameInfo instance) =>
+    <String, dynamic>{
+      'id': instance.id,
+      'gameName': instance.gameName,
+      'icon': instance.icon,
+      'typeFlag': instance.typeFlag,
+    };

+ 50 - 0
lib/model/HouseInfo.dart

@@ -0,0 +1,50 @@
+import 'package:json_annotation/json_annotation.dart';
+import 'GameInfo.dart';
+import 'HouseLevel.dart';
+
+part 'HouseInfo.g.dart';
+
+@JsonSerializable()
+class HouseInfo {
+  HouseInfo(
+      this.id,
+      this.gameId,
+      this.userId,
+      this.seasonId,
+      this.houseName,
+      this.houseAbstract,
+      this.video,
+      // this.gameInfo,
+      this.maxNumber,
+      this.bonus,
+      this.houseType,
+      this.houseLevel,
+      this.gameHouseId,
+      this.gameHousePassword,
+      this.statusFlag);
+  int id;
+  int gameId; //游戏ID
+  int userId; //用户ID
+  int seasonId; //赛季ID
+  String houseName; //房间名称
+  String houseAbstract; //房间描述
+  String video; //视频
+  // GameInfo gameInfo; //游戏信息
+  int maxNumber; //最大加入人数
+  int bonus; //奖金
+  int houseType; //0为个人1为官方
+  HouseLevel houseLevel;
+  String gameHouseId; //游戏房间号
+  String gameHousePassword; //游戏密码
+  int statusFlag; //状态
+  factory HouseInfo.fromJson(Map<String, dynamic> json) =>
+      _$HouseInfoFromJson(json);
+
+  Map<String, dynamic> toJson() => _$HouseInfoToJson(this);
+  // 命名构造函数
+  HouseInfo.empty();
+  @override
+  String toString() {
+    return _$HouseInfoToJson(this).toString();
+  }
+}

+ 60 - 0
lib/model/HouseInfo.g.dart

@@ -0,0 +1,60 @@
+// GENERATED CODE - DO NOT MODIFY BY HAND
+
+part of 'HouseInfo.dart';
+
+// **************************************************************************
+// JsonSerializableGenerator
+// **************************************************************************
+
+HouseInfo _$HouseInfoFromJson(Map<String, dynamic> json) {
+  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,
+    // GameInfo.fromJson(json['gameInfo'] as Map),
+    json['maxNumber'] as int,
+    json['bonus'] as int,
+    json['houseType'] as int,
+    HouseLevel.fromJson(json['houseLevelInfo'] as Map),
+    json['gameHouseId'] as String,
+    json['gameHousePassword'] as String,
+    json['statusFlag'] as int,
+  );
+}
+
+//  int id;
+//   int gameId; //游戏ID
+//   int userId; //用户ID
+//   int seasonId; //赛季ID
+//   String houseName; //房间名称
+//   String houseAbstract; //房间描述
+//   String video; //视频
+//   GameInfo gameInfo; //游戏信息
+//   int maxNumber; //最大加入人数
+//   int bonus; //奖金
+//   int houseType; //0为个人1为官方
+//   HouseLevel houseLevel;
+//   String gameHouseId; //游戏房间号
+//   String gameHousePassword; //游戏密码
+//   int statusFlag; //状态
+Map<String, dynamic> _$HouseInfoToJson(HouseInfo instance) => <String, dynamic>{
+      'id': instance.id,
+      'gameId': instance.gameId,
+      'userId': instance.userId,
+      'seasonId': instance.seasonId,
+      'houseName': instance.houseName,
+      'houseAbstract': instance.houseAbstract,
+      'video': instance.video,
+      // 'gameInfo': instance.gameInfo,
+      'maxNumber': instance.maxNumber,
+      'bonus': instance.bonus,
+      'houseType': instance.houseType,
+      'houseLevel': instance.houseLevel,
+      'gameHouseId': instance.gameHouseId,
+      'gameHousePassword': instance.gameHousePassword,
+      'statusFlag': instance.statusFlag
+    };

+ 22 - 0
lib/model/HouseLevel.dart

@@ -0,0 +1,22 @@
+import 'package:json_annotation/json_annotation.dart';
+
+part 'HouseLevel.g.dart';
+
+@JsonSerializable()
+class HouseLevel {
+  HouseLevel(this.id, this.levelName, this.icon, this.entryCoin);
+  int id;
+  String levelName;//名称
+  String icon;//图标
+  int entryCoin;//加入金额
+  factory HouseLevel.fromJson(Map<String, dynamic> json) =>
+      _$HouseLevelFromJson(json);
+
+  Map<String, dynamic> toJson() => _$HouseLevelToJson(this);
+  // 命名构造函数
+  HouseLevel.empty();
+  @override
+  String toString() {
+    return _$HouseLevelToJson(this).toString();
+  }
+}

+ 23 - 0
lib/model/HouseLevel.g.dart

@@ -0,0 +1,23 @@
+// GENERATED CODE - DO NOT MODIFY BY HAND
+
+part of 'HouseLevel.dart';
+
+// **************************************************************************
+// JsonSerializableGenerator
+// **************************************************************************
+
+HouseLevel _$HouseLevelFromJson(Map<String, dynamic> json) {
+  return HouseLevel(json['id'] as int, json['levelName'] as String,
+      json['icon'] as String, json['entryCoin'] as int);
+}
+
+// String levelName;//名称
+// String icon;//图标
+// int entryCoin;//加入金额
+Map<String, dynamic> _$HouseLevelToJson(HouseLevel instance) =>
+    <String, dynamic>{
+      'id': instance.id,
+      'levelName': instance.levelName,
+      'icon': instance.icon,
+      'entryCoin': instance.entryCoin,
+    };

+ 221 - 0
lib/pages/BindGame.dart

@@ -0,0 +1,221 @@
+import 'package:flutter/material.dart';
+import '../styles/colors.dart';
+import 'dart:ui';
+import '../styles/totast.dart';
+import 'package:flutter_redux/flutter_redux.dart';
+import '../redux/AppState.dart';
+import '../net/HttpManager.dart';
+import '../net/Result.dart';
+import '../model/BindGameInfo.dart';
+
+class BindGame extends StatefulWidget {
+  @override
+  BindGameState createState() => BindGameState();
+}
+
+class BindGameState extends State<BindGame> {
+  String bindName = '';
+  bool isBind = false;
+  BindGameInfo bindInfo;
+
+  void getBindInfo() async {
+    Toast.show(context, '加载中', -1, 'loading');
+    Result res = await HttpManager.get("bindGame/all", data: {
+      "gameId": 1,
+      "userId": StoreProvider.of<AppState>(context).state.userInfo.id
+    });
+    Toast.hide();
+    if (res.success) {
+      if (res.data.length > 0) {
+        print(res.data[0]);
+        setState(() {
+          isBind = true;
+          bindInfo = BindGameInfo.fromJson(res.data[0]);
+        });
+      } else {
+        setState(() {
+          isBind = false;
+        });
+      }
+    }
+  }
+
+  @override
+  void initState() {
+    super.initState();
+    Future.delayed(Duration(milliseconds: 50), () {
+      getBindInfo();
+    });
+  }
+
+  void bindEvent() async {
+    if (bindName == '') {
+      Toast.show(context, '请输入绑定角色名称', 1500, 'info');
+      return;
+    }
+    Toast.show(context, '加载中', -1, 'loading');
+    Result res = await HttpManager.post("bindGame/save", data: {
+      "gameId": 1,
+      "userId": StoreProvider.of<AppState>(context).state.userInfo.id,
+      "nickName": bindName
+    });
+    Toast.hide();
+    if (res.success) {
+      Toast.show(context, '绑定成功', 1000, 'success');
+      Future.delayed(Duration(milliseconds: 1000), () {
+        getBindInfo();
+      });
+    } else {}
+  }
+
+  void cancelBind() async {
+    Toast.show(context, '加载中', -1, 'loading');
+    Result res =
+        await HttpManager.post("bindGame/del", data: {'id': bindInfo.id});
+    Toast.hide();
+    if (res.success) {
+      Toast.show(context, '解绑成功', 1000, 'success');
+      Future.delayed(Duration(milliseconds: 1000), () {
+        getBindInfo();
+      });
+    } else {}
+  }
+
+  @override
+  Widget build(BuildContext context) {
+    return new Scaffold(
+        appBar: AppBar(
+          backgroundColor: PRIMARY_COLOR,
+          title: Text('绑定账号'),
+          centerTitle: true,
+          elevation: 0,
+        ),
+        body: Container(
+          color: BG_SUB_COLOR,
+          padding: EdgeInsets.all(15),
+          child: Column(
+            children: <Widget>[
+              Container(
+                height: 220,
+                width: double.infinity,
+                // padding: EdgeInsets.symmetric(vertical: 15, horizontal: 34),
+                decoration: BoxDecoration(
+                    image: DecorationImage(
+                        image: AssetImage('images/img_chijizhanchang.png'),
+                        fit: BoxFit.cover)),
+                child: Column(
+                  mainAxisAlignment: MainAxisAlignment.end,
+                  children: _bindWidegt(),
+                ),
+              )
+            ],
+          ),
+        ));
+  }
+
+  List<Widget> _bindWidegt() {
+    List<Widget> widgetList = [];
+    if (isBind) {
+      widgetList.add(Container(
+        height: 78,
+        padding: EdgeInsets.all(15),
+        decoration: BoxDecoration(
+            gradient: LinearGradient(
+                colors: [Color(0xFF464B6A), Color(0xFF35395E)],
+                begin: Alignment.topCenter,
+                end: Alignment.bottomCenter)),
+        child: Row(
+          children: <Widget>[
+            Image.network(bindInfo.gameInfo.icon, width: 48),
+            Container(
+              width: 10,
+            ),
+            Expanded(
+                flex: 1,
+                child: Column(
+                  mainAxisAlignment: MainAxisAlignment.center,
+                  crossAxisAlignment: CrossAxisAlignment.start,
+                  children: <Widget>[
+                    Text(bindInfo.gameInfo.gameName,
+                        style: TextStyle(color: Colors.white, fontSize: 14)),
+                    Container(
+                      height: 5,
+                    ),
+                    Row(
+                      children: <Widget>[
+                        Text(
+                          "已绑定",
+                          style: TextStyle(
+                              color: Color(0xFF727785),
+                              fontSize: 13,
+                              fontWeight: FontWeight.w500),
+                        ),
+                        Container(
+                          width: 10,
+                        ),
+                        Text(
+                          bindInfo.nickName,
+                          style: TextStyle(
+                              color: Colors.white,
+                              fontSize: 13,
+                              fontWeight: FontWeight.w500),
+                        )
+                      ],
+                    )
+                  ],
+                )),
+            Container(
+                width: 50,
+                height: 30,
+                child: OutlineButton(
+                  padding: EdgeInsets.all(0),
+                  borderSide: BorderSide(color: Color(0xFFC2524D), width: 1),
+                  textColor: Color(0xFFC2524D),
+                  highlightedBorderColor: Color(0xFF9B4040),
+                  child: Text("解绑"),
+                  onPressed: () => cancelBind(),
+                ))
+          ],
+        ),
+      ));
+    } else {
+      widgetList = [
+        Container(
+          margin: EdgeInsets.only(bottom: 10, left: 45, right: 45),
+          decoration: BoxDecoration(
+            borderRadius: BorderRadius.all(Radius.circular(2)),
+            color: Colors.white,
+          ),
+          height: 40,
+          child: TextField(
+            style: TextStyle(
+                color: Color(0xFFAF4946), fontWeight: FontWeight.w500),
+            textAlign: TextAlign.center,
+            decoration: InputDecoration(
+                hintText: '请输入刺激战场游戏昵称',
+                border: InputBorder.none,
+                hintStyle: TextStyle(fontSize: 12, color: Color(0xFF727785))),
+            onChanged: (value) {
+              setState(() {
+                bindName = value;
+              });
+            },
+          ),
+        ),
+        Container(
+          margin: EdgeInsets.only(left: 45, right: 45, bottom: 15),
+          width: double.infinity,
+          height: 40,
+          child: RaisedButton(
+            textTheme: ButtonTextTheme.primary,
+            child: Text('绑定角色'),
+            onPressed: () {
+              bindEvent();
+            },
+          ),
+        )
+      ];
+    }
+    return widgetList;
+  }
+}

+ 179 - 129
lib/pages/HomePage.dart

@@ -4,6 +4,11 @@ import './Setting.dart';
 import './CreateRoom.dart';
 import 'RoomList.dart'; //房间列表
 import 'package:flutter/cupertino.dart';
+import 'package:flutter_swiper/flutter_swiper.dart';
+import '../model/CompetitionSeason.dart';
+import '../styles/totast.dart';
+import '../net/HttpManager.dart';
+import '../net/Result.dart';
 
 class HomePage extends StatefulWidget {
   @override
@@ -11,6 +16,31 @@ class HomePage extends StatefulWidget {
 }
 
 class _HomePageState extends State<HomePage> {
+  List<CompetitionSeason> seasonList = [];
+  int nowIndex = 0;
+
+  void getSeasonInfo() async {
+    Toast.show(context, '加载中', -1, 'loading');
+    Result res = await HttpManager.get("competitionSeason/all");
+    Toast.hide();
+    if (res.success) {
+      List<CompetitionSeason> list = [];
+      for (var item in res.data) {
+        list.add(CompetitionSeason.fromJson(item));
+      }
+      setState(() {
+        seasonList = list;
+      });
+      print(seasonList);
+    } else {}
+  }
+
+  @override
+  void initState() {
+    super.initState();
+    getSeasonInfo();
+  }
+
   @override
   Widget build(BuildContext context) {
     return Scaffold(
@@ -24,55 +54,38 @@ class _HomePageState extends State<HomePage> {
           Color.fromARGB(255, 147, 64, 61)
         ], begin: Alignment.topCenter, end: Alignment.bottomCenter)),
         child: SafeArea(
-          child: Column(
+          child: centerWidget(),
+        ),
+      ),
+    );
+  }
+
+  Widget centerWidget() {
+    return Column(
+      children: <Widget>[
+        Expanded(
+          child: Stack(
             children: <Widget>[
-              Expanded(
-                child: Stack(
-                  children: <Widget>[
-                    Positioned(
-                      left: 0,
-                      top: 0,
-                      width: 48,
-                      height: 48,
-                      child: Material(
-                        color: Colors.transparent,
-                        child: Builder(
-                          builder: (context) => InkWell(
-                                onTap: () {
-                                  Scaffold.of(context).openDrawer();
-                                },
-                                child: Padding(
-                                  padding: EdgeInsets.all(12),
-                                  child:
-                                      Image.asset("images/home_icon_wode.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"),
-                          ),
-                        ),
-                      ),
-                    ),
-                    Center(
-                      child: SizedBox(
+              Container(
+                
+                  child: Swiper(
+                index: nowIndex,
+                itemCount: seasonList.length,
+                scrollDirection: Axis.horizontal,
+                loop: true,
+                onTap: (index) {
+                  setState(() {
+                   nowIndex=index; 
+                  });
+                },
+                onIndexChanged: (index) {
+                   setState(() {
+                   nowIndex=index; 
+                  });
+                },
+                itemBuilder: (context, index) {
+                  return Center(
+                    child: SizedBox(
                         width: 214,
                         height: 214,
                         child: Stack(
@@ -85,7 +98,7 @@ class _HomePageState extends State<HomePage> {
                                 textBaseline: TextBaseline.alphabetic,
                                 children: <Widget>[
                                   Text(
-                                    "568",
+                                    (seasonList[index].bonus/1000).toStringAsFixed(1),
                                     style: TextStyle(
                                       color: Colors.white,
                                       fontSize: 68,
@@ -109,102 +122,139 @@ class _HomePageState extends State<HomePage> {
                               right: 0,
                               child: Column(
                                 children: <Widget>[
-                                  Text(
-                                    "当前排名",
-                                    style: TextStyle(
-                                        color: Colors.white, fontSize: 13),
-                                  ),
-                                  Text(
-                                    "98686",
-                                    style: TextStyle(
-                                        color: Colors.white, fontSize: 13),
-                                  )
+                                  // Text(
+                                  //   "当前排名",
+                                  //   style: TextStyle(
+                                  //       color: Colors.white, fontSize: 13),
+                                  // ),
+                                  // Text(
+                                  //   "98686",
+                                  //   style: TextStyle(
+                                  //       color: Colors.white, fontSize: 13),
+                                  // )
                                 ],
                               ),
                             )
                           ],
+                        )),
+                  );
+                },
+              )),
+              Positioned(
+                left: 0,
+                top: 0,
+                width: 48,
+                height: 48,
+                child: Material(
+                  color: Colors.transparent,
+                  child: Builder(
+                    builder: (context) => InkWell(
+                          onTap: () {
+                            Scaffold.of(context).openDrawer();
+                          },
+                          child: Padding(
+                            padding: EdgeInsets.all(12),
+                            child: Image.asset("images/home_icon_wode.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(
-                      bottom: 11,
-                      left: 0,
-                      right: 0,
-                      child: Column(
-                        mainAxisAlignment: MainAxisAlignment.center,
-                        crossAxisAlignment: CrossAxisAlignment.center,
-                        children: <Widget>[
-                          Text(
-                            "赛季奖金",
-                            style: TextStyle(color: Colors.white, fontSize: 14),
-                          ),
-                          Text(
-                            "刺激战场之大逃杀",
-                            style: TextStyle(color: Colors.white, fontSize: 14),
-                          )
-                        ],
-                      ),
-                    )
-                  ],
+                  ),
                 ),
               ),
-              Container(
-                child: GridView.count(
-                  physics: new BouncingScrollPhysics(),
-                  shrinkWrap: true,
-                  crossAxisCount: 2,
+              Positioned(
+                bottom: 11,
+                left: 0,
+                right: 0,
+                child: Column(
+                  mainAxisAlignment: MainAxisAlignment.center,
+                  crossAxisAlignment: CrossAxisAlignment.center,
                   children: <Widget>[
-                    HomeMenu(
-                      "images/home_icon_fangjian.png",
-                      "创建房间",
-                      onTapHomeMenu: () {
-                        Navigator.of(context).push(PageRouteBuilder(
-                            opaque: false,
-                            transitionDuration: Duration(milliseconds: 300),
-                            transitionsBuilder: (BuildContext context,
-                                Animation<double> animation,
-                                Animation<double> secondaryAnimation,
-                                Widget child) {
-                              return FadeTransition(
-                                opacity: CurvedAnimation(
-                                    parent: animation, curve: Curves.linear),
-                                child: child,
-                              );
-                            },
-                            pageBuilder: (BuildContext context, _, __) {
-                              return CreateRoom();
-                            }));
-                      },
-                    ),
-                    HomeMenu(
-                      "images/home_icon_kuaisu.png",
-                      "快速进入",
-                      onTapHomeMenu: () {
-                       
-                      },
-                    ),
-                    HomeMenu(
-                      "images/home_icon_sousuo.png",
-                      "搜索",
-                      onTapHomeMenu: () {
-                         Navigator.push(
-                            context,
-                            new CupertinoPageRoute(
-                                builder: (context) => new RoomList()));
-                      },
-                    ),
-                    HomeMenu(
-                      "images/home_icon_youjian.png",
-                      "邮件",
-                      onTapHomeMenu: () {},
+                    Text(
+                      seasonList[nowIndex].season,
+                      style: TextStyle(color: Colors.white, fontSize: 14),
                     ),
+                    Text(
+                      seasonList[nowIndex].gameInfo.gameName,
+                      style: TextStyle(color: Colors.white, fontSize: 14),
+                    )
                   ],
                 ),
               )
             ],
           ),
         ),
-      ),
+        Container(
+          child: GridView.count(
+            physics: new BouncingScrollPhysics(),
+            shrinkWrap: true,
+            crossAxisCount: 2,
+            children: <Widget>[
+              HomeMenu(
+                "images/home_icon_fangjian.png",
+                "创建房间",
+                onTapHomeMenu: () {
+                  Navigator.of(context).push(PageRouteBuilder(
+                      opaque: false,
+                      transitionDuration: Duration(milliseconds: 300),
+                      transitionsBuilder: (BuildContext context,
+                          Animation<double> animation,
+                          Animation<double> secondaryAnimation,
+                          Widget child) {
+                        return FadeTransition(
+                          opacity: CurvedAnimation(
+                              parent: animation, curve: Curves.linear),
+                          child: child,
+                        );
+                      },
+                      pageBuilder: (BuildContext context, _, __) {
+                        return CreateRoom();
+                      }));
+                },
+              ),
+              HomeMenu(
+                "images/home_icon_kuaisu.png",
+                "快速进入",
+                onTapHomeMenu: () {},
+              ),
+              HomeMenu(
+                "images/home_icon_sousuo.png",
+                "搜索",
+                onTapHomeMenu: () {
+                  Navigator.push(
+                      context,
+                      new CupertinoPageRoute(
+                          builder: (context) => new RoomList()));
+                },
+              ),
+              HomeMenu(
+                "images/home_icon_youjian.png",
+                "邮件",
+                onTapHomeMenu: () {},
+              ),
+            ],
+          ),
+        )
+      ],
     );
   }
 }

+ 19 - 8
lib/pages/roomInfo.dart

@@ -9,6 +9,10 @@ import '../net/HttpManager.dart';
 import '../net/Result.dart';
 import 'package:flutter_redux/flutter_redux.dart';
 import '../redux/AppState.dart';
+import '../model/HouseInfo.dart';
+import '../net/HttpManager.dart';
+import '../net/Result.dart';
+import '../styles/totast.dart';
 
 class RoomInfo extends StatefulWidget {
   RoomInfo({Key key, this.roomId}) : super(key: key);
@@ -25,6 +29,7 @@ class RoomInfoState extends State<RoomInfo>
   TabController mController;
   ScrollController _perController;
   Map roomInfo;
+  HouseInfo houseInfo;
   Map colorInfo;
   List joinList = [];
   bool isJoin = true;
@@ -340,7 +345,10 @@ class RoomInfoState extends State<RoomInfo>
         child: RaisedButton(
           disabledColor: Color(0xFF914244),
           disabledTextColor: Color(0xFF252532),
-          child: Text('等待开始中',style: TextStyle(fontSize: 16),),
+          child: Text(
+            '等待开始中',
+            style: TextStyle(fontSize: 16),
+          ),
           onPressed: null,
         ),
       );
@@ -409,14 +417,17 @@ class RoomInfoState extends State<RoomInfo>
   }
 
   void getRoomInfo() async {
-    final response = await Dio().get(domain + 'houseInfo/getOne',
-        queryParameters: {"id": widget.roomId});
-    final res = json.decode(response.toString());
-    if (res['success']) {
+    Toast.show(context, '加载中', -1, 'loading');
+    Result res =
+        await HttpManager.get("houseInfo/getOne", data: {"id": widget.roomId});
+    Toast.hide();
+    if (res.success) {
+      print(res.data);
       setState(() {
-        roomInfo = res["data"];
+        roomInfo = res.data;
+        houseInfo=HouseInfo.fromJson(res.data);
       });
-      print(roomInfo);
-    }
+       print(houseInfo);
+    } else {}
   }
 }

+ 15 - 5
lib/widgets/HomeDrawer.dart

@@ -5,6 +5,7 @@ import 'package:flutter/cupertino.dart';
 import '../redux/AppState.dart';
 import '../model/UserInfo.dart';
 import '../pages/MyWallet.dart'; //我的钱包
+import '../pages/BindGame.dart'; //游戏绑定
 
 class HomeDrawer extends StatelessWidget {
   @override
@@ -87,16 +88,25 @@ class HomeDrawer extends StatelessWidget {
                         "images/icon_qianbao.png",
                         "我的钱包",
                         onTap: () {
-                           Navigator.push(
-                            context,
-                            new CupertinoPageRoute(
-                                builder: (context) => new MyWallet()));
+                          Navigator.push(
+                              context,
+                              new CupertinoPageRoute(
+                                  builder: (context) => new MyWallet()));
                         },
                       ),
                       Divder(),
                       DrawerMenu("images/icon_zhanji.png", "我的战绩"),
                       Divder(),
-                      DrawerMenu("images/icon_bangding.png", "游戏绑定")
+                      DrawerMenu(
+                        "images/icon_bangding.png",
+                        "游戏绑定",
+                        onTap: () {
+                          Navigator.push(
+                              context,
+                              new CupertinoPageRoute(
+                                  builder: (context) => new BindGame()));
+                        },
+                      )
                     ],
                   ),
                 ),