x1ongzhu vor 6 Jahren
Ursprung
Commit
06da98a02a
73 geänderte Dateien mit 2152 neuen und 1717 gelöschten Zeilen
  1. 1 1
      android/app/src/main/AndroidManifest.xml
  2. BIN
      images/2x/icon_baodi_01.png
  3. BIN
      images/2x/icon_baodi_02.png
  4. BIN
      images/2x/icon_gailv_01.png
  5. BIN
      images/2x/icon_gailv_02.png
  6. BIN
      images/2x/icon_gailv_03.png
  7. BIN
      images/2x/icon_jifen_01.png
  8. BIN
      images/2x/icon_jifen_02.png
  9. BIN
      images/2x/icon_jifen_03.png
  10. 0 0
      images/2x/icon_jiner.png
  11. BIN
      images/2x/icon_money.png
  12. BIN
      images/3x/icon_baodi_01.png
  13. BIN
      images/3x/icon_baodi_02.png
  14. BIN
      images/3x/icon_gailv_01.png
  15. BIN
      images/3x/icon_gailv_02.png
  16. BIN
      images/3x/icon_gailv_03.png
  17. BIN
      images/3x/icon_jifen_01.png
  18. BIN
      images/3x/icon_jifen_02.png
  19. BIN
      images/3x/icon_jifen_03.png
  20. 0 0
      images/3x/icon_jiner.png
  21. BIN
      images/3x/icon_money.png
  22. BIN
      images/icon_baodi_01.png
  23. BIN
      images/icon_baodi_02.png
  24. BIN
      images/icon_gailv_01.png
  25. BIN
      images/icon_gailv_02.png
  26. BIN
      images/icon_gailv_03.png
  27. BIN
      images/icon_jifen_01.png
  28. BIN
      images/icon_jifen_02.png
  29. BIN
      images/icon_jifen_03.png
  30. 0 0
      images/icon_jiner.png
  31. BIN
      images/icon_money.png
  32. 2 2
      ios/Runner/Info.plist
  33. 2 2
      ios/ScreenRecorder/Info.plist
  34. 22 0
      lib/Constants.dart
  35. 1 1
      lib/main.dart
  36. 7 8
      lib/model/PlayerInfo.dart
  37. 2 2
      lib/model/PlayerInfo.g.dart
  38. 19 17
      lib/model/SystemNotice.dart
  39. 7 2
      lib/model/SystemNotice.g.dart
  40. 3 3
      lib/pages/BindGame.dart
  41. 4 4
      lib/pages/CompetitionInformation.dart
  42. 22 0
      lib/pages/CompetitionRooms.dart
  43. 1 1
      lib/pages/Competitions.dart
  44. 12 1
      lib/pages/Home.dart
  45. 2 2
      lib/pages/HomePage.bak.dart
  46. 196 0
      lib/pages/RechargeCoin.dart
  47. 2 2
      lib/pages/RecordList.dart
  48. 26 836
      lib/pages/RoomInfo.dart
  49. 919 0
      lib/pages/RoomInfo1.dart
  50. 161 0
      lib/pages/RoomInfoDetail.dart
  51. 45 38
      lib/pages/SecondRoomInfo.dart
  52. 223 0
      lib/pages/Shop.dart
  53. 0 284
      lib/pages/ShoppingMall.dart
  54. 35 69
      lib/pages/TipInfo.dart
  55. 56 60
      lib/pages/TipList.dart
  56. 3 5
      lib/pages/UserChange.dart
  57. 2 2
      lib/pages/changeUserInfo.dart
  58. 2 2
      lib/pages/loginFirst.dart
  59. 2 2
      lib/pages/loginSecond.dart
  60. 81 152
      lib/pages/myWallet.dart
  61. 6 6
      lib/pages/openRoom.dart
  62. 13 13
      lib/pages/rankList.dart
  63. 232 166
      lib/pages/recharge.dart
  64. 4 4
      lib/pages/roomList.dart
  65. 1 3
      lib/pages/setting.dart
  66. 1 1
      lib/widget/CheckinDialog.dart
  67. 1 1
      lib/widget/Dialog.dart
  68. 7 9
      lib/widget/HomeDrawer.dart
  69. 3 3
      lib/widget/RoomItem.dart
  70. 2 2
      lib/widget/SuccessfulReception.dart
  71. 6 11
      lib/widget/VideoWidget.dart
  72. 14 0
      pubspec.lock
  73. 2 0
      pubspec.yaml

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

@@ -9,7 +9,7 @@
     <application
     <application
         android:name="com.izouma.screen_stream_plugin.MyApplication"
         android:name="com.izouma.screen_stream_plugin.MyApplication"
         android:icon="@mipmap/ic_launcher"
         android:icon="@mipmap/ic_launcher"
-        android:label="我要电竞"
+        android:label="电竞"
         android:theme="@style/AppTheme"
         android:theme="@style/AppTheme"
         android:usesCleartextTraffic="true">
         android:usesCleartextTraffic="true">
         <activity
         <activity

BIN
images/2x/icon_baodi_01.png


BIN
images/2x/icon_baodi_02.png


BIN
images/2x/icon_gailv_01.png


BIN
images/2x/icon_gailv_02.png


BIN
images/2x/icon_gailv_03.png


BIN
images/2x/icon_jifen_01.png


BIN
images/2x/icon_jifen_02.png


BIN
images/2x/icon_jifen_03.png


+ 0 - 0
images/2x/金币.png → images/2x/icon_jiner.png


BIN
images/2x/icon_money.png


BIN
images/3x/icon_baodi_01.png


BIN
images/3x/icon_baodi_02.png


BIN
images/3x/icon_gailv_01.png


BIN
images/3x/icon_gailv_02.png


BIN
images/3x/icon_gailv_03.png


BIN
images/3x/icon_jifen_01.png


BIN
images/3x/icon_jifen_02.png


BIN
images/3x/icon_jifen_03.png


+ 0 - 0
images/3x/金币.png → images/3x/icon_jiner.png


BIN
images/3x/icon_money.png


BIN
images/icon_baodi_01.png


BIN
images/icon_baodi_02.png


BIN
images/icon_gailv_01.png


BIN
images/icon_gailv_02.png


BIN
images/icon_gailv_03.png


BIN
images/icon_jifen_01.png


BIN
images/icon_jifen_02.png


BIN
images/icon_jifen_03.png


+ 0 - 0
images/金币.png → images/icon_jiner.png


BIN
images/icon_money.png


+ 2 - 2
ios/Runner/Info.plist

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

+ 2 - 2
ios/ScreenRecorder/Info.plist

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

+ 22 - 0
lib/Constants.dart

@@ -0,0 +1,22 @@
+abstract class HouseStatus {
+  // 等待
+  static const int WAIT = 0;
+
+  // 准备
+  static const int READY = 1;
+
+  // 开始
+  static const int START = 2;
+
+  // 结束
+  static const int END = 3;
+
+  // 结算
+  static const int SETTLEMENT = 4;
+
+  // 关闭
+  static const int CLOSE = 5;
+
+  // 解析完成
+  static const int ANALYSIS = 8;
+}

+ 1 - 1
lib/main.dart

@@ -25,7 +25,7 @@ class MobileCyberGamesApp extends StatelessWidget {
     return StoreProvider<AppState>(
     return StoreProvider<AppState>(
       store: store,
       store: store,
       child: MaterialApp(
       child: MaterialApp(
-        title: '我要电竞',
+        title: '电竞',
         supportedLocales: [
         supportedLocales: [
           const Locale('en'), // English
           const Locale('en'), // English
           const Locale('zh'), // China
           const Locale('zh'), // China

+ 7 - 8
lib/model/PlayerInfo.dart

@@ -8,21 +8,20 @@ part 'PlayerInfo.g.dart';
 @JsonSerializable()
 @JsonSerializable()
 class PlayerInfo {
 class PlayerInfo {
   PlayerInfo(
   PlayerInfo(
-      this.id, this.houseId, this.userId, this.statusFlag, this.userInfo,this.bonus,this.gameInfo,this.houseInfo,this.rank,this.houseRank,this.video);
+      this.id, this.houseId, this.userId, this.statusFlag, this.userInfo, this.points, this.gameInfo, this.houseInfo, this.rank, this.houseRank, this.video);
   int id;
   int id;
   int houseId; //房间id
   int houseId; //房间id
   int userId; //用户id
   int userId; //用户id
   int statusFlag; //状态 0加入 1准备 2开始 3结束 6未比赛
   int statusFlag; //状态 0加入 1准备 2开始 3结束 6未比赛
   UserInfo userInfo;
   UserInfo userInfo;
-  int bonus;//奖金
+  int points; //积分
   GameInfo gameInfo;
   GameInfo gameInfo;
   HouseInfo houseInfo;
   HouseInfo houseInfo;
-  int rank;//名次
-  int houseRank;//房间比赛名次
-  String video;//视频地址
-  
-  factory PlayerInfo.fromJson(Map<String, dynamic> json) =>
-      _$PlayerInfoFromJson(json);
+  int rank; //名次
+  int houseRank; //房间比赛名次
+  String video; //视频地址
+
+  factory PlayerInfo.fromJson(Map<String, dynamic> json) => _$PlayerInfoFromJson(json);
 
 
   Map<String, dynamic> toJson() => _$PlayerInfoToJson(this);
   Map<String, dynamic> toJson() => _$PlayerInfoToJson(this);
   // 命名构造函数
   // 命名构造函数

+ 2 - 2
lib/model/PlayerInfo.g.dart

@@ -15,7 +15,7 @@ PlayerInfo _$PlayerInfoFromJson(Map<String, dynamic> json) {
       json['userInfo'] == null
       json['userInfo'] == null
           ? null
           ? null
           : UserInfo.fromJson(json['userInfo'] as Map<String, dynamic>),
           : UserInfo.fromJson(json['userInfo'] as Map<String, dynamic>),
-      json['bonus'] as int,
+      json['points'] as int,
       json['gameInfo'] == null
       json['gameInfo'] == null
           ? null
           ? null
           : GameInfo.fromJson(json['gameInfo'] as Map<String, dynamic>),
           : GameInfo.fromJson(json['gameInfo'] as Map<String, dynamic>),
@@ -34,7 +34,7 @@ Map<String, dynamic> _$PlayerInfoToJson(PlayerInfo instance) =>
       'userId': instance.userId,
       'userId': instance.userId,
       'statusFlag': instance.statusFlag,
       'statusFlag': instance.statusFlag,
       'userInfo': instance.userInfo,
       'userInfo': instance.userInfo,
-      'bonus': instance.bonus,
+      'points': instance.points,
       'gameInfo': instance.gameInfo,
       'gameInfo': instance.gameInfo,
       'houseInfo': instance.houseInfo,
       'houseInfo': instance.houseInfo,
       'rank': instance.rank,
       'rank': instance.rank,

+ 19 - 17
lib/model/SystemNotice.dart

@@ -2,29 +2,31 @@ import 'package:json_annotation/json_annotation.dart';
 import 'GameInfo.dart';
 import 'GameInfo.dart';
 import 'HouseInfo.dart';
 import 'HouseInfo.dart';
 import 'PlayerInfo.dart';
 import 'PlayerInfo.dart';
+import './CompetitionInfo.dart';
 part 'SystemNotice.g.dart';
 part 'SystemNotice.g.dart';
 
 
 @JsonSerializable()
 @JsonSerializable()
 class SystemNotice {
 class SystemNotice {
-  SystemNotice(this.id, this.gameId, this.houseId, this.userId,this.seasonId,this.content,this.icon,this.typeFlag,this.statusFlag,this.createTime,this.playerId,this.gameInfo,this.houseInfo,this.playerInfo,this.bonus);
+  SystemNotice(this.id, this.gameId, this.houseId, this.userId, this.seasonId, this.content, this.icon, this.typeFlag, this.statusFlag, this.createTime,
+      this.playerId, this.gameInfo, this.houseInfo, this.playerInfo, this.bonus, this.competitionInfo);
   int id;
   int id;
-  int gameId;//游戏ID
-  int houseId;//房间ID
-  int userId;//用户ID
-  int seasonId;//赛季ID
-  String content;//内容
-  String icon;//图标
-  int typeFlag;//类型
-  int statusFlag;//状态
-  int createTime;//创建时间
-  int playerId;//玩家id
-  GameInfo gameInfo;//游戏信息
-  HouseInfo houseInfo;//房间信息
-  PlayerInfo playerInfo;//玩家信息
-  int bonus;//奖金
+  int gameId; //游戏ID
+  int houseId; //房间ID
+  int userId; //用户ID
+  int seasonId; //赛季ID
+  String content; //内容
+  String icon; //图标
+  int typeFlag; //类型
+  int statusFlag; //状态
+  int createTime; //创建时间
+  int playerId; //玩家id
+  GameInfo gameInfo; //游戏信息
+  HouseInfo houseInfo; //房间信息
+  PlayerInfo playerInfo; //玩家信息
+  int bonus; //奖金
+  CompetitionInfo competitionInfo;
 
 
-  factory SystemNotice.fromJson(Map<String, dynamic> json) =>
-      _$SystemNoticeFromJson(json);
+  factory SystemNotice.fromJson(Map<String, dynamic> json) => _$SystemNoticeFromJson(json);
 
 
   Map<String, dynamic> toJson() => _$SystemNoticeToJson(this);
   Map<String, dynamic> toJson() => _$SystemNoticeToJson(this);
   // 命名构造函数
   // 命名构造函数

+ 7 - 2
lib/model/SystemNotice.g.dart

@@ -28,7 +28,11 @@ SystemNotice _$SystemNoticeFromJson(Map<String, dynamic> json) {
       json['playerInfo'] == null
       json['playerInfo'] == null
           ? null
           ? null
           : PlayerInfo.fromJson(json['playerInfo'] as Map<String, dynamic>),
           : PlayerInfo.fromJson(json['playerInfo'] as Map<String, dynamic>),
-      json['bonus'] as int);
+      json['bonus'] as int,
+      json['competitionInfo'] == null
+          ? null
+          : CompetitionInfo.fromJson(
+              json['competitionInfo'] as Map<String, dynamic>));
 }
 }
 
 
 Map<String, dynamic> _$SystemNoticeToJson(SystemNotice instance) =>
 Map<String, dynamic> _$SystemNoticeToJson(SystemNotice instance) =>
@@ -47,5 +51,6 @@ Map<String, dynamic> _$SystemNoticeToJson(SystemNotice instance) =>
       'gameInfo': instance.gameInfo,
       'gameInfo': instance.gameInfo,
       'houseInfo': instance.houseInfo,
       'houseInfo': instance.houseInfo,
       'playerInfo': instance.playerInfo,
       'playerInfo': instance.playerInfo,
-      'bonus': instance.bonus
+      'bonus': instance.bonus,
+      'competitionInfo': instance.competitionInfo
     };
     };

+ 3 - 3
lib/pages/BindGame.dart

@@ -126,14 +126,14 @@ class BindGameState extends State<BindGame> {
                       children: <Widget>[
                       children: <Widget>[
                         Text(
                         Text(
                           '已绑定',
                           '已绑定',
-                          style: TextStyle(color: Color(0xFF727785), fontSize: 13, fontWeight: FontWeight.w500),
+                          style: TextStyle(color: Color(0xFF727785), fontSize: 13, fontWeight: FontWeight.bold),
                         ),
                         ),
                         Container(
                         Container(
                           width: 10,
                           width: 10,
                         ),
                         ),
                         Text(
                         Text(
                           bindInfo.nickName,
                           bindInfo.nickName,
-                          style: TextStyle(color: Colors.white, fontSize: 13, fontWeight: FontWeight.w500),
+                          style: TextStyle(color: Colors.white, fontSize: 13, fontWeight: FontWeight.bold),
                         )
                         )
                       ],
                       ],
                     )
                     )
@@ -163,7 +163,7 @@ class BindGameState extends State<BindGame> {
           ),
           ),
           height: 40,
           height: 40,
           child: TextField(
           child: TextField(
-            style: TextStyle(color: Color(0xFFAF4946), fontWeight: FontWeight.w500),
+            style: TextStyle(color: Color(0xFFAF4946), fontWeight: FontWeight.bold),
             textAlign: TextAlign.center,
             textAlign: TextAlign.center,
             decoration: InputDecoration(hintText: '请输入刺激战场游戏昵称', border: InputBorder.none, hintStyle: TextStyle(fontSize: 12, color: Color(0xFF727785))),
             decoration: InputDecoration(hintText: '请输入刺激战场游戏昵称', border: InputBorder.none, hintStyle: TextStyle(fontSize: 12, color: Color(0xFF727785))),
             onChanged: (value) {
             onChanged: (value) {

+ 4 - 4
lib/pages/CompetitionInformation.dart

@@ -78,7 +78,7 @@ class InfoBox extends StatelessWidget {
             padding: EdgeInsets.only(top: 25),
             padding: EdgeInsets.only(top: 25),
             child: Column(
             child: Column(
               children: <Widget>[
               children: <Widget>[
-                Text('竞赛须知 ' + typeIndex.toString() + '/4', style: TextStyle(color: Color(0xFFFDC372), fontSize: 20, fontWeight: FontWeight.w600)),
+                Text('竞赛须知 ' + typeIndex.toString() + '/4', style: TextStyle(color: Color(0xFFFDC372), fontSize: 20, fontWeight: FontWeight.bold)),
                 _centerContent(typeIndex)
                 _centerContent(typeIndex)
               ],
               ],
             ),
             ),
@@ -251,7 +251,7 @@ class InfoBox extends StatelessWidget {
                   ),
                   ),
                   TextSpan(
                   TextSpan(
                     text: '点击确认',
                     text: '点击确认',
-                    style: TextStyle(color: Color(0xFFC2524D), fontSize: 14, fontWeight: FontWeight.w500),
+                    style: TextStyle(color: Color(0xFFC2524D), fontSize: 14, fontWeight: FontWeight.bold),
                   ),
                   ),
                   TextSpan(
                   TextSpan(
                     text: ',否则视为放弃此次竞赛,已支付金币概不退换',
                     text: ',否则视为放弃此次竞赛,已支付金币概不退换',
@@ -280,7 +280,7 @@ class InfoBox extends StatelessWidget {
                   ),
                   ),
                   TextSpan(
                   TextSpan(
                     text: '点击“确定”',
                     text: '点击“确定”',
-                    style: TextStyle(color: Color(0xFFC2524D), fontSize: 14, fontWeight: FontWeight.w500),
+                    style: TextStyle(color: Color(0xFFC2524D), fontSize: 14, fontWeight: FontWeight.bold),
                   ),
                   ),
                   TextSpan(
                   TextSpan(
                     text: '或“允许”此操作,否则竞赛判定失败',
                     text: '或“允许”此操作,否则竞赛判定失败',
@@ -309,7 +309,7 @@ class InfoBox extends StatelessWidget {
                   ),
                   ),
                   TextSpan(
                   TextSpan(
                     text: '请一定一定一定要点击“继续”按钮',
                     text: '请一定一定一定要点击“继续”按钮',
-                    style: TextStyle(color: Color(0xFFC2524D), fontSize: 14, fontWeight: FontWeight.w600),
+                    style: TextStyle(color: Color(0xFFC2524D), fontSize: 14, fontWeight: FontWeight.bold),
                   ),
                   ),
                   TextSpan(
                   TextSpan(
                     text: ',显示到上图所示画面,然后再切换到我们全民APP中,点击完成比赛,方可成功上传本次成绩,赢取大奖',
                     text: ',显示到上图所示画面,然后再切换到我们全民APP中,点击完成比赛,方可成功上传本次成绩,赢取大奖',

+ 22 - 0
lib/pages/CompetitionRooms.dart

@@ -12,6 +12,7 @@ import '../net/HttpManager.dart';
 import '../net/Result.dart';
 import '../net/Result.dart';
 import './RoomInfo.dart';
 import './RoomInfo.dart';
 import '../redux/AppState.dart';
 import '../redux/AppState.dart';
+import '../plugins/ScreenStramPlugin.dart';
 
 
 class CompetitionRooms extends StatefulWidget {
 class CompetitionRooms extends StatefulWidget {
   CompetitionRooms(this.competitionInfo);
   CompetitionRooms(this.competitionInfo);
@@ -250,6 +251,27 @@ class _Room extends StatelessWidget {
   }
   }
 
 
   Future<void> joinRoom(context, houseId) async {
   Future<void> joinRoom(context, houseId) async {
+    final 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');
     Toast.show(context, '加载中', -1, 'loading');
     Result res = await HttpManager.post('houseInfo/join', data: {'houseId': houseId, 'userId': StoreProvider.of<AppState>(context).state.userInfo.id});
     Result res = await HttpManager.post('houseInfo/join', data: {'houseId': houseId, 'userId': StoreProvider.of<AppState>(context).state.userInfo.id});
     Toast.hide();
     Toast.hide();

+ 1 - 1
lib/pages/Competitions.dart

@@ -196,7 +196,7 @@ class _CompetitionState extends State<Competitions> {
   }
   }
 
 
   Future<void> _getCompetitions() async {
   Future<void> _getCompetitions() async {
-    Result res = await HttpManager.get('competition/getCompetitionList', data: {'status': 1});
+    Result res = await HttpManager.get('competition/getCompetitionList');
     if (res.success) {
     if (res.success) {
       List<CompetitionInfo> list = [];
       List<CompetitionInfo> list = [];
       for (var item in res.data) {
       for (var item in res.data) {

+ 12 - 1
lib/pages/Home.dart

@@ -2,6 +2,8 @@ import 'package:flutter/material.dart';
 import 'package:flutter/cupertino.dart';
 import 'package:flutter/cupertino.dart';
 import './Competitions.dart';
 import './Competitions.dart';
 import '../widget/HomeDrawer.dart';
 import '../widget/HomeDrawer.dart';
+import './TipList.dart';
+import './Shop.dart';
 
 
 class HomePage extends StatefulWidget {
 class HomePage extends StatefulWidget {
   const HomePage({Key key}) : super(key: key);
   const HomePage({Key key}) : super(key: key);
@@ -56,7 +58,16 @@ class _HomePageState extends State<HomePage> with SingleTickerProviderStateMixin
           activeColor: Color(0xff1990F8),
           activeColor: Color(0xff1990F8),
         ),
         ),
         tabBuilder: (BuildContext context, int index) {
         tabBuilder: (BuildContext context, int index) {
-          return Competitions();
+          switch (index) {
+            case 0:
+              return Competitions();
+            case 1:
+              return TipList();
+            case 2:
+              return Shop();
+            default:
+              return Competitions();
+          }
         },
         },
       ),
       ),
     );
     );

+ 2 - 2
lib/pages/HomePage.bak.dart

@@ -4,7 +4,7 @@ import 'CreateRoom.dart';
 import 'RoomList.dart';
 import 'RoomList.dart';
 import 'RankList.dart';
 import 'RankList.dart';
 import 'RoomInfo.dart';
 import 'RoomInfo.dart';
-import 'ShoppingMall.dart';
+import 'Recharge.dart';
 import 'package:flutter/cupertino.dart';
 import 'package:flutter/cupertino.dart';
 import 'package:flutter_swiper/flutter_swiper.dart';
 import 'package:flutter_swiper/flutter_swiper.dart';
 import '../model/GameInfoSeasons.dart';
 import '../model/GameInfoSeasons.dart';
@@ -378,7 +378,7 @@ class _HomePageState extends State<HomePage> with WidgetsBindingObserver {
                     'images/shoppingmall.png',
                     'images/shoppingmall.png',
                     39,
                     39,
                     onTapHomeMenu: () {
                     onTapHomeMenu: () {
-                      Navigator.push(context, CupertinoPageRoute(builder: (context) => ShoppingMall()));
+                      Navigator.push(context, CupertinoPageRoute(builder: (context) => Recharge()));
                     },
                     },
                   ),
                   ),
                 ],
                 ],

+ 196 - 0
lib/pages/RechargeCoin.dart

@@ -0,0 +1,196 @@
+import 'package:flutter/material.dart';
+import '../styles/colors.dart';
+import 'package:flutter_screenutil/flutter_screenutil.dart';
+import 'dart:ui';
+
+class RechrageCoin extends StatefulWidget {
+  @override
+  RechrageCoinState createState() => RechrageCoinState();
+}
+
+class RechrageCoinState extends State<RechrageCoin> {
+  List<Map> moenyList = [
+    {
+      'title': '10金币',
+      'money': 10,
+    },
+    {
+      'title': '50金币',
+      'money': 50,
+    },
+    {
+      'title': '100金币',
+      'money': 100,
+    },
+    {
+      'title': '300金币',
+      'money': 300,
+    },
+    {
+      'title': '500金币',
+      'money': 500,
+    }
+  ];
+
+  bool isInput = false;
+
+  int choosemoeny = 0;
+
+  bool autoChoose = false;
+
+  FocusNode _focusNode = FocusNode();
+
+  @override
+  void initState() {
+    super.initState();
+    _focusNode.addListener(_focusNodeListener);
+  }
+
+  Future<Null> _focusNodeListener() async {
+    if (_focusNode.hasFocus) {
+      setState(() {
+        if (!autoChoose) {
+          autoChoose = true;
+          choosemoeny = 0;
+        }
+        isInput = true;
+      });
+    } else {
+      setState(() {
+        isInput = false;
+      });
+    }
+  }
+
+  @override
+  Widget build(BuildContext context) {
+    ScreenUtil.instance = ScreenUtil(width: 375, height: 667)..init(context);
+    
+    return Scaffold(
+        appBar: AppBar(
+          backgroundColor: PRIMARY_COLOR,
+          title: Text('充值'),
+          centerTitle: true,
+          elevation: 0,
+        ),
+        body: GestureDetector(
+
+            ///透明也响应处理
+            behavior: HitTestBehavior.translucent,
+            onTap: () {
+              ///触摸手气键盘
+              FocusScope.of(context).requestFocus(FocusNode());
+            },
+            child: RefreshIndicator(
+              color: PRIMARY_COLOR,
+              backgroundColor: Colors.white,
+              onRefresh: () async {
+                await Future.delayed(const Duration(seconds: 1));
+              },
+              child: Container(
+                color: BG_COLOR,
+                child: Column(
+                  children: <Widget>[_useGride(context)],
+                ),
+              ),
+            )));
+  }
+
+  Widget _useGride(BuildContext context) {
+    return Container(
+      padding: EdgeInsets.all(ScreenUtil().setWidth(15)),
+      width: double.infinity,
+      child: Wrap(
+        alignment: WrapAlignment.spaceBetween,
+        children: _allChooseBtn(context),
+      ),
+    );
+  }
+
+  List<Widget> _allChooseBtn(BuildContext context) {
+    List<Widget> allWidget =
+        List<Widget>.generate(moenyList.length, (int index) {
+      return _chooseBtn(context, index);
+    });
+
+    Widget _input() {
+      return Container(
+          padding: EdgeInsets.only(left: 30, right: 5),
+          color: autoChoose ? PRIMARY_COLOR : BG_SUB_COLOR,
+          margin: EdgeInsets.only(bottom: ScreenUtil().setWidth(5)),
+          width: ScreenUtil().setWidth(170),
+          height: ScreenUtil().setWidth(60),
+          child: TextField(
+              focusNode: _focusNode,
+              textAlign: TextAlign.center,
+              keyboardType: TextInputType.number,
+              style: TextStyle(
+                fontSize: 16,
+                fontWeight: FontWeight.bold,
+                color: Colors.white,
+              ),
+              decoration: InputDecoration(
+                hintText: isInput ? '请输入金额' : '其他金额',
+                hintStyle: TextStyle(
+                    color: Colors.white,
+                    fontSize: 14,
+                    fontWeight: isInput?FontWeight.bold: FontWeight.normal),
+                suffixText: '金币',
+                suffixStyle: TextStyle(
+                    fontSize: 13,
+                    fontWeight:  FontWeight.normal,
+                    color: Colors.white),
+                border: OutlineInputBorder(borderSide: BorderSide.none),
+              ),
+              onChanged: (String str) {
+                //输入监听
+                choosemoeny = int.parse(str);
+              }));
+    }
+
+    allWidget.add(_input());
+    return allWidget;
+  }
+
+  Widget _chooseBtn(BuildContext context, int index) {
+    bool isChoose = false;
+    if (!autoChoose && moenyList[index]['money'] == choosemoeny) {
+      isChoose = true;
+    }
+    return Container(
+      margin: EdgeInsets.only(bottom: ScreenUtil().setWidth(5)),
+      width: ScreenUtil().setWidth(170),
+      height: ScreenUtil().setWidth(60),
+      child: FlatButton(
+        color: isChoose ? PRIMARY_COLOR : BG_SUB_COLOR,
+        highlightColor: isChoose
+            ? PRIMARY_COLOR.withOpacity(0.3)
+            : BG_COLOR.withOpacity(0.3),
+        child: Column(
+          mainAxisAlignment: MainAxisAlignment.center,
+          children: <Widget>[
+            Text(moenyList[index]['title'],
+                style: TextStyle(
+                    color: Colors.white,
+                    fontSize: 14,
+                    fontWeight: FontWeight.bold,
+                    height: 1)),
+            Text('¥' + moenyList[index]['money'].toString(),
+                style: TextStyle(
+                    color: isChoose ? Colors.white : Color(0xFF727785),
+                    fontSize: 13,
+                    fontWeight:  FontWeight.normal,
+                    height: 18 / 13)),
+          ],
+        ),
+        onPressed: () {
+          setState(() {
+            autoChoose = false;
+            choosemoeny = moenyList[index]['money'];
+            FocusScope.of(context).requestFocus(FocusNode());
+          });
+        },
+      ),
+    );
+  }
+}

+ 2 - 2
lib/pages/RecordList.dart

@@ -171,7 +171,7 @@ class houseItem extends StatelessWidget {
                             maxWidth: 170,
                             maxWidth: 170,
                             child: Text(
                             child: Text(
                               roomInfo.houseName,
                               roomInfo.houseName,
-                              style: TextStyle(color: Colors.white, fontSize: 14, fontWeight: FontWeight.w500),
+                              style: TextStyle(color: Colors.white, fontSize: 14, fontWeight: FontWeight.bold),
                               maxLines: 1,
                               maxLines: 1,
                               overflow: TextOverflow.ellipsis,
                               overflow: TextOverflow.ellipsis,
                             ),
                             ),
@@ -190,7 +190,7 @@ class houseItem extends StatelessWidget {
                       ),
                       ),
                       Text(
                       Text(
                         roomInfo.houseAbstract ?? '',
                         roomInfo.houseAbstract ?? '',
-                        style: TextStyle(fontSize: 12, fontWeight: FontWeight.w400, color: Color(0xFF9BA0AE)),
+                        style: TextStyle(fontSize: 12, fontWeight:  FontWeight.normal, color: Color(0xFF9BA0AE)),
                         maxLines: 2,
                         maxLines: 2,
                         overflow: TextOverflow.ellipsis,
                         overflow: TextOverflow.ellipsis,
                       )
                       )

+ 26 - 836
lib/pages/RoomInfo.dart

@@ -1,316 +1,47 @@
 import 'package:flutter/material.dart';
 import 'package:flutter/material.dart';
-import 'package:flutter_screenutil/flutter_screenutil.dart';
-import 'package:url_launcher/url_launcher.dart';
-import '../styles/colors.dart';
-import 'dart:ui';
-import '../plugins/ScreenStramPlugin.dart';
-import '../net/HttpManager.dart';
-import '../net/Result.dart';
-import 'package:flutter_redux/flutter_redux.dart';
-import '../redux/AppState.dart';
+import 'package:wanna_battle/pages/RoomInfoDetail.dart';
 import '../model/HouseInfo.dart';
 import '../model/HouseInfo.dart';
-import '../styles/totast.dart';
-import 'StartWindow.dart';
-import '../model/PlayerInfo.dart';
-import '../widget/VideoWidget.dart';
-import 'dart:async';
-import '../widget/Dialog.dart';
-import 'CompetitionInformation.dart';
-import 'SecondRoomInfo.dart';
-import 'package:flutter/cupertino.dart';
-import 'VideoPlayer.dart';
-import '../model/UserInfo.dart';
-import './CompetitionNotice.dart';
+import '../Constants.dart';
+import '../styles/colors.dart';
 
 
 class RoomInfo extends StatefulWidget {
 class RoomInfo extends StatefulWidget {
+  final HouseInfo houseInfo;
   RoomInfo(this.houseInfo, {Key key}) : super(key: key);
   RoomInfo(this.houseInfo, {Key key}) : super(key: key);
-  final HouseInfo houseInfo; // 用来储存传递过来的值
-
   @override
   @override
-  RoomInfoState createState() => RoomInfoState();
+  State<StatefulWidget> createState() {
+    return _RoomInfoState();
+  }
 }
 }
 
 
-class RoomInfoState extends State<RoomInfo> with SingleTickerProviderStateMixin {
-  TabController mController;
-  Map roomInfo;
+class _RoomInfoState extends State<RoomInfo> with SingleTickerProviderStateMixin {
   HouseInfo houseInfo;
   HouseInfo houseInfo;
-  bool isJoin = true;
-  PlayerInfo playerInfo;
-  bool isPop = false;
-  bool showBack = false;
-  Timer timer;
-  List<List<String>> roomTipsList = [];
-  ScrollController _tipController;
-  String _myUrl;
-  int tabIndex = 0;
-  int myRank = 0;
-
-  //获取房间信息
-  Future<void> getRoomInfo() async {
-    Result res = await HttpManager.get('houseInfo/getOne', data: {'id': houseInfo.id});
-    if (res.success) {
-      setState(() {
-        roomInfo = res.data;
-        houseInfo = HouseInfo.fromJson(res.data);
-      });
-    } else {}
-    checkJoinInfo();
-  }
-
-  //开始比赛
-  Future<void> startGame() async {
-    Toast.show(context, '加载中', -1, 'loading');
-    Result res = await HttpManager.post('houseInfo/handBegin', data: {'id': houseInfo.id});
-    Toast.hide();
-  }
-
-  //隔一秒检查是否开始
-  Future<void> getNowStatus() async {
-    Result res = await HttpManager.get('houseInfo/getPlayerNum', data: {'id': houseInfo.id});
-    if (res.success) {
-      if (houseInfo.statusFlag == 0 && res.data['statusFlag'] == 2) {
-        showStart();
-        // timer.cancel();
-      }
-      setState(() {
-        houseInfo.playerNumber = res.data['playerNumber'];
-        houseInfo.statusFlag = res.data['statusFlag'];
-        houseInfo.bonus = res.data['bonus'];
-        houseInfo.beginTime = res.data['beginTime'];
-      });
-    }
-  }
-
-//开始比赛确认按钮
-  Future<void> showStart() async {
-    if (!isJoin) {
-      return;
-    }
-    bool result = await Navigator.of(context).push<bool>(
-      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 StartWindow();
-        },
-      ),
-    );
-    Map<String, dynamic> data = {'id': playerInfo.id};
-    bool success = true;
-    if (result) {
-      success = await ScreenStreamPlugin.start(playerInfo.id.toString());
-      if (success) {
-        data['statusFlag'] = 2;
-      } else {
-        data['statusFlag'] = 6;
-      }
-    } else {
-      data['statusFlag'] = 6;
-    }
-    Result res = await HttpManager.post('playerInfo/update', data: data);
-
-    // MyDialog.showDialog(context, '自动启动游戏失败,请手动切换到游戏app开始竞赛', submitText: '知道了');
-    // Timer(Duration(seconds: 10), () {
-    //   showSucessInfo();
-    // });
-    // return;
-    if (res.success) {
-      if (data['statusFlag'] == 2) {
-        const url = 'pubgmhd1106467070://';
-        if (await canLaunch(url)) {
-          Timer(Duration(seconds: 1), () async {
-            await launch(url);
-            showSucessInfo();
-          });
-        } else {
-          showCustomDialog(context, '自动启动游戏失败,请手动切换到游戏app开始竞赛', submitText: '知道了');
-          Timer(Duration(seconds: 10), () {
-            showSucessInfo();
-          });
-
-          throw 'Could not launch $url';
-        }
-      } else {
-        showBackDialog(success ? 1 : 0);
-      }
-    }
-  }
-
-//开始录屏提示框
-  void showSucessInfo() {
-    showCustomDialog(context, '您已经完成比赛了吗,确认完成,那就点击下方完成竞赛按钮,上传本次成绩,祝您赢取大奖', title: '完成比赛', submitText: '我已完成比赛', onsubmit: () async {
-      HttpManager.post('playerInfo/update', data: {'id': playerInfo.id, 'statusFlag': 3});
-      bool success = await ScreenStreamPlugin.stop();
-
-      Timer(Duration(seconds: 1), () {
-        getEndTips();
-      });
-
-      setState(() {
-        playerInfo.statusFlag = 3;
-      });
-    });
-  }
-
-  Future<void> getEndTips() async {
-    Result res = await HttpManager.get('playerInfo/endNum', data: {'houseId': houseInfo.id});
-
-    if (res.success) {
-      int time = houseInfo.beginTime + 1 * 3600 * 1000 - DateTime.now().millisecondsSinceEpoch;
-      var nowTime = (time ~/ 1000 ~/ 60) % 60;
-      setState(() {
-        roomTipsList.add(['你已完成本次比赛,当前完成人数 ', res.data.toString(), '人,比赛需要等待所有人完成后方可结算奖励', '', ',你可以先去参加其他竞赛,稍后在“个人中心-我的战绩”中可以查看本次竞赛排名及领取奖励']);
-      });
-    }
-  }
-
-//未确认比赛弹窗
-  void showBackDialog(type) {
-    showCustomDialog(context, (type == 1 ? '由于您未在十秒内点击开始按钮' : '由于您未授权录屏') + ',系统已经判定您放弃比赛,谢谢您的参与。', title: '很遗憾');
-  }
-
-//检查加入信息
-  Future<void> checkJoinInfo() async {
-    Result res = await HttpManager.get('playerInfo/getOne', data: {'userId': StoreProvider.of<AppState>(context).state.userInfo.id, 'houseId': houseInfo.id});
-    if (res.success) {
-      if (res.data == null) {
-        setState(() {
-          isJoin = false;
-        });
-        if (houseInfo.statusFlag == 0) {
-          if (houseInfo.scoreType == 0) {
-            roomTipsList.add([
-              '上方奖金为当前本次竞赛的总奖金,根据当前人数的增加,奖金也就越多,竞赛的第一名获得${houseInfo.houseLevel.firstRatio}%,第二名获得${houseInfo.houseLevel.secondRatio}%,第三名获得${houseInfo.houseLevel.thirdRatio}%,其他名次算作失败没有奖励,祝你取得好成绩。注:奖金池的${houseInfo.houseLevel.feeRatio}%为平台方运营服务费, 奖金池的${houseInfo.houseLevel.poolRatio}%流入赛季总奖金。'
-            ]);
-          } else {
-            roomTipsList.add([
-              '同房间内的玩家进行竞赛,所有吃上鸡的玩家均可获得奖金,即平分总奖金池的${houseInfo.houseLevel.avgRatio}%。注:奖金池的${houseInfo.houseLevel.feeRatio}%为平台方运营服务费, 奖金池的${houseInfo.houseLevel.poolRatio}%流入赛季总奖金。'
-            ]);
-          }
-        }
-      } else {
-        playerInfo = PlayerInfo.fromJson(res.data);
-
-        if (houseInfo.statusFlag == 4) {
-          _myUrl = await ScreenStreamPlugin.getVideo(playerInfo.id.toString());
-          print('本地视频' + playerInfo.id.toString());
-          print(_myUrl);
-
-          Result rankRes = await HttpManager.get('playerInfo/userRank', data: {'id': playerInfo.id});
-          if (rankRes.success) {
-            myRank = rankRes.data + 1;
-          }
-        }
-
-        setState(() {
-          isJoin = true;
-        });
-        if (houseInfo.statusFlag == 0) {
-          if (houseInfo.createUser == StoreProvider.of<AppState>(context).state.userInfo.id.toString()) {
-            roomTipsList.add(['房间创建成功,待人数满员时会自动开启比赛,请在此页面耐心等待其他人的加入,退出房间则视为自动放弃比赛,已支付金币概不退换,快快点击右上角分享给好友加入战局吧']);
-          } else {
-            // roomTipsList.add([
-            //   '请在此页面耐心等待,竞赛即将开始,届时玩家有10秒的时间进行确认,点击确认方可正式进入竞赛,若没有点击,则视为自动放弃此次竞赛,已支付金币概不退换'
-            // ]);
-          }
-          // Timer(Duration(seconds: 1), () {
-          //   roomTipsList.add([
-          //     '游戏开始后会有弹窗提示授权进行录屏的操作,',
-          //     '请一定点击“确定”或“允许”此操作',
-          //     ',系统会自动跳转打开游戏app,若长时间没有自动跳转,请手动打开游戏app进行比赛,在游戏比赛结束后,请',
-          //     '���定要点击查看游戏最后的��数名次结算页面',
-          //     ',返回游戏主页,最后再切换到我们竞赛app中,点击完成比赛,方可成功上传本次成绩。从游戏开始一小时之内必须返回全民App点击完成比赛,否则判定游戏失败,祝你取得好成绩。'
-          //   ]);
-          //   changeScroll();
-          // });
-        } else if (houseInfo.statusFlag != 4) {
-          if (playerInfo.statusFlag == 3 || playerInfo.statusFlag == 8 || playerInfo.statusFlag == 9) {
-            getEndTips();
-          }
-        }
-      }
-    }
-
-    if (isJoin && houseInfo.statusFlag != 4) {
-      timer = Timer.periodic(Duration(seconds: 1), (timer) {
-        getNowStatus();
-      });
-    }
-  }
-
-//加入房间
-  Future<void> joinRoom() async {
-    Toast.show(context, '加载中', -1, 'loading');
-    Result res = await HttpManager.post('houseInfo/join', data: {'houseId': houseInfo.id, 'userId': StoreProvider.of<AppState>(context).state.userInfo.id});
-    Toast.hide();
-    if (res.success) {
-      Toast.show(context, '加入成功', 1500, 'success');
-      checkJoinInfo();
-    } else {
-      Toast.show(context, res.error, 1500, 'info');
-    }
-  }
-
-  //获取分秒
-  String getSecondsMIn(int time) {
-    if (time == null) {
-      return '';
-    } else {
-      return ((time ~/ 1000 ~/ 60) % 60).toString() + '分' + (time ~/ 1000 % 60).toString() + '秒';
-    }
-  }
+  TabController tabController;
+  RoomInfoDetail roomInfoDetail;
 
 
   @override
   @override
   void initState() {
   void initState() {
     super.initState();
     super.initState();
     houseInfo = widget.houseInfo;
     houseInfo = widget.houseInfo;
-    mController = TabController(
+    tabController = TabController(
       length: 2,
       length: 2,
       vsync: this,
       vsync: this,
     );
     );
-
-    mController.addListener(() {
-      setState(() {
-        tabIndex = mController.index;
-      });
-      print(tabIndex);
-    });
-    _tipController = ScrollController();
-    roomInfo = {};
-
-    Future.delayed(Duration.zero, () {
-      getRoomInfo();
-    });
   }
   }
 
 
   @override
   @override
   void dispose() {
   void dispose() {
     super.dispose();
     super.dispose();
-    mController.dispose();
-    if (timer != null) {
-      timer.cancel();
-    }
+    tabController.dispose();
   }
   }
 
 
   @override
   @override
   Widget build(BuildContext context) {
   Widget build(BuildContext context) {
-    ScreenUtil.instance = ScreenUtil(width: 375, height: 667)..init(context);
-    int status = 0;
-    if (houseInfo != null) {
-      status = houseInfo.statusFlag;
-    }
     return WillPopScope(
     return WillPopScope(
       child: Scaffold(
       child: Scaffold(
         appBar: AppBar(
         appBar: AppBar(
           title: Container(
           title: Container(
             child: TabBar(
             child: TabBar(
-              controller: mController,
+              controller: tabController,
               labelColor: PRIMARY_COLOR,
               labelColor: PRIMARY_COLOR,
               unselectedLabelColor: Color(0xCCFFFFFF),
               unselectedLabelColor: Color(0xCCFFFFFF),
               labelStyle: TextStyle(fontSize: 16.0),
               labelStyle: TextStyle(fontSize: 16.0),
@@ -336,564 +67,23 @@ class RoomInfoState extends State<RoomInfo> with SingleTickerProviderStateMixin
           ],
           ],
         ),
         ),
         body: Container(
         body: Container(
-            color: BG_SUB_COLOR,
-            child: TabBarView(
-              controller: mController,
-              children: [_firstPage(), SecondPage(houseInfo)],
-            )),
-        floatingActionButton: _joinBtn(),
-        floatingActionButtonLocation: FloatingActionButtonLocation.centerDocked,
-      ),
-      onWillPop: () {
-        if (houseInfo == null || (houseInfo.statusFlag != 0) || !isJoin) {
-          if (timer != null) {
-            timer.cancel();
-          }
-          isPop = true;
-          Toast.hide();
-          Navigator.of(context).pop();
-          return Future.value(false);
-        } else {
-          Toast.show(context, '比赛即将开始,暂不能离开房间', 1500, 'info');
-        }
-        return Future.value(false);
-      },
-    );
-  }
-
-  Widget _firstPage() {
-    int statuFlag = 0;
-    if (houseInfo != null) {
-      if (houseInfo.statusFlag != null) {
-        statuFlag = houseInfo.statusFlag;
-      }
-    }
-
-    return LayoutBuilder(
-      builder: (BuildContext context, BoxConstraints viewportConstraints) {
-        return Container(
-          child: RefreshIndicator(
-              color: PRIMARY_COLOR,
-              backgroundColor: Colors.white,
-              displacement: 10,
-              onRefresh: () async {
-                await Future.delayed(const Duration(seconds: 1));
-              },
-              child: SingleChildScrollView(
-                  controller: _tipController,
-                  physics: AlwaysScrollableScrollPhysics(),
-                  child: Column(
-                    children: <Widget>[
-                      houseInfo != null ? VideoWidget(videoSrc: houseInfo.video) : Container(),
-                      // Image.network(topImg, width: double.infinity),
-                      Container(
-                        height: 60,
-                        padding: EdgeInsets.fromLTRB(15, 0, 15, 0),
-                        child: Row(
-                          children: <Widget>[
-                            Expanded(
-                              child: Text(
-                                houseInfo.houseName,
-                                style: TextStyle(fontSize: 20, fontWeight: FontWeight.bold, color: Colors.white),
-                              ),
-                            ),
-                            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(
-                        height: 40,
-                        margin: EdgeInsets.fromLTRB(15, 0, 15, 0),
-                        color: Color(0x1A1990F8),
-                        child: Row(
-                          children: <Widget>[
-                            Expanded(
-                              flex: 1,
-                              child: CupertinoButton(
-                                padding: EdgeInsets.all(0),
-                                onPressed: () {},
-                                child: Text(
-                                  '返回锦标赛',
-                                  style: TextStyle(color: PRIMARY_COLOR, fontSize: 14, fontWeight: FontWeight.bold),
-                                ),
-                              ),
-                            ),
-                            Container(
-                              width: 1,
-                              height: 12,
-                              color: PRIMARY_COLOR,
-                            ),
-                            Expanded(
-                              flex: 1,
-                              child: CupertinoButton(
-                                padding: EdgeInsets.all(0),
-                                onPressed: () {
-                                  showNotice(context);
-                                },
-                                child: Text(
-                                  '竞赛须知',
-                                  style: TextStyle(color: PRIMARY_COLOR, fontSize: 14, fontWeight: FontWeight.bold),
-                                ),
-                              ),
-                            ),
-                          ],
-                        ),
-                      ),
-                      Container(
-                        height: 40,
-                        margin: EdgeInsets.fromLTRB(15, 10, 15, 0),
-                        decoration: BoxDecoration(
-                            color: Color(0x1AFFFF00),
-                            border: Border.all(
-                              width: 1,
-                              color: Colors.yellow,
-                            )),
-                        child: Row(
-                          mainAxisAlignment: MainAxisAlignment.spaceAround,
-                          children: <Widget>[
-                            Text('积分 加成+0%', style: TextStyle(color: Colors.yellow, fontSize: 12)),
-                            Text('保底 0积分', style: TextStyle(color: Colors.yellow, fontSize: 12)),
-                          ],
-                        ),
-                      ),
-                      statuFlag != 4
-                          ? TipsListContent(tipsList: roomTipsList, houseInfo: houseInfo)
-                          : RankContent(
-                              roomId: houseInfo.id.toString(),
-                            ),
-                      Container(
-                        width: double.infinity,
-                        height: 78,
-                      )
-                    ],
-                  ))),
-        );
-      },
-    );
-  }
-
-  Widget _joinBtn() {
-    int joinMoney = 0;
-    int statusFlag = houseInfo != null ? houseInfo.statusFlag : 1;
-    int playerStatus = playerInfo != null ? playerInfo.statusFlag : 0;
-    if (!isJoin && statusFlag == 0) {
-      return Container(
-        color: BG_SUB_COLOR,
-        width: ScreenUtil().setWidth(375),
-        height: 48 + ScreenUtil().setHeight(40),
-        padding: EdgeInsets.only(top: ScreenUtil().setHeight(20), bottom: ScreenUtil().setHeight(20), left: 15, right: 15),
-        child: RaisedButton(
-            textColor: Colors.white,
-            child: Row(
-              mainAxisAlignment: MainAxisAlignment.center,
-              children: <Widget>[
-                Container(
-                    margin: EdgeInsets.only(left: 20),
-                    child: Text(
-                      '加入房间',
-                      style: TextStyle(color: Colors.white, fontSize: 16, fontWeight: FontWeight.w500),
-                    ))
-              ],
-            ),
-            onPressed: () => joinRoom()),
-      );
-    } else if (!isJoin && statusFlag == 2) {
-      return Container(
-        width: double.infinity,
-        padding: EdgeInsets.symmetric(horizontal: 15, vertical: 20),
-        height: 88,
-        child: RaisedButton(
-          disabledColor: Color(0xFF914244),
-          disabledTextColor: Color(0xFF252532),
-          child: Text(
-            '房间已经开始,加入通道关闭',
-            style: TextStyle(fontSize: 16),
-          ),
-          onPressed: null,
-        ),
-      );
-    } else if (isJoin && statusFlag == 0) {
-      int _time;
-      if (houseInfo != null) {
-        _time = houseInfo.createTime + 600000 - DateTime.now().millisecondsSinceEpoch;
-      }
-      if (houseInfo != null && houseInfo.createUser == StoreProvider.of<AppState>(context).state.userInfo.id.toString()) {
-        return Container(
-          width: double.infinity,
-          padding: EdgeInsets.symmetric(horizontal: 15, vertical: 20),
-          height: 88,
-          child: RaisedButton(
-            child: Text.rich(TextSpan(children: [
-              TextSpan(
-                text: '开始比赛',
-                style: TextStyle(fontSize: 16),
+          child: TabBarView(
+            controller: tabController,
+            children: [
+              Builder(
+                builder: (context) {
+                  roomInfoDetail = RoomInfoDetail(houseInfo);
+                  return roomInfoDetail;
+                },
               ),
               ),
-              TextSpan(
-                text: '(${getSecondsMIn(_time)}秒后将自动开始)',
-                style: TextStyle(fontSize: 12),
-              )
-            ])),
-            onPressed: () {
-              showCustomDialog(context, '确认要开始比赛吗?', isCancel: true, onsubmit: () {
-                print('开始');
-                startGame();
-              });
-            },
-          ),
-        );
-      } else {
-        return Container(
-          width: double.infinity,
-          padding: EdgeInsets.symmetric(horizontal: 15, vertical: 20),
-          height: 88,
-          child: RaisedButton(
-            disabledColor: Color(0xFF1990F8),
-            disabledTextColor: Color(0xFF252532),
-            child: Text(
-              '预计' + getSecondsMIn(_time) + '后开始',
-              style: TextStyle(fontSize: 16),
-            ),
-            onPressed: null,
-          ),
-        );
-      }
-    } else if (isJoin && statusFlag == 8) {
-      return Container(
-        width: double.infinity,
-        padding: EdgeInsets.symmetric(horizontal: 15, vertical: 20),
-        height: 88,
-        child: RaisedButton(
-          disabledColor: Color(0xFF1990F8),
-          disabledTextColor: Color(0xFF252532),
-          child: Text(
-            '正在努力解析视频中',
-            style: TextStyle(fontSize: 16),
-          ),
-          onPressed: null,
-        ),
-      );
-    } else if (isJoin && (statusFlag == 2 || statusFlag == 3)) {
-      int _time;
-      if (houseInfo != null) {
-        _time = houseInfo.beginTime + 3600000 - DateTime.now().millisecondsSinceEpoch;
-      }
-      return Container(
-        width: double.infinity,
-        padding: EdgeInsets.symmetric(horizontal: 15, vertical: 20),
-        height: 88,
-        child: RaisedButton(
-          disabledColor: Color(0xFF1990F8),
-          disabledTextColor: Color(0xFF252532),
-          child: Text(
-            '最迟在' + getSecondsMIn(_time) + '后结算',
-            style: TextStyle(fontSize: 16),
-          ),
-          onPressed: null,
-        ),
-      );
-    } else if (statusFlag == 4 && tabIndex == 0) {
-      return Container(
-        width: double.infinity,
-        padding: EdgeInsets.symmetric(horizontal: 15, vertical: 20),
-        height: 88,
-        child: RaisedButton(
-          disabledColor: Color(0xFF1990F8),
-          disabledTextColor: Color(0xFF15151D),
-          child: Text(
-            '已结束',
-            style: TextStyle(fontSize: 16),
+              Container()
+            ],
           ),
           ),
-          onPressed: null,
-        ),
-      );
-    } else if (statusFlag == 4 && tabIndex == 1) {
-      return Builder(
-        builder: (context) {
-          return Container(
-            height: 48,
-            padding: EdgeInsets.symmetric(vertical: 9, horizontal: 20),
-            color: SUB_COLOR,
-            child: Row(
-              children: <Widget>[
-                Container(
-                  width: 30,
-                  height: 30,
-                  margin: EdgeInsets.only(right: 10),
-                  child: CircleAvatar(
-                    backgroundImage: NetworkImage(StoreProvider.of<AppState>(context).state.userInfo.icon),
-                  ),
-                ),
-                Expanded(
-                  flex: 1,
-                  child: Text(
-                    StoreProvider.of<AppState>(context).state.userInfo.nickname,
-                    style: TextStyle(
-                      fontSize: 14,
-                      color: Colors.white,
-                    ),
-                  ),
-                ),
-                _myUrl != null
-                    ? Container(
-                        width: 68,
-                        height: 24,
-                        margin: EdgeInsets.only(right: 10),
-                        child: OutlineButton(
-                          textColor: BG_SUB_COLOR,
-                          borderSide: BorderSide(color: BG_SUB_COLOR),
-                          padding: EdgeInsets.all(0),
-                          highlightColor: PRIMARY_COLOR.withOpacity(0.8),
-                          highlightedBorderColor: BG_SUB_COLOR,
-                          child: Text(
-                            '查看回放',
-                            style: TextStyle(fontSize: 12),
-                          ),
-                          onPressed: () {
-                            Navigator.push(context, CupertinoPageRoute(builder: (context) => VideoPlayerPage(videoUrl: _myUrl, fileType: 'file')));
-                          },
-                        ),
-                      )
-                    : Container(),
-                Text(
-                  myRank != 0 ? '第${myRank}名' : '未上榜',
-                  style: TextStyle(fontSize: 14, color: Colors.white, fontWeight: FontWeight.w500),
-                )
-              ],
-            ),
-          );
-        },
-      );
-    } else {
-      return Container();
-    }
-  }
-}
-
-//房间的提示信息
-class TipsListContent extends StatelessWidget {
-  TipsListContent({Key key, this.tipsList, this.houseInfo}) : super(key: key);
-  final List<List<String>> tipsList;
-  final HouseInfo houseInfo;
-
-  @override
-  Widget build(BuildContext context) {
-    return Container(
-      margin: EdgeInsets.only(top: 15),
-      width: double.infinity,
-      child: Column(
-        children: _list(),
-      ),
-    );
-  }
-
-  List<Widget> _list() {
-    List<Widget> myList = [];
-    for (int i = 0; i < tipsList.length; i++) {
-      myList.add(Tips(content: tipsList[i], showTongzhi: (tipsList[i].length == 1 && i == 0) ? true : false, houseInfo: houseInfo));
-    }
-
-    return myList;
-  }
-}
-
-class Tips extends StatelessWidget {
-  Tips({Key key, this.content, this.showTongzhi, this.houseInfo}) : super(key: key);
-  final List<String> content;
-  final bool showTongzhi;
-  final HouseInfo houseInfo;
-  @override
-  Widget build(BuildContext context) {
-    return Container(
-        padding: EdgeInsets.all(15),
-        margin: EdgeInsets.fromLTRB(15, 10, 15, 0),
-        color: Color(0xFF293354),
-        child: Column(
-          children: <Widget>[
-            content.length == 1
-                ? Text(
-                    content[0],
-                    style: TextStyle(color: Colors.white, fontSize: 13),
-                  )
-                : _textList(),
-            showTongzhi
-                ? FlatButton(
-                    padding: EdgeInsets.all(0),
-                    textColor: PRIMARY_COLOR,
-                    highlightColor: Colors.transparent,
-                    splashColor: Colors.transparent,
-                    child: Text(
-                      '查看竞赛须知',
-                      style: TextStyle(
-                        decoration: TextDecoration.underline,
-                      ),
-                    ),
-                    onPressed: () {
-                      showNotice(context);
-                    },
-                  )
-                : Container()
-          ],
-        ));
-  }
-
-  Widget _textList() {
-    return Text.rich(TextSpan(
-      style: TextStyle(color: Colors.white, fontSize: 13),
-      children: [
-        TextSpan(text: content[0]),
-        TextSpan(
-          text: content[1],
-          style: TextStyle(color: PRIMARY_COLOR, fontSize: 13, fontWeight: FontWeight.w500),
         ),
         ),
-        TextSpan(text: content[2]),
-        TextSpan(text: content[3]),
-        TextSpan(text: content[4])
-      ],
-    ));
-  }
-}
-
-//比赛结束排名
-class RankContent extends StatefulWidget {
-  RankContent({Key key, this.roomId}) : super(key: key);
-  final String roomId; // 用来储存传递过来的值
-  @override
-  RankContentState createState() => RankContentState();
-}
-
-class RankContentState extends State<RankContent> {
-  List<PlayerInfo> topList = [];
-  Future<void> getTopList() async {
-    Toast.show(context, '加载中', -1, 'loading');
-    Result res = await HttpManager.get('playerInfo/rankPage', data: {'houseId': widget.roomId, 'currentPage': 1, 'pageNumber': 3});
-    Toast.hide();
-    List<PlayerInfo> list = [];
-    if (res.success) {
-      for (var item in res.data['pp']) {
-        PlayerInfo jonPlayer = PlayerInfo.fromJson(item);
-        list.add(jonPlayer);
-      }
-    } else {}
-    setState(() {
-      topList = list;
-    });
-  }
-
-  @override
-  void initState() {
-    super.initState();
-    Future.delayed(Duration.zero, () {
-      getTopList();
-    });
-  }
-
-  @override
-  Widget build(BuildContext context) {
-    return Container(
-      width: double.infinity,
-      height: 180,
-      margin: EdgeInsets.only(top: 15),
-      child: Row(
-        mainAxisAlignment: MainAxisAlignment.center,
-        crossAxisAlignment: CrossAxisAlignment.end,
-        children: <Widget>[_rankItem(2), _rankItem(1), _rankItem(3)],
-      ),
-    );
-  }
-
-  Widget _rankItem(int _num) {
-    if (_num > topList.length) {
-      return Container(
-        width: 107,
-        height: 60,
-      );
-    }
-    List colorList = [
-      [Color(0xFFD48E00), Color(0xFFFECF01)],
-      [Color(0xFFC5C5C5), Color(0xFFE3E3E3)],
-      [Color(0xFFE77023), Color(0xFFF89E58)]
-    ];
-    return Container(
-      padding: EdgeInsets.only(left: 15, right: 15, top: _num == 1 ? 0 : 15),
-      width: 107,
-      child: Column(
-        crossAxisAlignment: CrossAxisAlignment.center,
-        children: <Widget>[
-          Container(
-            child: Stack(
-              children: <Widget>[
-                Positioned(
-                  top: 0,
-                  left: _num == 1 ? 19 : 14,
-                  child: Center(
-                    child: Image.asset(
-                      'images/icon_paihangbang_0' + '$_num.png',
-                      width: 32,
-                    ),
-                  ),
-                ),
-                Container(
-                  margin: EdgeInsets.only(top: 27, bottom: 20),
-                  width: _num == 1 ? 70 : 60,
-                  height: _num == 1 ? 70 : 60,
-                  decoration: BoxDecoration(
-                    gradient: LinearGradient(colors: colorList[_num - 1], begin: Alignment.topLeft, end: Alignment.bottomRight),
-                    borderRadius: BorderRadius.all(Radius.circular(100)),
-                  ),
-                  child: Center(
-                      child: Container(
-                    width: _num == 1 ? 60 : 50,
-                    height: _num == 1 ? 60 : 50,
-                    child: CircleAvatar(backgroundImage: NetworkImage(topList[_num - 1].userInfo.icon)),
-                  )),
-                ),
-                Positioned(
-                  bottom: 0,
-                  child: Center(
-                    child: Image.asset(
-                      'images/ph_yinpai_no' + '$_num.png',
-                      width: 67,
-                    ),
-                  ),
-                ),
-              ],
-            ),
-          ),
-          Text(
-            topList[_num - 1].userInfo.nickname,
-            style: TextStyle(
-              color: Color(0xFFFDC372),
-              fontSize: 12,
-            ),
-            overflow: TextOverflow.ellipsis,
-            textAlign: TextAlign.center,
-          ),
-          SizedBox(
-            height: 5,
-          ),
-          Row(
-            mainAxisAlignment: MainAxisAlignment.center,
-            children: <Widget>[
-              Image.asset('images/icon_jinbi_xiao_hong.png', width: 20),
-              Text('×' + (topList[_num - 1].bonus != null ? topList[_num - 1].bonus.toString() : '0'), style: TextStyle(color: PRIMARY_COLOR, fontSize: 12))
-            ],
-          )
-        ],
       ),
       ),
+      onWillPop: () {
+        return Future.value(true);
+      },
     );
     );
   }
   }
 }
 }

+ 919 - 0
lib/pages/RoomInfo1.dart

@@ -0,0 +1,919 @@
+import 'package:flutter/material.dart';
+import 'package:flutter_screenutil/flutter_screenutil.dart';
+import 'package:url_launcher/url_launcher.dart';
+import '../styles/colors.dart';
+import 'dart:ui';
+import '../plugins/ScreenStramPlugin.dart';
+import '../net/HttpManager.dart';
+import '../net/Result.dart';
+import 'package:flutter_redux/flutter_redux.dart';
+import '../redux/AppState.dart';
+import '../model/HouseInfo.dart';
+import '../styles/totast.dart';
+import 'StartWindow.dart';
+import '../model/PlayerInfo.dart';
+import '../widget/VideoWidget.dart';
+import 'dart:async';
+import '../widget/Dialog.dart';
+import 'SecondRoomInfo.dart';
+import 'package:flutter/cupertino.dart';
+import 'VideoPlayer.dart';
+import './CompetitionNotice.dart';
+
+class RoomInfo extends StatefulWidget {
+  RoomInfo(this.houseInfo, {Key key}) : super(key: key);
+  final HouseInfo houseInfo; // 用来储存传递过来的值
+
+  @override
+  RoomInfoState createState() => RoomInfoState();
+}
+
+class RoomInfoState extends State<RoomInfo> with SingleTickerProviderStateMixin {
+  TabController mController;
+  Map roomInfo;
+  HouseInfo houseInfo;
+  bool isJoin = true;
+  PlayerInfo playerInfo;
+  bool isPop = false;
+  bool showBack = false;
+  Timer timer;
+  List<List<String>> roomTipsList = [];
+  ScrollController _tipController;
+  String _myUrl;
+  int tabIndex = 0;
+  int myRank = 0;
+  int myPoints = 0;
+
+  //获取房间信息
+  Future<void> getRoomInfo() async {
+    Result res = await HttpManager.get('houseInfo/getOne', data: {'id': houseInfo.id});
+    if (res.success) {
+      setState(() {
+        roomInfo = res.data;
+        houseInfo = HouseInfo.fromJson(res.data);
+      });
+    } else {}
+    checkJoinInfo();
+  }
+
+  //开始比赛
+  Future<void> startGame() async {
+    Toast.show(context, '加载中', -1, 'loading');
+    Result res = await HttpManager.post('houseInfo/handBegin', data: {'id': houseInfo.id});
+    Toast.hide();
+  }
+
+  //隔一秒检查是否开始
+  Future<void> getNowStatus() async {
+    Result res = await HttpManager.get('houseInfo/getPlayerNum', data: {'id': houseInfo.id});
+    if (res.success) {
+      if (houseInfo.statusFlag == 0 && res.data['statusFlag'] == 2) {
+        showStart();
+        // timer.cancel();
+      }
+      setState(() {
+        houseInfo.playerNumber = res.data['playerNumber'];
+        houseInfo.statusFlag = res.data['statusFlag'];
+        houseInfo.bonus = res.data['bonus'];
+        houseInfo.beginTime = res.data['beginTime'];
+      });
+    }
+  }
+
+//开始比赛确认按钮
+  Future<void> showStart() async {
+    if (!isJoin) {
+      return;
+    }
+    bool result = await Navigator.of(context).push<bool>(
+      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 StartWindow();
+        },
+      ),
+    );
+    Map<String, dynamic> data = {'id': playerInfo.id};
+    bool success = true;
+    if (result) {
+      success = await ScreenStreamPlugin.start(playerInfo.id.toString());
+      if (success) {
+        data['statusFlag'] = 2;
+      } else {
+        data['statusFlag'] = 6;
+      }
+    } else {
+      data['statusFlag'] = 6;
+    }
+    Result res = await HttpManager.post('playerInfo/update', data: data);
+
+    // MyDialog.showDialog(context, '自动启动游戏失败,请手动切换到游戏app开始竞赛', submitText: '知道了');
+    // Timer(Duration(seconds: 10), () {
+    //   showSucessInfo();
+    // });
+    // return;
+    if (res.success) {
+      if (data['statusFlag'] == 2) {
+        const url = 'pubgmhd1106467070://';
+        if (await canLaunch(url)) {
+          Timer(Duration(seconds: 1), () async {
+            await launch(url);
+            showSucessInfo();
+          });
+        } else {
+          showCustomDialog(context, '自动启动游戏失败,请手动切换到游戏app开始竞赛', submitText: '知道了');
+          Timer(Duration(seconds: 10), () {
+            showSucessInfo();
+          });
+
+          throw 'Could not launch $url';
+        }
+      } else {
+        showBackDialog(success ? 1 : 0);
+      }
+    }
+  }
+
+//开始录屏提示框
+  void showSucessInfo() {
+    showCustomDialog(context, '您已经完成比赛了吗,确认完成,那就点击下方完成竞赛按钮,上传本次成绩,祝您赢取大奖', title: '完成比赛', submitText: '我已完成比赛', onsubmit: () async {
+      HttpManager.post('playerInfo/update', data: {'id': playerInfo.id, 'statusFlag': 3});
+      bool success = await ScreenStreamPlugin.stop();
+
+      Timer(Duration(seconds: 1), () {
+        getEndTips();
+      });
+
+      setState(() {
+        playerInfo.statusFlag = 3;
+      });
+    });
+  }
+
+  Future<void> getEndTips() async {
+    Result res = await HttpManager.get('playerInfo/endNum', data: {'houseId': houseInfo.id});
+
+    if (res.success) {
+      int time = houseInfo.beginTime + 1 * 3600 * 1000 - DateTime.now().millisecondsSinceEpoch;
+      var nowTime = (time ~/ 1000 ~/ 60) % 60;
+      setState(() {
+        roomTipsList.add(['你已完成本次比赛,当前完成人数 ', res.data.toString(), '人,比赛需要等待所有人完成后方可结算奖励', '', ',你可以先去参加其他竞赛,稍后在“个人中心-我的战绩”中可以查看本次竞赛排名及领取奖励']);
+      });
+    }
+  }
+
+//未确认比赛弹窗
+  void showBackDialog(type) {
+    showCustomDialog(context, (type == 1 ? '由于您未在十秒内点击开始按钮' : '由于您未授权录屏') + ',系统已经判定您放弃比赛,谢谢您的参与。', title: '很遗憾');
+  }
+
+//检查加入信息
+  Future<void> checkJoinInfo() async {
+    Result res = await HttpManager.get('playerInfo/getOne', data: {'userId': StoreProvider.of<AppState>(context).state.userInfo.id, 'houseId': houseInfo.id});
+    if (res.success) {
+      if (res.data == null) {
+        setState(() {
+          isJoin = false;
+        });
+        if (houseInfo.statusFlag == 0) {
+          if (houseInfo.scoreType == 0) {
+            roomTipsList.add([
+              '上方奖金为当前本次竞赛的总奖金,根据当前人数的增加,奖金也就越多,竞赛的第一名获得${houseInfo.houseLevel.firstRatio}%,第二名获得${houseInfo.houseLevel.secondRatio}%,第三名获得${houseInfo.houseLevel.thirdRatio}%,其他名次算作失败没有奖励,祝你取得好成绩。注:奖金池的${houseInfo.houseLevel.feeRatio}%为平台方运营服务费, 奖金池的${houseInfo.houseLevel.poolRatio}%流入赛季总奖金。'
+            ]);
+          } else {
+            roomTipsList.add([
+              '同房间内的玩家进行竞赛,所有吃上鸡的玩家均可获得奖金,即平分总奖金池的${houseInfo.houseLevel.avgRatio}%。注:奖金池的${houseInfo.houseLevel.feeRatio}%为平台方运营服务费, 奖金池的${houseInfo.houseLevel.poolRatio}%流入赛季总奖金。'
+            ]);
+          }
+        }
+      } else {
+        playerInfo = PlayerInfo.fromJson(res.data);
+        myPoints = playerInfo.points;
+        if (houseInfo.statusFlag == 4) {
+          _myUrl = await ScreenStreamPlugin.getVideo(playerInfo.id.toString());
+          print('本地视频' + playerInfo.id.toString());
+          print(_myUrl);
+
+          Result rankRes = await HttpManager.get('playerInfo/userRank', data: {'id': playerInfo.id});
+          if (rankRes.success) {
+            myRank = rankRes.data + 1;
+          }
+        }
+
+        setState(() {
+          isJoin = true;
+        });
+        if (houseInfo.statusFlag == 0) {
+          if (houseInfo.createUser == StoreProvider.of<AppState>(context).state.userInfo.id.toString()) {
+            roomTipsList.add(['房间创建成功,待人数满员时会自动开启比赛,请在此页面耐心等待其他人的加入,退出房间则视为自动放弃比赛,已支付金币概不退换,快快点击右上角分享给好友加入战局吧']);
+          } else {
+            // roomTipsList.add([
+            //   '请在此页面耐心等待,竞赛即将开始,届时玩家有10秒的时间进行确认,点击确认方可正式进入竞赛,若没有点击,则视为自动放弃此次竞赛,已支付金币概不退换'
+            // ]);
+          }
+          // Timer(Duration(seconds: 1), () {
+          //   roomTipsList.add([
+          //     '游戏开始后会有弹窗提示授权进行录屏的操作,',
+          //     '请一定点击“确定”或“允许”此操作',
+          //     ',系统会自动跳转打开游戏app,若长时间没有自动跳转,请手动打开游戏app进行比赛,在游戏比赛结束后,请',
+          //     '一定要点击查看游戏最后的��数名次结算页面',
+          //     ',返回游戏主页,最后再切换到我们竞赛app中,点击完成比赛,方可成功上传本次成绩。从游戏开始一小时之内必须返回全民App点击完成比赛,否则判定游戏失败,祝你取得好成绩。'
+          //   ]);
+          //   changeScroll();
+          // });
+        } else if (houseInfo.statusFlag != 4) {
+          if (playerInfo.statusFlag == 3 || playerInfo.statusFlag == 8 || playerInfo.statusFlag == 9) {
+            getEndTips();
+          }
+        }
+      }
+    }
+
+    if (isJoin && houseInfo.statusFlag != 4) {
+      timer = Timer.periodic(Duration(seconds: 1), (timer) {
+        getNowStatus();
+      });
+    }
+  }
+
+//加入房间
+  Future<void> joinRoom() async {
+    Toast.show(context, '加载中', -1, 'loading');
+    Result res = await HttpManager.post('houseInfo/join', data: {'houseId': houseInfo.id, 'userId': StoreProvider.of<AppState>(context).state.userInfo.id});
+    Toast.hide();
+    if (res.success) {
+      Toast.show(context, '加入成功', 1500, 'success');
+      checkJoinInfo();
+    } else {
+      Toast.show(context, res.error, 1500, 'info');
+    }
+  }
+
+  //获取分秒
+  String getSecondsMIn(int time) {
+    if (time == null) {
+      return '';
+    } else {
+      return ((time ~/ 1000 ~/ 60) % 60).toString() + '分' + (time ~/ 1000 % 60).toString() + '秒';
+    }
+  }
+
+  @override
+  void initState() {
+    super.initState();
+    houseInfo = widget.houseInfo;
+    mController = TabController(
+      length: 2,
+      vsync: this,
+    );
+
+    mController.addListener(() {
+      setState(() {
+        tabIndex = mController.index;
+      });
+      print(tabIndex);
+    });
+    _tipController = ScrollController();
+    roomInfo = {};
+
+    Future.delayed(Duration.zero, () {
+      getRoomInfo();
+    });
+  }
+
+  @override
+  void dispose() {
+    super.dispose();
+    mController.dispose();
+    if (timer != null) {
+      timer.cancel();
+    }
+  }
+
+  @override
+  Widget build(BuildContext context) {
+    ScreenUtil.instance = ScreenUtil(width: 375, height: 667)..init(context);
+    int status = 0;
+    if (houseInfo != null) {
+      status = houseInfo.statusFlag;
+    }
+    return WillPopScope(
+      child: Scaffold(
+        appBar: AppBar(
+          title: Container(
+            child: TabBar(
+              controller: mController,
+              labelColor: PRIMARY_COLOR,
+              unselectedLabelColor: Color(0xCCFFFFFF),
+              labelStyle: TextStyle(fontSize: 16.0),
+              indicatorColor: PRIMARY_COLOR,
+              indicatorWeight: 3,
+              indicatorSize: TabBarIndicatorSize.label,
+              tabs: <Widget>[
+                Tab(text: '房间信息'),
+                Tab(text: '参赛成员'),
+              ],
+            ),
+          ),
+          centerTitle: true,
+          elevation: 0,
+          actions: <Widget>[
+            Container(
+              padding: EdgeInsets.only(right: 30, left: 20),
+              child: Image.asset(
+                'images/icon_fenxiang.png',
+                width: 24,
+              ),
+            )
+          ],
+        ),
+        body: Container(
+            color: BG_SUB_COLOR,
+            child: TabBarView(
+              controller: mController,
+              children: [_firstPage(), SecondPage(houseInfo)],
+            )),
+        floatingActionButton: _joinBtn(),
+        floatingActionButtonLocation: FloatingActionButtonLocation.centerDocked,
+      ),
+      onWillPop: () {
+        if (houseInfo == null || (houseInfo.statusFlag != 0) || !isJoin) {
+          if (timer != null) {
+            timer.cancel();
+          }
+          isPop = true;
+          Toast.hide();
+          Navigator.of(context).pop();
+          return Future.value(false);
+        } else {
+          Toast.show(context, '比赛即将开始,暂不能离开房间', 1500, 'info');
+        }
+        return Future.value(false);
+      },
+    );
+  }
+
+  Widget _firstPage() {
+    int statuFlag = 0;
+    if (houseInfo != null) {
+      if (houseInfo.statusFlag != null) {
+        statuFlag = houseInfo.statusFlag;
+      }
+    }
+
+    return LayoutBuilder(
+      builder: (BuildContext context, BoxConstraints viewportConstraints) {
+        return Container(
+          child: RefreshIndicator(
+              color: PRIMARY_COLOR,
+              backgroundColor: Colors.white,
+              displacement: 10,
+              onRefresh: () async {
+                await Future.delayed(const Duration(seconds: 1));
+              },
+              child: SingleChildScrollView(
+                  controller: _tipController,
+                  physics: AlwaysScrollableScrollPhysics(),
+                  child: Column(
+                    children: <Widget>[
+                      houseInfo != null ? VideoWidget(videoSrc: houseInfo.video) : Container(),
+                      // Image.network(topImg, width: double.infinity),
+                      Container(
+                        height: 60,
+                        padding: EdgeInsets.fromLTRB(15, 0, 15, 0),
+                        child: Row(
+                          children: <Widget>[
+                            Expanded(
+                              child: Text(
+                                houseInfo.houseName,
+                                style: TextStyle(fontSize: 20, fontWeight: FontWeight.bold, color: Colors.white),
+                              ),
+                            ),
+                            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.bold, color: Color(0xFFB1B2C0)),
+                                ),
+                              ],
+                            )
+                          ],
+                        ),
+                      ),
+                      Container(
+                        height: 40,
+                        margin: EdgeInsets.fromLTRB(15, 0, 15, 0),
+                        color: Color(0x1A1990F8),
+                        child: Row(
+                          children: <Widget>[
+                            Expanded(
+                              flex: 1,
+                              child: CupertinoButton(
+                                padding: EdgeInsets.all(0),
+                                onPressed: () {
+                                  if (houseInfo == null || (houseInfo.statusFlag != 0) || !isJoin) {
+                                    if (timer != null) {
+                                      timer.cancel();
+                                    }
+                                    isPop = true;
+                                    Toast.hide();
+                                    Navigator.of(context).pop();
+                                    return Future.value(false);
+                                  } else {
+                                    Toast.show(context, '比赛即将开始,暂不能离开房间', 1500, 'info');
+                                  }
+                                },
+                                child: Text(
+                                  '返回锦标赛',
+                                  style: TextStyle(color: PRIMARY_COLOR, fontSize: 14, fontWeight: FontWeight.bold),
+                                ),
+                              ),
+                            ),
+                            Container(
+                              width: 1,
+                              height: 12,
+                              color: PRIMARY_COLOR,
+                            ),
+                            Expanded(
+                              flex: 1,
+                              child: CupertinoButton(
+                                padding: EdgeInsets.all(0),
+                                onPressed: () {
+                                  showNotice(context);
+                                },
+                                child: Text(
+                                  '竞赛须知',
+                                  style: TextStyle(color: PRIMARY_COLOR, fontSize: 14, fontWeight: FontWeight.bold),
+                                ),
+                              ),
+                            ),
+                          ],
+                        ),
+                      ),
+                      Container(
+                        height: 40,
+                        margin: EdgeInsets.fromLTRB(15, 10, 15, 0),
+                        decoration: BoxDecoration(
+                            color: Color(0x1AFFFF00),
+                            border: Border.all(
+                              width: 1,
+                              color: Colors.yellow,
+                            )),
+                        child: Row(
+                          mainAxisAlignment: MainAxisAlignment.spaceAround,
+                          children: <Widget>[
+                            Text('积分 加成+0%', style: TextStyle(color: Colors.yellow, fontSize: 12)),
+                            Text('保底 0积分', style: TextStyle(color: Colors.yellow, fontSize: 12)),
+                          ],
+                        ),
+                      ),
+                      statuFlag != 4
+                          ? TipsListContent(tipsList: roomTipsList, houseInfo: houseInfo)
+                          : RankContent(
+                              roomId: houseInfo.id.toString(),
+                            ),
+                      Container(
+                        width: double.infinity,
+                        height: 78,
+                      )
+                    ],
+                  ))),
+        );
+      },
+    );
+  }
+
+  Widget _joinBtn() {
+    int joinMoney = 0;
+    int statusFlag = houseInfo != null ? houseInfo.statusFlag : 1;
+    int playerStatus = playerInfo != null ? playerInfo.statusFlag : 0;
+    if (!isJoin && statusFlag == 0) {
+      return Container(
+        color: BG_SUB_COLOR,
+        width: ScreenUtil().setWidth(375),
+        height: 48 + ScreenUtil().setHeight(40),
+        padding: EdgeInsets.only(top: ScreenUtil().setHeight(20), bottom: ScreenUtil().setHeight(20), left: 15, right: 15),
+        child: RaisedButton(
+            textColor: Colors.white,
+            child: Row(
+              mainAxisAlignment: MainAxisAlignment.center,
+              children: <Widget>[
+                Container(
+                    margin: EdgeInsets.only(left: 20),
+                    child: Text(
+                      '加入房间',
+                      style: TextStyle(color: Colors.white, fontSize: 16, fontWeight: FontWeight.bold),
+                    ))
+              ],
+            ),
+            onPressed: () => joinRoom()),
+      );
+    } else if (!isJoin && statusFlag == 2) {
+      return Container(
+        width: double.infinity,
+        padding: EdgeInsets.symmetric(horizontal: 15, vertical: 20),
+        height: 88,
+        child: RaisedButton(
+          disabledColor: Color(0xFF914244),
+          disabledTextColor: Color(0xFF252532),
+          child: Text(
+            '房间已经开始,加入通道关闭',
+            style: TextStyle(fontSize: 16),
+          ),
+          onPressed: null,
+        ),
+      );
+    } else if (isJoin && statusFlag == 0) {
+      int _time;
+      if (houseInfo != null) {
+        _time = houseInfo.createTime + 600000 - DateTime.now().millisecondsSinceEpoch;
+      }
+      if (houseInfo != null && houseInfo.createUser == StoreProvider.of<AppState>(context).state.userInfo.id.toString()) {
+        return Container(
+          width: double.infinity,
+          padding: EdgeInsets.symmetric(horizontal: 15, vertical: 20),
+          height: 88,
+          child: RaisedButton(
+            child: Text.rich(TextSpan(children: [
+              TextSpan(
+                text: '开始比赛',
+                style: TextStyle(fontSize: 16),
+              ),
+              TextSpan(
+                text: '(${getSecondsMIn(_time)}秒后将自动开始)',
+                style: TextStyle(fontSize: 12),
+              )
+            ])),
+            onPressed: () {
+              showCustomDialog(context, '确认要开始比赛吗?', isCancel: true, onsubmit: () {
+                print('开始');
+                startGame();
+              });
+            },
+          ),
+        );
+      } else {
+        return Container(
+          width: double.infinity,
+          padding: EdgeInsets.symmetric(horizontal: 15, vertical: 20),
+          height: 88,
+          child: RaisedButton(
+            disabledColor: Color(0xFF1990F8),
+            disabledTextColor: Color(0xFF252532),
+            child: Text(
+              '预计' + getSecondsMIn(_time) + '后开始',
+              style: TextStyle(fontSize: 16),
+            ),
+            onPressed: null,
+          ),
+        );
+      }
+    } else if (isJoin && statusFlag == 8) {
+      return Container(
+        width: double.infinity,
+        padding: EdgeInsets.symmetric(horizontal: 15, vertical: 20),
+        height: 88,
+        child: RaisedButton(
+          disabledColor: Color(0xFF1990F8),
+          disabledTextColor: Color(0xFF252532),
+          child: Text(
+            '正在努力解析视频中',
+            style: TextStyle(fontSize: 16),
+          ),
+          onPressed: null,
+        ),
+      );
+    } else if (isJoin && (statusFlag == 2 || statusFlag == 3)) {
+      int _time;
+      if (houseInfo != null) {
+        _time = houseInfo.beginTime + 3600000 - DateTime.now().millisecondsSinceEpoch;
+      }
+      return Container(
+        width: double.infinity,
+        padding: EdgeInsets.symmetric(horizontal: 15, vertical: 20),
+        height: 88,
+        child: RaisedButton(
+          disabledColor: Color(0xFF1990F8),
+          disabledTextColor: Color(0xFF252532),
+          child: Text(
+            '最迟在' + getSecondsMIn(_time) + '后结算',
+            style: TextStyle(fontSize: 16),
+          ),
+          onPressed: null,
+        ),
+      );
+    } else if (statusFlag == 4 && tabIndex == 0) {
+      return Container(
+        width: double.infinity,
+        padding: EdgeInsets.symmetric(horizontal: 15, vertical: 20),
+        height: 88,
+        child: RaisedButton(
+          disabledColor: Color(0xFF1990F8),
+          disabledTextColor: Color(0xFF15151D),
+          child: Text(
+            '已结束',
+            style: TextStyle(fontSize: 16),
+          ),
+          onPressed: null,
+        ),
+      );
+    } else if (statusFlag == 4 && tabIndex == 1) {
+      return Builder(
+        builder: (context) {
+          return Container(
+            height: 48,
+            color: SUB_COLOR,
+            child: Row(
+              children: <Widget>[
+                Container(
+                    width: 57,
+                    child: Center(
+                      child: Container(
+                          width: 22,
+                          height: 22,
+                          color: PRIMARY_COLOR,
+                          child: Center(
+                            child: Text(
+                              myRank.toString(),
+                              style: TextStyle(fontSize: 12, color: Colors.white),
+                            ),
+                          )),
+                    )),
+                Container(
+                  width: 30,
+                  height: 30,
+                  margin: EdgeInsets.only(right: 10),
+                  child: CircleAvatar(
+                    backgroundImage: NetworkImage(StoreProvider.of<AppState>(context).state.userInfo.icon),
+                  ),
+                ),
+                Expanded(
+                  flex: 1,
+                  child: Text(
+                    StoreProvider.of<AppState>(context).state.userInfo.nickname,
+                    style: TextStyle(
+                      fontSize: 14,
+                      color: Colors.white,
+                    ),
+                  ),
+                ),
+                _myUrl != null
+                    ? Container(
+                        width: 68,
+                        height: 24,
+                        margin: EdgeInsets.only(right: 10),
+                        child: OutlineButton(
+                          textColor: BG_SUB_COLOR,
+                          borderSide: BorderSide(color: BG_SUB_COLOR),
+                          padding: EdgeInsets.all(0),
+                          highlightColor: PRIMARY_COLOR.withOpacity(0.8),
+                          highlightedBorderColor: BG_SUB_COLOR,
+                          child: Text(
+                            '查看回放',
+                            style: TextStyle(fontSize: 12),
+                          ),
+                          onPressed: () {
+                            Navigator.push(context, CupertinoPageRoute(builder: (context) => VideoPlayerPage(videoUrl: _myUrl, fileType: 'file')));
+                          },
+                        ),
+                      )
+                    : Container()
+              ],
+            ),
+          );
+        },
+      );
+    } else {
+      return Container();
+    }
+  }
+}
+
+//房间的提示信息
+class TipsListContent extends StatelessWidget {
+  TipsListContent({Key key, this.tipsList, this.houseInfo}) : super(key: key);
+  final List<List<String>> tipsList;
+  final HouseInfo houseInfo;
+
+  @override
+  Widget build(BuildContext context) {
+    return Container(
+      margin: EdgeInsets.only(top: 15),
+      width: double.infinity,
+      child: Column(
+        children: _list(),
+      ),
+    );
+  }
+
+  List<Widget> _list() {
+    List<Widget> myList = [];
+    for (int i = 0; i < tipsList.length; i++) {
+      myList.add(Tips(content: tipsList[i], showTongzhi: (tipsList[i].length == 1 && i == 0) ? true : false, houseInfo: houseInfo));
+    }
+
+    return myList;
+  }
+}
+
+class Tips extends StatelessWidget {
+  Tips({Key key, this.content, this.showTongzhi, this.houseInfo}) : super(key: key);
+  final List<String> content;
+  final bool showTongzhi;
+  final HouseInfo houseInfo;
+  @override
+  Widget build(BuildContext context) {
+    return Container(
+        padding: EdgeInsets.all(15),
+        margin: EdgeInsets.fromLTRB(15, 10, 15, 0),
+        color: Color(0xFF293354),
+        child: Column(
+          children: <Widget>[
+            content.length == 1
+                ? Text(
+                    content[0],
+                    style: TextStyle(color: Colors.white, fontSize: 13),
+                  )
+                : _textList(),
+            showTongzhi
+                ? FlatButton(
+                    padding: EdgeInsets.all(0),
+                    textColor: PRIMARY_COLOR,
+                    highlightColor: Colors.transparent,
+                    splashColor: Colors.transparent,
+                    child: Text(
+                      '查看竞赛须知',
+                      style: TextStyle(
+                        decoration: TextDecoration.underline,
+                      ),
+                    ),
+                    onPressed: () {
+                      showNotice(context);
+                    },
+                  )
+                : Container()
+          ],
+        ));
+  }
+
+  Widget _textList() {
+    return Text.rich(TextSpan(
+      style: TextStyle(color: Colors.white, fontSize: 13),
+      children: [
+        TextSpan(text: content[0]),
+        TextSpan(
+          text: content[1],
+          style: TextStyle(color: PRIMARY_COLOR, fontSize: 13, fontWeight: FontWeight.bold),
+        ),
+        TextSpan(text: content[2]),
+        TextSpan(text: content[3]),
+        TextSpan(text: content[4])
+      ],
+    ));
+  }
+}
+
+//比赛结束排名
+class RankContent extends StatefulWidget {
+  RankContent({Key key, this.roomId}) : super(key: key);
+  final String roomId; // 用来储存传递过来的值
+  @override
+  RankContentState createState() => RankContentState();
+}
+
+class RankContentState extends State<RankContent> {
+  List<PlayerInfo> topList = [];
+  Future<void> getTopList() async {
+    Toast.show(context, '加载中', -1, 'loading');
+    Result res = await HttpManager.get('playerInfo/rankPage', data: {'houseId': widget.roomId, 'currentPage': 1, 'pageNumber': 3});
+    Toast.hide();
+    List<PlayerInfo> list = [];
+    if (res.success) {
+      for (var item in res.data['pp']) {
+        PlayerInfo jonPlayer = PlayerInfo.fromJson(item);
+        list.add(jonPlayer);
+      }
+    } else {}
+    setState(() {
+      topList = list;
+    });
+  }
+
+  @override
+  void initState() {
+    super.initState();
+    Future.delayed(Duration.zero, () {
+      getTopList();
+    });
+  }
+
+  @override
+  Widget build(BuildContext context) {
+    return Container(
+      width: double.infinity,
+      height: 180,
+      margin: EdgeInsets.only(top: 15),
+      child: Row(
+        mainAxisAlignment: MainAxisAlignment.center,
+        crossAxisAlignment: CrossAxisAlignment.end,
+        children: <Widget>[_rankItem(2), _rankItem(1), _rankItem(3)],
+      ),
+    );
+  }
+
+  Widget _rankItem(int _num) {
+    if (_num > topList.length) {
+      return Container(
+        width: 107,
+        height: 60,
+      );
+    }
+    List colorList = [
+      [Color(0xFFD48E00), Color(0xFFFECF01)],
+      [Color(0xFFC5C5C5), Color(0xFFE3E3E3)],
+      [Color(0xFFE77023), Color(0xFFF89E58)]
+    ];
+    return Container(
+      padding: EdgeInsets.only(left: 15, right: 15, top: _num == 1 ? 0 : 15),
+      width: 107,
+      child: Column(
+        crossAxisAlignment: CrossAxisAlignment.center,
+        children: <Widget>[
+          Container(
+            child: Stack(
+              children: <Widget>[
+                Positioned(
+                  top: 0,
+                  left: _num == 1 ? 19 : 14,
+                  child: Center(
+                    child: Image.asset(
+                      'images/icon_paihangbang_0' + '$_num.png',
+                      width: 32,
+                    ),
+                  ),
+                ),
+                Container(
+                  margin: EdgeInsets.only(top: 27, bottom: 20),
+                  width: _num == 1 ? 70 : 60,
+                  height: _num == 1 ? 70 : 60,
+                  decoration: BoxDecoration(
+                    gradient: LinearGradient(colors: colorList[_num - 1], begin: Alignment.topLeft, end: Alignment.bottomRight),
+                    borderRadius: BorderRadius.all(Radius.circular(100)),
+                  ),
+                  child: Center(
+                      child: Container(
+                    width: _num == 1 ? 60 : 50,
+                    height: _num == 1 ? 60 : 50,
+                    child: CircleAvatar(backgroundImage: NetworkImage(topList[_num - 1].userInfo.icon)),
+                  )),
+                ),
+                Positioned(
+                  bottom: 0,
+                  child: Center(
+                    child: Image.asset(
+                      'images/ph_yinpai_no' + '$_num.png',
+                      width: 67,
+                    ),
+                  ),
+                ),
+              ],
+            ),
+          ),
+          Text(
+            topList[_num - 1].userInfo.nickname,
+            style: TextStyle(
+              color: Color(0xFFFDC372),
+              fontSize: 12,
+            ),
+            overflow: TextOverflow.ellipsis,
+            textAlign: TextAlign.center,
+          ),
+          SizedBox(
+            height: 5,
+          ),
+          Row(
+            mainAxisAlignment: MainAxisAlignment.center,
+            children: <Widget>[
+              Image.asset('images/icon_jifen.png', width: 20),
+              Text('×' + (topList[_num - 1].points != null ? topList[_num - 1].points.toString() : '0'), style: TextStyle(color: PRIMARY_COLOR, fontSize: 12))
+            ],
+          )
+        ],
+      ),
+    );
+  }
+}

+ 161 - 0
lib/pages/RoomInfoDetail.dart

@@ -0,0 +1,161 @@
+import 'package:flutter/cupertino.dart';
+import 'package:flutter/material.dart';
+import 'package:wanna_battle/Constants.dart';
+import 'package:wanna_battle/styles/colors.dart';
+import 'package:wanna_battle/styles/totast.dart';
+import '../widget/VideoWidget.dart';
+import '../model/HouseInfo.dart';
+import '../widget/Dialog.dart';
+import './CompetitionNotice.dart';
+
+class RoomInfoDetail extends StatefulWidget {
+  RoomInfoDetail(this.houseInfo, {Key key}) : super(key: key);
+
+  final HouseInfo houseInfo;
+  _RoomInfoDetailState state;
+
+  void setHouseInfo(HouseInfo houseInfo) {
+    state.setHouseInfo(houseInfo);
+  }
+
+  @override
+  State<StatefulWidget> createState() {
+    state = _RoomInfoDetailState();
+    return state;
+  }
+}
+
+class _RoomInfoDetailState extends State<RoomInfoDetail> {
+  HouseInfo houseInfo;
+
+  @override
+  void initState() {
+    super.initState();
+    houseInfo = widget.houseInfo;
+  }
+
+  @override
+  Widget build(BuildContext context) {
+    return Scaffold(
+      body: Stack(
+        children: <Widget>[
+          ListView(
+            children: <Widget>[
+              houseInfo != null ? VideoWidget(videoSrc: houseInfo.video) : Container(),
+              Container(
+                height: 60,
+                padding: EdgeInsets.fromLTRB(15, 0, 15, 0),
+                child: Row(
+                  children: <Widget>[
+                    Expanded(
+                      child: Text(
+                        houseInfo.houseName,
+                        style: TextStyle(fontSize: 20, fontWeight: FontWeight.bold, color: Colors.white),
+                      ),
+                    ),
+                    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.bold, color: Color(0xFFB1B2C0)),
+                        ),
+                      ],
+                    )
+                  ],
+                ),
+              ),
+              Container(
+                height: 40,
+                margin: EdgeInsets.fromLTRB(15, 0, 15, 0),
+                color: Color(0x1A1990F8),
+                child: Row(
+                  children: <Widget>[
+                    Expanded(
+                      flex: 1,
+                      child: CupertinoButton(
+                        padding: EdgeInsets.all(0),
+                        onPressed: () {
+                          Toast.show(context, '比赛即将开始,暂不能离开房间', 1500, 'info');
+                        },
+                        child: Text(
+                          '返回锦标赛',
+                          style: TextStyle(color: PRIMARY_COLOR, fontSize: 14, fontWeight: FontWeight.bold),
+                        ),
+                      ),
+                    ),
+                    Container(
+                      width: 1,
+                      height: 12,
+                      color: PRIMARY_COLOR,
+                    ),
+                    Expanded(
+                      flex: 1,
+                      child: CupertinoButton(
+                        padding: EdgeInsets.all(0),
+                        onPressed: () {
+                          showNotice(context);
+                        },
+                        child: Text(
+                          '竞赛须知',
+                          style: TextStyle(color: PRIMARY_COLOR, fontSize: 14, fontWeight: FontWeight.bold),
+                        ),
+                      ),
+                    ),
+                  ],
+                ),
+              ),
+              Container(
+                height: 40,
+                margin: EdgeInsets.fromLTRB(15, 10, 15, 0),
+                decoration: BoxDecoration(
+                    color: Color(0x1AFFFF00),
+                    border: Border.all(
+                      width: 1,
+                      color: Colors.yellow,
+                    )),
+                child: Row(
+                  mainAxisAlignment: MainAxisAlignment.spaceAround,
+                  children: <Widget>[
+                    Text('积分 加成+0%', style: TextStyle(color: Colors.yellow, fontSize: 12)),
+                    Text('保底 0积分', style: TextStyle(color: Colors.yellow, fontSize: 12)),
+                  ],
+                ),
+              ),
+            ],
+          ),
+          Align(
+            alignment: Alignment.bottomCenter,
+            child: SafeArea(
+              child: Container(
+                height: 48,
+                margin: EdgeInsets.fromLTRB(15, 0, 15, 10),
+                color: PRIMARY_COLOR,
+              ),
+            ),
+          )
+        ],
+      ),
+    );
+  }
+
+  Widget tip() {
+    switch (houseInfo.statusFlag) {
+      case HouseStatus.WAIT:
+      case HouseStatus.READY:
+    }
+    return Container();
+  }
+
+  void setHouseInfo(HouseInfo houseInfo) {
+    setState(() {
+      this.houseInfo = houseInfo;
+    });
+  }
+}

+ 45 - 38
lib/pages/SecondRoomInfo.dart

@@ -82,38 +82,53 @@ class SecondPageState extends State<SecondPage> {
         currentPage = 1;
         currentPage = 1;
         getPlayerPage();
         getPlayerPage();
       },
       },
-      child: ListView.builder(
-          physics: AlwaysScrollableScrollPhysics(),
-          controller: _perController,
-          itemCount: joinList.length + 1,
-          itemBuilder: (BuildContext context, int index) {
-            if (index < joinList.length) {
-              return PersonItem(joinList[index], index);
-            } else {
-              return Container(
-                padding: EdgeInsets.all(15),
-                child: Text(
-                  '其他人员正在火速赶来中...',
-                  style: TextStyle(color: Colors.white30),
-                  textAlign: TextAlign.center,
-                ),
-              );
-            }
-          }),
+      child: Container(
+        color: Color(0x1A000000),
+        child: ListView.builder(
+            physics: AlwaysScrollableScrollPhysics(),
+            padding: EdgeInsets.only(top: 10),
+            controller: _perController,
+            itemCount: joinList.length + 1,
+            itemBuilder: (BuildContext context, int index) {
+              if (index < joinList.length) {
+                return playerItem(joinList[index], index);
+              } else {
+                return Container(
+                  padding: EdgeInsets.all(15),
+                  child: Text(
+                    '其他人员正在火速赶来中...',
+                    style: TextStyle(color: Colors.white30),
+                    textAlign: TextAlign.center,
+                  ),
+                );
+              }
+            }),
+      ),
     );
     );
   }
   }
 
 
-  Widget PersonItem(PlayerInfo info, int index) {
+  Widget playerItem(PlayerInfo info, int index) {
     return Container(
     return Container(
       width: double.infinity,
       width: double.infinity,
       height: 60,
       height: 60,
-      color: Color(0xFF2B2B42),
-      margin: EdgeInsets.only(top: index == 0 ? 10 : 0),
-      padding: EdgeInsets.only(left: 15, right: 15),
+      color: BG_COLOR,
+      padding: EdgeInsets.only(left: 10, right: 15),
+      margin: EdgeInsets.only(top: 1),
       child: Container(
       child: Container(
         decoration: BoxDecoration(border: Border(bottom: BorderSide(width: 1, color: BG_SUB_COLOR, style: BorderStyle.solid))),
         decoration: BoxDecoration(border: Border(bottom: BorderSide(width: 1, color: BG_SUB_COLOR, style: BorderStyle.solid))),
         child: Row(
         child: Row(
           children: <Widget>[
           children: <Widget>[
+            Container(
+              width: 57,
+              child: Center(
+                child: widget.houseInfo.statusFlag == 4 && index < 3
+                    ? Image.asset(
+                        'images/icon_paihangbang_0' + (index + 1).toString() + '.png',
+                        width: 32,
+                      )
+                    : Container(),
+              ),
+            ),
             Container(
             Container(
               margin: EdgeInsets.only(right: 12),
               margin: EdgeInsets.only(right: 12),
               width: 36,
               width: 36,
@@ -137,32 +152,24 @@ class SecondPageState extends State<SecondPage> {
               ),
               ),
             ),
             ),
             widget.houseInfo.statusFlag == 4 && index < 3 && info.video != '' && info.video != null
             widget.houseInfo.statusFlag == 4 && index < 3 && info.video != '' && info.video != null
-                ? Container(
+                ? SizedBox(
                     width: 68,
                     width: 68,
                     height: 24,
                     height: 24,
-                    margin: EdgeInsets.only(right: 30),
                     child: OutlineButton(
                     child: OutlineButton(
-                      textColor: PRIMARY_COLOR,
-                      borderSide: BorderSide(color: PRIMARY_COLOR),
                       padding: EdgeInsets.all(0),
                       padding: EdgeInsets.all(0),
-                      highlightColor: BG_SUB_COLOR.withOpacity(0.8),
-                      highlightedBorderColor: PRIMARY_COLOR,
-                      child: Text(
-                        '查看回放',
-                        style: TextStyle(fontSize: 12),
-                      ),
+                      borderSide: BorderSide(color: PRIMARY_COLOR),
+                      textColor: PRIMARY_COLOR,
+                      splashColor: PRIMARY_COLOR.withAlpha(50),
+                      child: Text('查看回放',
+                          style: TextStyle(
+                            fontSize: 12,
+                          )),
                       onPressed: () {
                       onPressed: () {
                         Navigator.push(context, CupertinoPageRoute(builder: (context) => VideoPlayerPage(videoUrl: info.video, fileType: 'netWork')));
                         Navigator.push(context, CupertinoPageRoute(builder: (context) => VideoPlayerPage(videoUrl: info.video, fileType: 'netWork')));
                       },
                       },
                     ),
                     ),
                   )
                   )
                 : Container(),
                 : Container(),
-            widget.houseInfo.statusFlag == 4 && index < 3
-                ? Image.asset(
-                    'images/icon_paihangbang_0' + (index + 1).toString() + '.png',
-                    width: 32,
-                  )
-                : Container()
           ],
           ],
         ),
         ),
       ),
       ),

+ 223 - 0
lib/pages/Shop.dart

@@ -0,0 +1,223 @@
+import 'package:flutter/material.dart';
+import '../styles/colors.dart';
+
+class Shop extends StatefulWidget {
+  @override
+  State<StatefulWidget> createState() {
+    return _ShopState();
+  }
+}
+
+class _ShopState extends State<Shop> {
+  @override
+  Widget build(BuildContext context) {
+    return Scaffold(
+      appBar: AppBar(
+        title: Text('商城'),
+        centerTitle: true,
+      ),
+      body: Container(
+        padding: EdgeInsets.all(7.5),
+        child: GridView.builder(
+          gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
+            crossAxisCount: 3,
+            childAspectRatio: 105 / 120,
+          ),
+          itemCount: 9,
+          itemBuilder: (context, index) {
+            switch (index) {
+              case 0:
+                return shopItem(
+                  icon: 'images/icon_jifen_01.png',
+                  text: '+10%积分',
+                  money: 100,
+                  color: Color(0xFF3EF166),
+                );
+              case 1:
+                return shopItem(
+                  icon: 'images/icon_jifen_02.png',
+                  text: '+20%积分',
+                  money: 300,
+                  color: Color(0xFFF2F2F2),
+                );
+              case 2:
+                return shopItem(
+                  icon: 'images/icon_jifen_03.png',
+                  text: '+40%积分',
+                  money: 500,
+                  color: Colors.yellow,
+                );
+              case 3:
+                return shopItem(
+                  icon: 'images/icon_jifen_01.png',
+                  text: '+10%积分',
+                  money: 100,
+                  color: Color(0xFF3EF166),
+                );
+              case 4:
+                return shopItem(
+                  icon: 'images/icon_jifen_02.png',
+                  text: '+20%积分',
+                  money: 300,
+                  color: Color(0xFFF2F2F2),
+                );
+              case 5:
+                return shopItem(
+                  icon: 'images/icon_jifen_03.png',
+                  text: '+40%积分',
+                  money: 500,
+                  color: Colors.yellow,
+                );
+              case 6:
+                return shopItem(
+                  icon: 'images/icon_jifen_01.png',
+                  text: '+10%积分',
+                  money: 100,
+                  color: Color(0xFF3EF166),
+                );
+              case 7:
+                return shopItem(
+                  icon: 'images/icon_jifen_02.png',
+                  text: '+20%积分',
+                  money: 300,
+                  color: Color(0xFFF2F2F2),
+                );
+              case 8:
+                return shopItem(
+                  icon: 'images/icon_jifen_03.png',
+                  text: '+40%积分',
+                  money: 500,
+                  color: Colors.yellow,
+                );
+            }
+            return shopItem(
+              icon: 'images/icon_jifen_01.png',
+              text: '+10%积分',
+              money: 100,
+              color: Color(0xFF3EF166),
+            );
+          },
+        ),
+      ),
+    );
+  }
+
+  Widget shopItem({@required String icon, @required String text, @required int money, @required Color color}) {
+    return GestureDetector(
+      child: Container(
+        padding: EdgeInsets.all(7.5),
+        height: 120,
+        child: Container(
+          color: Color(0xFF293354),
+          child: Column(
+            mainAxisAlignment: MainAxisAlignment.center,
+            children: <Widget>[
+              Image.asset(icon),
+              Text(
+                text,
+                style: TextStyle(color: color, fontSize: 10),
+              ),
+              Container(
+                margin: EdgeInsets.only(top: 16),
+                child: Row(
+                  mainAxisAlignment: MainAxisAlignment.center,
+                  children: <Widget>[
+                    Image.asset('images/icon_money.png'),
+                    Container(
+                      margin: EdgeInsets.only(left: 2),
+                      child: Text(
+                        money.toString(),
+                        style: TextStyle(
+                          color: Colors.yellow,
+                          fontSize: 14,
+                          fontWeight: FontWeight.bold,
+                        ),
+                      ),
+                    ),
+                  ],
+                ),
+              )
+            ],
+          ),
+        ),
+      ),
+      onTap: () {
+        // showModalBottomSheet(
+        //   context: context,
+        //   builder: (context) {
+        //     return Theme(
+        //       data: Theme.of(context).copyWith(canvasColor: Colors.transparent),
+        //       child: ChooseCount(),
+        //     );
+        //   },
+        // );
+      },
+    );
+  }
+}
+
+class ChooseCount extends StatefulWidget {
+  @override
+  State<StatefulWidget> createState() {
+    return ChooseCountState();
+  }
+}
+
+class ChooseCountState extends State<ChooseCount> {
+  @override
+  Widget build(BuildContext context) {
+    return Container(
+      padding: EdgeInsets.fromLTRB(16, 0, 16, 10),
+      height: 285,
+      width: double.infinity,
+      color: Colors.transparent,
+      child: Column(
+        children: <Widget>[
+          Container(
+            height: 212,
+            child: Stack(
+              children: <Widget>[
+                Align(
+                  alignment: Alignment.topCenter,
+                  child: Container(
+                    height: 197,
+                    margin: EdgeInsets.only(top: 15),
+                    color: SUB_COLOR,
+                  ),
+                ),
+                Align(
+                  alignment: Alignment.topLeft,
+                  child: Container(
+                    height: 85,
+                    width: 85,
+                    margin: EdgeInsets.fromLTRB(15, 0, 0, 0),
+                    color: SUB_COLOR,
+                  ),
+                )
+              ],
+            ),
+          ),
+          Container(
+            margin: EdgeInsets.only(top: 15),
+            child: MaterialButton(
+              highlightElevation: 0,
+              elevation: 0,
+              color: PRIMARY_COLOR,
+              height: 48,
+              minWidth: double.infinity,
+              child: Text(
+                '确定购买',
+                style: TextStyle(
+                  color: Colors.white,
+                  fontSize: 16,
+                  fontWeight: FontWeight.bold,
+                ),
+              ),
+              onPressed: () {},
+            ),
+          )
+        ],
+      ),
+    );
+  }
+}

+ 0 - 284
lib/pages/ShoppingMall.dart

@@ -1,284 +0,0 @@
-import 'package:flutter/material.dart';
-import '../styles/colors.dart';
-import '../net/HttpManager.dart';
-import '../net/Result.dart';
-import '../styles/totast.dart';
-import 'package:flutter_redux/flutter_redux.dart';
-import '../redux/AppState.dart';
-import '../model/ProductInfo.dart';
-import '../widget/Dialog.dart';
-
-class ShoppingMall extends StatefulWidget {
-  @override
-  ShoppingMallState createState() => ShoppingMallState();
-}
-
-class ShoppingMallState extends State<ShoppingMall> {
-  final List<Tab> myTabs = <Tab>[Tab(text: '金币充值'), Tab(text: '会员充值')];
-
-  @override
-  Widget build(BuildContext context) {
-    return DefaultTabController(
-      length: myTabs.length,
-      child: Scaffold(
-        appBar: AppBar(
-          backgroundColor: PRIMARY_COLOR,
-          title: Padding(
-            padding: EdgeInsets.only(right: 56),
-            child: TabBar(
-              tabs: myTabs,
-              indicatorColor: Colors.white,
-              labelColor: Colors.white,
-              indicatorSize: TabBarIndicatorSize.label,
-            ),
-          ),
-        ),
-        body: TabBarView(
-          children: <Widget>[
-            Recharge(type: 0),
-            Recharge(
-              type: 1,
-            )
-          ],
-        ),
-      ),
-    );
-  }
-}
-
-class Recharge extends StatefulWidget {
-  Recharge({Key key, this.type}) : super(key: key);
-  final int type; //类型 0 金币 1 会员
-  @override
-  RechargeState createState() => RechargeState();
-}
-
-class RechargeState extends State<Recharge> {
-  List moneyList = [100, 300, 500, 1000, 2000, 5000];
-  List vipList = [
-    {'name': 'VIP1', 'value': 100},
-    {'name': 'VIP2', 'value': 300},
-    {'name': 'VIP3', 'value': 500},
-    {'name': 'VIP4', 'value': 1000},
-    {'name': 'VIP5', 'value': 2000},
-    {'name': 'VIP6', 'value': 5000}
-  ];
-  List<ProductInfo> productInfoList = [];
-  int chooseMoney = 0;
-  ProductInfo chooseProduct;
-
-  Future<void> getInfoList() async {
-    Toast.show(context, '加载中', -1, 'loading');
-    final Result res = await HttpManager.get('productInfo/all',
-        data: {'typeFlag': widget.type});
-    Toast.hide();
-    if (res.success) {
-      for (var item in res.data) {
-        ProductInfo product;
-        product = ProductInfo.fromJson(item);
-        setState(() {
-          productInfoList.add(product);
-        });
-      }
-      if (productInfoList.isNotEmpty) {
-        setState(() {
-          chooseProduct = productInfoList[0];
-        });
-      }
-    }
-  }
-
-  Future<void> showDialog(id) async {
-    Toast.show(context, '加载中', -1, 'loading');
-    Result res = await HttpManager.get('alertMessage/getOne', data: {'id': id});
-    Toast.hide();
-    if (res.success) {
-      showCustomDialog(context, res.data['remark']);
-    }
-  }
-
-  @override
-  void initState() {
-    super.initState();
-    getInfoList();
-  }
-
-  @override
-  Widget build(BuildContext context) {
-    return Scaffold(
-      body: Container(
-        color: BG_COLOR,
-        child: ListView.builder(
-            itemCount: productInfoList.length + 1,
-            itemBuilder: (BuildContext context, int index) {
-              if (index == 0) {
-                return Padding(
-                  padding: EdgeInsets.fromLTRB(15, 15, 15, 10),
-                  child: Row(
-                    crossAxisAlignment: CrossAxisAlignment.center,
-                    mainAxisAlignment: MainAxisAlignment.center,
-                    children: <Widget>[
-                      Expanded(
-                        flex: 1,
-                        child: ShoopingBtn('images/icon_haoli.png', '更多好礼',
-                            onTapHomeMenu: () {
-                              showDialog(2);
-                            }),
-                      ),
-                      Container(
-                        width: 15,
-                      ),
-                      Expanded(
-                        flex: 1,
-                        child: ShoopingBtn('images/icon_shangwu.png', '商务合作',
-                            onTapHomeMenu: () {
-                               showDialog(3);
-                            }),
-                      ),
-                    ],
-                  ),
-                );
-              }
-              bool isChoose = false;
-              if (productInfoList[index - 1].id == chooseProduct.id) {
-                isChoose = true;
-              }
-              return Container(
-                padding: EdgeInsets.symmetric(horizontal: 15),
-                margin: EdgeInsets.only(top: 10),
-                height: 60,
-                child: FlatButton(
-                  color: Color(0xFF222335),
-                  padding: EdgeInsets.all(0),
-                  shape: Border.all(
-                      color: isChoose ? Color(0xFFC2524D) : Colors.transparent,
-                      width: 1),
-                  disabledColor: Color(0xFF222335),
-                  child: Container(
-                    child: Stack(
-                      children: <Widget>[
-                        Center(
-                          child: Row(
-                            mainAxisAlignment: MainAxisAlignment.center,
-                            children: <Widget>[
-                              Text(productInfoList[index - 1].productName,
-                                  style: TextStyle(
-                                      color: Color(0xFFFFFFFF),
-                                      fontWeight: FontWeight.w500,
-                                      fontSize: 15)),
-                              Container(
-                                width: 10,
-                              ),
-                              Text(
-                                '¥' +
-                                    productInfoList[index - 1].money.toString(),
-                                style: TextStyle(
-                                    color: Color(0xFF727785),
-                                    fontWeight: FontWeight.w400,
-                                    fontSize: 14),
-                              )
-                            ],
-                          ),
-                        ),
-                        Positioned(
-                          right: 0,
-                          bottom: 0,
-                          child: isChoose
-                              ? Image.asset('images/icon_xuanzhong.png',
-                                  width: 36)
-                              : Container(),
-                        )
-                      ],
-                    ),
-                  ),
-                  onPressed: isChoose
-                      ? null
-                      : () {
-                          setState(() {
-                            chooseProduct = productInfoList[index - 1];
-                          });
-                        },
-                ),
-              );
-            }),
-      ),
-      floatingActionButton: Container(
-        width: double.infinity,
-        padding: EdgeInsets.symmetric(horizontal: 15),
-        height: 48,
-        child: FlatButton(
-          color: PRIMARY_COLOR,
-          textColor: Colors.white,
-          child: Text('立即充值'),
-          onPressed: () async {
-            Toast.show(context, '加载中', -1, 'loading');
-            final Result res = await HttpManager.post('productInfo/buy', data: {
-              'userId': StoreProvider.of<AppState>(context).state.userInfo.id,
-              'typeFlag': widget.type,
-              'money': chooseProduct.money,
-              'id': chooseProduct.id
-            });
-            Toast.hide();
-            if (res.success) {
-              Toast.show(context, '购买成功', 1500, 'success');
-            } else {
-              Toast.show(context, res.error, 1500, 'info');
-            }
-          },
-        ),
-      ),
-      floatingActionButtonLocation: FloatingActionButtonLocation.centerFloat,
-    );
-  }
-}
-
-typedef void OnTapMenu();
-
-class ShoopingBtn extends StatelessWidget {
-  final String icon;
-  final String title;
-  final OnTapMenu onTapHomeMenu;
-  ShoopingBtn(
-    this.icon,
-    this.title, {
-    this.onTapHomeMenu,
-  });
-  @override
-  Widget build(BuildContext context) {
-    return Container(
-      height: 70,
-      decoration: BoxDecoration(
-          gradient: LinearGradient(
-              begin: Alignment.topCenter,
-              end: Alignment.bottomCenter,
-              stops: [0.0, 0.5],
-              colors: [Color(0xFF464B6A), Color(0xFF35395E)])),
-      child: Material(
-          color: Colors.transparent,
-          child: InkWell(
-            onTap: onTapHomeMenu,
-            child: Column(
-              mainAxisAlignment: MainAxisAlignment.center,
-              children: <Widget>[
-                Image.asset(
-                  icon,
-                  width: 20,
-                  height: 20,
-                ),
-                Container(
-                  height: 5,
-                ),
-                Text(
-                  title,
-                  style: TextStyle(
-                    fontSize: 13,
-                    fontWeight: FontWeight.w600,
-                    color: Color(0xFFC2524D),
-                  ),
-                )
-              ],
-            ),
-          )),
-    );
-  }
-}

+ 35 - 69
lib/pages/TipInfo.dart

@@ -12,36 +12,34 @@ import '../pages/RoomInfo.dart';
 import '../widget/SuccessfulReception.dart';
 import '../widget/SuccessfulReception.dart';
 
 
 class TipInfo extends StatefulWidget {
 class TipInfo extends StatefulWidget {
-  TipInfo({Key key, this.tipId}) : super(key: key);
-  final int tipId;
+  TipInfo({Key key, this.notice}) : super(key: key);
+  final SystemNotice notice;
   @override
   @override
   TipInfoState createState() => TipInfoState();
   TipInfoState createState() => TipInfoState();
 }
 }
 
 
 class TipInfoState extends State<TipInfo> {
 class TipInfoState extends State<TipInfo> {
-  SystemNotice tipInfo = SystemNotice.fromJson({'content': '', 'createTime': DateTime.now().microsecondsSinceEpoch});
+  SystemNotice notice;
   HouseInfo houseInfo;
   HouseInfo houseInfo;
   Future<void> getInfo() async {
   Future<void> getInfo() async {
     Toast.show(context, '加载中', -1, 'loading');
     Toast.show(context, '加载中', -1, 'loading');
-    Result res = await HttpManager.get('systemNotice/getOne', data: {'id': widget.tipId});
+    Result res = await HttpManager.get('systemNotice/getOne', data: {'id': widget.notice.id});
     Toast.hide();
     Toast.hide();
     if (res.success) {
     if (res.success) {
       setState(() {
       setState(() {
-        tipInfo = SystemNotice.fromJson(res.data);
+        notice = SystemNotice.fromJson(res.data);
       });
       });
     }
     }
 
 
-    print(tipInfo.bonus);
-
-    if (tipInfo.statusFlag == 0 && tipInfo.typeFlag != 2 && tipInfo.typeFlag != 3) {
-      HttpManager.post('systemNotice/update', data: {'id': tipInfo.id, 'statusFlag': 1});
+    if (notice.statusFlag == 0 && notice.typeFlag != 2 && notice.typeFlag != 3) {
+      HttpManager.post('systemNotice/update', data: {'id': notice.id, 'statusFlag': 1});
     }
     }
 
 
-    if (tipInfo.typeFlag == 3) {
+    if (notice.typeFlag == 3) {
       return;
       return;
     }
     }
 
 
-    Result res2 = await HttpManager.get('houseInfo/getOne', data: {'id': tipInfo.houseId});
+    Result res2 = await HttpManager.get('houseInfo/getOne', data: {'id': notice.houseId});
     if (res2.success) {
     if (res2.success) {
       setState(() {
       setState(() {
         houseInfo = HouseInfo.fromJson(res2.data);
         houseInfo = HouseInfo.fromJson(res2.data);
@@ -70,29 +68,26 @@ class TipInfoState extends State<TipInfo> {
   @override
   @override
   void initState() {
   void initState() {
     super.initState();
     super.initState();
+    notice = widget.notice;
     Future.delayed(Duration.zero, () => getInfo());
     Future.delayed(Duration.zero, () => getInfo());
   }
   }
 
 
   @override
   @override
   Widget build(BuildContext context) {
   Widget build(BuildContext context) {
-    int type = tipInfo.typeFlag != null ? tipInfo.typeFlag : 0;
-    int status = tipInfo.statusFlag ?? 0;
+    int type = notice.typeFlag != null ? notice.typeFlag : 0;
+    int status = notice.statusFlag ?? 0;
     GameInfo gameInfo;
     GameInfo gameInfo;
-    if (tipInfo.gameInfo != null) {
-      gameInfo = tipInfo.gameInfo;
+    if (notice.gameInfo != null) {
+      gameInfo = notice.gameInfo;
     }
     }
     return WillPopScope(
     return WillPopScope(
       child: Scaffold(
       child: Scaffold(
           appBar: AppBar(
           appBar: AppBar(
-            backgroundColor: PRIMARY_COLOR,
             title: Text('通知详情'),
             title: Text('通知详情'),
             centerTitle: true,
             centerTitle: true,
             elevation: 0,
             elevation: 0,
           ),
           ),
           body: Container(
           body: Container(
-            color: Color(0xFF2B2B42),
-            width: double.infinity,
-            height: double.infinity,
             child: Column(
             child: Column(
               children: <Widget>[
               children: <Widget>[
                 Padding(
                 Padding(
@@ -102,7 +97,7 @@ class TipInfoState extends State<TipInfo> {
                     children: <Widget>[
                     children: <Widget>[
                       Padding(
                       Padding(
                         padding: EdgeInsets.symmetric(vertical: 12),
                         padding: EdgeInsets.symmetric(vertical: 12),
-                        child: Text(readTimestamp(tipInfo.createTime, 'yyyy.MM.dd HH:mm:ss'), style: TextStyle(color: Colors.white24, fontSize: 13)),
+                        child: Text(readTimestamp(notice.createTime, 'yyyy.MM.dd HH:mm:ss'), style: TextStyle(color: Colors.white24, fontSize: 13)),
                       ),
                       ),
                       Container(
                       Container(
                         height: 1,
                         height: 1,
@@ -111,14 +106,14 @@ class TipInfoState extends State<TipInfo> {
                       Padding(
                       Padding(
                         padding: EdgeInsets.only(top: 10, bottom: 17),
                         padding: EdgeInsets.only(top: 10, bottom: 17),
                         child: Text(
                         child: Text(
-                          tipInfo.content,
+                          notice.content,
                           style: TextStyle(color: Colors.white, fontSize: 14),
                           style: TextStyle(color: Colors.white, fontSize: 14),
                         ),
                         ),
                       )
                       )
                     ],
                     ],
                   ),
                   ),
                 ),
                 ),
-                houseInfo != null && type != 3 ? houseItem(roomInfo: houseInfo, gameInfo: gameInfo) : Container(),
+                houseInfo != null && type != 3 ? _houseWidget() : Container(),
                 (type == 2 || type == 3)
                 (type == 2 || type == 3)
                     ? Container(
                     ? Container(
                         width: double.infinity,
                         width: double.infinity,
@@ -133,14 +128,14 @@ class TipInfoState extends State<TipInfo> {
                               ? () async {
                               ? () async {
                                   Toast.show(context, '加载中', -1, 'loading');
                                   Toast.show(context, '加载中', -1, 'loading');
                                   Result res = type == 2
                                   Result res = type == 2
-                                      ? await HttpManager.post('playerInfo/receive', data: {'id': tipInfo.playerId})
-                                      : await HttpManager.post('systemNotice/receive', data: {'id': widget.tipId});
+                                      ? await HttpManager.post('playerInfo/receive', data: {'id': notice.playerId})
+                                      : await HttpManager.post('systemNotice/receive', data: {'id': widget.notice.id});
                                   Toast.hide();
                                   Toast.hide();
                                   if (res.success) {
                                   if (res.success) {
-                                    if (tipInfo.playerInfo != null) {
-                                      showSuccess(tipInfo.playerInfo.bonus);
+                                    if (notice.playerInfo != null) {
+                                      showSuccess(notice.playerInfo.points);
                                     } else {
                                     } else {
-                                      showSuccess(tipInfo.bonus);
+                                      showSuccess(notice.bonus);
                                     }
                                     }
                                     getInfo();
                                     getInfo();
                                   } else {
                                   } else {
@@ -166,23 +161,11 @@ class TipInfoState extends State<TipInfo> {
       },
       },
     );
     );
   }
   }
-}
 
 
-class houseItem extends StatelessWidget {
-  houseItem({Key key, this.roomInfo, this.gameInfo}) : super(key: key);
-  final HouseInfo roomInfo;
-  final GameInfo gameInfo;
-  @override
-  Widget build(BuildContext context) {
+  Widget _houseWidget() {
     return Container(
     return Container(
       margin: EdgeInsets.only(bottom: 50),
       margin: EdgeInsets.only(bottom: 50),
-      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: SUB_COLOR,
       child: Material(
       child: Material(
         color: Colors.transparent,
         color: Colors.transparent,
         child: InkWell(
         child: InkWell(
@@ -191,7 +174,7 @@ class houseItem extends StatelessWidget {
             child: Row(
             child: Row(
               children: <Widget>[
               children: <Widget>[
                 Image.network(
                 Image.network(
-                  gameInfo.icon,
+                  notice.gameInfo.icon,
                   width: 48,
                   width: 48,
                   height: 48,
                   height: 48,
                 ),
                 ),
@@ -203,32 +186,15 @@ class houseItem extends StatelessWidget {
                   child: Column(
                   child: Column(
                     crossAxisAlignment: CrossAxisAlignment.start,
                     crossAxisAlignment: CrossAxisAlignment.start,
                     children: <Widget>[
                     children: <Widget>[
-                      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),
-                              )),
-                        ],
+                      Text(
+                        notice.competitionInfo.competitionName,
+                        style: TextStyle(color: Colors.white, fontSize: 14, fontWeight: FontWeight.bold),
+                        maxLines: 1,
+                        overflow: TextOverflow.ellipsis,
                       ),
                       ),
                       Text(
                       Text(
-                        roomInfo.houseAbstract,
-                        style: TextStyle(fontSize: 12, fontWeight: FontWeight.w400, color: Color(0xFF9BA0AE)),
+                        houseInfo.houseName,
+                        style: TextStyle(fontSize: 12, fontWeight:  FontWeight.normal, color: Color(0xFF9BA0AE)),
                         maxLines: 2,
                         maxLines: 2,
                         overflow: TextOverflow.ellipsis,
                         overflow: TextOverflow.ellipsis,
                       )
                       )
@@ -240,8 +206,8 @@ class houseItem extends StatelessWidget {
                   children: <Widget>[
                   children: <Widget>[
                     Image.asset('images/icon_renshu.png', width: 20),
                     Image.asset('images/icon_renshu.png', width: 20),
                     Text(
                     Text(
-                      (roomInfo.playerNumber != null ? roomInfo.playerNumber.toString() : '0') + '/' + roomInfo.maxNumber.toString(),
-                      style: TextStyle(fontSize: 14, fontWeight: FontWeight.w500, color: Color(0xFFB1B2C0)),
+                      (houseInfo.playerNumber != null ? houseInfo.playerNumber.toString() : '0') + '/' + houseInfo.maxNumber.toString(),
+                      style: TextStyle(fontSize: 14, fontWeight: FontWeight.bold, color: Color(0xFFB1B2C0)),
                     )
                     )
                   ],
                   ],
                 )
                 )
@@ -249,7 +215,7 @@ class houseItem extends StatelessWidget {
             ),
             ),
           ),
           ),
           onTap: () {
           onTap: () {
-            Navigator.push(context, CupertinoPageRoute(builder: (context) => RoomInfo(roomInfo)));
+            Navigator.push(context, CupertinoPageRoute(builder: (context) => RoomInfo(houseInfo)));
           },
           },
         ),
         ),
       ),
       ),

+ 56 - 60
lib/pages/TipList.dart

@@ -26,8 +26,11 @@ class TipListState extends State<TipList> {
     if (currentPage != 1) {
     if (currentPage != 1) {
       Toast.show(context, '加载中', -1, 'loading');
       Toast.show(context, '加载中', -1, 'loading');
     }
     }
-    Result res = await HttpManager.get('systemNotice/page',
-        data: {'userId': StoreProvider.of<AppState>(context).state.userInfo.id, 'currentPage': currentPage, 'pageNumber': 20});
+    Result res = await HttpManager.get('systemNotice/page', data: {
+      'userId': StoreProvider.of<AppState>(context).state.userInfo.id,
+      'currentPage': currentPage,
+      'pageNumber': 20,
+    });
     Toast.hide();
     Toast.hide();
     List<SystemNotice> list = tipList;
     List<SystemNotice> list = tipList;
     if (currentPage == 1) {
     if (currentPage == 1) {
@@ -70,55 +73,48 @@ class TipListState extends State<TipList> {
 
 
   @override
   @override
   Widget build(BuildContext context) {
   Widget build(BuildContext context) {
-    return WillPopScope(
-        child: Scaffold(
-            appBar: AppBar(
-              backgroundColor: PRIMARY_COLOR,
-              title: Text('通知列表'),
-              centerTitle: true,
-              elevation: 0,
-            ),
-            body: RefreshIndicator(
-              color: PRIMARY_COLOR,
-              backgroundColor: Colors.white,
-              onRefresh: () async {
-                currentPage = 1;
-                getListPage();
-              },
-              child: Container(
-                color: BG_COLOR,
-                child: ListView.builder(
-                    physics: AlwaysScrollableScrollPhysics(),
-                    controller: _mControll,
-                    itemCount: tipList.isNotEmpty ? tipList.length : 1,
-                    itemBuilder: (BuildContext context, int index) {
-                      if (tipList.isEmpty) {
-                        return Text(
-                          '数据正在火速加载中...',
-                          style: TextStyle(color: Colors.white30, fontSize: 13, height: 2),
-                          textAlign: TextAlign.center,
-                        );
+    return Scaffold(
+      appBar: AppBar(
+        title: Text('邮件列表'),
+        centerTitle: true,
+        elevation: 0,
+      ),
+      body: RefreshIndicator(
+        color: PRIMARY_COLOR,
+        backgroundColor: Colors.white,
+        onRefresh: () async {
+          currentPage = 1;
+          getListPage();
+        },
+        child: Container(
+          child: ListView.builder(
+              physics: AlwaysScrollableScrollPhysics(),
+              controller: _mControll,
+              itemCount: tipList.isNotEmpty ? tipList.length : 1,
+              itemBuilder: (BuildContext context, int index) {
+                if (tipList.isEmpty) {
+                  return Text(
+                    '数据正在火速加载中...',
+                    style: TextStyle(color: Colors.white30, fontSize: 13, height: 2),
+                    textAlign: TextAlign.center,
+                  );
+                }
+                return TipItem(
+                    tipInfo: tipList[index],
+                    tapInfo: () async {
+                      bool res = await Navigator.push(context, CupertinoPageRoute(builder: (context) => TipInfo(notice: tipList[index])));
+                      if (res != null) {
+                        setState(() {
+                          tipList = [];
+                        });
+                        currentPage = 1;
+                        getListPage();
                       }
                       }
-                      return TipItem(
-                          tipInfo: tipList[index],
-                          tapInfo: () async {
-                            bool res = await Navigator.push(context, CupertinoPageRoute(builder: (context) => TipInfo(tipId: tipList[index].id)));
-                            if (res != null) {
-                              setState(() {
-                                tipList = [];
-                              });
-                              currentPage = 1;
-                              getListPage();
-                            }
-                          });
-                    }),
-              ),
-            )),
-        onWillPop: () {
-          Toast.hide();
-          Navigator.of(context).pop(true);
-          return Future.value(false);
-        });
+                    });
+              }),
+        ),
+      ),
+    );
   }
   }
 }
 }
 
 
@@ -133,19 +129,15 @@ class TipItem extends StatelessWidget {
     return Container(
     return Container(
       // height: 108,
       // height: 108,
       margin: EdgeInsets.only(top: 10),
       margin: EdgeInsets.only(top: 10),
-      decoration: BoxDecoration(
-        gradient: LinearGradient(
-          colors: [Color(0xFF464B6A), Color(0xFF35395E)],
-          begin: Alignment.topCenter,
-          end: Alignment.bottomCenter,
-        ),
-      ),
+      color: SUB_COLOR,
       child: Material(
       child: Material(
         color: Colors.transparent,
         color: Colors.transparent,
         child: InkWell(
         child: InkWell(
           child: Padding(
           child: Padding(
             padding: EdgeInsets.symmetric(horizontal: 15),
             padding: EdgeInsets.symmetric(horizontal: 15),
             child: Column(
             child: Column(
+              mainAxisAlignment: MainAxisAlignment.center,
+              crossAxisAlignment: CrossAxisAlignment.stretch,
               children: <Widget>[
               children: <Widget>[
                 Padding(
                 Padding(
                   padding: EdgeInsets.symmetric(vertical: 12),
                   padding: EdgeInsets.symmetric(vertical: 12),
@@ -154,8 +146,8 @@ class TipItem extends StatelessWidget {
                     children: <Widget>[
                     children: <Widget>[
                       Text(readTimestamp(tipInfo.createTime, 'yyyy.MM.dd HH:mm:ss'), style: TextStyle(color: Color(0xFF9BA0AE), fontSize: 13)),
                       Text(readTimestamp(tipInfo.createTime, 'yyyy.MM.dd HH:mm:ss'), style: TextStyle(color: Color(0xFF9BA0AE), fontSize: 13)),
                       tipInfo.statusFlag == 0
                       tipInfo.statusFlag == 0
-                          ? Text('未读', style: TextStyle(color: Color(0xFFC2524D), fontSize: 13, fontWeight: FontWeight.w600))
-                          : Text('已读', style: TextStyle(color: Color(0xFF000000), fontSize: 13, fontWeight: FontWeight.w600))
+                          ? Text('未读', style: TextStyle(color: PRIMARY_COLOR, fontSize: 13, fontWeight: FontWeight.bold))
+                          : Text('已读', style: TextStyle(color: Colors.black, fontSize: 13, fontWeight: FontWeight.bold))
                     ],
                     ],
                   ),
                   ),
                 ),
                 ),
@@ -165,7 +157,11 @@ class TipItem extends StatelessWidget {
                 ),
                 ),
                 Padding(
                 Padding(
                   padding: EdgeInsets.only(top: 10, bottom: 15),
                   padding: EdgeInsets.only(top: 10, bottom: 15),
-                  child: Text(tipInfo.content, style: TextStyle(color: Colors.white, fontSize: 14)),
+                  child: Text(
+                    tipInfo.content,
+                    style: TextStyle(color: Colors.white, fontSize: 14),
+                    textAlign: TextAlign.left,
+                  ),
                 )
                 )
               ],
               ],
             ),
             ),

+ 3 - 5
lib/pages/UserChange.dart

@@ -51,10 +51,8 @@ class UserChangeState extends State<UserChange> {
           return WillPopScope(
           return WillPopScope(
               key: Key('UserChangesPage'),
               key: Key('UserChangesPage'),
               child: Scaffold(
               child: Scaffold(
-                backgroundColor: PAGE_BACKGROUND_COLOR,
                 appBar: AppBar(
                 appBar: AppBar(
-                  backgroundColor: PRIMARY_COLOR,
-                  title: Text('系统设置'),
+                  title: Text('个人设置'),
                   centerTitle: true,
                   centerTitle: true,
                   elevation: 0,
                   elevation: 0,
                 ),
                 ),
@@ -131,7 +129,7 @@ class UserChangeState extends State<UserChange> {
                           highlightColor: Color(0xFF763434),
                           highlightColor: Color(0xFF763434),
                           child: Text(
                           child: Text(
                             '退出登录',
                             '退出登录',
-                            style: TextStyle(fontSize: 16, fontWeight: FontWeight.w700),
+                            style: TextStyle(fontSize: 16, fontWeight:  FontWeight.normal),
                           ),
                           ),
                           onPressed: () async {
                           onPressed: () async {
                             Toast.show(context, '退出成功', 1500, 'success');
                             Toast.show(context, '退出成功', 1500, 'success');
@@ -321,7 +319,7 @@ class UserChangeState extends State<UserChange> {
 
 
   Widget _section(List<Widget> children) {
   Widget _section(List<Widget> children) {
     return Container(
     return Container(
-      color: CELL_COLOR,
+      color: SUB_COLOR,
       child: Column(
       child: Column(
         children: children,
         children: children,
       ),
       ),

+ 2 - 2
lib/pages/changeUserInfo.dart

@@ -66,7 +66,7 @@ class ChangeUserInfoState extends State<ChangeUserInfo> {
                               fontSize: 16,
                               fontSize: 16,
                               color: Color(0xFF727785),
                               color: Color(0xFF727785),
                             ),
                             ),
-                            textStyle: TextStyle(color: Colors.white, fontSize: 18, fontWeight: FontWeight.w500),
+                            textStyle: TextStyle(color: Colors.white, fontSize: 18, fontWeight: FontWeight.bold),
                             fieldCallBack: (content) {
                             fieldCallBack: (content) {
                               setState(() {
                               setState(() {
                                 changeText = content;
                                 changeText = content;
@@ -85,7 +85,7 @@ class ChangeUserInfoState extends State<ChangeUserInfo> {
                             highlightColor: Color(0xFF763434),
                             highlightColor: Color(0xFF763434),
                             child: Text(
                             child: Text(
                               '确定修改',
                               '确定修改',
-                              style: TextStyle(fontSize: 16, fontWeight: FontWeight.w500),
+                              style: TextStyle(fontSize: 16, fontWeight: FontWeight.bold),
                             ),
                             ),
                             onPressed: () async {
                             onPressed: () async {
                               if (changeText.isEmpty) {
                               if (changeText.isEmpty) {

+ 2 - 2
lib/pages/loginFirst.dart

@@ -46,7 +46,7 @@ class LoginFirstState extends State<LoginFirst> {
                       Image.asset('images/icon_logo.png'),
                       Image.asset('images/icon_logo.png'),
                       Container(
                       Container(
                         margin: EdgeInsets.only(top: 30),
                         margin: EdgeInsets.only(top: 30),
-                        child: Text('手机快捷登录', style: TextStyle(color: Colors.white, fontSize: 28, fontWeight: FontWeight.w500)),
+                        child: Text('手机快捷登录', style: TextStyle(color: Colors.white, fontSize: 28, fontWeight: FontWeight.bold)),
                       ),
                       ),
                       Container(
                       Container(
                           margin: EdgeInsets.only(top: 20),
                           margin: EdgeInsets.only(top: 20),
@@ -54,7 +54,7 @@ class LoginFirstState extends State<LoginFirst> {
                               autofocus: true,
                               autofocus: true,
                               keyboardType: TextInputType.phone,
                               keyboardType: TextInputType.phone,
                               maxLength: 11,
                               maxLength: 11,
-                              style: TextStyle(color: Colors.white, fontSize: 18, fontWeight: FontWeight.w500),
+                              style: TextStyle(color: Colors.white, fontSize: 18, fontWeight: FontWeight.bold),
                               decoration: InputDecoration(
                               decoration: InputDecoration(
                                   hintText: '输入手机号',
                                   hintText: '输入手机号',
                                   hintStyle: TextStyle(
                                   hintStyle: TextStyle(

+ 2 - 2
lib/pages/loginSecond.dart

@@ -61,14 +61,14 @@ class LoginSecondState extends State<LoginSecond> {
                           children: <Widget>[
                           children: <Widget>[
                             Text(
                             Text(
                               '验证码已发送至',
                               '验证码已发送至',
-                              style: TextStyle(color: Colors.white, fontSize: 28, fontWeight: FontWeight.w600),
+                              style: TextStyle(color: Colors.white, fontSize: 28, fontWeight: FontWeight.bold),
                             ),
                             ),
                             Container(
                             Container(
                               margin: EdgeInsets.only(top: 45),
                               margin: EdgeInsets.only(top: 45),
                               child: Row(
                               child: Row(
                                 mainAxisAlignment: MainAxisAlignment.spaceBetween,
                                 mainAxisAlignment: MainAxisAlignment.spaceBetween,
                                 children: <Widget>[
                                 children: <Widget>[
-                                  Text(widget.phone, style: TextStyle(color: Color(0xFFF15436), fontSize: 20, fontWeight: FontWeight.w500)),
+                                  Text(widget.phone, style: TextStyle(color: Color(0xFFF15436), fontSize: 20, fontWeight: FontWeight.bold)),
                                   FlatButton(
                                   FlatButton(
                                     highlightColor: BG_SUB_COLOR,
                                     highlightColor: BG_SUB_COLOR,
                                     textColor: PRIMARY_COLOR,
                                     textColor: PRIMARY_COLOR,

+ 81 - 152
lib/pages/myWallet.dart

@@ -1,6 +1,5 @@
 import 'package:flutter/material.dart';
 import 'package:flutter/material.dart';
 import 'package:flutter/cupertino.dart';
 import 'package:flutter/cupertino.dart';
-import 'package:flutter_screenutil/flutter_screenutil.dart';
 import '../styles/colors.dart';
 import '../styles/colors.dart';
 import 'package:redux/redux.dart';
 import 'package:redux/redux.dart';
 import 'package:flutter_redux/flutter_redux.dart';
 import 'package:flutter_redux/flutter_redux.dart';
@@ -81,134 +80,106 @@ class MyWalletState extends State<MyWallet> {
 
 
   @override
   @override
   Widget build(BuildContext context) {
   Widget build(BuildContext context) {
-    ScreenUtil.instance = ScreenUtil(width: 375, height: 667)..init(context);
     return StoreConnector<AppState, UserInfo>(
     return StoreConnector<AppState, UserInfo>(
         converter: (Store store) => store.state.userInfo,
         converter: (Store store) => store.state.userInfo,
         builder: (context, userInfo) {
         builder: (context, userInfo) {
           return Scaffold(
           return Scaffold(
-              body: RefreshIndicator(
-            color: PRIMARY_COLOR,
-            backgroundColor: Colors.white,
-            onRefresh: () async {
-              await Future.delayed(const Duration(seconds: 1));
-              setState(() {
-                walletList = [];
-                isShow = false;
-                currentPage = 1;
-              });
-              getWalletPage();
-            },
-            child: Container(
-              color: BG_COLOR,
-              child: Stack(
-                children: <Widget>[
-                  CustomScrollView(
-                    controller: _controller,
-                    slivers: <Widget>[
-                      SliverAppBar(
-                        backgroundColor: PRIMARY_COLOR,
-                        title: Text(isShow ? '余额明细' : ''),
-                        centerTitle: true,
-                        pinned: true,
-                      ),
-                      _sliverToBoxAdapter(context, userInfo),
-                      _sliverList(context),
-                    ],
-                  ),
-                  // _floatTab(context)
-                ],
+            appBar: AppBar(
+              title: Text('我的钱包'),
+              centerTitle: true,
+            ),
+            bottomNavigationBar: Container(
+              color: SUB_COLOR,
+              height: 68,
+              padding: EdgeInsets.fromLTRB(15, 10, 15, 10),
+              child: MaterialButton(
+                elevation: 0,
+                highlightElevation: 0,
+                height: 48,
+                minWidth: double.infinity,
+                color: PRIMARY_COLOR,
+                child: Text(
+                  '充值',
+                  style: TextStyle(color: Colors.white, fontSize: 16, fontWeight: FontWeight.bold),
+                ),
+                onPressed: () {
+                  Navigator.push(context, CupertinoPageRoute(builder: (context) => Recharge()));
+                },
               ),
               ),
             ),
             ),
-          ));
+            body: RefreshIndicator(
+              color: PRIMARY_COLOR,
+              backgroundColor: Colors.white,
+              onRefresh: () async {
+                await Future.delayed(const Duration(seconds: 1));
+                setState(() {
+                  walletList = [];
+                  isShow = false;
+                  currentPage = 1;
+                });
+                getWalletPage();
+              },
+              child: Container(
+                child: Stack(
+                  children: <Widget>[
+                    CustomScrollView(
+                      controller: _controller,
+                      slivers: <Widget>[
+                        _sliverToBoxAdapter(context, userInfo),
+                        _sliverList(context),
+                      ],
+                    ),
+                    // _floatTab(context)
+                  ],
+                ),
+              ),
+            ),
+          );
         });
         });
   }
   }
 
 
-//浮块
-  Widget _floatTab(BuildContext context) {
-    _topHeight = 56 + MediaQueryData.fromWindow(window).padding.top;
-    return Positioned(
-      top: isShow ? _topHeight : -46,
-      child: Container(
-        width: window.physicalSize.width / window.devicePixelRatio,
-        height: 46,
-        color: PRIMARY_COLOR,
-        child: _newRouterTab(context),
-      ),
-    );
-  }
-
   Widget _sliverToBoxAdapter(BuildContext context, UserInfo userInfo) {
   Widget _sliverToBoxAdapter(BuildContext context, UserInfo userInfo) {
     return SliverToBoxAdapter(
     return SliverToBoxAdapter(
         child: Column(
         child: Column(
       children: <Widget>[
       children: <Widget>[
         Container(
         Container(
-          alignment: Alignment.center,
-          width: double.infinity,
-          height: 194,
-          decoration: BoxDecoration(
-              //背景装饰
-              gradient: LinearGradient(
-            begin: Alignment.bottomRight,
-            colors: [Color(0xFFFFA6A2), PRIMARY_COLOR],
-          )),
-          child: Stack(
-            overflow: Overflow.visible,
+          height: 135,
+          child: Column(
+            mainAxisAlignment: MainAxisAlignment.center,
             children: <Widget>[
             children: <Widget>[
               Container(
               Container(
-                width: 216,
-                height: 192,
-                decoration: BoxDecoration(
-                    image: DecorationImage(
-                  image: AssetImage('images/img_wodeshouyi.png'),
-                  fit: BoxFit.contain,
-                )),
-                child: Column(
-                  mainAxisAlignment: MainAxisAlignment.center,
-                  children: <Widget>[
-                    Container(
-                      child: Text(userInfo.moneyCoin.toString(),
-                          style: TextStyle(
-                            color: PRIMARY_COLOR,
-                            fontSize: 51,
-                            fontWeight: FontWeight.w900,
-                          )),
-                      padding: EdgeInsets.only(top: 10),
-                    ),
-                    Row(
-                      mainAxisAlignment: MainAxisAlignment.center,
-                      children: <Widget>[
-                        Image(
-                          image: AssetImage('images/icon_jinbi_xiao_hong.png'),
-                          width: 20,
-                        ),
-                        Text('我的金币',
-                            style: TextStyle(
-                              color: PRIMARY_COLOR,
-                              fontSize: 14,
-                            ))
-                      ],
-                    )
-                  ],
-                ),
+                child: Text(userInfo.moneyCoin.toString(),
+                    style: TextStyle(
+                      color: PRIMARY_COLOR,
+                      fontSize: 51,
+                      fontWeight: FontWeight.bold,
+                    )),
+                padding: EdgeInsets.only(top: 10),
               ),
               ),
-              // Positioned(
-              //   bottom: -23,
-              //   left: -(ScreenUtil().setWidth(345) - 216) / 2,
-              //   child: Container(
-              //     width: ScreenUtil().setWidth(345),
-              //     height: 46,
-              //     color: PRIMARY_COLOR,
-              //     child: _newRouterTab(context),
-              //   ),
-              // )
+              Row(
+                mainAxisAlignment: MainAxisAlignment.center,
+                children: <Widget>[
+                  Image(
+                    image: AssetImage('images/icon_jiner.png'),
+                    width: 20,
+                  ),
+                  Text('我的金币',
+                      style: TextStyle(
+                        color: PRIMARY_COLOR,
+                        fontSize: 14,
+                      ))
+                ],
+              )
             ],
             ],
           ),
           ),
         ),
         ),
         Container(
         Container(
           width: double.infinity,
           width: double.infinity,
+          height: 56,
+          color: SUB_COLOR,
           child: Text(
           child: Text(
             '余额明细',
             '余额明细',
-            style: TextStyle(color: Colors.white, fontSize: 16, fontWeight: FontWeight.w500),
+            style: TextStyle(color: Colors.white, fontSize: 16, fontWeight: FontWeight.bold),
           ),
           ),
           padding: EdgeInsets.only(
           padding: EdgeInsets.only(
             left: 15,
             left: 15,
@@ -220,48 +191,6 @@ class MyWalletState extends State<MyWallet> {
     ));
     ));
   }
   }
 
 
-  //充值,提现
-  Widget _newRouterTab(BuildContext context) {
-    return Row(
-      children: <Widget>[
-        Expanded(
-          flex: 1,
-          child: GestureDetector(
-            child: Container(
-              padding: EdgeInsets.all(10),
-              child: Text(
-                '提现',
-                textAlign: TextAlign.center,
-                style: TextStyle(color: Colors.white, fontSize: 16, fontWeight: FontWeight.w500),
-              ),
-            ),
-            onTap: () {},
-          ),
-        ),
-        Container(
-          width: 1,
-          height: 20,
-          color: Color(0x2E000000),
-        ),
-        Expanded(
-          flex: 1,
-          child: GestureDetector(
-            child: Container(
-                padding: EdgeInsets.all(10),
-                child: Text(
-                  '充值',
-                  textAlign: TextAlign.center,
-                  style: TextStyle(color: Colors.white, fontSize: 16, fontWeight: FontWeight.w500),
-                )),
-            onTap: () {
-              Navigator.push(context, CupertinoPageRoute(builder: (context) => Rechrage()));
-            },
-          ),
-        )
-      ],
-    );
-  }
-
   Widget _sliverList(BuildContext context) {
   Widget _sliverList(BuildContext context) {
     return SliverFixedExtentList(
     return SliverFixedExtentList(
       itemExtent: 66,
       itemExtent: 66,
@@ -271,7 +200,7 @@ class MyWalletState extends State<MyWallet> {
             padding: EdgeInsets.all(15),
             padding: EdgeInsets.all(15),
             decoration: BoxDecoration(
             decoration: BoxDecoration(
               border: BorderDirectional(top: BorderSide(width: 1, color: Color(0x2E000000), style: BorderStyle.solid)),
               border: BorderDirectional(top: BorderSide(width: 1, color: Color(0x2E000000), style: BorderStyle.solid)),
-              color: BG_COLOR,
+              color: SUB_COLOR,
             ),
             ),
             child: Row(
             child: Row(
               mainAxisAlignment: MainAxisAlignment.center,
               mainAxisAlignment: MainAxisAlignment.center,
@@ -280,7 +209,7 @@ class MyWalletState extends State<MyWallet> {
                     width: 53,
                     width: 53,
                     child: Text(
                     child: Text(
                       walletList[index]['money'].toString(),
                       walletList[index]['money'].toString(),
-                      style: TextStyle(color: Colors.white, fontSize: 20, fontWeight: FontWeight.w500),
+                      style: TextStyle(color: Colors.white, fontSize: 20, fontWeight: FontWeight.bold),
                     )),
                     )),
                 Expanded(
                 Expanded(
                   flex: 1,
                   flex: 1,
@@ -291,11 +220,11 @@ class MyWalletState extends State<MyWallet> {
                         walletList[index]['remark'],
                         walletList[index]['remark'],
                         maxLines: 1,
                         maxLines: 1,
                         overflow: TextOverflow.ellipsis,
                         overflow: TextOverflow.ellipsis,
-                        style: TextStyle(color: Colors.white, fontSize: 14, fontWeight: FontWeight.w500),
+                        style: TextStyle(color: Colors.white, fontSize: 14, fontWeight: FontWeight.bold),
                       ),
                       ),
                       Text(
                       Text(
                         readTimestamp(walletList[index]['createTime'], 'yyyy-MM-dd HH:mm:ss'),
                         readTimestamp(walletList[index]['createTime'], 'yyyy-MM-dd HH:mm:ss'),
-                        style: TextStyle(color: Color(0xFF727785), fontSize: 12, fontWeight: FontWeight.w400),
+                        style: TextStyle(color: Color(0xFF727785), fontSize: 12, fontWeight: FontWeight.normal),
                       )
                       )
                     ],
                     ],
                   ),
                   ),
@@ -307,7 +236,7 @@ class MyWalletState extends State<MyWallet> {
           return Center(
           return Center(
             child: Text(
             child: Text(
               '没有更多了',
               '没有更多了',
-              style: TextStyle(color: Color(0xFF727785), fontSize: 12, fontWeight: FontWeight.w400),
+              style: TextStyle(color: Color(0xFF727785), fontSize: 12, fontWeight: FontWeight.normal),
             ),
             ),
           );
           );
         }
         }

+ 6 - 6
lib/pages/openRoom.dart

@@ -28,7 +28,7 @@ class OpenRoom extends StatefulWidget {
 
 
 class OpenRoomState extends State<OpenRoom> {
 class OpenRoomState extends State<OpenRoom> {
   TextStyle titleStyle = TextStyle(color: Colors.white, fontSize: 14);
   TextStyle titleStyle = TextStyle(color: Colors.white, fontSize: 14);
-  TextStyle valStyle = TextStyle(color: Colors.white, fontSize: 15, fontWeight: FontWeight.w500);
+  TextStyle valStyle = TextStyle(color: Colors.white, fontSize: 15, fontWeight: FontWeight.bold);
 
 
   Map<String, dynamic> editRoomInfo = {'gameId': 1, 'houseLevel': 1, 'maxNumber': 10, 'scoreType': 0};
   Map<String, dynamic> editRoomInfo = {'gameId': 1, 'houseLevel': 1, 'maxNumber': 10, 'scoreType': 0};
   List<GameInfo> gameList = [];
   List<GameInfo> gameList = [];
@@ -395,13 +395,13 @@ class OpenRoomState extends State<OpenRoom> {
                             ),
                             ),
                             Text(
                             Text(
                               '×' + (chooseLevelInfo.entryCoin ?? 0).toString(),
                               '×' + (chooseLevelInfo.entryCoin ?? 0).toString(),
-                              style: TextStyle(color: Colors.white, fontSize: 16, fontWeight: FontWeight.w500),
+                              style: TextStyle(color: Colors.white, fontSize: 16, fontWeight: FontWeight.bold),
                             ),
                             ),
                             Padding(
                             Padding(
                               padding: EdgeInsets.only(left: 20),
                               padding: EdgeInsets.only(left: 20),
                               child: Text(
                               child: Text(
                                 '创建房间',
                                 '创建房间',
-                                style: TextStyle(color: Colors.white, fontSize: 16, fontWeight: FontWeight.w500),
+                                style: TextStyle(color: Colors.white, fontSize: 16, fontWeight: FontWeight.bold),
                               ),
                               ),
                             )
                             )
                           ],
                           ],
@@ -613,11 +613,11 @@ class ChooseContent extends StatelessWidget {
                         ),
                         ),
                         Text(
                         Text(
                           '×' + (chooseLevelInfo.entryCoin ?? 0).toString(),
                           '×' + (chooseLevelInfo.entryCoin ?? 0).toString(),
-                          style: TextStyle(color: Colors.white, fontSize: 15, fontWeight: FontWeight.w500),
+                          style: TextStyle(color: Colors.white, fontSize: 15, fontWeight: FontWeight.bold),
                         )
                         )
                       ],
                       ],
                     )
                     )
-                  : Text(val ?? '', style: TextStyle(fontSize: 15, color: Colors.white, fontWeight: FontWeight.w500), textAlign: TextAlign.right),
+                  : Text(val ?? '', style: TextStyle(fontSize: 15, color: Colors.white, fontWeight: FontWeight.bold), textAlign: TextAlign.right),
             ),
             ),
             Image.asset('images/icon_inter.png', width: 24)
             Image.asset('images/icon_inter.png', width: 24)
           ],
           ],
@@ -661,7 +661,7 @@ class InputContentState extends State<InputContent> {
       child: TextField(
       child: TextField(
         controller: _controller,
         controller: _controller,
         textAlign: TextAlign.end,
         textAlign: TextAlign.end,
-        style: TextStyle(fontSize: 15, color: Colors.white, fontWeight: FontWeight.w500),
+        style: TextStyle(fontSize: 15, color: Colors.white, fontWeight: FontWeight.bold),
         maxLength: 10,
         maxLength: 10,
         decoration: InputDecoration(
         decoration: InputDecoration(
             hintText: '请输入' + widget.title,
             hintText: '请输入' + widget.title,

+ 13 - 13
lib/pages/rankList.dart

@@ -199,11 +199,11 @@ class RankListState extends State<RankList> {
                       Image.asset('images/icon_jinbi_da_bai.png', width: 20),
                       Image.asset('images/icon_jinbi_da_bai.png', width: 20),
                       Padding(
                       Padding(
                         padding: EdgeInsets.only(left: 2),
                         padding: EdgeInsets.only(left: 2),
-                        child: Text((myPlayInfo.bonus ?? 0).toString(),
+                        child: Text((myPlayInfo.points ?? 0).toString(),
                             style: TextStyle(
                             style: TextStyle(
                                 color: Colors.white,
                                 color: Colors.white,
                                 fontSize: 14,
                                 fontSize: 14,
-                                fontWeight: FontWeight.w500)),
+                                fontWeight: FontWeight.bold)),
                       ),
                       ),
                       myPlayInfo.rank == null
                       myPlayInfo.rank == null
                           ? Container()
                           ? Container()
@@ -214,7 +214,7 @@ class RankListState extends State<RankList> {
                                   style: TextStyle(
                                   style: TextStyle(
                                       color: Colors.white,
                                       color: Colors.white,
                                       fontSize: 14,
                                       fontSize: 14,
-                                      fontWeight: FontWeight.w500),
+                                      fontWeight: FontWeight.bold),
                                   textAlign: TextAlign.right),
                                   textAlign: TextAlign.right),
                             )
                             )
                     ],
                     ],
@@ -252,7 +252,7 @@ class RankListState extends State<RankList> {
                     style: TextStyle(
                     style: TextStyle(
                         color: Colors.white,
                         color: Colors.white,
                         fontSize: 13,
                         fontSize: 13,
-                        fontWeight: FontWeight.w400),
+                        fontWeight:  FontWeight.normal),
                   ),
                   ),
                   Image.asset(
                   Image.asset(
                     'images/icon_zhankai_baise.png',
                     'images/icon_zhankai_baise.png',
@@ -337,11 +337,11 @@ class RankListState extends State<RankList> {
                                   width: 20),
                                   width: 20),
                               Padding(
                               Padding(
                                 padding: EdgeInsets.only(left: 2),
                                 padding: EdgeInsets.only(left: 2),
-                                child: Text(rankList[index].bonus.toString(),
+                                child: Text(rankList[index].points.toString(),
                                     style: TextStyle(
                                     style: TextStyle(
                                       color: Colors.white,
                                       color: Colors.white,
                                       fontSize: 14,
                                       fontSize: 14,
-                                      fontWeight: FontWeight.w500,
+                                      fontWeight: FontWeight.bold,
                                     )),
                                     )),
                               )
                               )
                             ],
                             ],
@@ -364,7 +364,7 @@ class RankListState extends State<RankList> {
                               style: TextStyle(
                               style: TextStyle(
                                   color: Color(0xFF15151D),
                                   color: Color(0xFF15151D),
                                   fontSize: 12,
                                   fontSize: 12,
-                                  fontWeight: FontWeight.w500,
+                                  fontWeight: FontWeight.bold,
                                   height: 2),
                                   height: 2),
                               textAlign: TextAlign.center,
                               textAlign: TextAlign.center,
                             ),
                             ),
@@ -438,11 +438,11 @@ class RankListState extends State<RankList> {
                       child: Image.asset('images/icon_jinbi_da_bai.png',
                       child: Image.asset('images/icon_jinbi_da_bai.png',
                           width: 20),
                           width: 20),
                     ),
                     ),
-                    Text(rankList[0].bonus.toString(),
+                    Text(rankList[0].points.toString(),
                         style: TextStyle(
                         style: TextStyle(
                             color: Colors.white,
                             color: Colors.white,
                             fontSize: 14,
                             fontSize: 14,
-                            fontWeight: FontWeight.w500))
+                            fontWeight: FontWeight.bold))
                   ],
                   ],
                 )
                 )
               ],
               ],
@@ -510,11 +510,11 @@ class RankListState extends State<RankList> {
                             child: Image.asset('images/icon_jinbi_da_bai.png',
                             child: Image.asset('images/icon_jinbi_da_bai.png',
                                 width: 20),
                                 width: 20),
                           ),
                           ),
-                          Text(rankList[1].bonus.toString(),
+                          Text(rankList[1].points.toString(),
                               style: TextStyle(
                               style: TextStyle(
                                   color: Colors.white,
                                   color: Colors.white,
                                   fontSize: 14,
                                   fontSize: 14,
-                                  fontWeight: FontWeight.w500))
+                                  fontWeight: FontWeight.bold))
                         ],
                         ],
                       )
                       )
                     ],
                     ],
@@ -580,11 +580,11 @@ class RankListState extends State<RankList> {
                         child: Image.asset('images/icon_jinbi_da_bai.png',
                         child: Image.asset('images/icon_jinbi_da_bai.png',
                             width: 20),
                             width: 20),
                       ),
                       ),
-                      Text(rankList[2].bonus.toString(),
+                      Text(rankList[2].points.toString(),
                           style: TextStyle(
                           style: TextStyle(
                               color: Colors.white,
                               color: Colors.white,
                               fontSize: 14,
                               fontSize: 14,
-                              fontWeight: FontWeight.w500))
+                              fontWeight: FontWeight.bold))
                     ],
                     ],
                   )
                   )
                 ],
                 ],

+ 232 - 166
lib/pages/recharge.dart

@@ -1,196 +1,262 @@
 import 'package:flutter/material.dart';
 import 'package:flutter/material.dart';
 import '../styles/colors.dart';
 import '../styles/colors.dart';
-import 'package:flutter_screenutil/flutter_screenutil.dart';
-import 'dart:ui';
+import '../net/HttpManager.dart';
+import '../net/Result.dart';
+import '../styles/totast.dart';
+import 'package:flutter_redux/flutter_redux.dart';
+import '../redux/AppState.dart';
+import '../model/ProductInfo.dart';
+import '../widget/Dialog.dart';
 
 
-class Rechrage extends StatefulWidget {
+class Recharge extends StatefulWidget {
   @override
   @override
-  RechrageState createState() => RechrageState();
+  RechargeState createState() => RechargeState();
 }
 }
 
 
-class RechrageState extends State<Rechrage> {
-  List<Map> moenyList = [
-    {
-      'title': '10金币',
-      'money': 10,
-    },
-    {
-      'title': '50金币',
-      'money': 50,
-    },
-    {
-      'title': '100金币',
-      'money': 100,
-    },
-    {
-      'title': '300金币',
-      'money': 300,
-    },
-    {
-      'title': '500金币',
-      'money': 500,
-    }
-  ];
+class RechargeState extends State<Recharge> {
+  final List<Tab> myTabs = <Tab>[Tab(text: '金币充值'), Tab(text: '会员充值')];
+
+  @override
+  Widget build(BuildContext context) {
+    return DefaultTabController(
+      length: myTabs.length,
+      child: Scaffold(
+        appBar: AppBar(
+          title: Padding(
+            padding: EdgeInsets.only(right: 56),
+            child: TabBar(
+              tabs: myTabs,
+              indicatorColor: Colors.white,
+              labelColor: Colors.white,
+              indicatorSize: TabBarIndicatorSize.label,
+            ),
+          ),
+        ),
+        body: TabBarView(
+          children: <Widget>[
+            RechargePage(type: 0),
+            RechargePage(type: 1),
+          ],
+        ),
+      ),
+    );
+  }
+}
 
 
-  bool isInput = false;
+class RechargePage extends StatefulWidget {
+  RechargePage({Key key, this.type}) : super(key: key);
+  final int type; //类型 0 金币 1 会员
+  @override
+  RechargePageState createState() => RechargePageState();
+}
 
 
-  int choosemoeny = 0;
+class RechargePageState extends State<RechargePage> {
+  List moneyList = [100, 300, 500, 1000, 2000, 5000];
+  List vipList = [
+    {'name': 'VIP1', 'value': 100},
+    {'name': 'VIP2', 'value': 300},
+    {'name': 'VIP3', 'value': 500},
+    {'name': 'VIP4', 'value': 1000},
+    {'name': 'VIP5', 'value': 2000},
+    {'name': 'VIP6', 'value': 5000}
+  ];
+  List<ProductInfo> productInfoList = [];
+  int chooseMoney = 0;
+  ProductInfo chooseProduct;
 
 
-  bool autoChoose = false;
+  Future<void> getInfoList() async {
+    Toast.show(context, '加载中', -1, 'loading');
+    final Result res = await HttpManager.get('productInfo/all', data: {'typeFlag': widget.type});
+    Toast.hide();
+    if (res.success) {
+      for (var item in res.data) {
+        ProductInfo product;
+        product = ProductInfo.fromJson(item);
+        setState(() {
+          productInfoList.add(product);
+        });
+      }
+      if (productInfoList.isNotEmpty) {
+        setState(() {
+          chooseProduct = productInfoList[0];
+        });
+      }
+    }
+  }
 
 
-  FocusNode _focusNode = FocusNode();
+  Future<void> showDialog(id) async {
+    Toast.show(context, '加载中', -1, 'loading');
+    Result res = await HttpManager.get('alertMessage/getOne', data: {'id': id});
+    Toast.hide();
+    if (res.success) {
+      showCustomDialog(context, res.data['remark']);
+    }
+  }
 
 
   @override
   @override
   void initState() {
   void initState() {
     super.initState();
     super.initState();
-    _focusNode.addListener(_focusNodeListener);
-  }
-
-  Future<Null> _focusNodeListener() async {
-    if (_focusNode.hasFocus) {
-      setState(() {
-        if (!autoChoose) {
-          autoChoose = true;
-          choosemoeny = 0;
-        }
-        isInput = true;
-      });
-    } else {
-      setState(() {
-        isInput = false;
-      });
-    }
+    getInfoList();
   }
   }
 
 
   @override
   @override
   Widget build(BuildContext context) {
   Widget build(BuildContext context) {
-    ScreenUtil.instance = ScreenUtil(width: 375, height: 667)..init(context);
-    
     return Scaffold(
     return Scaffold(
-        appBar: AppBar(
-          backgroundColor: PRIMARY_COLOR,
-          title: Text('充值'),
-          centerTitle: true,
-          elevation: 0,
-        ),
-        body: GestureDetector(
-
-            ///透明也响应处理
-            behavior: HitTestBehavior.translucent,
-            onTap: () {
-              ///触摸手气键盘
-              FocusScope.of(context).requestFocus(FocusNode());
-            },
-            child: RefreshIndicator(
-              color: PRIMARY_COLOR,
-              backgroundColor: Colors.white,
-              onRefresh: () async {
-                await Future.delayed(const Duration(seconds: 1));
-              },
-              child: Container(
-                color: BG_COLOR,
-                child: Column(
-                  children: <Widget>[_useGride(context)],
+      body: Container(
+        color: BG_COLOR,
+        child: ListView.builder(
+            itemCount: productInfoList.length + 1,
+            itemBuilder: (BuildContext context, int index) {
+              if (index == 0) {
+                return Padding(
+                  padding: EdgeInsets.fromLTRB(15, 15, 15, 10),
+                  child: Row(
+                    crossAxisAlignment: CrossAxisAlignment.center,
+                    mainAxisAlignment: MainAxisAlignment.center,
+                    children: <Widget>[
+                      Expanded(
+                        flex: 1,
+                        child: ShoopingBtn('images/icon_haoli.png', '更多好礼', onTapHomeMenu: () {
+                          showDialog(2);
+                        }),
+                      ),
+                      Container(
+                        width: 15,
+                      ),
+                      Expanded(
+                        flex: 1,
+                        child: ShoopingBtn('images/icon_shangwu.png', '商务合作', onTapHomeMenu: () {
+                          showDialog(3);
+                        }),
+                      ),
+                    ],
+                  ),
+                );
+              }
+              bool isChoose = false;
+              if (productInfoList[index - 1].id == chooseProduct.id) {
+                isChoose = true;
+              }
+              return Container(
+                padding: EdgeInsets.symmetric(horizontal: 15),
+                margin: EdgeInsets.only(top: 10),
+                height: 60,
+                child: FlatButton(
+                  color: Color(0xFF222335),
+                  padding: EdgeInsets.all(0),
+                  shape: Border.all(color: isChoose ? Color(0xFFC2524D) : Colors.transparent, width: 1),
+                  disabledColor: Color(0xFF222335),
+                  child: Container(
+                    child: Stack(
+                      children: <Widget>[
+                        Center(
+                          child: Row(
+                            mainAxisAlignment: MainAxisAlignment.center,
+                            children: <Widget>[
+                              Text(productInfoList[index - 1].productName,
+                                  style: TextStyle(color: Color(0xFFFFFFFF), fontWeight: FontWeight.bold, fontSize: 15)),
+                              Container(
+                                width: 10,
+                              ),
+                              Text(
+                                '¥' + productInfoList[index - 1].money.toString(),
+                                style: TextStyle(color: Color(0xFF727785), fontWeight:  FontWeight.normal, fontSize: 14),
+                              )
+                            ],
+                          ),
+                        ),
+                        Positioned(
+                          right: 0,
+                          bottom: 0,
+                          child: isChoose ? Image.asset('images/icon_xuanzhong.png', width: 36) : Container(),
+                        )
+                      ],
+                    ),
+                  ),
+                  onPressed: isChoose
+                      ? null
+                      : () {
+                          setState(() {
+                            chooseProduct = productInfoList[index - 1];
+                          });
+                        },
                 ),
                 ),
-              ),
-            )));
-  }
-
-  Widget _useGride(BuildContext context) {
-    return Container(
-      padding: EdgeInsets.all(ScreenUtil().setWidth(15)),
-      width: double.infinity,
-      child: Wrap(
-        alignment: WrapAlignment.spaceBetween,
-        children: _allChooseBtn(context),
+              );
+            }),
       ),
       ),
+      floatingActionButton: Container(
+        width: double.infinity,
+        padding: EdgeInsets.symmetric(horizontal: 15),
+        height: 48,
+        child: FlatButton(
+          color: PRIMARY_COLOR,
+          textColor: Colors.white,
+          child: Text('立即充值'),
+          onPressed: () async {
+            Toast.show(context, '加载中', -1, 'loading');
+            final Result res = await HttpManager.post('productInfo/buy', data: {
+              'userId': StoreProvider.of<AppState>(context).state.userInfo.id,
+              'typeFlag': widget.type,
+              'money': chooseProduct.money,
+              'id': chooseProduct.id
+            });
+            Toast.hide();
+            if (res.success) {
+              Toast.show(context, '购买成功', 1500, 'success');
+            } else {
+              Toast.show(context, res.error, 1500, 'info');
+            }
+          },
+        ),
+      ),
+      floatingActionButtonLocation: FloatingActionButtonLocation.centerFloat,
     );
     );
   }
   }
+}
 
 
-  List<Widget> _allChooseBtn(BuildContext context) {
-    List<Widget> allWidget =
-        List<Widget>.generate(moenyList.length, (int index) {
-      return _chooseBtn(context, index);
-    });
-
-    Widget _input() {
-      return Container(
-          padding: EdgeInsets.only(left: 30, right: 5),
-          color: autoChoose ? PRIMARY_COLOR : BG_SUB_COLOR,
-          margin: EdgeInsets.only(bottom: ScreenUtil().setWidth(5)),
-          width: ScreenUtil().setWidth(170),
-          height: ScreenUtil().setWidth(60),
-          child: TextField(
-              focusNode: _focusNode,
-              textAlign: TextAlign.center,
-              keyboardType: TextInputType.number,
-              style: TextStyle(
-                fontSize: 16,
-                fontWeight: FontWeight.w500,
-                color: Colors.white,
-              ),
-              decoration: InputDecoration(
-                hintText: isInput ? '请输入金额' : '其他金额',
-                hintStyle: TextStyle(
-                    color: Colors.white,
-                    fontSize: 14,
-                    fontWeight: isInput?FontWeight.w500:FontWeight.w400),
-                suffixText: '金币',
-                suffixStyle: TextStyle(
-                    fontSize: 13,
-                    fontWeight: FontWeight.w400,
-                    color: Colors.white),
-                border: OutlineInputBorder(borderSide: BorderSide.none),
-              ),
-              onChanged: (String str) {
-                //输入监听
-                choosemoeny = int.parse(str);
-              }));
-    }
-
-    allWidget.add(_input());
-    return allWidget;
-  }
+typedef void OnTapMenu();
 
 
-  Widget _chooseBtn(BuildContext context, int index) {
-    bool isChoose = false;
-    if (!autoChoose && moenyList[index]['money'] == choosemoeny) {
-      isChoose = true;
-    }
+class ShoopingBtn extends StatelessWidget {
+  final String icon;
+  final String title;
+  final OnTapMenu onTapHomeMenu;
+  ShoopingBtn(
+    this.icon,
+    this.title, {
+    this.onTapHomeMenu,
+  });
+  @override
+  Widget build(BuildContext context) {
     return Container(
     return Container(
-      margin: EdgeInsets.only(bottom: ScreenUtil().setWidth(5)),
-      width: ScreenUtil().setWidth(170),
-      height: ScreenUtil().setWidth(60),
-      child: FlatButton(
-        color: isChoose ? PRIMARY_COLOR : BG_SUB_COLOR,
-        highlightColor: isChoose
-            ? PRIMARY_COLOR.withOpacity(0.3)
-            : BG_COLOR.withOpacity(0.3),
-        child: Column(
-          mainAxisAlignment: MainAxisAlignment.center,
-          children: <Widget>[
-            Text(moenyList[index]['title'],
-                style: TextStyle(
-                    color: Colors.white,
-                    fontSize: 14,
-                    fontWeight: FontWeight.w500,
-                    height: 1)),
-            Text('¥' + moenyList[index]['money'].toString(),
-                style: TextStyle(
-                    color: isChoose ? Colors.white : Color(0xFF727785),
+      height: 70,
+      decoration: BoxDecoration(
+          gradient: LinearGradient(begin: Alignment.topCenter, end: Alignment.bottomCenter, stops: [0.0, 0.5], colors: [Color(0xFF464B6A), Color(0xFF35395E)])),
+      child: Material(
+          color: Colors.transparent,
+          child: InkWell(
+            onTap: onTapHomeMenu,
+            child: Column(
+              mainAxisAlignment: MainAxisAlignment.center,
+              children: <Widget>[
+                Image.asset(
+                  icon,
+                  width: 20,
+                  height: 20,
+                ),
+                Container(
+                  height: 5,
+                ),
+                Text(
+                  title,
+                  style: TextStyle(
                     fontSize: 13,
                     fontSize: 13,
-                    fontWeight: FontWeight.w400,
-                    height: 18 / 13)),
-          ],
-        ),
-        onPressed: () {
-          setState(() {
-            autoChoose = false;
-            choosemoeny = moenyList[index]['money'];
-            FocusScope.of(context).requestFocus(FocusNode());
-          });
-        },
-      ),
+                    fontWeight: FontWeight.bold,
+                    color: Color(0xFFC2524D),
+                  ),
+                )
+              ],
+            ),
+          )),
     );
     );
   }
   }
 }
 }

+ 4 - 4
lib/pages/roomList.dart

@@ -177,7 +177,7 @@ class RoomListState extends State<RoomList> {
                 flex: 1,
                 flex: 1,
                 child: Text(
                 child: Text(
                   gameInfo['gameName'],
                   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.bold),
                   overflow: TextOverflow.ellipsis,
                   overflow: TextOverflow.ellipsis,
                   textAlign: TextAlign.center,
                   textAlign: TextAlign.center,
                 ),
                 ),
@@ -230,7 +230,7 @@ class RoomListState extends State<RoomList> {
                 flex: 1,
                 flex: 1,
                 child: Text(
                 child: Text(
                   levelInfo['levelName'],
                   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.bold),
                   overflow: TextOverflow.ellipsis,
                   overflow: TextOverflow.ellipsis,
                   textAlign: TextAlign.center,
                   textAlign: TextAlign.center,
                 ),
                 ),
@@ -283,7 +283,7 @@ class RoomListState extends State<RoomList> {
                 flex: 1,
                 flex: 1,
                 child: Text(
                 child: Text(
                   typeInfo['name'],
                   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.bold),
                   overflow: TextOverflow.ellipsis,
                   overflow: TextOverflow.ellipsis,
                   textAlign: TextAlign.center,
                   textAlign: TextAlign.center,
                 ),
                 ),
@@ -336,7 +336,7 @@ class RoomListState extends State<RoomList> {
                 flex: 1,
                 flex: 1,
                 child: Text(
                 child: Text(
                   statusInfo['name'],
                   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.bold),
                   overflow: TextOverflow.ellipsis,
                   overflow: TextOverflow.ellipsis,
                   textAlign: TextAlign.center,
                   textAlign: TextAlign.center,
                 ),
                 ),

+ 1 - 3
lib/pages/setting.dart

@@ -46,9 +46,7 @@ class SettingState extends State<Setting> {
           return WillPopScope(
           return WillPopScope(
               key: Key('SettingsPage'),
               key: Key('SettingsPage'),
               child: Scaffold(
               child: Scaffold(
-                backgroundColor: PAGE_BACKGROUND_COLOR,
                 appBar: AppBar(
                 appBar: AppBar(
-                  backgroundColor: PRIMARY_COLOR,
                   title: Text('系统设置'),
                   title: Text('系统设置'),
                   centerTitle: true,
                   centerTitle: true,
                   elevation: 0,
                   elevation: 0,
@@ -110,7 +108,7 @@ class SettingState extends State<Setting> {
                           highlightColor: Color(0xFF763434),
                           highlightColor: Color(0xFF763434),
                           child: Text(
                           child: Text(
                             '退出登录',
                             '退出登录',
-                            style: TextStyle(fontSize: 16, fontWeight: FontWeight.w700),
+                            style: TextStyle(fontSize: 16, fontWeight:  FontWeight.normal),
                           ),
                           ),
                           onPressed: () async {
                           onPressed: () async {
                             Toast.show(context, '退出成功', 1500, 'success');
                             Toast.show(context, '退出成功', 1500, 'success');

+ 1 - 1
lib/widget/CheckinDialog.dart

@@ -210,7 +210,7 @@ class _CheckinDialogState extends State<_CheckinDialog> {
           ),
           ),
           child: Center(
           child: Center(
             child: Text(
             child: Text(
-              '��签到',
+              '签到',
               style: TextStyle(color: Colors.white, fontSize: 10),
               style: TextStyle(color: Colors.white, fontSize: 10),
             ),
             ),
           ),
           ),

+ 1 - 1
lib/widget/Dialog.dart

@@ -53,7 +53,7 @@ class LoadingDialog extends Dialog {
                       child: Column(
                       child: Column(
                         mainAxisAlignment: MainAxisAlignment.center,
                         mainAxisAlignment: MainAxisAlignment.center,
                         children: <Widget>[
                         children: <Widget>[
-                          Text(title ?? '提示', style: TextStyle(color: Colors.white, fontSize: 18, fontWeight: FontWeight.w600)),
+                          Text(title ?? '提示', style: TextStyle(color: Colors.white, fontSize: 18, fontWeight: FontWeight.bold)),
                           Container(
                           Container(
                             height: 20,
                             height: 20,
                           ),
                           ),

+ 7 - 9
lib/widget/HomeDrawer.dart

@@ -12,6 +12,7 @@ import '../net/HttpManager.dart';
 import '../net/Result.dart';
 import '../net/Result.dart';
 import '../redux/UserRedux.dart';
 import '../redux/UserRedux.dart';
 import '../pages/UserChange.dart';
 import '../pages/UserChange.dart';
+import '../styles/colors.dart';
 
 
 class HomeDrawer extends StatefulWidget {
 class HomeDrawer extends StatefulWidget {
   @override
   @override
@@ -39,11 +40,7 @@ class HomeDrawerState extends State<HomeDrawer> {
       builder: (context, userInfo) {
       builder: (context, userInfo) {
         return Drawer(
         return Drawer(
             child: Container(
             child: Container(
-          decoration: BoxDecoration(
-              gradient: LinearGradient(
-            begin: Alignment.bottomRight,
-            colors: [Color(0xFF3D3E6C), Color(0xFF626C85)],
-          )),
+          color: SUB_COLOR,
           child: Column(
           child: Column(
             children: <Widget>[
             children: <Widget>[
               Container(
               Container(
@@ -74,22 +71,23 @@ class HomeDrawerState extends State<HomeDrawer> {
                           children: <Widget>[
                           children: <Widget>[
                             Text(
                             Text(
                               userInfo.nickname,
                               userInfo.nickname,
-                              style: TextStyle(fontSize: 27, color: Colors.white, fontWeight: FontWeight.w700),
+                              style: TextStyle(fontSize: 27, color: Colors.white, fontWeight: FontWeight.normal),
                             ),
                             ),
                             Row(
                             Row(
                               mainAxisAlignment: MainAxisAlignment.center,
                               mainAxisAlignment: MainAxisAlignment.center,
+                              crossAxisAlignment: CrossAxisAlignment.center,
                               children: <Widget>[
                               children: <Widget>[
                                 Container(
                                 Container(
                                   margin: EdgeInsets.only(right: 4),
                                   margin: EdgeInsets.only(right: 4),
                                   child: SizedBox(
                                   child: SizedBox(
                                     width: 20,
                                     width: 20,
                                     height: 20,
                                     height: 20,
-                                    child: Image.asset('images/icon_jinbi_da_bai.png'),
+                                    child: Image.asset('images/icon_jiner.png'),
                                   ),
                                   ),
                                 ),
                                 ),
                                 Text(
                                 Text(
                                   userInfo.moneyCoin.toString(),
                                   userInfo.moneyCoin.toString(),
-                                  style: TextStyle(fontSize: 16, color: Colors.white, fontWeight: FontWeight.w700),
+                                  style: TextStyle(fontSize: 16, color: Colors.white, fontWeight: FontWeight.normal),
                                 )
                                 )
                               ],
                               ],
                             ),
                             ),
@@ -186,7 +184,7 @@ class DrawerMenu extends StatelessWidget {
                 margin: EdgeInsets.only(left: 16),
                 margin: EdgeInsets.only(left: 16),
                 child: Text(
                 child: Text(
                   title,
                   title,
-                  style: TextStyle(color: Colors.white, fontSize: 15, fontWeight: FontWeight.w700),
+                  style: TextStyle(color: Colors.white, fontSize: 15, fontWeight: FontWeight.normal),
                 ),
                 ),
               ),
               ),
             ),
             ),

+ 3 - 3
lib/widget/RoomItem.dart

@@ -49,7 +49,7 @@ class HouseItem extends StatelessWidget {
                             maxWidth: 170,
                             maxWidth: 170,
                             child: Text(
                             child: Text(
                               roomInfo.houseName,
                               roomInfo.houseName,
-                              style: TextStyle(color: Colors.white, fontSize: 14, fontWeight: FontWeight.w500),
+                              style: TextStyle(color: Colors.white, fontSize: 14, fontWeight: FontWeight.bold),
                               maxLines: 1,
                               maxLines: 1,
                               overflow: TextOverflow.ellipsis,
                               overflow: TextOverflow.ellipsis,
                             ),
                             ),
@@ -70,7 +70,7 @@ class HouseItem extends StatelessWidget {
                       ),
                       ),
                       Text(
                       Text(
                         roomInfo.houseAbstract ?? '',
                         roomInfo.houseAbstract ?? '',
-                        style: TextStyle(fontSize: 12, fontWeight: FontWeight.w400, color: Color(0xFF9BA0AE)),
+                        style: TextStyle(fontSize: 12, fontWeight:  FontWeight.normal, color: Color(0xFF9BA0AE)),
                         maxLines: 2,
                         maxLines: 2,
                         overflow: TextOverflow.ellipsis,
                         overflow: TextOverflow.ellipsis,
                       )
                       )
@@ -83,7 +83,7 @@ class HouseItem extends StatelessWidget {
                     Image.asset('images/icon_renshu.png', width: 20),
                     Image.asset('images/icon_renshu.png', width: 20),
                     Text(
                     Text(
                       (roomInfo.playerNumber != null ? roomInfo.playerNumber.toString() : '0') + '/' + roomInfo.maxNumber.toString(),
                       (roomInfo.playerNumber != null ? roomInfo.playerNumber.toString() : '0') + '/' + roomInfo.maxNumber.toString(),
-                      style: TextStyle(fontSize: 14, fontWeight: FontWeight.w500, color: Color(0xFFB1B2C0)),
+                      style: TextStyle(fontSize: 14, fontWeight: FontWeight.bold, color: Color(0xFFB1B2C0)),
                     )
                     )
                   ],
                   ],
                 )
                 )

+ 2 - 2
lib/widget/SuccessfulReception.dart

@@ -45,7 +45,7 @@ class SuccessfulReceptionState extends State<SuccessfulReception> {
                           style: TextStyle(
                           style: TextStyle(
                               color: Color(0xFFFDC372),
                               color: Color(0xFFFDC372),
                               fontSize: 18,
                               fontSize: 18,
-                              fontWeight: FontWeight.w600)),
+                              fontWeight: FontWeight.bold)),
                       Row(
                       Row(
                         mainAxisAlignment: MainAxisAlignment.center,
                         mainAxisAlignment: MainAxisAlignment.center,
                         children: <Widget>[
                         children: <Widget>[
@@ -55,7 +55,7 @@ class SuccessfulReceptionState extends State<SuccessfulReception> {
                               style: TextStyle(
                               style: TextStyle(
                                   color: Color(0xFFC2524D),
                                   color: Color(0xFFC2524D),
                                   fontSize: 32,
                                   fontSize: 32,
-                                  fontWeight: FontWeight.w900))
+                                  fontWeight: FontWeight.bold))
                         ],
                         ],
                       )
                       )
                     ],
                     ],

+ 6 - 11
lib/widget/VideoWidget.dart

@@ -11,8 +11,7 @@ class VideoWidget extends StatefulWidget {
 
 
 class VideoWidgetState extends State<VideoWidget> {
 class VideoWidgetState extends State<VideoWidget> {
   VideoPlayerController _controller;
   VideoPlayerController _controller;
-  String _defaultVideo =
-      'http://oss.izouma.com/shouyoudianjing/video/2019-03-01-11-19-41-ivqsgiy9.mp4';
+  String _defaultVideo = 'http://oss.izouma.com/shouyoudianjing/video/2019-03-01-11-19-41-ivqsgiy9.mp4';
   bool isVideo = true;
   bool isVideo = true;
   bool showVideo = false;
   bool showVideo = false;
   bool isPlay = false;
   bool isPlay = false;
@@ -30,10 +29,6 @@ class VideoWidgetState extends State<VideoWidget> {
       }
       }
     }
     }
 
 
-    print('**********');
-    print(isVideo);
-    print(_defaultVideo);
-    print(widget.videoSrc);
     if (isVideo) {
     if (isVideo) {
       _controller = VideoPlayerController.network(_defaultVideo)
       _controller = VideoPlayerController.network(_defaultVideo)
         ..initialize().then((_) {
         ..initialize().then((_) {
@@ -100,7 +95,9 @@ class VideoWidgetState extends State<VideoWidget> {
                         )
                         )
                       : Image.network(
                       : Image.network(
                           'http://images.liqucn.com/img/h22/h70/img_localize_8e824debdd9ee29522690f36680e2d8e_600x337.png',
                           'http://images.liqucn.com/img/h22/h70/img_localize_8e824debdd9ee29522690f36680e2d8e_600x337.png',
-                          width: double.infinity),
+                          width: double.infinity,
+                          fit: BoxFit.cover,
+                        ),
                 ),
                 ),
                 onTap: () => playVideo()),
                 onTap: () => playVideo()),
             !isPlay
             !isPlay
@@ -114,14 +111,12 @@ class VideoWidgetState extends State<VideoWidget> {
                           width: 44,
                           width: 44,
                           height: 44,
                           height: 44,
                           child: RaisedButton(
                           child: RaisedButton(
-                            shape: RoundedRectangleBorder(
-                                borderRadius: BorderRadius.circular(44)),
+                            shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(44)),
                             padding: EdgeInsets.all(0),
                             padding: EdgeInsets.all(0),
                             color: Colors.black87,
                             color: Colors.black87,
                             textColor: Colors.white,
                             textColor: Colors.white,
                             onPressed: () => playVideo(),
                             onPressed: () => playVideo(),
-                            child:
-                                Icon(isPlay ? Icons.pause : Icons.play_arrow),
+                            child: Icon(isPlay ? Icons.pause : Icons.play_arrow),
                           ),
                           ),
                         ),
                         ),
                       ),
                       ),

+ 14 - 0
pubspec.lock

@@ -188,6 +188,13 @@ packages:
       url: "https://pub.dartlang.org"
       url: "https://pub.dartlang.org"
     source: hosted
     source: hosted
     version: "0.3.2"
     version: "0.3.2"
+  flutter_html:
+    dependency: "direct main"
+    description:
+      name: flutter_html
+      url: "https://pub.dartlang.org"
+    source: hosted
+    version: "0.10.1+hotfix.1"
   flutter_localizations:
   flutter_localizations:
     dependency: "direct main"
     dependency: "direct main"
     description: flutter
     description: flutter
@@ -532,6 +539,13 @@ packages:
       url: "https://pub.dartlang.org"
       url: "https://pub.dartlang.org"
     source: hosted
     source: hosted
     version: "1.5.5"
     version: "1.5.5"
+  sprintf:
+    dependency: "direct main"
+    description:
+      name: sprintf
+      url: "https://pub.dartlang.org"
+    source: hosted
+    version: "4.0.2"
   sqflite:
   sqflite:
     dependency: transitive
     dependency: transitive
     description:
     description:

+ 2 - 0
pubspec.yaml

@@ -38,6 +38,8 @@ dependencies:
     path: ./ttdj_plugin
     path: ./ttdj_plugin
   cached_network_image: ^0.8.0
   cached_network_image: ^0.8.0
   gradient_text: ^1.0.2
   gradient_text: ^1.0.2
+  sprintf: ^4.0.2
+  flutter_html: ^0.10.1+hotfix.1
 
 
 dev_dependencies:
 dev_dependencies:
   build_runner: ^1.1.1
   build_runner: ^1.1.1