panhui 6 rokov pred
rodič
commit
c8ad044bfd

+ 1 - 1
android/app/src/main/AndroidManifest.xml

@@ -9,7 +9,7 @@
     <application
         android:name="com.izouma.screen_stream_plugin.MyApplication"
         android:icon="@mipmap/ic_launcher"
-        android:label="我要电竞"
+        android:label="猿人电竞"
         android:usesCleartextTraffic="true">
         <activity
             android:name="com.yalantis.ucrop.UCropActivity"

BIN
android/app/src/main/res/mipmap-hdpi/icon_qidongye.png


BIN
android/app/src/main/res/mipmap-mdpi/icon_qidongye.png


BIN
android/app/src/main/res/mipmap-xhdpi/icon_qidongye.png


BIN
android/app/src/main/res/mipmap-xxhdpi/icon_qidongye.png


BIN
android/app/src/main/res/mipmap-xxxhdpi/icon_qidongye.png


BIN
images/2x/icon_kong.png


BIN
images/2x/icon_sousuo.png


BIN
images/3x/icon_kong.png


BIN
images/3x/icon_sousuo.png


BIN
images/icon_kong.png


BIN
images/icon_sousuo.png


+ 2 - 2
ios/Runner/Info.plist

@@ -5,7 +5,7 @@
 	<key>CFBundleDevelopmentRegion</key>
 	<string>en</string>
 	<key>CFBundleDisplayName</key>
-	<string>我要电竞</string>
+	<string>猿人电竞</string>
 	<key>CFBundleExecutable</key>
 	<string>$(EXECUTABLE_NAME)</string>
 	<key>CFBundleIdentifier</key>
@@ -13,7 +13,7 @@
 	<key>CFBundleInfoDictionaryVersion</key>
 	<string>6.0</string>
 	<key>CFBundleName</key>
-	<string>我要电竞</string>
+	<string>猿人电竞</string>
 	<key>CFBundlePackageType</key>
 	<string>APPL</string>
 	<key>CFBundleShortVersionString</key>

+ 2 - 2
ios/ScreenRecorder/Info.plist

@@ -5,7 +5,7 @@
 	<key>CFBundleDevelopmentRegion</key>
 	<string>$(DEVELOPMENT_LANGUAGE)</string>
 	<key>CFBundleDisplayName</key>
-	<string>我要电竞</string>
+	<string>猿人电竞</string>
 	<key>CFBundleExecutable</key>
 	<string>$(EXECUTABLE_NAME)</string>
 	<key>CFBundleIdentifier</key>
@@ -13,7 +13,7 @@
 	<key>CFBundleInfoDictionaryVersion</key>
 	<string>6.0</string>
 	<key>CFBundleName</key>
-	<string>我要电竞</string>
+	<string>猿人电竞</string>
 	<key>CFBundlePackageType</key>
 	<string>XPC!</string>
 	<key>CFBundleShortVersionString</key>

+ 3 - 1
lib/model/CompetitionSeason.dart

@@ -1,12 +1,13 @@
 import 'package:json_annotation/json_annotation.dart';
 import 'GameInfo.dart';
+import 'PlayerInfo.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);
+      this.bonus, this.statusFlag, this.gameId,this.gameInfo,this.playerInfo);
   int id;
   String season;//名称
   String shortName;//简称
@@ -16,6 +17,7 @@ class CompetitionSeason {
   int statusFlag;//状态
   int gameId; //游戏ID
   GameInfo gameInfo;//游戏信息
+  PlayerInfo playerInfo;
   
   factory CompetitionSeason.fromJson(Map<String, dynamic> json) =>
       _$CompetitionSeasonFromJson(json);

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

@@ -17,7 +17,8 @@ CompetitionSeason _$CompetitionSeasonFromJson(Map<String, dynamic> json) {
       json['statusFlag'] as int,
       json['gameId'] as int,
 
-      json['gameInfo']!=null?GameInfo.fromJson(json['gameInfo']):GameInfo.empty()
+      json['gameInfo']!=null?GameInfo.fromJson(json['gameInfo']):GameInfo.empty(),
+      json['playerInfo']!=null?PlayerInfo.fromJson(json['playerInfo']):PlayerInfo.empty()
       );
 }
 
@@ -39,5 +40,6 @@ Map<String, dynamic> _$CompetitionSeasonToJson(CompetitionSeason instance) =>
       'bonus': instance.bonus,
       'statusFlag': instance.statusFlag,
       'gameId': instance.gameId,
-      'gameInfo':instance.gameInfo
+      'gameInfo':instance.gameInfo,
+      'playerInfo':instance.playerInfo
     };

+ 2 - 1
lib/model/HouseInfo.dart

@@ -26,7 +26,7 @@ class HouseInfo {
       this.createUser,
       this.beginTime,
       this.createTime,
-      this.scoreType);
+      this.scoreType,this.houseCode);
   int id;
   int gameId; //游戏ID
   int userId; //用户ID
@@ -47,6 +47,7 @@ class HouseInfo {
   int beginTime; //开始时间
   int createTime;//创建时间
   int scoreType;//评分类型
+String houseCode;//房间号
   factory HouseInfo.fromJson(Map<String, dynamic> json) =>
       _$HouseInfoFromJson(json);
 

+ 6 - 4
lib/model/HouseInfo.g.dart

@@ -29,7 +29,8 @@ HouseInfo _$HouseInfoFromJson(Map<String, dynamic> json) {
       json['createUser'] as String,
       json['beginTime'] as int,
       json['createTime'] as int,
-      json['scoreType'] as int );
+      json['scoreType'] as int,
+      json['houseCode'] as String);
 }
 
 //  int id;
@@ -66,7 +67,8 @@ Map<String, dynamic> _$HouseInfoToJson(HouseInfo instance) => <String, dynamic>{
       'gameHousePassword': instance.gameHousePassword,
       'statusFlag': instance.statusFlag,
       'createUser': instance.createUser,
-      'beginTime':instance.beginTime,
-      'createTime':instance.createTime,
-      'scoreType':instance.scoreType
+      'beginTime': instance.beginTime,
+      'createTime': instance.createTime,
+      'scoreType': instance.scoreType,
+      'houseCode': instance.houseCode
     };

+ 54 - 17
lib/pages/HomePage.dart

@@ -32,7 +32,9 @@ class _HomePageState extends State<HomePage> with WidgetsBindingObserver {
 
   Future<void> getSeasonInfo() async {
     Toast.show(context, '加载中', -1, 'loading');
-    Result res = await HttpManager.get('gameInfo/seasons');
+    Result res = await HttpManager.get('gameInfo/seasons', data: {
+      'userId': StoreProvider.of<AppState>(context).state.userInfo.id,
+    });
     Toast.hide();
     if (res.success) {
       List<GameInfoSeasons> list = [];
@@ -219,7 +221,7 @@ class _HomePageState extends State<HomePage> with WidgetsBindingObserver {
                             return Center(
                                 child: Container(
                               // width: 0.64 * (height - 334),
-                              height: 0.64 * (height - 334),
+                              // height: 0.64 * (height - 334),
 
                               // decoration: BoxDecoration(image: DecorationImage(image: AssetImage('images/home_icon_yuan.png'), fit: BoxFit.contain)),
                               child: Column(
@@ -229,13 +231,18 @@ class _HomePageState extends State<HomePage> with WidgetsBindingObserver {
                                     width: double.infinity,
                                     height: 52,
                                     decoration: BoxDecoration(
-                                      image:DecorationImage(image: AssetImage('images/img_guang_home.png'))
-                                    ),
-                                    child: Text('赛季奖金',
+                                        image: DecorationImage(
+                                            image: AssetImage(
+                                                'images/img_guang_home.png'))),
+                                    child: Text(
+                                      '赛季奖金',
                                       style: TextStyle(
-                                          color: Color(0xFFFFFFFF),
-                                          fontSize: 26,
-                                          fontFamily: 'Pangmen',),textAlign: TextAlign.center,),
+                                        color: Color(0xFFFFFFFF),
+                                        fontSize: 26,
+                                        fontFamily: 'Pangmen',
+                                      ),
+                                      textAlign: TextAlign.center,
+                                    ),
                                   ),
                                   Row(
                                     mainAxisAlignment: MainAxisAlignment.center,
@@ -245,11 +252,23 @@ class _HomePageState extends State<HomePage> with WidgetsBindingObserver {
                                   Container(
                                     height: 15,
                                   ),
-                                  Text('当前排名 99866',
-                                      style: TextStyle(
-                                          color: Color(0xFFFFFFFF),
-                                          fontSize: 24,
-                                          fontFamily: 'Pangmen')),
+                                  seasonList[index]
+                                              .competitionSeason
+                                              .playerInfo
+                                              .rank !=
+                                          null
+                                      ? Text(
+                                          '当前排名 ' +
+                                              seasonList[index]
+                                                  .competitionSeason
+                                                  .playerInfo
+                                                  .rank
+                                                  .toString(),
+                                          style: TextStyle(
+                                              color: Color(0xFFFFFFFF),
+                                              fontSize: 24,
+                                              fontFamily: 'Pangmen'))
+                                      : Container(),
                                   Container(
                                     height: 12,
                                   ),
@@ -472,10 +491,10 @@ class _HomePageState extends State<HomePage> with WidgetsBindingObserver {
     String bouns = (seasonList[nowIndex].competitionSeason.bonus / 1000)
         .toStringAsFixed(1);
 
-    // String bouns = (900000000100 / 1000).toStringAsFixed(1);
+    // String bouns = (6002222100 / 1000).toStringAsFixed(1);
     // print(bouns);
     // print(bouns.indexOf('.0'));
-    if (bouns.indexOf('.0') != -1 || num.parse(bouns) > 999) {
+    if (bouns.indexOf('.0') != -1 || num.parse(bouns) > 99) {
       bouns = bouns.substring(0, bouns.length - 2);
     }
 
@@ -514,7 +533,9 @@ class _HomePageState extends State<HomePage> with WidgetsBindingObserver {
           _imageList.add('images/9.png');
           break;
         case '.':
+          _imageList.add('kong');
           _imageList.add('images/dian.png');
+          _imageList.add('kong');
           break;
       }
     }
@@ -523,7 +544,18 @@ class _HomePageState extends State<HomePage> with WidgetsBindingObserver {
     }
 
     for (var item in _imageList) {
-      _list.add(Image.asset(item));
+      if (item == 'kong') {
+        _list.add(Container(
+          width: 5,
+        ));
+      } else {
+        if (_bounsList.length > 4) {
+          _list.add(Image.asset(item, height: 300 / _bounsList.length));
+        } else {
+          _list.add(Image.asset(item));
+        }
+      }
+
       // if (item != '.') {
       //   // if (_imageList.length > 4) {
       //   //   double _scale = 1 - (_imageList.length - 4) * 0.2;
@@ -541,7 +573,12 @@ class _HomePageState extends State<HomePage> with WidgetsBindingObserver {
       // }
     }
     _list.add(Container(width: 5));
-    _list.add(Image.asset('images/K.png'));
+    if (_bounsList.length > 4) {
+      _list.add(Image.asset('images/K.png', height: 300 / _bounsList.length));
+    } else {
+      _list.add(Image.asset('images/K.png'));
+    }
+
     return _list;
   }
 }

+ 7 - 4
lib/pages/MyTeam.dart

@@ -84,9 +84,9 @@ class MyTeamState extends State<MyTeam> {
       if (StoreProvider.of<AppState>(context).state.userInfo.recommender !=
           null) {
         getHigh();
-        getLevelList();
-        getLevel();
       }
+      getLevelList();
+      getLevel();
     });
 
     _controller = ScrollController();
@@ -220,8 +220,11 @@ class MyTeamState extends State<MyTeam> {
   List<Widget> _widgetList() {
     List<Widget> list = [];
     if (teamList.isEmpty) {
-      list.add(Center(
-        child: Text('暂无数据', style: TextStyle(color: Colors.white24)),
+      list.add(Padding(
+        child: Center(
+          child: Text('暂无数据', style: TextStyle(color: Colors.white24)),
+        ),
+        padding: EdgeInsets.symmetric(vertical: 10),
       ));
     } else {
       for (var item in teamList) {

+ 89 - 76
lib/pages/RecordList.dart

@@ -226,7 +226,7 @@ class houseItem extends StatelessWidget {
     ];
     String imageSrc = '';
     String tishiStr = '';
-    bool isImport=false;
+    bool isImport = false;
     if (playerInfo != null) {
       if (playerInfo.houseRank != null) {
         if (playerInfo.houseRank < 4) {
@@ -249,7 +249,7 @@ class houseItem extends StatelessWidget {
     } else {
       if (roomInfo.statusFlag == 0) {
         tishiStr = '未开始';
-        isImport=true;
+        isImport = true;
       } else if (roomInfo.statusFlag == 2) {
         tishiStr = '比赛中';
       } else if (roomInfo.statusFlag == 4) {
@@ -264,87 +264,100 @@ class houseItem extends StatelessWidget {
     }
     return Container(
       decoration: BoxDecoration(
-          gradient: LinearGradient(
-            colors: [Color(0xFF3F4261), Color(0xFF323456)],
-            begin: Alignment.topCenter,
-            end: Alignment.bottomCenter,
-          ),
-          border: Border(bottom: BorderSide(color: Colors.black, width: 1))),
-      child: Material(
-        color: Colors.transparent,
-        child: InkWell(
-          child: Padding(
-            padding: EdgeInsets.all(15),
-            child: Row(
-              children: <Widget>[
-                Image.network(
-                  gameInfo.icon,
-                  width: 48,
-                  height: 48,
-                ),
-                Container(
-                  width: 10,
-                ),
-                Expanded(
-                  flex: 1,
-                  child: Column(
-                    crossAxisAlignment: CrossAxisAlignment.start,
-                    children: <Widget>[
-                      Row(
+        // gradient: LinearGradient(
+        //   colors: [Color(0xFF3F4261), Color(0xFF323456)],
+        //   begin: Alignment.topCenter,
+        //   end: Alignment.bottomCenter,
+        // ),
+        color: Color(0xFF363759),
+      ),
+      child: Column(
+        children: <Widget>[
+          Material(
+            color: Colors.transparent,
+            child: InkWell(
+              child: Padding(
+                padding: EdgeInsets.all(15),
+                child: Row(
+                  children: <Widget>[
+                    Image.network(
+                      gameInfo.icon,
+                      width: 48,
+                      height: 48,
+                    ),
+                    Container(
+                      width: 10,
+                    ),
+                    Expanded(
+                      flex: 1,
+                      child: Column(
+                        crossAxisAlignment: CrossAxisAlignment.start,
                         children: <Widget>[
-                          LimitedBox(
-                            maxWidth: 170,
-                            child: Text(
-                              roomInfo.houseName,
-                              style: TextStyle(
-                                  color: Colors.white,
-                                  fontSize: 14,
-                                  fontWeight: FontWeight.w500),
-                              maxLines: 1,
-                              overflow: TextOverflow.ellipsis,
-                            ),
-                          ),
-                          Container(
-                            margin: EdgeInsets.only(left: 6),
-                            child: Image.network(roomInfo.houseLevel.icon,
-                                width: 14),
+                          Row(
+                            children: <Widget>[
+                              LimitedBox(
+                                maxWidth: 170,
+                                child: Text(
+                                  roomInfo.houseName,
+                                  style: TextStyle(
+                                      color: Colors.white,
+                                      fontSize: 14,
+                                      fontWeight: FontWeight.w500),
+                                  maxLines: 1,
+                                  overflow: TextOverflow.ellipsis,
+                                ),
+                              ),
+                              Container(
+                                margin: EdgeInsets.only(left: 6),
+                                child: Image.network(roomInfo.houseLevel.icon,
+                                    width: 14),
+                              ),
+                              Container(
+                                  margin: EdgeInsets.only(left: 1),
+                                  child: Text(
+                                    roomInfo.houseLevel.levelName,
+                                    style: TextStyle(
+                                        color: Color(0xFFF9D881), fontSize: 9),
+                                  )),
+                            ],
                           ),
-                          Container(
-                              margin: EdgeInsets.only(left: 1),
-                              child: Text(
-                                roomInfo.houseLevel.levelName,
-                                style: TextStyle(
-                                    color: Color(0xFFF9D881), fontSize: 9),
-                              )),
+                          Text(
+                            roomInfo.houseAbstract ?? '',
+                            style: TextStyle(
+                                fontSize: 12,
+                                fontWeight: FontWeight.w400,
+                                color: Color(0xFF9BA0AE)),
+                            maxLines: 2,
+                            overflow: TextOverflow.ellipsis,
+                          )
                         ],
                       ),
-                      Text(
-                        roomInfo.houseAbstract ?? '',
-                        style: TextStyle(
-                            fontSize: 12,
-                            fontWeight: FontWeight.w400,
-                            color: Color(0xFF9BA0AE)),
-                        maxLines: 2,
-                        overflow: TextOverflow.ellipsis,
-                      )
-                    ],
-                  ),
+                    ),
+                    imageSrc != ''
+                        ? Image.asset(imageSrc, width: 70)
+                        : Text(tishiStr,
+                            style: TextStyle(
+                                color:
+                                    isImport ? PRIMARY_COLOR : Colors.white54,
+                                fontSize: 14))
+                  ],
                 ),
-                imageSrc != ''
-                    ? Image.asset(imageSrc, width: 70)
-                    : Text(tishiStr,
-                        style: TextStyle(color:isImport? PRIMARY_COLOR: Colors.white54, fontSize: 14))
-              ],
+              ),
+              onTap: () {
+                Navigator.push(
+                    context,
+                    CupertinoPageRoute(
+                        builder: (context) =>
+                            RoomInfo(roomId: roomInfo.id.toString())));
+              },
             ),
           ),
-          onTap: () {
-            Navigator.push(
-                context,
-                CupertinoPageRoute(
-                    builder: (context) =>
-                        RoomInfo(roomId: roomInfo.id.toString())));
-          },
-        ),
+          Container(
+            margin: EdgeInsets.symmetric(horizontal: 15),
+            height: 1,
+            color: Color(0xFF2B2B42),
+          )
+        ],
       ),
     );
   }

+ 8 - 7
lib/pages/TipList.dart

@@ -133,13 +133,14 @@ class TipItem extends StatelessWidget {
     return Container(
       // height: 108,
       margin: EdgeInsets.only(top: 10),
-      decoration: BoxDecoration(
-        gradient: LinearGradient(
-          colors: [Color(0xFF464B6A), Color(0xFF35395E)],
-          begin: Alignment.topCenter,
-          end: Alignment.bottomCenter,
-        ),
-      ),
+      // decoration: BoxDecoration(
+      //   gradient: LinearGradient(
+      //     colors: [Color(0xFF464B6A), Color(0xFF35395E)],
+      //     begin: Alignment.topCenter,
+      //     end: Alignment.bottomCenter,
+      //   ),
+      // ),
+      color: Color(0xFF363759),
       child: Material(
         color: Colors.transparent,
         child: InkWell(

+ 53 - 19
lib/pages/UserChange.dart

@@ -75,7 +75,14 @@ class UserChangeState extends State<UserChange> {
                                 _cell(
                                   '头像',
                                   ClipOval(
-                                    child: Image.network(userInfo.icon, width: 36, height: 36),
+                                    child: new SizedBox(
+                                      width: 36.0,
+                                      height: 36.0,
+                                      child: Image.network(
+                                        userInfo.icon,
+                                        fit: BoxFit.fill,
+                                      ),
+                                    ),
                                   ),
                                   onTap: () {
                                     _chooseImage();
@@ -87,9 +94,18 @@ class UserChangeState extends State<UserChange> {
                                   placeholder: '请填写昵称',
                                   onTap: () {
                                     Navigator.push(
-                                        context, CupertinoPageRoute(builder: (context) => ChangeUserInfo(title: '昵称', val: userInfo.nickname)));
+                                        context,
+                                        CupertinoPageRoute(
+                                            builder: (context) =>
+                                                ChangeUserInfo(
+                                                    title: '昵称',
+                                                    val: userInfo.nickname)));
                                   },
                                 ),
+                                _cell(
+                                  '用户Code',
+                                  userInfo.id.toString(),
+                                ),
                                 _cell(
                                   '性别',
                                   userInfo.sex,
@@ -101,15 +117,22 @@ class UserChangeState extends State<UserChange> {
                                 _cell(
                                   '生日',
                                   DateFormat('yyyy-MM-dd').format(
-                                    DateTime.fromMillisecondsSinceEpoch(userInfo.birthday),
+                                    DateTime.fromMillisecondsSinceEpoch(
+                                        userInfo.birthday),
                                   ),
                                   placeholder: '选择生日',
                                   onTap: () {
                                     _chooseBirthday(context);
                                   },
                                 ),
-                                _cell('手机', userInfo.phone, showBorder: false, onTap: () {
-                                  Navigator.push(context, CupertinoPageRoute(builder: (context) => ChangeUserInfo(title: '手机号', val: userInfo.phone)));
+                                _cell('手机', userInfo.phone, showBorder: false,
+                                    onTap: () {
+                                  Navigator.push(
+                                      context,
+                                      CupertinoPageRoute(
+                                          builder: (context) => ChangeUserInfo(
+                                              title: '手机号',
+                                              val: userInfo.phone)));
                                 })
                               ]),
                             ],
@@ -157,7 +180,8 @@ class UserChangeState extends State<UserChange> {
     if (Toast.preToast == null) {
       Toast.show(context, '加载中', -1, 'loading');
     }
-    final Result res = await HttpManager.post('userInfo/update', data: {'id': userInfo.id, key: value});
+    final Result res = await HttpManager.post('userInfo/update',
+        data: {'id': userInfo.id, key: value});
     Toast.hide();
     if (res.success) {
       Toast.show(context, '修改成功', 1500, 'success');
@@ -170,7 +194,8 @@ class UserChangeState extends State<UserChange> {
   Future<void> getUserInfo() async {
     Result res = await HttpManager.get('userInfo/getUserInfo');
     if (res.success) {
-      StoreProvider.of<AppState>(context).dispatch(UpdateUserAction(UserInfo.fromJson(res.data)));
+      StoreProvider.of<AppState>(context)
+          .dispatch(UpdateUserAction(UserInfo.fromJson(res.data)));
     } else {}
   }
 
@@ -203,13 +228,16 @@ class UserChangeState extends State<UserChange> {
           );
         });
     if (sex != null) {
-      updateUserInfo(StoreProvider.of<AppState>(context).state.userInfo, sex, 'sex');
+      updateUserInfo(
+          StoreProvider.of<AppState>(context).state.userInfo, sex, 'sex');
     }
   }
 
   Future<void> _chooseBirthday(BuildContext context) async {
     UserInfo userInfo = StoreProvider.of<AppState>(context).state.userInfo;
-    DateTime date = userInfo.birthday > 0 ? DateTime.fromMillisecondsSinceEpoch(userInfo.birthday) : DateTime.now();
+    DateTime date = userInfo.birthday > 0
+        ? DateTime.fromMillisecondsSinceEpoch(userInfo.birthday)
+        : DateTime.now();
     DateTime res = await showCupertinoModalPopup<DateTime>(
       context: context,
       builder: (BuildContext context) {
@@ -308,7 +336,8 @@ class UserChangeState extends State<UserChange> {
     });
     Toast.hide();
     if (res.success) {
-      updateUserInfo(StoreProvider.of<AppState>(context).state.userInfo, res.data[0], 'icon');
+      updateUserInfo(StoreProvider.of<AppState>(context).state.userInfo,
+          res.data[0], 'icon');
     }
   }
 
@@ -325,7 +354,8 @@ class UserChangeState extends State<UserChange> {
     );
   }
 
-  Widget _cell(String title, dynamic child, {String placeholder, void Function() onTap, bool showBorder = true}) {
+  Widget _cell(String title, dynamic child,
+      {String placeholder, void Function() onTap, bool showBorder = true}) {
     Widget secondChild;
     if (child == null || (child is String && child.isEmpty)) {
       secondChild = Text(
@@ -364,14 +394,18 @@ class UserChangeState extends State<UserChange> {
                 ),
               ),
               secondChild,
-              Padding(
-                padding: EdgeInsets.only(left: 2),
-                child: Image.asset(
-                  'images/icon_inter.png',
-                  width: 24,
-                  height: 24,
-                ),
-              )
+              onTap != null
+                  ? Padding(
+                      padding: EdgeInsets.only(left: 2),
+                      child: Image.asset(
+                        'images/icon_inter.png',
+                        width: 24,
+                        height: 24,
+                      ),
+                    )
+                  : Container(
+                      width: 28,
+                    )
             ],
           ),
         ),

+ 5 - 1
lib/pages/VideoPlayer.dart

@@ -1,5 +1,6 @@
 import 'package:flutter/material.dart';
 import '../widget/LocalVideoPlayer.dart';
+import '../net/HttpManager.dart';
 
 class VideoPlayerPage extends StatefulWidget {
   VideoPlayerPage({Key key, this.videoUrl, this.fileType}) : super(key: key);
@@ -16,7 +17,7 @@ class _VideoPlayerPageState extends State<VideoPlayerPage> {
   @override
   void initState() {
     super.initState();
-    print(widget.fileType);
+    print(widget.videoUrl);
 
     if (widget.videoUrl != '' && widget.videoUrl != null) {
       if (widget.fileType == 'netWork') {
@@ -30,6 +31,7 @@ class _VideoPlayerPageState extends State<VideoPlayerPage> {
     } else {
       isNet = true;
     }
+    // _defalutUrl='http://47.96.141.102:8080/videos/2019-05-24-04-47-48-4bzyynao.mp4';
     print(_defalutUrl);
     print(isNet);
   }
@@ -46,10 +48,12 @@ class _VideoPlayerPageState extends State<VideoPlayerPage> {
                 ? LocalVideoPlayer(
                     _defalutUrl,
                     isFullScreen: true,
+                    isNet:true,
                   )
                 : LocalVideoPlayer(
                     _defalutUrl,
                     isFullScreen: true,
+                    isNet:false,
                   )));
   }
 }

+ 25 - 19
lib/pages/openRoom.dart

@@ -35,7 +35,7 @@ class OpenRoomState extends State<OpenRoom> {
   Map<String, dynamic> editRoomInfo = {
     'gameId': 1,
     'houseLevel': 1,
-    'maxNumber': 10,
+    'maxNumber': 5,
     'scoreType': 0
   };
   List<GameInfo> gameList = [];
@@ -228,18 +228,18 @@ class OpenRoomState extends State<OpenRoom> {
             title: Text('创建' + (widget.roomFlag == '0' ? '普通' : '官方') + '房间'),
             centerTitle: true,
             elevation: 0,
-            actions: <Widget>[
-              Container(
-                width: 60,
-                child: FlatButton(
-                  highlightColor: PRIMARY_COLOR,
-                  padding: EdgeInsets.only(right: 0),
-                  child: Text('规则',
-                      style: TextStyle(color: Colors.white, fontSize: 13)),
-                  onPressed: () {},
-                ),
-              )
-            ],
+            // actions: <Widget>[
+            //   Container(
+            //     width: 60,
+            //     child: FlatButton(
+            //       highlightColor: PRIMARY_COLOR,
+            //       padding: EdgeInsets.only(right: 0),
+            //       child: Text('规则',
+            //           style: TextStyle(color: Colors.white, fontSize: 13)),
+            //       onPressed: () {},
+            //     ),
+            //   )
+            // ],
           ),
           body: Container(
             color: BG_COLOR,
@@ -338,6 +338,7 @@ class OpenRoomState extends State<OpenRoom> {
                           editRoomInfo['houseName'] = value;
                         }),
                     Container(
+                      margin: EdgeInsets.symmetric(horizontal: 15),
                       height: 1,
                       color: BG_SUB_COLOR,
                     ),
@@ -372,7 +373,8 @@ class OpenRoomState extends State<OpenRoom> {
                     //     },
                     //   ),
                     // ),
-                    Container(
+                     Container(
+                      margin: EdgeInsets.symmetric(horizontal: 15),
                       height: 1,
                       color: BG_SUB_COLOR,
                     ),
@@ -385,7 +387,8 @@ class OpenRoomState extends State<OpenRoom> {
                         showLevelPicker(context);
                       },
                     ),
-                    Container(
+                     Container(
+                      margin: EdgeInsets.symmetric(horizontal: 15),
                       height: 1,
                       color: BG_SUB_COLOR,
                     ),
@@ -398,7 +401,8 @@ class OpenRoomState extends State<OpenRoom> {
                         showNumPicker(context);
                       },
                     ),
-                    Container(
+                     Container(
+                      margin: EdgeInsets.symmetric(horizontal: 15),
                       height: 1,
                       color: BG_SUB_COLOR,
                     ),
@@ -553,9 +557,10 @@ class OpenRoomState extends State<OpenRoom> {
   void showNumPicker(BuildContext context) {
     List _list = [];
     List _listName = [];
-    for (var i = 10; i <= 100; i = i + 10) {
-      _list.add(i);
-      _listName.add(i.toString() + '人次房卡');
+    List _member=[5,10,15,20,25,50,100];
+    for (var item in _member) {
+      _list.add(item);
+      _listName.add(item.toString() + '人次房卡');
     }
 
     String pickerData = json.encode(_listName);
@@ -801,6 +806,7 @@ class FloatTextContent extends StatelessWidget {
                     style: TextStyle(
                         color: Colors.white,
                         fontSize: 12,
+                        fontWeight: FontWeight.w400,
                         decoration: TextDecoration.none)),
               ),
             )

+ 1 - 1
lib/pages/rankList.dart

@@ -75,7 +75,7 @@ class RankListState extends State<RankList> {
       rankList = list;
     });
 
-    if (rankList.isNotEmpty) {
+    if (rankList.isEmpty) {
       showBackDialog();
     }
   }

+ 169 - 123
lib/pages/roomInfo.dart

@@ -297,6 +297,27 @@ class RoomInfoState extends State<RoomInfo>
 
 //加入房间
   Future<void> joinRoom() async {
+    bool hasPermission = await ScreenStreamPlugin.checkPermission();
+    if (!hasPermission) {
+      showDialog(
+        context: context,
+        builder: (context) => AlertDialog(
+              title: Text('需要悬浮窗权限'),
+              contentTextStyle: TextStyle(color: Colors.black87),
+              content: Text('请在点击确定后,勾选"允许显示在其他应用的上层"'),
+              actions: <Widget>[
+                FlatButton(
+                  child: Text('确定'),
+                  onPressed: () {
+                    Navigator.of(context).pop();
+                    ScreenStreamPlugin.requestPermission();
+                  },
+                ),
+              ],
+            ),
+      );
+      return;
+    }
     Toast.show(context, '加载中', -1, 'loading');
     Result res = await HttpManager.post('houseInfo/join', data: {
       'houseId': widget.roomId,
@@ -496,129 +517,160 @@ class RoomInfoState extends State<RoomInfo>
               child: SingleChildScrollView(
                   controller: _tipController,
                   physics: AlwaysScrollableScrollPhysics(),
-                  child: Column(
+                  child: Stack(
                     children: <Widget>[
-                      houseInfo != null
-                          ? VideoWidget(videoSrc: houseInfo.video)
-                          : Container(),
-                      // Image.network(topImg, width: double.infinity),
-                      Container(
-                          padding: EdgeInsets.only(top: 10),
-                          child: Row(
+                      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,
+                                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(
+                            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>[
-                              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,
+                              Image.asset(
+                                'images/icon_renshu.png',
+                                width: 20,
                               ),
                               Text(
-                                houseLevelInfo.containsKey('levelName')
-                                    ? houseLevelInfo['levelName']
-                                    : '',
-                                style: TextStyle(color: colorInfo[levelName]),
+                                (houseInfo != null
+                                        ? (houseInfo.playerNumber ?? 0)
+                                            .toString()
+                                        : '0') +
+                                    '/' +
+                                    (houseInfo != null
+                                        ? houseInfo.maxNumber.toString()
+                                        : '0'),
+                                style: TextStyle(
+                                    fontSize: 14,
+                                    fontWeight: FontWeight.w500,
+                                    color: Color(0xFFB1B2C0)),
                               )
                             ],
-                          )),
-                      Container(
-                        margin: EdgeInsets.only(top: 6),
-                        child: Text(
-                          roomInfo.containsKey('houseAbstract')
-                              ? roomInfo['houseAbstract']
-                              : '',
-                          style:
-                              TextStyle(color: Color(0xFF9BA0AE), fontSize: 12),
-                        ),
-                      ),
-                      Row(
-                        mainAxisAlignment: MainAxisAlignment.center,
-                        children: <Widget>[
-                          Image.asset(
-                            'images/icon_renshu.png',
-                            width: 20,
                           ),
-                          Text(
-                            (houseInfo != null
-                                    ? (houseInfo.playerNumber ?? 0).toString()
-                                    : '0') +
-                                '/' +
-                                (houseInfo != null
-                                    ? houseInfo.maxNumber.toString()
-                                    : '0'),
-                            style: TextStyle(
-                                fontSize: 14,
-                                fontWeight: FontWeight.w500,
-                                color: Color(0xFFB1B2C0)),
+                          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(
+                                  '×' +
+                                      (houseInfo != null
+                                          ? houseInfo.bonus.toString()
+                                          : '0'),
+                                  style: TextStyle(
+                                    color: PRIMARY_COLOR,
+                                    fontSize: 22,
+                                    fontWeight: FontWeight.w900,
+                                  ),
+                                )
+                              ],
+                            ),
+                          ),
+
+                          statuFlag != 4
+                              ? TipsListContent(
+                                  tipsList: roomTipsList, houseInfo: houseInfo)
+                              : RankContent(
+                                  roomId: widget.roomId,
+                                ),
+                          Container(
+                            width: double.infinity,
+                            height: 78,
                           )
                         ],
                       ),
-                      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(
-                              '×' +
-                                  (houseInfo != null
-                                      ? houseInfo.bonus.toString()
-                                      : '0'),
-                              style: TextStyle(
-                                color: PRIMARY_COLOR,
-                                fontSize: 22,
-                                fontWeight: FontWeight.w900,
+                      roomInfo.isNotEmpty
+                          ? Positioned(
+                              left: 0,
+                              top: 20,
+                              child: Container(
+                                padding: EdgeInsets.fromLTRB(4, 6, 15, 6),
+                                decoration: BoxDecoration(
+                                    color: Color(0xFFFFB231).withOpacity(0.76),
+                                    borderRadius: BorderRadius.only(
+                                        topRight: Radius.circular(30),
+                                        bottomRight: Radius.circular(30))),
+                                child: Text(
+                                  '房间号:' +
+                                      (houseInfo.houseCode != null
+                                          ? houseInfo.houseCode
+                                          : ''),
+                                  style: TextStyle(
+                                      color: Colors.white,
+                                      fontSize: 13,
+                                      fontWeight: FontWeight.w500),
+                                ),
                               ),
                             )
-                          ],
-                        ),
-                      ),
-
-                      statuFlag != 4
-                          ? TipsListContent(
-                              tipsList: roomTipsList, houseInfo: houseInfo)
-                          : RankContent(
-                              roomId: widget.roomId,
-                            ),
-                      Container(
-                        width: double.infinity,
-                        height: 78,
-                      )
+                          : Container()
                     ],
                   ))),
         );
@@ -812,19 +864,13 @@ class RoomInfoState extends State<RoomInfo>
             );
       } else {
         return Container(
-          width: double.infinity,
-          padding: EdgeInsets.symmetric(horizontal: 15, vertical: 20),
-          height: 88,
-          child: RaisedButton(
-            disabledColor: Color(0xFF914244),
-            disabledTextColor: Color(0xFF252532),
-            child: Text(
-              '预计' + getSecondsMIn(_time) + '后开始',
-              style: TextStyle(fontSize: 16),
-            ),
-            onPressed: null,
-          ),
-        );
+            width: double.infinity,
+            padding: EdgeInsets.symmetric(horizontal: 15, vertical: 20),
+            height: 88,
+            child: LinearButton(
+                btntext: '预计' + getSecondsMIn(_time) + '后开始',
+                colorList: [Color(0xFFC99C09), Color(0xFFC7873E)],
+                textColor: Color(0xFF252532)));
       }
     } else if (isJoin && statusFlag == 8) {
       return Container(

+ 201 - 48
lib/pages/roomList.dart

@@ -8,6 +8,11 @@ import '../net/HttpManager.dart';
 import '../net/Result.dart';
 import '../model/HouseInfo.dart';
 import '../model/GameInfo.dart';
+import '../widget/ITextInput.dart';
+import 'package:redux/redux.dart';
+import 'package:flutter_redux/flutter_redux.dart';
+import '../redux/AppState.dart';
+import '../model/UserInfo.dart';
 
 class RoomList extends StatefulWidget {
   @override
@@ -19,11 +24,14 @@ class RoomListState extends State<RoomList> {
   int currentPage = 1;
   ScrollController _controller;
   bool scrollFlag = true;
+  bool _showSearch = false;
 
   String gameId = '';
   String houseLevel = '';
   String houseType = '';
   String statusFlag = '0';
+  String searchKey = '';
+  FocusNode _contentFocusNode = FocusNode();
 
   List gameList = [
     {'id': '', 'gameName': '全部游戏'}
@@ -45,6 +53,17 @@ class RoomListState extends State<RoomList> {
     {'name': '结算完成', 'val': '4'}
   ];
 
+  Future<void> search(String text) async {
+    if (text != searchKey) {
+      currentPage = 1;
+      searchKey = text;
+      statusFlag = '';
+      houseLevel = '';
+      houseType = '';
+      getRoomInfo();
+    }
+  }
+
   @override
   void initState() {
     super.initState();
@@ -93,12 +112,44 @@ class RoomListState extends State<RoomList> {
     ScreenUtil.instance = ScreenUtil(width: 375, height: 667)..init(context);
 
     return Scaffold(
-        appBar: AppBar(
-          backgroundColor: PRIMARY_COLOR,
-          title: Text('房间列表'),
-          centerTitle: true,
-          elevation: 0,
-        ),
+        appBar: !_showSearch
+            ? AppBar(
+                backgroundColor: PRIMARY_COLOR,
+                title: Text('房间列表'),
+                centerTitle: true,
+                elevation: 0,
+                actions: <Widget>[
+                  GestureDetector(
+                    child: Image.asset('images/icon_sousuo.png'),
+                    onTap: () async {
+                      setState(() {
+                        _showSearch = true;
+                      });
+                      // String result = await 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 searchInput();
+                      //         }));
+                      // if (result != '' || searchKey != '') {
+                      //   search(result);
+                      // }
+                    },
+                  )
+                ],
+              )
+            : null,
         body: RefreshIndicator(
           color: PRIMARY_COLOR,
           backgroundColor: Colors.white,
@@ -110,7 +161,7 @@ class RoomListState extends State<RoomList> {
             getRoomInfo();
           },
           child: Container(
-            color: BG_COLOR,
+            color: Color(0xFF363759),
             child: Stack(
               children: <Widget>[
                 CustomScrollView(
@@ -119,34 +170,46 @@ class RoomListState extends State<RoomList> {
                   slivers: <Widget>[
                     SliverToBoxAdapter(
                       child: Container(
-                        height: 44,
+                        height: _showSearch
+                            ? MediaQueryData.fromWindow(window).padding.top +
+                                100
+                            : 44,
                       ),
                     ),
                     SliverFixedExtentList(
-                      itemExtent: ScreenUtil().setWidth(78),
-                      delegate: SliverChildBuilderDelegate((BuildContext context, int index) {
-                        if(roomList.isEmpty){
-                          return Text('暂无数据',style: TextStyle(
-                            color: Colors.grey,
-                            fontSize: 13,
-                            height:3
-                          ),textAlign: TextAlign.center);
-                        }else if(index ==roomList.length){
-                            return Text('更多房间敬请期待...',style: TextStyle(
-                            color: Colors.grey,
-                            fontSize: 13,
-                            height:3
-                          ),textAlign: TextAlign.center);
+                      itemExtent:
+                          roomList.isEmpty ? 300 : ScreenUtil().setWidth(78),
+                      delegate: SliverChildBuilderDelegate(
+                          (BuildContext context, int index) {
+                        if (roomList.isEmpty) {
+                          return Container(
+                            padding: EdgeInsets.only(top: 105),
+                            child: Column(
+                              children: <Widget>[
+                                Image.asset('images/icon_kong.png'),
+                                Text('暂时没有此房间哦~',
+                                    style: TextStyle(
+                                        fontSize: 14,
+                                        color:
+                                            Color(0xFFFFB726).withOpacity(0.3)))
+                              ],
+                            ),
+                          );
+                        } else if (index == roomList.length) {
+                          return Text('更多房间敬请期待...',
+                              style: TextStyle(
+                                  color: Colors.grey, fontSize: 13, height: 3),
+                              textAlign: TextAlign.center);
                         }
                         return HouseItem(
-                          roomInfo: roomList[index],
-                          gameInfo:roomList[index].gameInfo
-                        );
-                      }, childCount: roomList.length+1),
+                            roomInfo: roomList[index],
+                            gameInfo: roomList[index].gameInfo);
+                      }, childCount: roomList.length + 1),
                     )
                   ],
                 ),
-                _topWidget()
+                _topWidget(),
+                _showSearch ? _searchInput() : Container()
               ],
             ),
           ),
@@ -155,14 +218,20 @@ class RoomListState extends State<RoomList> {
 
   Widget _topWidget() {
     return Positioned(
+      top: _showSearch ? MediaQueryData.fromWindow(window).padding.top + 56 : 0,
       width: ScreenUtil().setWidth(375),
       height: 44,
       child: Container(
         padding: EdgeInsets.all(14),
-        color: Color(0xFF3A3D5C),
+        color: Color(0xFF2B2B42),
         child: Row(
           mainAxisAlignment: MainAxisAlignment.spaceBetween,
-          children: <Widget>[_chooseGame(), _chooseHouseType(), _chooseLevel(), _chooseStatus()],
+          children: <Widget>[
+            _chooseGame(),
+            _chooseHouseType(),
+            _chooseLevel(),
+            _chooseStatus()
+          ],
         ),
       ),
     );
@@ -189,7 +258,10 @@ class RoomListState extends State<RoomList> {
                 flex: 1,
                 child: Text(
                   gameInfo['gameName'],
-                  style: TextStyle(color: gameId != '' ? PRIMARY_COLOR : Colors.white, fontSize: 12, fontWeight: FontWeight.w500),
+                  style: TextStyle(
+                      color: gameId != '' ? PRIMARY_COLOR : Colors.white,
+                      fontSize: 12,
+                      fontWeight: FontWeight.w500),
                   overflow: TextOverflow.ellipsis,
                   textAlign: TextAlign.center,
                 ),
@@ -205,7 +277,7 @@ class RoomListState extends State<RoomList> {
             setState(() {
               gameId = value;
             });
-            currentPage=1;
+            currentPage = 1;
             getRoomInfo();
           },
           itemBuilder: (BuildContext context) {
@@ -242,7 +314,10 @@ class RoomListState extends State<RoomList> {
                 flex: 1,
                 child: Text(
                   levelInfo['levelName'],
-                  style: TextStyle(color: houseLevel != '' ? PRIMARY_COLOR : Colors.white, fontSize: 12, fontWeight: FontWeight.w500),
+                  style: TextStyle(
+                      color: houseLevel != '' ? PRIMARY_COLOR : Colors.white,
+                      fontSize: 12,
+                      fontWeight: FontWeight.w500),
                   overflow: TextOverflow.ellipsis,
                   textAlign: TextAlign.center,
                 ),
@@ -258,7 +333,7 @@ class RoomListState extends State<RoomList> {
             setState(() {
               houseLevel = value;
             });
-            currentPage=1;
+            currentPage = 1;
             getRoomInfo();
           },
           itemBuilder: (BuildContext context) {
@@ -295,7 +370,10 @@ class RoomListState extends State<RoomList> {
                 flex: 1,
                 child: Text(
                   typeInfo['name'],
-                  style: TextStyle(color: houseType != '' ? PRIMARY_COLOR : Colors.white, fontSize: 12, fontWeight: FontWeight.w500),
+                  style: TextStyle(
+                      color: houseType != '' ? PRIMARY_COLOR : Colors.white,
+                      fontSize: 12,
+                      fontWeight: FontWeight.w500),
                   overflow: TextOverflow.ellipsis,
                   textAlign: TextAlign.center,
                 ),
@@ -311,7 +389,7 @@ class RoomListState extends State<RoomList> {
             setState(() {
               houseType = value;
             });
-            currentPage=1;
+            currentPage = 1;
             getRoomInfo();
           },
           itemBuilder: (BuildContext context) {
@@ -348,7 +426,10 @@ class RoomListState extends State<RoomList> {
                 flex: 1,
                 child: Text(
                   statusInfo['name'],
-                  style: TextStyle(color: statusFlag != '' ? PRIMARY_COLOR : Colors.white, fontSize: 12, fontWeight: FontWeight.w500),
+                  style: TextStyle(
+                      color: statusFlag != '' ? PRIMARY_COLOR : Colors.white,
+                      fontSize: 12,
+                      fontWeight: FontWeight.w500),
                   overflow: TextOverflow.ellipsis,
                   textAlign: TextAlign.center,
                 ),
@@ -364,7 +445,7 @@ class RoomListState extends State<RoomList> {
             setState(() {
               statusFlag = value;
             });
-            currentPage=1;
+            currentPage = 1;
             getRoomInfo();
           },
           itemBuilder: (BuildContext context) {
@@ -381,10 +462,10 @@ class RoomListState extends State<RoomList> {
   }
 
   Future<void> getRoomInfo() async {
-   
     Map<String, dynamic> data = {
       'currentPage': currentPage,
       'pageNumber': 20,
+      'myUserId': StoreProvider.of<AppState>(context).state.userInfo.id
     };
     data['advancedQuery'] = '';
     if (gameId != '') {
@@ -401,25 +482,34 @@ class RoomListState extends State<RoomList> {
     } else {
       data['statusStr'] = '0,4';
     }
-    List<HouseInfo> _allList=roomList;
-    if(currentPage==1){
-      _allList=[];
+    data['searchKey'] = searchKey;
+    List<HouseInfo> _allList = roomList;
+    if (currentPage == 1) {
+      _allList = [];
+    }
+
+    if (StoreProvider.of<AppState>(context).state.userInfo.recommender !=
+        null) {
+      data['recommender'] =
+          StoreProvider.of<AppState>(context).state.userInfo.recommender;
     }
+
+    // myUserId=84705&recommender=84702
     Result res = await HttpManager.get('houseInfo/page', data: data);
     if (res.success && res.data['pp'] != null) {
       for (var item in res.data['pp']) {
-        HouseInfo _temHouse=HouseInfo.fromJson(item);
+        HouseInfo _temHouse = HouseInfo.fromJson(item);
         _allList.add(_temHouse);
       }
       if (res.data['page']['currentPage'] < res.data['page']['totalPage']) {
-          scrollFlag = true;
-        } else {
-          scrollFlag = false;
-        }
-      } else {}
+        scrollFlag = true;
+      } else {
+        scrollFlag = false;
+      }
+    } else {}
 
     setState(() {
-     roomList=_allList; 
+      roomList = _allList;
     });
 
     // final response = await Dio().get(domain + 'houseInfo/page', data: data);
@@ -438,4 +528,67 @@ class RoomListState extends State<RoomList> {
     //   }
     // }
   }
+
+  Widget _searchInput() {
+    return Positioned(
+      child: Container(
+          padding: EdgeInsets.only(
+              top: MediaQueryData.fromWindow(window).padding.top, left: 15),
+          decoration: BoxDecoration(
+              gradient: LinearGradient(
+                  colors: [Color(0xFFFFC30F), Color(0xFFFFA54C)],
+                  begin: Alignment.topCenter,
+                  end: Alignment.bottomCenter)),
+          height: MediaQueryData.fromWindow(window).padding.top + 56,
+          child: Row(
+            children: <Widget>[
+              Expanded(
+                flex: 1,
+                child: Container(
+                  height: 34,
+                  decoration: BoxDecoration(
+                    color: Colors.white,
+                    borderRadius: BorderRadius.all(Radius.circular(100)),
+                  ),
+                  child: ITextField(
+                      focusNode: _contentFocusNode,
+                      autofocus: true,
+                      hintText: '输入房间名称/房间号/创建人Code',
+                      inputBorder: InputBorder.none,
+                      hintStyle: TextStyle(
+                        fontSize: 16,
+                        color: Color(0xFF727785),
+                      ),
+                      textStyle: TextStyle(color: Colors.black),
+                      contentPadding:
+                          EdgeInsets.symmetric(vertical: 4, horizontal: 19),
+                      fieldCallBack: (content) {
+                        search(content);
+                      },
+                      counterStyle: TextStyle(color: BG_SUB_COLOR, fontSize: 0),
+                      textInputAction: TextInputAction.search),
+                ),
+              ),
+              InkWell(
+                child: Container(
+                  padding: EdgeInsets.fromLTRB(16, 0, 15, 4),
+                  child: Text('取消',
+                      style: TextStyle(color: Colors.white, fontSize: 16)),
+                ),
+                onTap: () {
+                  setState(() {
+                    _showSearch = false;
+                    currentPage = 1;
+                    searchKey = '';
+                    statusFlag = '0';
+                    houseLevel = '';
+                    houseType = '';
+                    getRoomInfo();
+                  });
+                },
+              )
+            ],
+          )),
+    );
+  }
 }

+ 1 - 1
lib/styles/colors.dart

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

+ 41 - 5
lib/widget/ITextInput.dart

@@ -4,7 +4,16 @@ import 'package:flutter/services.dart';
 ///自带删除的ITextField
 typedef void ITextFieldCallBack(String content);
 
-enum ITextInputType { text, multiline, number, phone, datetime, emailAddress, url, password }
+enum ITextInputType {
+  text,
+  multiline,
+  number,
+  phone,
+  datetime,
+  emailAddress,
+  url,
+  password
+}
 
 class ITextField extends StatefulWidget {
   final ITextInputType keyboardType;
@@ -13,6 +22,7 @@ class ITextField extends StatefulWidget {
   final String hintText;
   final TextStyle hintStyle;
   final ITextFieldCallBack fieldCallBack;
+  final ITextFieldCallBack fieldSubmit;
   final Icon deleteIcon;
   final InputBorder inputBorder;
   final Widget prefixIcon;
@@ -21,6 +31,9 @@ class ITextField extends StatefulWidget {
   final TextStyle counterStyle;
   final String inputText;
   final bool autofocus;
+  final TextInputAction textInputAction;
+  final EdgeInsetsGeometry contentPadding;
+  final FocusNode focusNode;
 
   ITextField(
       {Key key,
@@ -30,6 +43,7 @@ class ITextField extends StatefulWidget {
       this.hintText,
       this.hintStyle,
       this.fieldCallBack,
+      this.fieldSubmit,
       this.deleteIcon,
       this.inputBorder,
       this.textStyle,
@@ -37,7 +51,10 @@ class ITextField extends StatefulWidget {
       this.validator,
       this.counterStyle,
       this.inputText,
-      this.autofocus = false})
+      this.autofocus = false,
+      this.textInputAction,
+      this.contentPadding,
+      this.focusNode})
       : assert(maxLines == null || maxLines > 0),
         assert(maxLength == null || maxLength > 0),
         keyboardType = maxLines == 1 ? keyboardType : ITextInputType.multiline,
@@ -94,6 +111,9 @@ class _ITextFieldState extends State<ITextField> {
   void initState() {
     super.initState();
     _inputText = widget.inputText != null ? widget.inputText : '';
+    if (widget.focusNode != null) {
+      _focusNode = widget.focusNode;
+    }
     _focusNode.addListener(() {
       if (!_focusNode.hasFocus) {
         setState(() {
@@ -110,19 +130,28 @@ class _ITextFieldState extends State<ITextField> {
   @override
   Widget build(BuildContext context) {
     TextEditingController _controller = TextEditingController.fromValue(
-        TextEditingValue(text: _inputText, selection: TextSelection.fromPosition(TextPosition(affinity: TextAffinity.downstream, offset: _inputText.length))));
+        TextEditingValue(
+            text: _inputText,
+            selection: TextSelection.fromPosition(TextPosition(
+                affinity: TextAffinity.downstream,
+                offset: _inputText.length))));
     TextField textField = TextField(
       autofocus: widget.autofocus,
       focusNode: _focusNode,
       controller: _controller,
+      textInputAction: widget.textInputAction,
+      cursorColor: Theme.of(context).primaryColor,
       decoration: InputDecoration(
         counterStyle: widget.counterStyle,
         hintStyle: widget.hintStyle,
         hintText: widget.hintText,
-        border: widget.inputBorder != null ? widget.inputBorder : UnderlineInputBorder(),
+        border: widget.inputBorder != null
+            ? widget.inputBorder
+            : UnderlineInputBorder(),
         fillColor: Colors.transparent,
         filled: true,
         prefixIcon: widget.prefixIcon,
+        contentPadding: widget.contentPadding,
         suffixIcon: _hasdeleteIcon
             ? Container(
                 width: 20.0,
@@ -131,7 +160,9 @@ class _ITextFieldState extends State<ITextField> {
                   alignment: Alignment.center,
                   padding: const EdgeInsets.all(0.0),
                   iconSize: 18.0,
-                  icon: widget.deleteIcon != null ? widget.deleteIcon : Icon(Icons.cancel),
+                  icon: widget.deleteIcon != null
+                      ? widget.deleteIcon
+                      : Icon(Icons.cancel),
                   onPressed: () {
                     setState(() {
                       _inputText = '';
@@ -150,6 +181,11 @@ class _ITextFieldState extends State<ITextField> {
           widget.fieldCallBack(_inputText);
         });
       },
+      onSubmitted: (str) {
+        setState(() {
+          widget.fieldSubmit(str);
+        });
+      },
       keyboardType: _getTextInputType(),
       maxLength: widget.maxLength,
       maxLines: widget.maxLines,

+ 29 - 12
lib/widget/LocalVideoPlayer.dart

@@ -8,8 +8,10 @@ import 'package:screen/screen.dart';
 class LocalVideoPlayer extends StatefulWidget {
   final String source;
   bool isFullScreen;
+  bool isNet;
 
-  LocalVideoPlayer(this.source, {this.isFullScreen = false});
+  LocalVideoPlayer(this.source,
+      {this.isFullScreen = false, this.isNet = false});
 
   @override
   _LocalVideoPlayerState createState() => _LocalVideoPlayerState();
@@ -29,8 +31,13 @@ class _LocalVideoPlayerState extends State<LocalVideoPlayer> {
       }
       setState(() {});
     };
-    File _sourceFile = File('file://${widget.source}');
-    controller = VideoPlayerController.file(_sourceFile);
+    if (widget.isNet) {
+      print(widget.source);
+      controller = VideoPlayerController.network(widget.source);
+    } else {
+      File _sourceFile = File('file://${widget.source}');
+      controller = VideoPlayerController.file(_sourceFile);
+    }
     controller.initialize();
     controller.setLooping(true);
     controller.addListener(listener);
@@ -202,32 +209,40 @@ class _PlayViewState extends State<PlayView> {
                                       onTap: onClickPlay,
                                     ),
                                     Container(
-                                        padding: EdgeInsets.symmetric(horizontal: 5.0),
+                                        padding: EdgeInsets.symmetric(
+                                            horizontal: 5.0),
                                         child: Center(
                                           child: Text(
                                             '${controller.value.position.toString().split('.')[0]}',
-                                            style: TextStyle(color: Colors.white),
+                                            style:
+                                                TextStyle(color: Colors.white),
                                           ),
                                         )),
                                     Expanded(
                                         child: VideoProgressIndicator(
                                       controller,
                                       allowScrubbing: true,
-                                      padding: EdgeInsets.symmetric(horizontal: 1.0, vertical: 1.0),
-                                      colors: VideoProgressColors(playedColor: primaryColor),
+                                      padding: EdgeInsets.symmetric(
+                                          horizontal: 1.0, vertical: 1.0),
+                                      colors: VideoProgressColors(
+                                          playedColor: primaryColor),
                                     )),
                                     Container(
-                                        padding: EdgeInsets.symmetric(horizontal: 5.0),
+                                        padding: EdgeInsets.symmetric(
+                                            horizontal: 5.0),
                                         child: Center(
                                           child: Text(
                                             '${controller.value.duration.toString().split('.')[0]}',
-                                            style: TextStyle(color: Colors.white),
+                                            style:
+                                                TextStyle(color: Colors.white),
                                           ),
                                         )),
                                     Container(
                                       child: widget.allowFullScreen
                                           ? Container(
-                                              child: MediaQuery.of(context).orientation == Orientation.portrait
+                                              child: MediaQuery.of(context)
+                                                          .orientation ==
+                                                      Orientation.portrait
                                                   ? GestureDetector(
                                                       child: Icon(
                                                         Icons.fullscreen,
@@ -240,7 +255,8 @@ class _PlayViewState extends State<PlayView> {
                                                         Icons.fullscreen_exit,
                                                         color: primaryColor,
                                                       ),
-                                                      onTap: onClickExitFullScreen,
+                                                      onTap:
+                                                          onClickExitFullScreen,
                                                     ),
                                             )
                                           : Container(),
@@ -272,7 +288,8 @@ class _PlayViewState extends State<PlayView> {
               controller.setLooping(true);
               controller.play();
             },
-            shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(30.0)),
+            shape: RoundedRectangleBorder(
+                borderRadius: BorderRadius.circular(30.0)),
             child: Text('play error, try again!'),
           ),
         ),

+ 9 - 7
lib/widget/RoomItem.dart

@@ -16,18 +16,20 @@ class HouseItem extends StatelessWidget {
     //   return Container();
     // }
     return Container(
+      margin: EdgeInsets.symmetric(horizontal: 15),
       decoration: BoxDecoration(
-          gradient: LinearGradient(
-            colors: [Color(0xFF3F4261), Color(0xFF323456)],
-            begin: Alignment.topCenter,
-            end: Alignment.bottomCenter,
-          ),
-          border: Border(bottom: BorderSide(color: Colors.black, width: 1))),
+        color: Color(0xFF363759),
+          // gradient: LinearGradient(
+          //   colors: [Color(0xFF3F4261), Color(0xFF323456)],
+          //   begin: Alignment.topCenter,
+          //   end: Alignment.bottomCenter,
+          // ),
+          border: Border(bottom: BorderSide(color: Color(0xFF2F304B), width: 1))),
       child: Material(
         color: Colors.transparent,
         child: InkWell(
           child: Padding(
-            padding: EdgeInsets.all(15),
+            padding: EdgeInsets.symmetric(vertical: 15),
             child: Row(
               children: <Widget>[
                 Image.network(