Explorar el Código

02/25 初级合并

panhui hace 6 años
padre
commit
c0eb695220

+ 11 - 4
lib/main.dart

@@ -21,10 +21,17 @@ class MobileCyberGamesApp extends StatelessWidget {
         store: this.store,
         store: this.store,
         child: new MaterialApp(
         child: new MaterialApp(
           title: '全民电竞',
           title: '全民电竞',
-
-
-
-          
+          theme: ThemeData(
+              cardColor: Color(0xFF2B2B42),
+              backgroundColor: Color(0xFF222335),
+              primaryColor: Color(0xFFC2524D),
+              buttonColor: Color(0xFFC2524D),
+              highlightColor: Color(0xFF933E3E),
+              accentColor: Color(0xFFC2524D),
+              textSelectionColor: Colors.white,
+              textTheme: TextTheme(
+                subhead: TextStyle(color: Colors.white),
+              )),
           home: store.state.isLogin ? HomePage() : LoginFirst(),
           home: store.state.isLogin ? HomePage() : LoginFirst(),
         ));
         ));
   }
   }

+ 1 - 1
lib/model/UserInfo.dart

@@ -12,7 +12,7 @@ class UserInfo {
   String icon;
   String icon;
   String phone;
   String phone;
   String sex;
   String sex;
-  double moneyCoin; //余额
+  int moneyCoin; //余额
   double moneyPoint; //积分
   double moneyPoint; //积分
   int birthday;
   int birthday;
   factory UserInfo.fromJson(Map<String, dynamic> json) =>
   factory UserInfo.fromJson(Map<String, dynamic> json) =>

+ 1 - 1
lib/model/UserInfo.g.dart

@@ -14,7 +14,7 @@ UserInfo _$UserInfoFromJson(Map<String, dynamic> json) {
       json['icon'] as String,
       json['icon'] as String,
       json['phone'] as String,
       json['phone'] as String,
       json['sex'] as String,
       json['sex'] as String,
-      (json['moneyCoin'] as num)?.toDouble(),
+      (json['moneyCoin'] as num)?.toInt(),
       (json['moneyPoint'] as num)?.toDouble(),
       (json['moneyPoint'] as num)?.toDouble(),
       json['birthday'] as int);
       json['birthday'] as int);
 }
 }

+ 10 - 3
lib/pages/HomePage.dart

@@ -2,6 +2,7 @@ import 'package:flutter/material.dart';
 import '../widgets/HomeDrawer.dart';
 import '../widgets/HomeDrawer.dart';
 import './Setting.dart';
 import './Setting.dart';
 import './CreateRoom.dart';
 import './CreateRoom.dart';
+import 'RoomList.dart'; //房间列表
 import 'package:flutter/cupertino.dart';
 import 'package:flutter/cupertino.dart';
 
 
 class HomePage extends StatefulWidget {
 class HomePage extends StatefulWidget {
@@ -62,7 +63,6 @@ class _HomePageState extends State<HomePage> {
                                 context,
                                 context,
                                 new CupertinoPageRoute(
                                 new CupertinoPageRoute(
                                     builder: (context) => new Setting()));
                                     builder: (context) => new Setting()));
-
                           },
                           },
                           child: Padding(
                           child: Padding(
                             padding: EdgeInsets.all(12),
                             padding: EdgeInsets.all(12),
@@ -179,12 +179,19 @@ class _HomePageState extends State<HomePage> {
                     HomeMenu(
                     HomeMenu(
                       "images/home_icon_kuaisu.png",
                       "images/home_icon_kuaisu.png",
                       "快速进入",
                       "快速进入",
-                      onTapHomeMenu: () {},
+                      onTapHomeMenu: () {
+                       
+                      },
                     ),
                     ),
                     HomeMenu(
                     HomeMenu(
                       "images/home_icon_sousuo.png",
                       "images/home_icon_sousuo.png",
                       "搜索",
                       "搜索",
-                      onTapHomeMenu: () {},
+                      onTapHomeMenu: () {
+                         Navigator.push(
+                            context,
+                            new CupertinoPageRoute(
+                                builder: (context) => new RoomList()));
+                      },
                     ),
                     ),
                     HomeMenu(
                     HomeMenu(
                       "images/home_icon_youjian.png",
                       "images/home_icon_youjian.png",

+ 1 - 2
lib/pages/loginSecond.dart

@@ -151,8 +151,7 @@ class LoginSecondState extends State<LoginSecond> {
                                       Toast.hide();
                                       Toast.hide();
                                       if (res.success) {
                                       if (res.success) {
                                         print(res);
                                         print(res);
-                                        final prefs = await SharedPreferences
-                                            .getInstance();
+                                        final prefs = await SharedPreferences.getInstance();
                                         prefs.setString('token', res.token);
                                         prefs.setString('token', res.token);
                                         print(prefs.getString('token'));
                                         print(prefs.getString('token'));
                                         HttpManager.token = res.token;
                                         HttpManager.token = res.token;

+ 118 - 91
lib/pages/myWallet.dart

@@ -2,8 +2,15 @@ import 'package:flutter/material.dart';
 import 'package:flutter/cupertino.dart';
 import 'package:flutter/cupertino.dart';
 import 'package:flutter_screenutil/flutter_screenutil.dart';
 import 'package:flutter_screenutil/flutter_screenutil.dart';
 import '../styles/colors.dart';
 import '../styles/colors.dart';
+import 'package:redux/redux.dart';
+import 'package:flutter_redux/flutter_redux.dart';
+import '../redux/AppState.dart';
+import '../model/UserInfo.dart';
+import '../net/HttpManager.dart';
+import '../net/Result.dart';
+import '../styles/api.dart';
 import 'dart:ui';
 import 'dart:ui';
-
+import '../styles/totast.dart';
 import 'recharge.dart';
 import 'recharge.dart';
 
 
 class MyWallet extends StatefulWidget {
 class MyWallet extends StatefulWidget {
@@ -13,19 +20,51 @@ class MyWallet extends StatefulWidget {
 
 
 class MyWalletState extends State<MyWallet> {
 class MyWalletState extends State<MyWallet> {
   ScrollController _controller;
   ScrollController _controller;
-  List<Map> walletList;
+  List walletList;
   bool isShow = false;
   bool isShow = false;
   num _topHeight;
   num _topHeight;
+  int currentPage = 1;
+  bool canNext = true;
+
+  getWalletPage() async {
+    Toast.show(context, '加载中', -1, 'loading');
+    canNext = false;
+    Result res = await HttpManager.get("memberCoin/page", data: {
+      "userId": StoreProvider.of<AppState>(context).state.userInfo.id,
+      "currentPage": currentPage,
+      "pageNumber": 20
+    });
+    Toast.hide();
+    if (res.success) {
+      if (currentPage == 1) {
+        walletList = [];
+      }
+      setState(() {
+        walletList.addAll(res.data['pp']);
+      });
+
+      if (res.data['page']['totalNumber'] > currentPage) {
+        canNext = true;
+      }
+      print(walletList);
+    } else {}
+  }
+
   @override
   @override
   void initState() {
   void initState() {
     super.initState();
     super.initState();
     walletList = List<Map>();
     walletList = List<Map>();
+    Future.delayed(Duration(milliseconds: 100), () {
+      getWalletPage();
+    });
     _controller = ScrollController();
     _controller = ScrollController();
     isShow = false;
     isShow = false;
-    fetchTen();
+
     _controller.addListener(() {
     _controller.addListener(() {
-      if (_controller.position.pixels == _controller.position.maxScrollExtent) {
-        fetchTen();
+      if (_controller.position.pixels == _controller.position.maxScrollExtent &&
+          canNext) {
+        currentPage++;
+        getWalletPage();
       }
       }
 
 
       if (_controller.position.pixels >= _topHeight + 82) {
       if (_controller.position.pixels >= _topHeight + 82) {
@@ -49,40 +88,45 @@ class MyWalletState extends State<MyWallet> {
   @override
   @override
   Widget build(BuildContext context) {
   Widget build(BuildContext context) {
     ScreenUtil.instance = ScreenUtil(width: 375, height: 667)..init(context);
     ScreenUtil.instance = ScreenUtil(width: 375, height: 667)..init(context);
-    return new Scaffold(
-        body: RefreshIndicator(
-      color: PRIMARY_COLOR,
-      backgroundColor: BG_COLOR,
-      onRefresh: () async {
-        await new Future.delayed(const Duration(seconds: 1));
-        setState(() {
-          walletList = List<Map>();
-          isShow = false;
-        });
-        fetchTen();
-      },
-      child: Container(
-        color: BG_COLOR,
-        child: Stack(
-          children: <Widget>[
-            CustomScrollView(
-              controller: _controller,
-              slivers: <Widget>[
-                SliverAppBar(
-                  backgroundColor: PRIMARY_COLOR,
-                  title: Text(isShow ? "余额明细" : ""),
-                  centerTitle: true,
-                  pinned: true,
-                ),
-                _sliverToBoxAdapter(context),
-                _sliverList(context),
-              ],
+    return StoreConnector<AppState, UserInfo>(
+        converter: (Store store) => store.state.userInfo,
+        builder: (context, userInfo) {
+          return new Scaffold(
+              body: RefreshIndicator(
+            color: PRIMARY_COLOR,
+            backgroundColor: BG_COLOR,
+            onRefresh: () async {
+              await new Future.delayed(const Duration(seconds: 1));
+              setState(() {
+                walletList = [];
+                isShow = false;
+                currentPage = 1;
+              });
+              getWalletPage();
+            },
+            child: Container(
+              color: BG_COLOR,
+              child: Stack(
+                children: <Widget>[
+                  CustomScrollView(
+                    controller: _controller,
+                    slivers: <Widget>[
+                      SliverAppBar(
+                        backgroundColor: PRIMARY_COLOR,
+                        title: Text(isShow ? "余额明细" : ""),
+                        centerTitle: true,
+                        pinned: true,
+                      ),
+                      _sliverToBoxAdapter(context, userInfo),
+                      _sliverList(context),
+                    ],
+                  ),
+                  // _floatTab(context)
+                ],
+              ),
             ),
             ),
-            _floatTab(context)
-          ],
-        ),
-      ),
-    ));
+          ));
+        });
   }
   }
 
 
 //浮块
 //浮块
@@ -99,7 +143,7 @@ class MyWalletState extends State<MyWallet> {
     );
     );
   }
   }
 
 
-  Widget _sliverToBoxAdapter(BuildContext context) {
+  Widget _sliverToBoxAdapter(BuildContext context, UserInfo userInfo) {
     return SliverToBoxAdapter(
     return SliverToBoxAdapter(
         child: Column(
         child: Column(
       children: <Widget>[
       children: <Widget>[
@@ -128,7 +172,7 @@ class MyWalletState extends State<MyWallet> {
                   mainAxisAlignment: MainAxisAlignment.center,
                   mainAxisAlignment: MainAxisAlignment.center,
                   children: <Widget>[
                   children: <Widget>[
                     Container(
                     Container(
-                      child: Text('156',
+                      child: Text(userInfo.moneyCoin.toString(),
                           style: TextStyle(
                           style: TextStyle(
                             color: PRIMARY_COLOR,
                             color: PRIMARY_COLOR,
                             fontSize: 51,
                             fontSize: 51,
@@ -153,16 +197,16 @@ class MyWalletState extends State<MyWallet> {
                   ],
                   ],
                 ),
                 ),
               ),
               ),
-              Positioned(
-                bottom: -23,
-                left: -(ScreenUtil().setWidth(345) - 216) / 2,
-                child: Container(
-                  width: ScreenUtil().setWidth(345),
-                  height: 46,
-                  color: PRIMARY_COLOR,
-                  child: _newRouterTab(context),
-                ),
-              )
+              // Positioned(
+              //   bottom: -23,
+              //   left: -(ScreenUtil().setWidth(345) - 216) / 2,
+              //   child: Container(
+              //     width: ScreenUtil().setWidth(345),
+              //     height: 46,
+              //     color: PRIMARY_COLOR,
+              //     child: _newRouterTab(context),
+              //   ),
+              // )
             ],
             ],
           ),
           ),
         ),
         ),
@@ -175,7 +219,7 @@ class MyWalletState extends State<MyWallet> {
           ),
           ),
           padding: EdgeInsets.only(
           padding: EdgeInsets.only(
             left: 15,
             left: 15,
-            top: 53,
+            top: 15,
             bottom: 15,
             bottom: 15,
           ),
           ),
         )
         )
@@ -193,13 +237,13 @@ class MyWalletState extends State<MyWallet> {
             child: Container(
             child: Container(
               padding: EdgeInsets.all(10),
               padding: EdgeInsets.all(10),
               child: Text(
               child: Text(
-              '提现',
-              textAlign: TextAlign.center,
-              style: TextStyle(
-                  color: Colors.white,
-                  fontSize: 16,
-                  fontWeight: FontWeight.w500),
-            ),
+                '提现',
+                textAlign: TextAlign.center,
+                style: TextStyle(
+                    color: Colors.white,
+                    fontSize: 16,
+                    fontWeight: FontWeight.w500),
+              ),
             ),
             ),
             onTap: () {
             onTap: () {
               print('提现');
               print('提现');
@@ -214,23 +258,20 @@ class MyWalletState extends State<MyWallet> {
         Expanded(
         Expanded(
           flex: 1,
           flex: 1,
           child: GestureDetector(
           child: GestureDetector(
-            child:  Container(
-              padding: EdgeInsets.all(10),
-              child:Text(
-              '充值',
-              textAlign: TextAlign.center,
-              style: TextStyle(
-                  color: Colors.white,
-                  fontSize: 16,
-                  fontWeight: FontWeight.w500),
-            )
-            ),
+            child: Container(
+                padding: EdgeInsets.all(10),
+                child: Text(
+                  '充值',
+                  textAlign: TextAlign.center,
+                  style: TextStyle(
+                      color: Colors.white,
+                      fontSize: 16,
+                      fontWeight: FontWeight.w500),
+                )),
             onTap: () {
             onTap: () {
               print("充值");
               print("充值");
-               Navigator.push(
-                  context,
-                  new CupertinoPageRoute(
-                      builder: (context) => new Rechrage()));
+              Navigator.push(context,
+                  new CupertinoPageRoute(builder: (context) => new Rechrage()));
             },
             },
           ),
           ),
         )
         )
@@ -259,7 +300,7 @@ class MyWalletState extends State<MyWallet> {
                 Container(
                 Container(
                     width: 53,
                     width: 53,
                     child: Text(
                     child: Text(
-                      walletList[index]['money'],
+                      walletList[index]['money'].toString(),
                       style: TextStyle(
                       style: TextStyle(
                           color: Colors.white,
                           color: Colors.white,
                           fontSize: 20,
                           fontSize: 20,
@@ -271,7 +312,7 @@ class MyWalletState extends State<MyWallet> {
                     crossAxisAlignment: CrossAxisAlignment.start,
                     crossAxisAlignment: CrossAxisAlignment.start,
                     children: <Widget>[
                     children: <Widget>[
                       Text(
                       Text(
-                        walletList[index]['name'],
+                        walletList[index]['remark'],
                         maxLines: 1,
                         maxLines: 1,
                         overflow: TextOverflow.ellipsis,
                         overflow: TextOverflow.ellipsis,
                         style: TextStyle(
                         style: TextStyle(
@@ -280,7 +321,8 @@ class MyWalletState extends State<MyWallet> {
                             fontWeight: FontWeight.w500),
                             fontWeight: FontWeight.w500),
                       ),
                       ),
                       Text(
                       Text(
-                        walletList[index]['time'],
+                        readTimestamp(walletList[index]['createTime'],
+                            'yyyy-MM-dd HH:mm:ss'),
                         style: TextStyle(
                         style: TextStyle(
                             color: Color(0xFF727785),
                             color: Color(0xFF727785),
                             fontSize: 12,
                             fontSize: 12,
@@ -306,19 +348,4 @@ class MyWalletState extends State<MyWallet> {
       }, childCount: walletList.length + 1),
       }, childCount: walletList.length + 1),
     );
     );
   }
   }
-
-  fetch() async {
-    Map jsonp = {"money": '+90', "name": "竞赛奖励", "time": "2018.05.02 15:36"};
-    setState(() {
-      walletList.add(jsonp);
-    });
-  }
-
-  fetchTen() {
-    if (walletList.length < 100) {
-      for (int i = 0; i < 20; i++) {
-        fetch();
-      }
-    }
-  }
 }
 }

+ 12 - 17
lib/pages/openRoom.dart

@@ -30,7 +30,7 @@ class OpenRoomState extends State<OpenRoom> {
   Map<String, dynamic> editRoomInfo = {
   Map<String, dynamic> editRoomInfo = {
     "gameId": 1,
     "gameId": 1,
     "houseLevel": 1,
     "houseLevel": 1,
-    "playerNumber": 0
+    "maxNumber": 10
   };
   };
   List gameList = [];
   List gameList = [];
   List levelList = [];
   List levelList = [];
@@ -45,7 +45,7 @@ class OpenRoomState extends State<OpenRoom> {
     Toast.hide();
     Toast.hide();
     if (res.success) {
     if (res.success) {
       setState(() {
       setState(() {
-        editRoomInfo['video'] = res.data;
+        editRoomInfo['video'] = res.data[0];
       });
       });
     } else {}
     } else {}
   }
   }
@@ -102,32 +102,30 @@ class OpenRoomState extends State<OpenRoom> {
   @override
   @override
   void initState() {
   void initState() {
     super.initState();
     super.initState();
+    print(widget.roomFlag);
     editRoomInfo['houseType'] = widget.roomFlag;
     editRoomInfo['houseType'] = widget.roomFlag;
     getInfo();
     getInfo();
   }
   }
 
 
   getInfo() async {
   getInfo() async {
+    Toast.show(context, '加载中', -1, 'loading');
     Result res = await HttpManager.get("gameInfo/all");
     Result res = await HttpManager.get("gameInfo/all");
-    print(res.data);
     if (res.success) {
     if (res.success) {
-      if (res.data.length > 0) {
-        editRoomInfo['gameId'] = res.data[0]['id'];
-      }
       setState(() {
       setState(() {
-        print(res.data);
         gameList = res.data;
         gameList = res.data;
-        editRoomInfo['gameId'] = res.data[0]['id'];
+        if (res.data.length > 0) {
+          editRoomInfo['gameId'] = res.data[0]['id'];
+        }
       });
       });
-      
     } else {}
     } else {}
 
 
-    Result res2 = await HttpManager.get("gameInfo/all");
+    Result res2 = await HttpManager.get("houseLevel/all");
+    Toast.hide();
     if (res2.success) {
     if (res2.success) {
       setState(() {
       setState(() {
         levelList = res2.data;
         levelList = res2.data;
         if (levelList.length > 0) {
         if (levelList.length > 0) {
           editRoomInfo['houseLevel'] = levelList[0]['id'];
           editRoomInfo['houseLevel'] = levelList[0]['id'];
-          editRoomInfo['playerNumber'] = levelList[0]['minNumber'];
         }
         }
       });
       });
     } else {}
     } else {}
@@ -392,7 +390,7 @@ class OpenRoomState extends State<OpenRoom> {
                               Expanded(
                               Expanded(
                                 flex: 1,
                                 flex: 1,
                                 child: Text(
                                 child: Text(
-                                  editRoomInfo['playerNumber'].toString(),
+                                  editRoomInfo['maxNumber'].toString(),
                                   textAlign: TextAlign.right,
                                   textAlign: TextAlign.right,
                                   style: valStyle,
                                   style: valStyle,
                                 ),
                                 ),
@@ -549,9 +547,7 @@ class OpenRoomState extends State<OpenRoom> {
 
 
   showNumPicker(Map info) {
   showNumPicker(Map info) {
     List _list = [];
     List _list = [];
-    print(info['minNumber']);
-    print(info['maxNumber']);
-    for (var i = info['minNumber']; i <= info['maxNumber']; i = i + 5) {
+    for (var i = 10; i <= 100; i = i + 10) {
       _list.add(i);
       _list.add(i);
     }
     }
 
 
@@ -567,7 +563,7 @@ class OpenRoomState extends State<OpenRoom> {
         onConfirm: (Picker picker, List value) {
         onConfirm: (Picker picker, List value) {
           print(value);
           print(value);
           setState(() {
           setState(() {
-            editRoomInfo['playerNumber'] = _list[value[0]];
+            editRoomInfo['maxNumber'] = _list[value[0]];
           });
           });
         }).showModal(this.context);
         }).showModal(this.context);
   }
   }
@@ -590,7 +586,6 @@ class OpenRoomState extends State<OpenRoom> {
         onConfirm: (Picker picker, List value) {
         onConfirm: (Picker picker, List value) {
           setState(() {
           setState(() {
             editRoomInfo['houseLevel'] = levelList[value[0]]['id'];
             editRoomInfo['houseLevel'] = levelList[value[0]]['id'];
-            editRoomInfo['playerNumber'] = levelList[value[0]]['minNumber'];
           });
           });
         }).showModal(this.context);
         }).showModal(this.context);
   }
   }

+ 87 - 83
lib/pages/roomInfo.dart

@@ -5,6 +5,8 @@ import 'package:dio/dio.dart';
 import '../styles/api.dart';
 import '../styles/api.dart';
 import 'dart:ui';
 import 'dart:ui';
 import 'dart:convert';
 import 'dart:convert';
+import '../net/HttpManager.dart';
+import '../net/Result.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);
@@ -23,6 +25,12 @@ class RoomInfoState extends State<RoomInfo>
   Map roomInfo;
   Map roomInfo;
   Map colorInfo;
   Map colorInfo;
   List joinList = [];
   List joinList = [];
+  bool isJoin = false;
+
+  checkJoinInfo() {
+
+  }
+
   @override
   @override
   void initState() {
   void initState() {
     super.initState();
     super.initState();
@@ -43,6 +51,9 @@ class RoomInfoState extends State<RoomInfo>
     };
     };
     _perController = ScrollController();
     _perController = ScrollController();
     getRoomInfo();
     getRoomInfo();
+    Future.delayed(Duration(milliseconds: 100),(){
+      checkJoinInfo();
+    });
   }
   }
 
 
   @override
   @override
@@ -89,15 +100,12 @@ class RoomInfoState extends State<RoomInfo>
       ),
       ),
       body: Container(
       body: Container(
           color: BG_SUB_COLOR,
           color: BG_SUB_COLOR,
-          child: Stack(
-            children: <Widget>[
-              TabBarView(
-                controller: mController,
-                children: [_firstPage(), _secondPage(context)],
-              ),
-              _joinBtn()
-            ],
+          child: TabBarView(
+            controller: mController,
+            children: [_firstPage(), _secondPage(context)],
           )),
           )),
+      floatingActionButton: _joinBtn(),
+      floatingActionButtonLocation: FloatingActionButtonLocation.centerDocked,
     );
     );
   }
   }
 
 
@@ -177,9 +185,9 @@ class RoomInfoState extends State<RoomInfo>
                         width: 20,
                         width: 20,
                       ),
                       ),
                       Text(
                       Text(
-                        houseLevelInfo['minNumber'].toString() +
+                        roomInfo['playerNumber'].toString() +
                             '/' +
                             '/' +
-                            houseLevelInfo['maxNumber'].toString(),
+                            roomInfo['maxNumber'].toString(),
                         style: TextStyle(
                         style: TextStyle(
                             fontSize: 14,
                             fontSize: 14,
                             fontWeight: FontWeight.w500,
                             fontWeight: FontWeight.w500,
@@ -218,8 +226,8 @@ class RoomInfoState extends State<RoomInfo>
                         ),
                         ),
                         Text(
                         Text(
                           'X' +
                           'X' +
-                              (roomInfo.containsKey("bonus")
-                                  ? roomInfo["bonus"].toString()
+                              (houseLevelInfo.containsKey('entryCoin')
+                                  ? houseLevelInfo['entryCoin'].toString()
                                   : '0'),
                                   : '0'),
                           style: TextStyle(
                           style: TextStyle(
                             color: PRIMARY_COLOR,
                             color: PRIMARY_COLOR,
@@ -264,52 +272,49 @@ class RoomInfoState extends State<RoomInfo>
   Widget _joinBtn() {
   Widget _joinBtn() {
     Map houseLevelInfo = roomInfo.isNotEmpty ? roomInfo["houseLevelInfo"] : {};
     Map houseLevelInfo = roomInfo.isNotEmpty ? roomInfo["houseLevelInfo"] : {};
 
 
-    int joinMoney =
-        houseLevelInfo.containsKey('feeRatio') && roomInfo.containsKey("bonus")
-            ? houseLevelInfo["feeRatio"] * roomInfo["bonus"]
-            : 0;
-    return Positioned(
-      bottom: 0,
-      child: Container(
-        width: ScreenUtil().setWidth(375),
-        height: 48 + ScreenUtil().setHeight(40),
-        padding: EdgeInsets.only(
-            top: ScreenUtil().setHeight(20),
-            bottom: ScreenUtil().setHeight(20),
-            left: 15,
-            right: 15),
-        child: RaisedButton(
-          textColor: Colors.white,
-          child: Row(
-            mainAxisAlignment: MainAxisAlignment.center,
-            children: <Widget>[
-              Image.asset(
-                'images/icon_jinbi_da_bai.png',
-                width: 20,
+    int joinMoney = houseLevelInfo.containsKey('entryCoin')
+        ? houseLevelInfo['entryCoin']
+        : 0;
+
+    return Container(
+      width: ScreenUtil().setWidth(375),
+      height: 48 + ScreenUtil().setHeight(40),
+      padding: EdgeInsets.only(
+          top: ScreenUtil().setHeight(20),
+          bottom: ScreenUtil().setHeight(20),
+          left: 15,
+          right: 15),
+      child: RaisedButton(
+        textColor: Colors.white,
+        child: Row(
+          mainAxisAlignment: MainAxisAlignment.center,
+          children: <Widget>[
+            Image.asset(
+              'images/icon_jinbi_da_bai.png',
+              width: 20,
+            ),
+            Container(
+              margin: EdgeInsets.only(left: 6),
+              child: Text(
+                'X' + joinMoney.toString(),
+                style: TextStyle(
+                    color: Colors.white,
+                    fontSize: 16,
+                    fontWeight: FontWeight.w500),
               ),
               ),
-              Container(
-                margin: EdgeInsets.only(left: 6),
+            ),
+            Container(
+                margin: EdgeInsets.only(left: 20),
                 child: Text(
                 child: Text(
-                  'X' + joinMoney.toString(),
+                  '加入房间',
                   style: TextStyle(
                   style: TextStyle(
                       color: Colors.white,
                       color: Colors.white,
                       fontSize: 16,
                       fontSize: 16,
                       fontWeight: FontWeight.w500),
                       fontWeight: FontWeight.w500),
-                ),
-              ),
-              Container(
-                  margin: EdgeInsets.only(left: 20),
-                  child: Text(
-                    '加入房间',
-                    style: TextStyle(
-                        color: Colors.white,
-                        fontSize: 16,
-                        fontWeight: FontWeight.w500),
-                  ))
-            ],
-          ),
-          onPressed: () => {},
+                ))
+          ],
         ),
         ),
+        onPressed: () => {},
       ),
       ),
     );
     );
   }
   }
@@ -327,47 +332,46 @@ class RoomInfoState extends State<RoomInfo>
           controller: _perController,
           controller: _perController,
           itemCount: 3,
           itemCount: 3,
           itemBuilder: (BuildContext context, int index) {
           itemBuilder: (BuildContext context, int index) {
-            return person_item({},index);
+            return person_item({}, index);
           }),
           }),
     );
     );
   }
   }
 
 
-
-  Widget person_item(Map info,int  index){
+  Widget person_item(Map info, int index) {
     return Container(
     return Container(
       width: double.infinity,
       width: double.infinity,
-      height:60,
+      height: 60,
       color: Color(0xFF2B2B42),
       color: Color(0xFF2B2B42),
-      margin: EdgeInsets.only(top:index==0?10:0),
-      padding:EdgeInsets.only(left: 15,right: 15),
+      margin: EdgeInsets.only(top: index == 0 ? 10 : 0),
+      padding: EdgeInsets.only(left: 15, right: 15),
       child: Container(
       child: Container(
-        decoration:BoxDecoration(
-          border: Border(bottom: BorderSide(
-            width: 1,
-            color: BG_SUB_COLOR,
-            style: BorderStyle.solid
-          ))
-        ),
+        decoration: BoxDecoration(
+            border: Border(
+                bottom: BorderSide(
+                    width: 1, color: BG_SUB_COLOR, style: BorderStyle.solid))),
         child: Row(
         child: Row(
           children: <Widget>[
           children: <Widget>[
-           Container(
-             margin: EdgeInsets.only(right: 12),
-             width: 36,
-             height: 36,
-             child:  CircleAvatar(
-              backgroundImage:NetworkImage('http://bpic.588ku.com/original_pic/19/01/10/c21f0c83a0029a820d47e4828559353f.jpg'),
+            Container(
+              margin: EdgeInsets.only(right: 12),
+              width: 36,
+              height: 36,
+              child: CircleAvatar(
+                backgroundImage: NetworkImage(
+                    'http://bpic.588ku.com/original_pic/19/01/10/c21f0c83a0029a820d47e4828559353f.jpg'),
+              ),
             ),
             ),
-           ),
-           Expanded(
-             flex: 1,
-             child: Text('邱好好',style: TextStyle(
-               color: Colors.white,
-               fontSize: 14,
-             ),
-              maxLines:1,
-              overflow: TextOverflow.ellipsis,
-             ),
-           )
+            Expanded(
+              flex: 1,
+              child: Text(
+                '邱好好',
+                style: TextStyle(
+                  color: Colors.white,
+                  fontSize: 14,
+                ),
+                maxLines: 1,
+                overflow: TextOverflow.ellipsis,
+              ),
+            )
           ],
           ],
         ),
         ),
       ),
       ),
@@ -375,8 +379,8 @@ class RoomInfoState extends State<RoomInfo>
   }
   }
 
 
   void getRoomInfo() async {
   void getRoomInfo() async {
-    final response = await Dio()
-        .get(domain + 'houseInfo/getOne', queryParameters: {"id": widget.roomId});
+    final response = await Dio().get(domain + 'houseInfo/getOne',
+        queryParameters: {"id": widget.roomId});
     final res = json.decode(response.toString());
     final res = json.decode(response.toString());
     if (res['success']) {
     if (res['success']) {
       setState(() {
       setState(() {

+ 297 - 49
lib/pages/roomList.dart

@@ -7,6 +7,9 @@ import 'dart:convert';
 import '../widget/room_item.dart';
 import '../widget/room_item.dart';
 import '../widget/popupButton_my.dart';
 import '../widget/popupButton_my.dart';
 import 'dart:ui';
 import 'dart:ui';
+import '../styles/netUtil.dart';
+import '../net/HttpManager.dart';
+import '../net/Result.dart';
 
 
 class RoomList extends StatefulWidget {
 class RoomList extends StatefulWidget {
   @override
   @override
@@ -14,11 +17,36 @@ class RoomList extends StatefulWidget {
 }
 }
 
 
 class RoomListState extends State<RoomList> {
 class RoomListState extends State<RoomList> {
-  List<Map> roomList = [];
+  List roomList = [];
   int currentPage = 1;
   int currentPage = 1;
   ScrollController _controller;
   ScrollController _controller;
   bool scrollFlag = true;
   bool scrollFlag = true;
 
 
+  String game_id = '';
+  String house_level = '';
+  String house_type = '';
+  String status_flag = '0';
+
+  List gameList = [
+    {"id": '', "gameName": '全部游戏'}
+  ];
+  List levelList = [
+    {"levelName": '全部等级', "id": ''}
+  ];
+  List typeList = [
+    {"name": '全部房间', "val": ''},
+    {"name": '普通房间', 'val': '0'},
+    {"name": '官方房间', 'val': '1'}
+  ];
+  List statusList = [
+    {"name": '不限状态', "val": ''},
+    {"name": '等待中', "val": '0'},
+    {"name": '准备中', "val": '1'},
+    {"name": '已经开始', "val": '2'},
+    {"name": '已经结束', "val": '3'},
+    {"name": '正在结算', "val": '4'}
+  ];
+
   @override
   @override
   void initState() {
   void initState() {
     super.initState();
     super.initState();
@@ -32,9 +60,28 @@ class RoomListState extends State<RoomList> {
           });
           });
           getRoomInfo();
           getRoomInfo();
         }
         }
-        
       }
       }
     });
     });
+
+    getInfo();
+  }
+
+  getInfo() async {
+    Result res = await HttpManager.get("gameInfo/all");
+    if (res.success) {
+      setState(() {
+        gameList.addAll(res.data);
+      });
+    }
+
+    Result res2 = await HttpManager.get("houseLevel/all");
+    if (res2.success) {
+      print(res2.data);
+      setState(() {
+        levelList.addAll(res2.data);
+      });
+      print(levelList);
+    }
   }
   }
 
 
   @override
   @override
@@ -108,88 +155,289 @@ class RoomListState extends State<RoomList> {
         child: Row(
         child: Row(
           mainAxisAlignment: MainAxisAlignment.spaceBetween,
           mainAxisAlignment: MainAxisAlignment.spaceBetween,
           children: <Widget>[
           children: <Widget>[
-            _chooseItem(),
-            _chooseItem(),
-            _chooseItem(),
-            _chooseItem()
+            _chooseGame(),
+            _chooseHouseType(),
+            _chooseLevel(),
+            _chooseStatus()
           ],
           ],
         ),
         ),
       ),
       ),
     );
     );
   }
   }
 
 
-  Widget _chooseItem() {
+//选择游戏
+  Widget _chooseGame() {
+    Map gameInfo = {};
+    for (var item in gameList) {
+      print(item['id']);
+      if (item['id'].toString() == game_id.toString()) {
+        gameInfo = item;
+      }
+    }
     return Expanded(
     return Expanded(
       flex: 1,
       flex: 1,
       child: MyPopupMenuButton(
       child: MyPopupMenuButton(
-        initialValue:'刺激战场',
-        padding: EdgeInsets.all(0.0),
+          initialValue: game_id,
+          padding: EdgeInsets.all(0.0),
           child: Row(
           child: Row(
             crossAxisAlignment: CrossAxisAlignment.center,
             crossAxisAlignment: CrossAxisAlignment.center,
             mainAxisAlignment: MainAxisAlignment.center,
             mainAxisAlignment: MainAxisAlignment.center,
             children: <Widget>[
             children: <Widget>[
-              Text(
-                '全部游戏',
-                style: TextStyle(
-                    color: Colors.white,
-                    fontSize: 12,
-                    fontWeight: FontWeight.w500),
+              Expanded(
+                flex: 1,
+                child: Text(
+                  gameInfo['gameName'],
+                  style: TextStyle(
+                      color: game_id != '' ? PRIMARY_COLOR : Colors.white,
+                      fontSize: 12,
+                      fontWeight: FontWeight.w500),
+                  overflow: TextOverflow.ellipsis,
+                  textAlign: TextAlign.center,
+                ),
+              ),
+              Icon(
+                Icons.keyboard_arrow_down,
+                color: game_id != '' ? PRIMARY_COLOR : Colors.white,
+                size: 18,
               ),
               ),
-              Image.asset(
-                'images/icon_zhankai_baise.png',
-                width: 20,
-              )
             ],
             ],
           ),
           ),
-          onSelected: (String value) {
-            print('******');
+          onSelected: (value) {
+            setState(() {
+              game_id = value;
+            });
+            getRoomInfo();
           },
           },
-          itemBuilder: (BuildContext context) => <MyPopupMenuEntry<String>>[
-                MyPopupMenuItem(
-                  child: Container(
-                    height: 30,
-                    child: Text('刺激战场',style: TextStyle(
-                      fontSize: 14,
-                    )),
+          itemBuilder: (BuildContext context) {
+            return gameList.map((choice) {
+              return new MyPopupMenuItem(
+                  child: new Text(
+                    choice['gameName'],
+                    style: TextStyle(fontSize: 14),
                   ),
                   ),
-                  value: '刺激战场',
+                  value: choice['id'].toString());
+            }).toList();
+          }),
+    );
+  }
+
+//选择等级
+  Widget _chooseLevel() {
+    print(levelList);
+    Map levelInfo = {};
+    for (var item in levelList) {
+      print(item['id']);
+      if (item['id'].toString() == house_level.toString()) {
+        levelInfo = item;
+      }
+    }
+    return Expanded(
+      flex: 1,
+      child: MyPopupMenuButton(
+          initialValue: house_level,
+          padding: EdgeInsets.all(0.0),
+          child: Row(
+            crossAxisAlignment: CrossAxisAlignment.center,
+            mainAxisAlignment: MainAxisAlignment.center,
+            children: <Widget>[
+              Expanded(
+                flex: 1,
+                child: Text(
+                  levelInfo['levelName'],
+                  style: TextStyle(
+                      color: house_level != '' ? PRIMARY_COLOR : Colors.white,
+                      fontSize: 12,
+                      fontWeight: FontWeight.w500),
+                  overflow: TextOverflow.ellipsis,
+                  textAlign: TextAlign.center,
                 ),
                 ),
-                MyPopupMenuItem(
-                  child: Container(
-                    child: Text('11',style: TextStyle(
-                      fontSize: 14
-                    )),
+              ),
+              Icon(
+                Icons.keyboard_arrow_down,
+                color: house_level != '' ? PRIMARY_COLOR : Colors.white,
+                size: 18,
+              ),
+            ],
+          ),
+          onSelected: (value) {
+            setState(() {
+              house_level = value;
+            });
+            getRoomInfo();
+          },
+          itemBuilder: (BuildContext context) {
+            return levelList.map((choice) {
+              return new MyPopupMenuItem(
+                  child: new Text(
+                    choice['levelName'],
+                    style: TextStyle(fontSize: 14),
                   ),
                   ),
-                  value: '这是增加',
+                  value: choice['id'].toString());
+            }).toList();
+          }),
+    );
+  }
+
+  //选择房间状态
+  Widget _chooseHouseType() {
+    Map typeInfo = {};
+    for (var item in typeList) {
+      if (item['val'] == house_type) {
+        typeInfo = item;
+      }
+    }
+    return Expanded(
+      flex: 1,
+      child: MyPopupMenuButton(
+          initialValue: house_type,
+          padding: EdgeInsets.all(0.0),
+          child: Row(
+            crossAxisAlignment: CrossAxisAlignment.center,
+            mainAxisAlignment: MainAxisAlignment.center,
+            children: <Widget>[
+              Expanded(
+                flex: 1,
+                child: Text(
+                  typeInfo['name'],
+                  style: TextStyle(
+                      color: house_type != '' ? PRIMARY_COLOR : Colors.white,
+                      fontSize: 12,
+                      fontWeight: FontWeight.w500),
+                  overflow: TextOverflow.ellipsis,
+                  textAlign: TextAlign.center,
+                ),
+              ),
+              Icon(
+                Icons.keyboard_arrow_down,
+                color: house_type != '' ? PRIMARY_COLOR : Colors.white,
+                size: 18,
+              ),
+            ],
+          ),
+          onSelected: (value) {
+            setState(() {
+              house_type = value;
+            });
+            getRoomInfo();
+          },
+          itemBuilder: (BuildContext context) {
+            return typeList.map((choice) {
+              return new MyPopupMenuItem(
+                  child: new Text(
+                    choice['name'],
+                    style: TextStyle(fontSize: 14),
+                  ),
+                  value: choice['val']);
+            }).toList();
+          }),
+    );
+  }
+
+  //选择状态
+  Widget _chooseStatus() {
+    Map statusInfo = {};
+    for (var item in statusList) {
+      if (item['val'] == status_flag) {
+        statusInfo = item;
+      }
+    }
+    return Expanded(
+      flex: 1,
+      child: MyPopupMenuButton(
+          initialValue: status_flag,
+          padding: EdgeInsets.all(0.0),
+          child: Row(
+            crossAxisAlignment: CrossAxisAlignment.center,
+            mainAxisAlignment: MainAxisAlignment.center,
+            children: <Widget>[
+              Expanded(
+                flex: 1,
+                child: Text(
+                  statusInfo['name'],
+                  style: TextStyle(
+                      color: status_flag != '' ? PRIMARY_COLOR : Colors.white,
+                      fontSize: 12,
+                      fontWeight: FontWeight.w500),
+                  overflow: TextOverflow.ellipsis,
+                  textAlign: TextAlign.center,
                 ),
                 ),
-              ]),
+              ),
+              Icon(
+                Icons.keyboard_arrow_down,
+                color: status_flag != '' ? PRIMARY_COLOR : Colors.white,
+                size: 18,
+              ),
+            ],
+          ),
+          onSelected: (value) {
+            setState(() {
+              status_flag = value;
+            });
+            getRoomInfo();
+          },
+          itemBuilder: (BuildContext context) {
+            return statusList.map((choice) {
+              return new MyPopupMenuItem(
+                  child: new Text(
+                    choice['name'],
+                    style: TextStyle(fontSize: 14),
+                  ),
+                  value: choice['val']);
+            }).toList();
+          }),
     );
     );
   }
   }
 
 
   void getRoomInfo() async {
   void getRoomInfo() async {
-    print('getInfo');
     if (currentPage == 1) {
     if (currentPage == 1) {
       setState(() {
       setState(() {
         roomList = [];
         roomList = [];
       });
       });
     }
     }
-    final response = await Dio().get(domain + 'houseInfo/page', queryParameters: {
+
+    Map<String, dynamic> data = {
       "currentPage": currentPage,
       "currentPage": currentPage,
       "pageNumber": 20,
       "pageNumber": 20,
-    });
-    final res = json.decode(response.toString());
-    if (res['success']) {
-      for (var item in res['data']['pp']) {
-        setState(() {
-          roomList.add(item);
-        });
-      }
-      if (res['data']['page']['currentPage'] <
-          res['data']['page']['totalPage']) {
+    };
+    data['advancedQuery'] = '';
+    if (game_id != '') {
+      data['advancedQuery'] += 'AND_,game_id_,=_,' + game_id + '_;';
+    }
+    if (house_level != '') {
+      data['advancedQuery'] += 'AND_,house_level_,=_,' + house_level + '_;';
+    }
+    if (house_type != '') {
+      data['advancedQuery'] += 'AND_,house_type_,=_,' + house_type + '_;';
+    }
+    if (status_flag != '') {
+      data['advancedQuery'] += 'AND_,status_flag_,=_,' + status_flag + '_;';
+    }
+    Result res = await HttpManager.get("houseInfo/page", data: data);
+    if (res.success) {
+      setState(() {
+       roomList.addAll(res.data['pp']); 
+      });
+      if (res.data['page']['currentPage'] < res.data['page']['totalPage']) {
         scrollFlag = true;
         scrollFlag = true;
       } else {
       } else {
         scrollFlag = false;
         scrollFlag = false;
       }
       }
-    }
+    } else {}
+
+    // final response = await Dio().get(domain + 'houseInfo/page', data: data);
+    // final res = json.decode(response.toString());
+    // if (res['success']) {
+    //   for (var item in res['data']['pp']) {
+    //     setState(() {
+    //       roomList.add(item);
+    //     });
+    //   }
+    //   if (res['data']['page']['currentPage'] <
+    //       res['data']['page']['totalPage']) {
+    //     scrollFlag = true;
+    //   } else {
+    //     scrollFlag = false;
+    //   }
+    // }
   }
   }
 }
 }

+ 10 - 5
lib/pages/setting.dart

@@ -132,8 +132,11 @@ class SettingState extends State<Setting> {
                             highlightColor: Color(0xFF763434),
                             highlightColor: Color(0xFF763434),
                             child: Text("退出登录"),
                             child: Text("退出登录"),
                             onPressed: () {
                             onPressed: () {
-                              StoreProvider.of<AppState>(context)
-                                  .dispatch({"action": Actions.logout});
+                              Future.delayed(const Duration(seconds: 1), () {
+                                StoreProvider.of<AppState>(context)
+                                    .dispatch({"action": Actions.logout});
+                              });
+
                               Toast.show(context, '退出成功', 1500, 'success');
                               Toast.show(context, '退出成功', 1500, 'success');
                               Navigator.push(
                               Navigator.push(
                                   context,
                                   context,
@@ -189,7 +192,8 @@ class SettingState extends State<Setting> {
             Navigator.push(
             Navigator.push(
                 context,
                 context,
                 new CupertinoPageRoute(
                 new CupertinoPageRoute(
-                    builder: (context) => new ChangeUserInfo(title: '昵称',val:userInfo.nickname)));
+                    builder: (context) => new ChangeUserInfo(
+                        title: '昵称', val: userInfo.nickname)));
           } else if (name == '性别') {
           } else if (name == '性别') {
             showPicker(userInfo, context);
             showPicker(userInfo, context);
           } else if (name == '生日') {
           } else if (name == '生日') {
@@ -198,7 +202,8 @@ class SettingState extends State<Setting> {
             Navigator.push(
             Navigator.push(
                 context,
                 context,
                 new CupertinoPageRoute(
                 new CupertinoPageRoute(
-                    builder: (context) => new ChangeUserInfo(title: '手机号',val:userInfo.phone)));
+                    builder: (context) =>
+                        new ChangeUserInfo(title: '手机号', val: userInfo.phone)));
           }
           }
         },
         },
       ),
       ),
@@ -252,7 +257,7 @@ class SettingState extends State<Setting> {
     } else if (name == '生日') {
     } else if (name == '生日') {
       if (userInfo.birthday != null) {
       if (userInfo.birthday != null) {
         _wiget = Text(
         _wiget = Text(
-          readTimestamp(userInfo.birthday),
+          readTimestamp(userInfo.birthday,'yy/MM/dd'),
           style: mainText,
           style: mainText,
           textAlign: TextAlign.right,
           textAlign: TextAlign.right,
         );
         );

+ 2 - 2
lib/styles/api.dart

@@ -17,8 +17,8 @@ bool checkPhone (phone){
     return result;
     return result;
 }
 }
 
 
-String readTimestamp(int timestamp) {
+String readTimestamp(int timestamp,String _timeType) {
    
    
 
 
-    return DateFormat('yy/MM/dd').format(DateTime.fromMillisecondsSinceEpoch(timestamp));
+    return DateFormat(_timeType).format(DateTime.fromMillisecondsSinceEpoch(timestamp));
   }
   }

+ 4 - 4
lib/widget/popupButton_my.dart

@@ -19,13 +19,13 @@ import 'package:flutter/widgets.dart';
 const Duration _kMenuDuration = Duration(milliseconds: 300);
 const Duration _kMenuDuration = Duration(milliseconds: 300);
 const double _kBaselineOffsetFromBottom = 20.0;
 const double _kBaselineOffsetFromBottom = 20.0;
 const double _kMenuCloseIntervalEnd = 2.0 / 3.0;
 const double _kMenuCloseIntervalEnd = 2.0 / 3.0;
-const double _kMenuHorizontalPadding = 16.0;
+const double _kMenuHorizontalPadding = 10.0;
 const double _kMenuItemHeight = 48.0;
 const double _kMenuItemHeight = 48.0;
 const double _kMenuDividerHeight = 16.0;
 const double _kMenuDividerHeight = 16.0;
 const double _kMenuMaxWidth = 5.0 * _kMenuWidthStep;
 const double _kMenuMaxWidth = 5.0 * _kMenuWidthStep;
 const double _kMenuMinWidth = 2.0 * _kMenuWidthStep;
 const double _kMenuMinWidth = 2.0 * _kMenuWidthStep;
 const double _kMenuVerticalPadding = 8.0;
 const double _kMenuVerticalPadding = 8.0;
-const double _kMenuWidthStep = 56.0;
+const double _kMenuWidthStep = 48.0;
 const double _kMenuScreenPadding = 8.0;
 const double _kMenuScreenPadding = 8.0;
 
 
 /// A base class for entries in a material design popup menu.
 /// A base class for entries in a material design popup menu.
@@ -541,6 +541,7 @@ class _MyPopupMenuRouteLayout extends SingleChildLayoutDelegate {
     } else {
     } else {
       y = position.top + (size.height - position.top - position.bottom) / 2.0 - selectedItemOffset;
       y = position.top + (size.height - position.top - position.bottom) / 2.0 - selectedItemOffset;
     }
     }
+     y = size.height-position.bottom+10;
 
 
     // Find the ideal horizontal position.
     // Find the ideal horizontal position.
     double x;
     double x;
@@ -562,7 +563,6 @@ class _MyPopupMenuRouteLayout extends SingleChildLayoutDelegate {
           break;
           break;
       }
       }
     }
     }
-
     // Avoid going outside an area defined as the rectangle 8.0 pixels from the
     // Avoid going outside an area defined as the rectangle 8.0 pixels from the
     // edge of the screen in every direction.
     // edge of the screen in every direction.
     if (x < _kMenuScreenPadding)
     if (x < _kMenuScreenPadding)
@@ -823,7 +823,7 @@ class MyPopupMenuButton<T> extends StatefulWidget {
     this.onSelected,
     this.onSelected,
     this.onCanceled,
     this.onCanceled,
     this.tooltip,
     this.tooltip,
-    this.elevation = 8.0,
+    this.elevation =0,
     this.padding = const EdgeInsets.all(8.0),
     this.padding = const EdgeInsets.all(8.0),
     this.child,
     this.child,
     this.icon,
     this.icon,

+ 5 - 3
lib/widget/room_item.dart

@@ -1,7 +1,7 @@
 import 'package:flutter/material.dart';
 import 'package:flutter/material.dart';
 import 'package:flutter_screenutil/flutter_screenutil.dart';
 import 'package:flutter_screenutil/flutter_screenutil.dart';
 import 'package:flutter/cupertino.dart';
 import 'package:flutter/cupertino.dart';
-import '../pages/roomInfo.dart';
+import '../pages/RoomInfo.dart';
 
 
 class RommItem extends StatelessWidget {
 class RommItem extends StatelessWidget {
   RommItem({this.roomInfo, this.hasBorder, this.isRage});
   RommItem({this.roomInfo, this.hasBorder, this.isRage});
@@ -19,6 +19,8 @@ class RommItem extends StatelessWidget {
 
 
         Map useRoomInfo=roomInfo.isNotEmpty?roomInfo:{};
         Map useRoomInfo=roomInfo.isNotEmpty?roomInfo:{};
 
 
+        Map gameInfo=roomInfo.containsKey('gameInfo')?roomInfo['gameInfo']:{};
+
     Map imageInfo = {
     Map imageInfo = {
       "黄金": Image.asset('images/dengji_icon_huangjin.png',
       "黄金": Image.asset('images/dengji_icon_huangjin.png',
           width: ScreenUtil().setWidth(14)),
           width: ScreenUtil().setWidth(14)),
@@ -37,7 +39,7 @@ class RommItem extends StatelessWidget {
    
    
 
 
       DecorationImage myIcon=DecorationImage(
       DecorationImage myIcon=DecorationImage(
-                    image: NetworkImage( useRoomInfo.containsKey('icon')?useRoomInfo["icon"]:''),
+                    image: NetworkImage( gameInfo.containsKey('icon')?gameInfo["icon"]:''),
                     fit: BoxFit.cover);
                     fit: BoxFit.cover);
 
 
     return FlatButton(
     return FlatButton(
@@ -116,7 +118,7 @@ class RommItem extends StatelessWidget {
               mainAxisAlignment: MainAxisAlignment.center,
               mainAxisAlignment: MainAxisAlignment.center,
               children: <Widget>[
               children: <Widget>[
                 Image.asset('images/icon_renshu.png', width: 20),
                 Image.asset('images/icon_renshu.png', width: 20),
-                Text(houseLevelInfo['minNumber'].toString()+'/'+houseLevelInfo['maxNumber'].toString(),
+                Text((roomInfo.containsKey('playerNumber')?roomInfo['playerNumber'].toString():'0')+'/'+roomInfo['maxNumber'].toString(),
                 style: TextStyle(
                 style: TextStyle(
                   fontSize: 14,
                   fontSize: 14,
                   fontWeight: FontWeight.w500,
                   fontWeight: FontWeight.w500,

+ 6 - 2
lib/widgets/HomeDrawer.dart

@@ -1,8 +1,10 @@
 import 'package:flutter/material.dart';
 import 'package:flutter/material.dart';
 import 'package:redux/redux.dart';
 import 'package:redux/redux.dart';
 import 'package:flutter_redux/flutter_redux.dart';
 import 'package:flutter_redux/flutter_redux.dart';
+import 'package:flutter/cupertino.dart';
 import '../redux/AppState.dart';
 import '../redux/AppState.dart';
 import '../model/UserInfo.dart';
 import '../model/UserInfo.dart';
+import '../pages/MyWallet.dart'; //我的钱包
 
 
 class HomeDrawer extends StatelessWidget {
 class HomeDrawer extends StatelessWidget {
   @override
   @override
@@ -85,8 +87,10 @@ class HomeDrawer extends StatelessWidget {
                         "images/icon_qianbao.png",
                         "images/icon_qianbao.png",
                         "我的钱包",
                         "我的钱包",
                         onTap: () {
                         onTap: () {
-                          print("object");
-                          Navigator.of(context).pop();
+                           Navigator.push(
+                            context,
+                            new CupertinoPageRoute(
+                                builder: (context) => new MyWallet()));
                         },
                         },
                       ),
                       ),
                       Divder(),
                       Divder(),