panhui 6 лет назад
Родитель
Сommit
7f864b3489

+ 1 - 1
android/app/build.gradle

@@ -37,7 +37,7 @@ android {
     }
 
     defaultConfig {
-        applicationId "com.yuanren.dianjing"
+        applicationId "com.quanming.dianjing"
         minSdkVersion 21
         targetSdkVersion 28
         versionCode flutterVersionCode.toInteger()

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

@@ -1,5 +1,5 @@
 <manifest xmlns:android="http://schemas.android.com/apk/res/android"
-    package="com.yuanren.dianjing">
+    package="com.quanming.dianjing">
     <!-- Flutter needs it to communicate with the running application
          to allow setting breakpoints, to provide hot reload, etc.
     -->

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

@@ -1,6 +1,6 @@
 <manifest xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:tools="http://schemas.android.com/tools"
-    package="com.yuanren.dianjing">
+    package="com.quanming.dianjing">
 
     <!-- io.flutter.app.FlutterApplication is an android.app.Application that
          calls FlutterMain.startInitialization(this); in its onCreate method.
@@ -19,7 +19,7 @@
             android:screenOrientation="portrait"
             android:theme="@style/Theme.AppCompat.Light.NoActionBar" />
         <activity
-            android:name="com.yuanren.dianjing.MainActivity"
+            android:name="com.quanming.dianjing.MainActivity"
             android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
             android:hardwareAccelerated="true"
             android:launchMode="singleTop"

+ 1 - 1
android/app/src/main/kotlin/com/quanming/dianjing/MainActivity.kt

@@ -1,4 +1,4 @@
-package com.yuanren.dianjing
+package com.quanming.dianjing
 
 import android.content.Intent
 import android.os.Bundle

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

@@ -1,5 +1,5 @@
 <manifest xmlns:android="http://schemas.android.com/apk/res/android"
-    package="com.yuanren.dianjing">
+    package="com.quanming.dianjing">
     <!-- Flutter needs it to communicate with the running application
          to allow setting breakpoints, to provide hot reload, etc.
     -->

BIN
images/2x/img_xuzhi_04.png


BIN
images/3x/img_xuzhi_04.png


BIN
images/img_xuzhi_04.png


+ 24 - 0
lib/model/CustomerService.dart

@@ -0,0 +1,24 @@
+import 'package:json_annotation/json_annotation.dart';
+
+part 'CustomerService.g.dart';
+
+@JsonSerializable()
+class CustomerService {
+  CustomerService(this.id, this.serviceName, this.icon, this.telephone,this.wchat,this.qq);
+  int id;
+  String serviceName;
+  String icon;
+  String telephone;
+  String wchat;
+  String qq;
+  factory CustomerService.fromJson(Map<String, dynamic> json) =>
+      _$CustomerServiceFromJson(json);
+
+  Map<String, dynamic> toJson() => _$CustomerServiceToJson(this);
+  // 命名构造函数
+  CustomerService.empty();
+  @override
+  String toString() {
+    return _$CustomerServiceToJson(this).toString();
+  }
+}

+ 28 - 0
lib/model/CustomerService.g.dart

@@ -0,0 +1,28 @@
+// GENERATED CODE - DO NOT MODIFY BY HAND
+
+part of 'CustomerService.dart';
+
+// **************************************************************************
+// JsonSerializableGenerator
+// **************************************************************************
+
+CustomerService _$CustomerServiceFromJson(Map<String, dynamic> json) {
+  return CustomerService(
+      json['id'] as int, json['serviceName'] as String, json['icon'] as String, json['telephone'] as String, json['wchat'] as String, json['qq'] as String);
+}
+
+//  int id;
+//   String serviceName;
+//   String icon;
+//   String telephone;
+//   String wchat;
+//   String qq;
+
+Map<String, dynamic> _$CustomerServiceToJson(CustomerService instance) => <String, dynamic>{
+      'id': instance.id,
+      'serviceName': instance.serviceName,
+      'icon': instance.icon,
+      'telephone': instance.telephone,
+      'wchat': instance.wchat,
+      'qq': instance.qq
+    };

+ 3 - 1
lib/model/HouseInfo.dart

@@ -1,6 +1,7 @@
 import 'package:json_annotation/json_annotation.dart';
 import 'GameInfo.dart';
 import 'HouseLevel.dart';
+import 'CustomerService.dart';
 
 part 'HouseInfo.g.dart';
 
@@ -26,7 +27,7 @@ class HouseInfo {
       this.createUser,
       this.beginTime,
       this.createTime,
-      this.scoreType,this.houseCode,this.killnumber);
+      this.scoreType,this.houseCode,this.killnumber,this.customerService);
   int id;
   int gameId; //游戏ID
   int userId; //用户ID
@@ -50,6 +51,7 @@ class HouseInfo {
   int scoreType;//评分类型 0.评分 1.吃鸡
 String houseCode;//房间号
 int killnumber;//击杀人数
+CustomerService customerService;
   factory HouseInfo.fromJson(Map<String, dynamic> json) =>
       _$HouseInfoFromJson(json);
 

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

@@ -33,7 +33,8 @@ HouseInfo _$HouseInfoFromJson(Map<String, dynamic> json) {
       json['createTime'] as int,
       json['scoreType'] as int,
       json['houseCode'] as String,
-      json['killnumber'] as int);
+      json['killnumber'] as int,
+      json['customerService']==null?null:CustomerService.fromJson(json['customerService'] as Map<String, dynamic>));
 }
 
 Map<String, dynamic> _$HouseInfoToJson(HouseInfo instance) => <String, dynamic>{
@@ -58,5 +59,6 @@ Map<String, dynamic> _$HouseInfoToJson(HouseInfo instance) => <String, dynamic>{
       'createTime': instance.createTime,
       'scoreType': instance.scoreType,
       'houseCode': instance.houseCode,
-      'killnumber':instance.killnumber
+      'killnumber':instance.killnumber,
+      'customerService':instance.customerService
     };

+ 2 - 2
lib/net/HttpManager.dart

@@ -3,8 +3,8 @@ import 'Result.dart';
 import 'package:intl/intl.dart';
 
 class HttpManager {
-  // static String baseUrl = 'http://123.58.240.138:9000/';
-  static String baseUrl='http://192.168.50.15:8080/';
+  static String baseUrl = 'http://117.81.233.142:8206/';
+  // static String baseUrl='http://192.168.50.15:8080/';
   static String token;
   static bool debug;
 

+ 65 - 69
lib/pages/MatchPage.dart

@@ -21,6 +21,7 @@ import 'dart:async';
 import 'dart:convert';
 import 'dart:ui';
 import 'dart:math';
+import 'SelectRoom.dart';
 
 class MatchPage extends StatefulWidget {
   @override
@@ -228,7 +229,7 @@ class _MatchPageState extends State<MatchPage> with WidgetsBindingObserver {
                     btnHeight: 26.0,
                     colorList: [Color(0xFFFFB726), Color(0xFFFFB726)],
                     textSize: 12.0,
-                    onTapHomeMenu: (){
+                    onTapHomeMenu: () {
                       showNotice();
                     },
                   ),
@@ -284,7 +285,7 @@ class _MatchPageState extends State<MatchPage> with WidgetsBindingObserver {
                                 list.add(
                                   Container(
                                       key: Key("pagination_$i"),
-                                      margin:EdgeInsets.symmetric(vertical: 3,horizontal: 2),
+                                      margin: EdgeInsets.symmetric(vertical: 3, horizontal: 2),
                                       child: Container(
                                         width: active ? 8 : 3,
                                         height: 3,
@@ -309,61 +310,42 @@ class _MatchPageState extends State<MatchPage> with WidgetsBindingObserver {
                       delegate: _SliverAppBarDelegate(
                           minHeight: 60, //收起的高度
                           maxHeight: 60, //展开的最大高度
-                          child: Container(
-                            color: Color(0xFF2E3049),
-                            height: 60,
-                            padding: EdgeInsets.symmetric(vertical: 10, horizontal: 15),
-                            child: Container(
-                              decoration: BoxDecoration(color: Colors.white, borderRadius: BorderRadius.all(Radius.circular(4))),
-                              child: Row(
-                                children: <Widget>[
-                                  Container(
-                                    width: 10,
-                                  ),
-                                  ImageIcon(
-                                    AssetImage('images/home_icon_sousuo.png'),
-                                    color: Color(0xFF727785),
-                                  ),
-                                  Expanded(
-                                    flex: 1,
-                                    child: Container(
-                                      height: 34,
-                                      decoration: BoxDecoration(
-                                        color: Colors.white,
-                                        borderRadius: BorderRadius.all(Radius.circular(100)),
+                          child: InkWell(
+                              onTap: () {
+                                Navigator.push(context, CupertinoPageRoute(builder: (context) => SelectRoom()));
+                              },
+                              child: Container(
+                                color: Color(0xFF2E3049),
+                                height: 60,
+                                padding: EdgeInsets.symmetric(vertical: 10, horizontal: 15),
+                                child: Container(
+                                  decoration: BoxDecoration(color: Colors.white, borderRadius: BorderRadius.all(Radius.circular(4))),
+                                  child: Row(
+                                    children: <Widget>[
+                                      Container(
+                                        width: 10,
                                       ),
-                                      child: ITextField(
-                                          hintText: '搜索竞赛房间',
-                                          inputBorder: InputBorder.none,
-                                          hintStyle: TextStyle(fontSize: 13, color: Color(0xFFB1B5C0), height: 1.2),
-                                          textStyle: TextStyle(color: Colors.black),
-                                          contentPadding: EdgeInsets.symmetric(vertical: 4, horizontal: 4),
-                                          fieldCallBack: (content) {
-                                            search(content);
-                                            _focusNode.unfocus();
-                                          },
-                                          focusNode: _focusNode,
-                                          counterStyle: TextStyle(color: Color(0xFF9BA0AE), fontSize: 0),
-                                          textInputAction: TextInputAction.search,
-                                          fileOnTap: () {
-                                            print('选择input');
-                                            if (_controller.position.pixels < 200) {
-                                              _controller.animateTo(200, duration: Duration(milliseconds: 300), curve: Curves.ease);
-                                            }
-                                          }),
-                                    ),
-                                  ),
-                                  Container(
-                                    width: 1,
-                                    height: 10,
-                                    color: Color(0xFFB1B5C0),
-                                  ),
-                                  Container(
-                                      width: 99,
-                                      child: InkWell(
-                                          onTap: () {
-                                            showPicker(context);
-                                          },
+                                      ImageIcon(
+                                        AssetImage('images/home_icon_sousuo.png'),
+                                        color: Color(0xFF727785),
+                                      ),
+                                      Expanded(
+                                        flex: 1,
+                                        child: Container(
+                                          decoration: BoxDecoration(
+                                            color: Colors.white,
+                                            borderRadius: BorderRadius.all(Radius.circular(100)),
+                                          ),
+                                          child: Text('搜索竞赛房间', style: TextStyle(color: Color(0xFF9BA0AE), fontSize: 13)),
+                                        ),
+                                      ),
+                                      Container(
+                                        width: 1,
+                                        height: 10,
+                                        color: Color(0xFFB1B5C0),
+                                      ),
+                                      Container(
+                                          width: 99,
                                           child: Row(
                                             mainAxisAlignment: MainAxisAlignment.center,
                                             children: <Widget>[
@@ -384,29 +366,43 @@ class _MatchPageState extends State<MatchPage> with WidgetsBindingObserver {
                                                 width: 5,
                                               )
                                             ],
-                                          )))
-                                ],
-                              ),
-                            ),
-                          )),
+                                          ))
+                                    ],
+                                  ),
+                                ),
+                              ))),
                     ),
                     SliverFixedExtentList(
                       itemExtent: houseList.isEmpty ? 300 : 90,
                       delegate: SliverChildBuilderDelegate((BuildContext context, int index) {
                         if (houseList.isEmpty) {
-                          return Container(
-                            padding: EdgeInsets.only(top: 105),
-                            child: Column(
-                              children: <Widget>[
-                                Image.asset('images/icon_kong.png'),
-                                Text('暂时没有此房间哦~', style: TextStyle(fontSize: 14, color: Theme.of(context).primaryColor.withOpacity(0.3)))
-                              ],
+                          return InkWell(
+                            child: Container(
+                              padding: EdgeInsets.only(top: 105),
+                              child: Column(
+                                children: <Widget>[
+                                  Image.asset('images/icon_kong.png'),
+                                  Text('暂时没有此房间哦~', style: TextStyle(fontSize: 14, color: Theme.of(context).primaryColor.withOpacity(0.3)))
+                                ],
+                              ),
                             ),
+                            onTap: () {
+                              _focusNode.unfocus();
+                            },
                           );
                         } else if (index == houseList.length) {
                           return Text('更多房间敬请期待...', style: TextStyle(color: Colors.grey, fontSize: 13, height: 3), textAlign: TextAlign.center);
                         }
-                        return HouseItem(houseList[index], houseList[index].gameInfo);
+                        return HouseItem(
+                          houseList[index],
+                          houseList[index].gameInfo,
+                          isNext: !_focusNode.hasFocus,
+                          onTapHomeMenu: () {
+                            setState(() {
+                              _focusNode.unfocus();
+                            });
+                          },
+                        );
                       }, childCount: houseList.length + 1),
                     )
                   ],

+ 1 - 1
lib/pages/RankList.dart

@@ -517,7 +517,7 @@ class RankItem extends StatelessWidget {
                 child: Text(playerInfo.userInfo.nickname,
                     style: TextStyle(color: Theme.of(context).primaryColor, fontSize: 14, height: 1.2), overflow: TextOverflow.ellipsis),
               ),
-              Medal(playerInfo.getPlatinum(), '铂金'),
+              // Medal(playerInfo.getPlatinum(), '铂金'),
               Medal(playerInfo.getGold(), '金牌'),
               Medal(playerInfo.getSilver(), '银牌'),
               Medal(playerInfo.getBronze(), '铜牌'),

+ 5 - 5
lib/pages/RoomInfo.dart

@@ -228,7 +228,7 @@ class RoomInfoState extends State<RoomInfo> with SingleTickerProviderStateMixin
 
           if (isJoin) {
             roomTipsList
-                .add(['待人数满员时会自动开启比赛,房主也可以手动开启比赛,请在此页面耐心等待其他人的加入,加入房间后再次退出则视为自动放弃比赛', '由于部分手机在低电量情况下无法在后台正常运行竞赛APP,为了你比赛数据的正常获取,请保持手机电量在50%以上', '', '', '']);
+                .add(['待倒计时结束或人数满员时会自动开启比赛,请在此页面耐心等待其他人的加入,加入房间后再次退出则视为自动放弃比赛', '由于部分手机在低电量情况下无法在后台正常运行竞赛APP,为了你比赛数据的正常获取,请保持手机电量在50%以上', '', '', '']);
           }
 
           changeScroll();
@@ -236,7 +236,7 @@ class RoomInfoState extends State<RoomInfo> with SingleTickerProviderStateMixin
       } else {
         if (houseInfo.statusFlag == 0) {
           roomTipsList
-              .add(['待人数满员时会自动开启比赛,房主也可以手动开启比赛,请在此页面耐心等待其他人的加入,加入房间后再次退出则视为自动放弃比赛', '由于部分手机在低电量情况下无法在后台正常运行竞赛APP,为了你比赛数据的正常获取,请保持手机电量在50%以上', '', '', '']);
+              .add(['待倒计时结束或人数满员时会自动开启比赛,请在此页面耐心等待其他人的加入,加入房间后再次退出则视为自动放弃比赛', '由于部分手机在低电量情况下无法在后台正常运行竞赛APP,为了你比赛数据的正常获取,请保持手机电量在50%以上', '', '', '']);
         }
         playerInfo = PlayerInfo.fromJson(res.data);
 
@@ -475,7 +475,7 @@ class RoomInfoState extends State<RoomInfo> with SingleTickerProviderStateMixin
             color: BG_SUB_COLOR,
             child: TabBarView(
               controller: mController,
-              children: [_firstPage(), SecondPage(roomId: widget.roomId, status: status)],
+              children: [_firstPage(), SecondPage(roomId: widget.roomId, status: status,houseInfo:houseInfo)],
             )),
         floatingActionButton: _joinBtn(),
         floatingActionButtonLocation: FloatingActionButtonLocation.centerDocked,
@@ -852,7 +852,7 @@ class RoomInfoState extends State<RoomInfo> with SingleTickerProviderStateMixin
                     Container(
                       margin: EdgeInsets.only(left: 6),
                       child: Text(
-                        '×${houseInfo.bonus}',
+                        '×1',
                         style: TextStyle(color: Colors.white, fontSize: 16, fontWeight: FontWeight.w500),
                       ),
                     ),
@@ -899,7 +899,7 @@ class RoomInfoState extends State<RoomInfo> with SingleTickerProviderStateMixin
               Container(
                 margin: EdgeInsets.only(left: 6),
                 child: Text(
-                  '×${houseInfo.bonus}',
+                  '×1',
                   style: TextStyle(color: Colors.white, fontSize: 16, fontWeight: FontWeight.w500),
                 ),
               ),

+ 34 - 7
lib/pages/SecondRoomInfo.dart

@@ -7,11 +7,13 @@ import '../net/Result.dart';
 import '../styles/colors.dart';
 import 'package:flutter/cupertino.dart';
 import 'VideoPlayer.dart';
+import '../model/HouseInfo.dart';
 
 class SecondPage extends StatefulWidget {
-  SecondPage({Key key, this.roomId, this.status}) : super(key: key);
+  SecondPage({Key key, this.roomId, this.status, this.houseInfo}) : super(key: key);
   final String roomId; // 用来储存传递过来的值
   final int status;
+  final HouseInfo houseInfo;
   @override
   SecondPageState createState() => SecondPageState();
 }
@@ -86,10 +88,35 @@ class SecondPageState extends State<SecondPage> {
       child: ListView.builder(
           physics: AlwaysScrollableScrollPhysics(),
           controller: _perController,
-          itemCount: joinList.length + 1,
+          itemCount: joinList.length + 2,
           itemBuilder: (BuildContext context, int index) {
-            if (index < joinList.length) {
-              return PersonItem(joinList[index], index);
+            if (index == 0) {
+              return Container(
+                  width: double.infinity,
+                  height: 60,
+                  color: Color(0xFF2B2B42),
+                  padding: EdgeInsets.only(left: 15, right: 15),
+                  child: Row(
+                    children: <Widget>[
+                      ClipOval(
+                        child: CircleAvatar(
+                          backgroundImage: NetworkImage(widget.houseInfo.customerService.icon),
+                        ),
+                      ),
+                      Container(
+                        width: 12,
+                      ),
+                      Text(
+                        widget.houseInfo.customerService.serviceName + ' QQ:' + widget.houseInfo.customerService.qq,
+                        style: TextStyle(
+                          color: Colors.white,
+                          fontSize: 14,
+                        ),
+                      )
+                    ],
+                  ));
+            } else if (index - 1 < joinList.length) {
+              return PersonItem(joinList[index - 1], index - 1);
             } else {
               return Container(
                 padding: EdgeInsets.all(15),
@@ -119,7 +146,7 @@ class SecondPageState extends State<SecondPage> {
       width: double.infinity,
       height: 60,
       color: Color(0xFF2B2B42),
-      margin: EdgeInsets.only(top: index == 0 ? 10 : 0),
+      margin: EdgeInsets.only(top: 0),
       padding: EdgeInsets.only(left: 15, right: 15),
       child: Container(
         decoration: BoxDecoration(border: Border(bottom: BorderSide(width: 1, color: BG_SUB_COLOR, style: BorderStyle.solid))),
@@ -167,9 +194,9 @@ class SecondPageState extends State<SecondPage> {
                     ),
                   )
                 : Container(),
-            img!=''
+            img != ''
                 ? Image.asset(
-                   img,
+                    img,
                     width: 32,
                   )
                 : Text('')

+ 339 - 0
lib/pages/SelectRoom.dart

@@ -0,0 +1,339 @@
+import 'package:flutter/material.dart';
+import 'package:flutter/cupertino.dart';
+import 'package:flutter/material.dart' as prefix0;
+import '../styles/totast.dart';
+import '../net/HttpManager.dart';
+import '../net/Result.dart';
+import 'package:flutter_redux/flutter_redux.dart';
+import '../redux/AppState.dart';
+import '../model/BannerInfo.dart';
+import '../widget/ITextInput.dart';
+import '../widget/HouseItem.dart';
+import '../model/HouseInfo.dart';
+import 'package:flutter_picker/flutter_picker.dart';
+import '../model/GameInfo.dart';
+import 'dart:async';
+import 'dart:convert';
+import 'dart:ui';
+import 'dart:math';
+
+class SelectRoom extends StatefulWidget {
+  @override
+  _SelectRoomState createState() => _SelectRoomState();
+}
+
+class _SelectRoomState extends State<SelectRoom> with WidgetsBindingObserver {
+  List<HouseInfo> houseList = [];
+  int currentPage = 0;
+  bool showBadge = false;
+  int gameId = 0;
+  String searchKey = '';
+  bool scrollFlag = false;
+  List<BannerInfo> bannerList = [];
+  ScrollController _controller;
+  List<GameInfo> gameList = [];
+  String gameName = '全部游戏';
+  bool isFirst = true;
+  FocusNode _focusNode = new FocusNode();
+
+  void showPicker(BuildContext context) {
+    List<String> _list = [];
+    for (var item in gameList) {
+      _list.add(item.gameName);
+    }
+    String PickerData = json.encode(_list);
+    Picker(
+        confirmText: '确定',
+        cancelText: '取消',
+        adapter: PickerDataAdapter<String>(pickerdata: JsonDecoder().convert(PickerData)),
+        changeToFirst: true,
+        textAlign: TextAlign.left,
+        columnPadding: const EdgeInsets.all(8.0),
+        onConfirm: (Picker picker, List value) {
+          setState(() {
+            gameId = gameList[value[0]].id;
+            gameName = gameList[value[0]].gameName;
+          });
+        }).showModal(this.context);
+  }
+
+  Future<void> getGame() async {
+    // Toast.show(context, '加载中', -1, 'loading');
+    Result res = await HttpManager.get('gameInfo/all');
+    // Toast.hide();
+    if (res.success) {
+      List<GameInfo> _list = [];
+      for (var item in res.data) {
+        _list.add(GameInfo.fromJson(item));
+      }
+      setState(() {
+        gameList = _list;
+      });
+    } else {}
+  }
+
+  Future<void> getRoomInfo() async {
+    print('获取房间');
+    Map<String, dynamic> data = {'currentPage': currentPage, 'pageNumber': 20, 'myUserId': StoreProvider.of<AppState>(context).state.userInfo.id};
+
+    data['advancedQuery'] = '';
+    if (gameId != 0) {
+      data['gameId'] = gameId;
+    }
+    data['searchKey'] = searchKey;
+    List<HouseInfo> _allList = houseList;
+    if (currentPage == 1) {
+      _allList = [];
+    }
+
+    if (StoreProvider.of<AppState>(context).state.userInfo.recommender != null) {
+      data['recommender'] = StoreProvider.of<AppState>(context).state.userInfo.recommender;
+    }
+    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);
+        _allList.add(_temHouse);
+      }
+      if (res.data['page']['currentPage'] < res.data['page']['totalPage']) {
+        scrollFlag = true;
+      } else {
+        scrollFlag = false;
+      }
+    } else {}
+
+    setState(() {
+      houseList = _allList;
+    });
+  }
+
+  Future<void> search(String text) async {
+    if (text != searchKey) {
+      currentPage = 1;
+      setState(() {
+        searchKey = text;
+      });
+      if (searchKey == '') {
+        houseList = [];
+      } else {
+        getRoomInfo();
+      }
+    }
+  }
+
+  @override
+  void initState() {
+    super.initState();
+    bannerList = [];
+    _controller = ScrollController();
+    // gameList.add(GameInfo.fromJson({"id": 0, "gameName": '全部游戏'}));
+    _controller.addListener(() {
+      if (_controller.position.pixels == _controller.position.maxScrollExtent) {
+        if (scrollFlag) {
+          setState(() {
+            currentPage++;
+          });
+          getRoomInfo();
+        }
+      }
+      print('aaaaaaa');
+      setState(() {
+        _focusNode.unfocus();
+      });
+    });
+    Future.delayed(Duration.zero, () {
+      getGame();
+      // getRoomInfo();
+    });
+  }
+
+  @override
+  void dispose() {
+    super.dispose();
+  }
+
+  @override
+  Widget build(BuildContext context) {
+    return GestureDetector(
+      behavior: HitTestBehavior.translucent,
+      child: Scaffold(
+          backgroundColor: Color(0xFF23253C),
+          body: SafeArea(
+            child: Container(
+              color: Color(0xFF2E3049),
+              height: double.infinity,
+              width: double.infinity,
+              child: RefreshIndicator(
+                color: Theme.of(context).primaryColor,
+                backgroundColor: Colors.white,
+                displacement: 10,
+                onRefresh: () async {
+                  await Future.delayed(const Duration(seconds: 1));
+                  gameId = 0;
+                  currentPage = 1;
+                  searchKey = '';
+                  getGame();
+                },
+                child: CustomScrollView(
+                  physics: AlwaysScrollableScrollPhysics(),
+                  controller: _controller,
+                  slivers: <Widget>[
+                    SliverPersistentHeader(
+                      pinned: true, //是否固定在顶部
+                      floating: true,
+                      delegate: _SliverAppBarDelegate(
+                          minHeight: 85, //收起的高度
+                          maxHeight: 85, //展开的最大高度
+                          child: Container(
+                            color: Color(0xFF23253C),
+                            height: 60,
+                            padding: EdgeInsets.fromLTRB(15, 5, 0, 0),
+                            margin: EdgeInsets.fromLTRB(0, 0, 0, 15),
+                            child: Column(
+                              // decoration: BoxDecoration(color: Colors.white, borderRadius: BorderRadius.all(Radius.circular(4))),
+                              children: [
+                                ITextField(
+                                    hintText: '房间标题/房间号/房主ID号',
+                                    inputBorder: InputBorder.none,
+                                    hintStyle: TextStyle(fontSize: 13, color: Color(0xFFB1B5C0), height: 1.2),
+                                    textStyle: TextStyle(color: Colors.black),
+                                    contentPadding: EdgeInsets.symmetric(vertical: 4),
+                                    inputText: searchKey,
+                                    fieldCallBack: (content) {
+                                      search(content);
+                                      // _focusNode.unfocus();
+                                    },
+                                    focusNode: _focusNode,
+                                    counterStyle: TextStyle(color: Color(0xFF9BA0AE), fontSize: 0),
+                                    textInputAction: TextInputAction.search,
+                                    fileOnTap: () {
+                                      // print('选择input');
+                                      // if (_controller.position.pixels < 200) {
+                                      //   _controller.animateTo(200, duration: Duration(milliseconds: 300), curve: Curves.ease);
+                                      // }
+                                    },
+                                    hasCancel: true),
+                                Container(
+                                    width: double.infinity,
+                                    height: 40,
+                                    padding: EdgeInsets.symmetric(horizontal: 20),
+                                    child: InkWell(
+                                        onTap: () {
+                                          showPicker(context);
+                                        },
+                                        child: Row(
+                                          mainAxisAlignment: MainAxisAlignment.center,
+                                          children: <Widget>[
+                                            Text(
+                                              '筛选游戏',
+                                              style: TextStyle(color: Colors.white54, fontSize: 12),
+                                            ),
+                                            Expanded(
+                                              flex: 1,
+                                              child: Container(),
+                                            ),
+                                            Container(
+                                              padding: EdgeInsets.only(left: 5),
+                                              alignment: Alignment.center,
+                                              child: Text(
+                                                gameName,
+                                                style: TextStyle(color: Colors.white, fontSize: 12),
+                                                overflow: TextOverflow.ellipsis,
+                                                textAlign: TextAlign.right,
+                                              ),
+                                            ),
+                                            Image.asset('images/icon_zhankai_huise.png'),
+                                            Container(
+                                              width: 5,
+                                            )
+                                          ],
+                                        )))
+                              ],
+                            ),
+                          )),
+                    ),
+                    SliverFixedExtentList(
+                      itemExtent: houseList.isEmpty ? 300 : 90,
+                      delegate: SliverChildBuilderDelegate((BuildContext context, int index) {
+                        if (houseList.isEmpty) {
+                          if (searchKey != '') {
+                            return InkWell(
+                              child: Container(
+                                padding: EdgeInsets.only(top: 105),
+                                child: Column(
+                                  children: <Widget>[
+                                    Image.asset('images/icon_kong.png'),
+                                    Text('暂时没有此房间哦~', style: TextStyle(fontSize: 14, color: Theme.of(context).primaryColor.withOpacity(0.3)))
+                                  ],
+                                ),
+                              ),
+                              onTap: () {
+                                _focusNode.unfocus();
+                              },
+                            );
+                          } else {
+                            return Container();
+                          }
+                        } else if (index == houseList.length) {
+                          return Text('更多房间敬请期待...', style: TextStyle(color: Colors.grey, fontSize: 13, height: 3), textAlign: TextAlign.center);
+                        }
+                        return HouseItem(
+                          houseList[index],
+                          houseList[index].gameInfo,
+                          isNext: !_focusNode.hasFocus,
+                          onTapHomeMenu: () {
+                            setState(() {
+                              _focusNode.unfocus();
+                            });
+                          },
+                        );
+                      }, childCount: houseList.length + 1),
+                    )
+                  ],
+                ),
+              ),
+            ),
+          )),
+      onTap: () {
+        _focusNode.unfocus();
+      },
+    );
+  }
+
+  List<Widget> _houseList(houselist) {
+    List<Widget> list = [];
+    for (var i = 0; i < houselist.length; i++) {
+      list.add(HouseItem(houselist[i], houselist[i].gameInfo));
+    }
+
+    return list;
+  }
+}
+
+class _SliverAppBarDelegate extends SliverPersistentHeaderDelegate {
+  _SliverAppBarDelegate({
+    @required this.minHeight,
+    @required this.maxHeight,
+    @required this.child,
+  });
+
+  final double minHeight;
+  final double maxHeight;
+  final Widget child;
+
+  @override
+  double get minExtent => minHeight;
+
+  @override
+  double get maxExtent => max(maxHeight, minHeight);
+
+  @override
+  Widget build(BuildContext context, double shrinkOffset, bool overlapsContent) {
+    return new SizedBox.expand(child: child);
+  }
+
+  @override
+  bool shouldRebuild(_SliverAppBarDelegate oldDelegate) {
+    return maxHeight != oldDelegate.maxHeight || minHeight != oldDelegate.minHeight || child != oldDelegate.child;
+  }
+}

+ 16 - 10
lib/widget/HouseItem.dart

@@ -8,11 +8,15 @@ import '../pages/RoomInfo.dart';
 import 'package:cached_network_image/cached_network_image.dart';
 import 'dart:ui';
 
+typedef void OnTapHomeMenu();
+
 class HouseItem extends StatelessWidget {
-  HouseItem(this.houseInfo, this.gameInfo, {this.playerInfo = null});
+  HouseItem(this.houseInfo, this.gameInfo, {this.playerInfo = null, this.isNext = true, this.onTapHomeMenu});
   HouseInfo houseInfo;
   GameInfo gameInfo;
   PlayerInfo playerInfo;
+  bool isNext;
+  OnTapHomeMenu onTapHomeMenu;
 
   List<String> imageList = ['images/img_fangjian_hong.png', 'images/img_fangjian_huise.png'];
 
@@ -25,7 +29,13 @@ class HouseItem extends StatelessWidget {
             color: Colors.transparent,
             child: InkWell(
                 onTap: () {
-                  Navigator.push(context, CupertinoPageRoute(builder: (context) => RoomInfo(roomId: houseInfo.id.toString())));
+                  print('aaaaaaa');
+                  if (!isNext) {
+                    onTapHomeMenu();
+                  } else {
+                    Navigator.push(context, CupertinoPageRoute(builder: (context) => RoomInfo(roomId: houseInfo.id.toString())));
+                  }
+                  //
                 },
                 child: Container(
                   height: 80,
@@ -58,7 +68,7 @@ class HouseItem extends StatelessWidget {
                             Container(
                               height: 4,
                             ),
-                            Text('游戏中击败${houseInfo.killnumber}人',style: TextStyle(fontSize: 13, color: Color(0xFF999999)))
+                            Text('游戏中击败${houseInfo.killnumber}人', style: TextStyle(fontSize: 13, color: Color(0xFF999999)))
                           ],
                         ),
                       ),
@@ -70,7 +80,7 @@ class HouseItem extends StatelessWidget {
                             children: <Widget>[
                               Image.asset('images/house1.png'),
                               Text(
-                                '${houseInfo.playerNumber!=null?houseInfo.playerNumber:0}/${houseInfo.maxNumber}',
+                                '${houseInfo.playerNumber != null ? houseInfo.playerNumber : 0}/${houseInfo.maxNumber}',
                                 style: TextStyle(color: Colors.white, fontSize: 14),
                               )
                             ],
@@ -87,13 +97,9 @@ class HouseItem extends StatelessWidget {
       return Image.asset('images/join.png');
     } else {
       if (playerInfo.ranking == 1) {
-        return Text(
-          '吃鸡',
-          style: prefix0.TextStyle(color: Color(0xFFD4504B), fontSize: 14, fontWeight: FontWeight.w600)
-        );
+        return Text('吃鸡', style: prefix0.TextStyle(color: Color(0xFFD4504B), fontSize: 14, fontWeight: FontWeight.w600));
       } else {
-        return Text('未吃鸡',
-          style: prefix0.TextStyle(color: Color(0xFF5C5C5C), fontSize: 14, fontWeight: FontWeight.w600));
+        return Text('未吃鸡', style: prefix0.TextStyle(color: Color(0xFF5C5C5C), fontSize: 14, fontWeight: FontWeight.w600));
       }
     }
     // return Container();

+ 47 - 29
lib/widget/ITextInput.dart

@@ -4,16 +4,7 @@ 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;
@@ -35,6 +26,7 @@ class ITextField extends StatefulWidget {
   final EdgeInsetsGeometry contentPadding;
   final FocusNode focusNode;
   final GestureTapCallback fileOnTap;
+  final bool hasCancel;
 
   ITextField(
       {Key key,
@@ -51,12 +43,13 @@ class ITextField extends StatefulWidget {
       this.prefixIcon,
       this.validator,
       this.counterStyle,
-      this.inputText,
+      this.inputText = '',
       this.autofocus = false,
       this.textInputAction,
       this.contentPadding,
       this.focusNode,
-      this.fileOnTap})
+      this.fileOnTap,
+      this.hasCancel = false})
       : assert(maxLines == null || maxLines > 0),
         assert(maxLength == null || maxLength > 0),
         keyboardType = maxLines == 1 ? keyboardType : ITextInputType.multiline,
@@ -132,11 +125,7 @@ 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,
@@ -147,9 +136,7 @@ class _ITextFieldState extends State<ITextField> {
         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,
@@ -162,10 +149,8 @@ class _ITextFieldState extends State<ITextField> {
                   alignment: Alignment.center,
                   padding: const EdgeInsets.all(2.0),
                   iconSize: 18.0,
-                  icon: widget.deleteIcon != null
-                      ? widget.deleteIcon
-                      : Icon(Icons.cancel),
-                      color:Color(0xFf727785) ,
+                  icon: widget.deleteIcon != null ? widget.deleteIcon : Icon(Icons.cancel),
+                  color: Color(0xFf727785),
                   onPressed: () {
                     setState(() {
                       _inputText = '';
@@ -173,8 +158,6 @@ class _ITextFieldState extends State<ITextField> {
                       widget.fieldCallBack(_inputText);
                     });
                   },
-
-                  
                 ),
               )
             : Text(''),
@@ -197,10 +180,45 @@ class _ITextFieldState extends State<ITextField> {
       inputFormatters: _getTextInputFormatter(),
       style: widget.textStyle,
       obscureText: _isPassword,
-      onTap: (){
-       widget.fileOnTap();
+      onTap: () {
+        widget.fileOnTap();
       },
     );
-    return textField;
+
+    if (!widget.hasCancel) {
+      return textField;
+    } else {
+      return Row(
+        children: <Widget>[
+          Expanded(
+            flex: 1,
+            child: Container(
+                height: 34,
+                padding: EdgeInsets.fromLTRB(20, 0, 0, 0),
+                decoration: BoxDecoration(
+                  color: Colors.white,
+                  borderRadius: BorderRadius.all(Radius.circular(100)),
+                ),
+                child: textField),
+          ),
+          InkWell(
+            child: Container(
+              padding: EdgeInsets.symmetric(horizontal: 15, vertical: 6),
+              child: Text('取消', style: TextStyle(fontSize: 16, color: Colors.white)),
+            ),
+            onTap: () {
+              setState(() {
+                setState(() {
+                  _inputText = '';
+                  _hasdeleteIcon = (_inputText.isNotEmpty);
+                  widget.fieldCallBack(_inputText);
+                  _focusNode.unfocus();
+                });
+              });
+            },
+          )
+        ],
+      );
+    }
   }
 }

+ 1 - 1
screen_stream_plugin/android/src/main/java/com/izouma/screen_stream_plugin/VideoProcessService.java

@@ -104,7 +104,7 @@ public class VideoProcessService extends Service implements ImageAvailableListen
                             e.printStackTrace();
                         }
                         try {
-                            String uploadId = new MultipartUploadRequest(VideoProcessService.this, "http://123.58.240.138:9000/playerInfo/uploadVideo")
+                            String uploadId = new MultipartUploadRequest(VideoProcessService.this, "http://117.81.233.142:8206/playerInfo/uploadVideo")
                                     .addFileToUpload(imageAvailableListener.getVideoPath(), "video")
                                     // .addFileToUpload("/storage/emulated/0/Android/data/com.izouma.mobilecybergames/files/record/record1553655902913.flv", "video")
                                     .addParameter("id", String.valueOf(playerInfoId))