panhui 6 éve
szülő
commit
ea8eb9b7e3

BIN
images/2x/icon_shangchuan.png


BIN
images/2x/shili_img_01.png


BIN
images/2x/shili_img_02.png


BIN
images/3x/icon_shangchuan.png


BIN
images/3x/shili_img_01.png


BIN
images/3x/shili_img_02.png


BIN
images/icon_shangchuan.png


BIN
images/shili_img_01.png


BIN
images/shili_img_02.png


+ 6 - 1
lib/model/PlayerInfo.dart

@@ -8,7 +8,7 @@ part 'PlayerInfo.g.dart';
 @JsonSerializable()
 class 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.platinum,this.gold,this.silver,this.bronze,this.medal);
+      this.id, this.houseId, this.userId, this.statusFlag, this.userInfo,this.bonus,this.gameInfo,this.houseInfo,this.rank,this.houseRank,this.video,this.platinum,this.gold,this.silver,this.bronze,this.medal,this.liveTime,this.score,this.ranking,this.beginTime,this.endTime);
   int id;
   int houseId; //房间id
   int userId; //用户id
@@ -25,6 +25,11 @@ class PlayerInfo {
   int  silver;//银牌
   int bronze;//铜牌
   String medal;//奖牌
+  num liveTime;//存活时间
+  num score;//评分
+  int ranking;//是否吃鸡 1吃鸡
+  int beginTime;//开始比赛时间
+  int endTime;//结束比赛时间
   
   factory PlayerInfo.fromJson(Map<String, dynamic> json) =>
       _$PlayerInfoFromJson(json);

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

@@ -12,16 +12,10 @@ PlayerInfo _$PlayerInfoFromJson(Map<String, dynamic> json) {
       json['houseId'] as int,
       json['userId'] as int,
       json['statusFlag'] as int,
-      json['userInfo'] == null
-          ? null
-          : UserInfo.fromJson(json['userInfo'] as Map<String, dynamic>),
+      json['userInfo'] == null ? null : UserInfo.fromJson(json['userInfo'] as Map<String, dynamic>),
       json['bonus'] as int,
-      json['gameInfo'] == null
-          ? null
-          : GameInfo.fromJson(json['gameInfo'] as Map<String, dynamic>),
-      json['houseInfo'] == null
-          ? null
-          : HouseInfo.fromJson(json['houseInfo'] as Map<String, dynamic>),
+      json['gameInfo'] == null ? null : GameInfo.fromJson(json['gameInfo'] as Map<String, dynamic>),
+      json['houseInfo'] == null ? null : HouseInfo.fromJson(json['houseInfo'] as Map<String, dynamic>),
       json['rank'] as int,
       json['houseRank'] as int,
       json['video'] as String,
@@ -29,11 +23,15 @@ PlayerInfo _$PlayerInfoFromJson(Map<String, dynamic> json) {
       json['gold'] as int,
       json['silver'] as int,
       json['bronze'] as int,
-      json['medal'] as String);
+      json['medal'] as String,
+      json['liveTime'] == null ? null : (json['liveTime'] as num),
+      json['score'] == null ? 0 : (json['score'] as num),
+      json['ranking'] == null ? 0 : (json['ranking'] as int),
+      json['beginTime'] as int,
+      json['endTime'] as int);
 }
 
-Map<String, dynamic> _$PlayerInfoToJson(PlayerInfo instance) =>
-    <String, dynamic>{
+Map<String, dynamic> _$PlayerInfoToJson(PlayerInfo instance) => <String, dynamic>{
       'id': instance.id,
       'houseId': instance.houseId,
       'userId': instance.userId,
@@ -49,5 +47,7 @@ Map<String, dynamic> _$PlayerInfoToJson(PlayerInfo instance) =>
       'gold': instance.gold,
       'silver': instance.silver,
       'bronze': instance.bronze,
-      'medal': instance.medal
+      'medal': instance.medal,
+      'beginTime': instance.beginTime,
+      'endTime': instance.endTime
     };

+ 1 - 0
lib/pages/Appeal.dart

@@ -33,6 +33,7 @@ class AppealState extends State<Appeal> {
         return Future.value(true);
       },
       child: Scaffold(
+        backgroundColor: Color(0xFF3A3D5C),
         appBar: AppBar(
           title: Text('上传比赛结果'),
           centerTitle: true,

+ 40 - 17
lib/pages/ChoosePay.dart

@@ -8,6 +8,10 @@ import '../redux/AppState.dart';
 import '../model/ProductInfo.dart';
 import '../redux/UserRedux.dart';
 import '../model/UserInfo.dart';
+import 'package:fluwx/fluwx.dart' as fluwx;
+import 'package:get_ip/get_ip.dart';
+import 'package:dio/dio.dart';
+import 'dart:convert';
 
 class ChoosePay extends StatefulWidget {
   ChoosePay(this.type, this.chooseProduct);
@@ -18,7 +22,7 @@ class ChoosePay extends StatefulWidget {
 }
 
 class _ChoosePayState extends State<ChoosePay> with WidgetsBindingObserver {
-  String chooseKey = 'alipay';
+  String chooseKey = 'wxpay';
   Future<void> getUserInfo() async {
     Result res = await HttpManager.get('userInfo/getUserInfo');
     if (res.success) {
@@ -30,6 +34,7 @@ class _ChoosePayState extends State<ChoosePay> with WidgetsBindingObserver {
   @override
   void initState() {
     super.initState();
+    fluwx.register(appId: "wx62f8a9c1d3d70245");
     Future.delayed(Duration.zero, () => getUserInfo());
   }
 
@@ -61,11 +66,11 @@ class _ChoosePayState extends State<ChoosePay> with WidgetsBindingObserver {
                 ],
               ),
             ),
-            PayContent('支付宝', '支持有支付宝,网银的用户使用', 'images/icon_zhifubao.png', 'alipay', chooseKey, () {
-              setState(() {
-                chooseKey = 'alipay';
-              });
-            }),
+            // PayContent('支付宝', '支持有支付宝,网银的用户使用', 'images/icon_zhifubao.png', 'alipay', chooseKey, () {
+            //   setState(() {
+            //     chooseKey = 'alipay';
+            //   });
+            // }),
             PayContent('微信支付', '使用微信支付,方便快捷', 'images/icon_weixin.png', 'wxpay', chooseKey, () {
               setState(() {
                 chooseKey = 'wxpay';
@@ -83,21 +88,39 @@ class _ChoosePayState extends State<ChoosePay> with WidgetsBindingObserver {
           textColor: Colors.white,
           child: Text('立即支付'),
           onPressed: () async {
-            Toast.show(context, '加载中', -1, 'loading');
-            final Result res = await HttpManager.post('productInfo/buy', data: {
+            String ipAddress = await GetIp.ipAddress;
+            print(ipAddress);
+            final Result res = await HttpManager.get('lyf/appUnifiedOrder', data: {
               'userId': StoreProvider.of<AppState>(context).state.userInfo.id,
-              'typeFlag': widget.type,
-              'money': widget.chooseProduct.money,
-              'id': widget.chooseProduct.id
+              // 'typeFlag': widget.type,
+              'ip': ipAddress,
+              'productId': widget.chooseProduct.id
             });
-            Toast.hide();
+            print( StoreProvider.of<AppState>(context).state.userInfo.id);
             if (res.success) {
-              Toast.show(context, '购买成功', 1500, 'success');
-              getUserInfo();
-              Navigator.of(context).pop();
-            } else {
-              Toast.show(context, res.error, 1500, 'info');
+                fluwx.launchMiniProgram(username: "gh_a6a98cd9b3cd",path:"page/component/confirm/index?data="+res.data);
             }
+
+         
+            
+          //  String str= 'eyJhbW91bnQiOiIxIiwiYXR0YWNoIjoie1widG90YWxcIjoxLFwicHJvZHVjdElkXCI6XCIxXCIsXCJ1c2VySWRcIjpcIjg0NzA1XCIsXCJjYXNoXCI6MTB9IiwiYm9keSI6IjHpl6jnpagiLCJtY2hfaWQiOiIxMDAwMDAwODM1NDEiLCJub25jZV9zdHIiOiI1MjM2OGU0NjRkNDI0MTYwODdjZmZjNzVjODg0MDljZCIsIm5vdGlmeV91cmwiOiJodHRwOi8vMTIzLjU4LjI0MC4xMzg6OTAwMC8iLCJvdXRfdHJhZGVfbm8iOiIxNTY0NzM5OTc0MTM4ODE4OTQyOSIsInBheW1lbnRfdHlwZSI6InRyYWRlLndlaXhpbi5hcHAiLCJyZXR1cm5fdXJsIjoiaHR0cDovLzEyMy41OC4yNDAuMTM4OjkwMDAvbHlmL25vdGlmeSIsInNpZ24iOiIyN2RjMTY2OTE4YzRkY2E0NjAyOWQ4YzllNDhhYjdmMiIsInNpZ25fdHlwZSI6Ik1ENSIsInNwYmlsbF9jcmVhdGVfaXAiOiIxMjcuMC4wLjEifQ==';
+
+            // fluwx.launchMiniProgram(username: "gh_a6a98cd9b3cd",path:"page/component/confirm/index?data="+str);
+            // 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': widget.chooseProduct.money,
+            //   'id': widget.chooseProduct.id
+            // });
+            // Toast.hide();
+            // if (res.success) {
+            //   Toast.show(context, '购买成功', 1500, 'success');
+            //   getUserInfo();
+            //   Navigator.of(context).pop();
+            // } else {
+            //   Toast.show(context, res.error, 1500, 'info');
+            // }
           },
         ),
       ),

+ 61 - 52
lib/pages/CompetitionInformation.dart

@@ -32,11 +32,9 @@ class CompetitionInformationState extends State<CompetitionInformation> {
                     layout: SwiperLayout.DEFAULT,
                     itemWidth: 270.0,
                     itemHeight: 422.0,
-                    control: SwiperControl(
-                        color: Theme.of(context).primaryColor,
-                        disableColor: Colors.transparent),
+                    control: SwiperControl(color: Theme.of(context).primaryColor, disableColor: Colors.transparent),
                     index: nowSwiperIndex,
-                    itemCount: 3,
+                    itemCount: 4,
                     scrollDirection: Axis.horizontal,
                     loop: false,
                     itemBuilder: (context, index) {
@@ -61,8 +59,7 @@ class CompetitionInformationState extends State<CompetitionInformation> {
 typedef OnTapHomeMenu = void Function();
 
 class InfoBox extends StatelessWidget {
-  InfoBox({Key key, this.typeIndex, this.next, this.end, this.houseInfo})
-      : super(key: key);
+  InfoBox({Key key, this.typeIndex, this.next, this.end, this.houseInfo}) : super(key: key);
   final int typeIndex;
   final OnTapHomeMenu next;
   final OnTapHomeMenu end;
@@ -74,9 +71,7 @@ class InfoBox extends StatelessWidget {
         child: Container(
       width: 270,
       height: 422,
-      decoration: BoxDecoration(
-          border: Border.all(width: 1, color: Theme.of(context).primaryColor),
-          color: Colors.black),
+      decoration: BoxDecoration(border: Border.all(width: 1, color: Theme.of(context).primaryColor), color: Colors.black),
       child: Stack(
         children: <Widget>[
           Container(
@@ -84,12 +79,8 @@ class InfoBox extends StatelessWidget {
             padding: EdgeInsets.only(top: 25),
             child: Column(
               children: <Widget>[
-                Text('竞赛须知 ' + typeIndex.toString() + '/3',
-                    style: TextStyle(
-                        color: Color(0xFFFDC372),
-                        fontSize: 20,
-                        fontWeight: FontWeight.w600)),
-                _centerContent(typeIndex,context)
+                Text('竞赛须知 ' + typeIndex.toString() + '/4', style: TextStyle(color: Color(0xFFFDC372), fontSize: 20, fontWeight: FontWeight.w600)),
+                _centerContent(typeIndex, context)
               ],
             ),
           ),
@@ -115,21 +106,19 @@ class InfoBox extends StatelessWidget {
             child: Column(
               children: <Widget>[
                 Container(
-                  width: 220,
-                  height: 36,
-                  child:
-                  LinearButton(
-                    btntext: typeIndex != 3 ? '下一个' : '知道了',
-                    onTapHomeMenu:typeIndex != 3 ? next : end ,
-                    
-                  )
-                  //  RaisedButton(
-                  //   textColor: Colors.white,
-                  //   child: Text(typeIndex != 4 ? '下一个' : '结束'),
-                  //   onPressed: typeIndex != 4 ? next : end,
-                  // ),
-                ),
-                FlatButton(
+                    width: 220,
+                    height: 36,
+                    child: LinearButton(
+                      btntext: typeIndex != 4 ? '下一个' : '知道了',
+                      onTapHomeMenu: typeIndex != 4 ? next : end,
+                    )
+                    //  RaisedButton(
+                    //   textColor: Colors.white,
+                    //   child: Text(typeIndex != 4 ? '下一个' : '结束'),
+                    //   onPressed: typeIndex != 4 ? next : end,
+                    // ),
+                    ),
+               typeIndex!=4? FlatButton(
                   textColor: Color(0xFF727785),
                   highlightColor: Colors.transparent,
                   splashColor: Colors.transparent,
@@ -137,7 +126,7 @@ class InfoBox extends StatelessWidget {
                   onPressed: () {
                     end();
                   },
-                )
+                ):Container()
               ],
             ),
           )
@@ -147,10 +136,31 @@ class InfoBox extends StatelessWidget {
   }
 
 // 第一名获得${houseInfo.houseLevel.firstRatio}%,第二名获得${houseInfo.houseLevel.secondRatio}%,第三名获得${houseInfo.houseLevel.thirdRatio}%
-  Widget _centerContent(int index,BuildContext context) {
+  Widget _centerContent(int index, BuildContext context) {
     Widget useContent = Container();
     TextStyle _text = TextStyle(color: Colors.white, fontSize: 14);
-     if (index == 1) {
+
+    if (index == 1) {
+      useContent = Container(
+        margin: EdgeInsets.only(top: 20),
+        padding: EdgeInsets.symmetric(horizontal: 20),
+        child: Column(
+          crossAxisAlignment: CrossAxisAlignment.start,
+          children: <Widget>[
+            Text(
+              '吃鸡模式',
+              style: TextStyle(color: Color(0xFFFFB726)),
+            ),
+            Text('胜利条件:只要在游戏中成功吃鸡,即可获得一枚铂金奖牌,没有吃鸡即算做失败', style: TextStyle(color: Colors.white)),
+            Container(
+              height: 15,
+            ),
+            Text('评分模式', style: TextStyle(color: Color(0xFFFFB726))),
+            Text('胜利条件:不管游戏最终是否吃鸡,按游戏最终显示评分数值进行排序,评分相同用时短者优胜,前三名分别获得金银铜奖牌,其它人算做失败', style: TextStyle(color: Colors.white))
+          ],
+        ),
+      );
+    } else if (index == 2) {
       useContent = Container(
         margin: EdgeInsets.only(top: 20),
         padding: EdgeInsets.symmetric(horizontal: 20),
@@ -163,15 +173,12 @@ class InfoBox extends StatelessWidget {
             Text.rich(
                 TextSpan(children: [
                   TextSpan(
-                    text: '竞赛开始前请在此耐心等待,在开始时会有上图所示弹窗,玩家必须在10秒内',
+                    text: '竞赛开始前请在此耐心等待,在开始时会有上图所示弹窗,',
                     style: _text,
                   ),
                   TextSpan(
-                    text: '点击确认',
-                    style: TextStyle(
-                        color: Theme.of(context).primaryColor,
-                        fontSize: 14,
-                        fontWeight: FontWeight.w500),
+                    text: '玩家必须在10秒内点击确认',
+                    style: TextStyle(color: Color(0xFFFFB726), fontSize: 14, fontWeight: FontWeight.w500),
                   ),
                   TextSpan(
                     text: ',否则视为放弃此次竞赛,已支付金币概不退换',
@@ -182,7 +189,7 @@ class InfoBox extends StatelessWidget {
           ],
         ),
       );
-    } else if (index ==2) {
+    } else if (index == 3) {
       useContent = Container(
         margin: EdgeInsets.only(top: 20),
         padding: EdgeInsets.symmetric(horizontal: 20),
@@ -200,13 +207,18 @@ class InfoBox extends StatelessWidget {
                   ),
                   TextSpan(
                     text: '点击“确定”',
-                    style: TextStyle(
-                        color: Theme.of(context).primaryColor,
-                        fontSize: 14,
-                        fontWeight: FontWeight.w500),
+                    style: TextStyle(color: Color(0xFFFFB726), fontSize: 14, fontWeight: FontWeight.w500),
+                  ),
+                  TextSpan(
+                    text: '或',
+                    style: _text,
                   ),
                   TextSpan(
-                    text: '或“允许”此操作,否则竞赛判定失败',
+                    text: '“允许”',
+                    style: TextStyle(color: Color(0xFFFFB726), fontSize: 14, fontWeight: FontWeight.w500),
+                  ),
+                  TextSpan(
+                    text: '此操作,否则竞赛判定失败',
                     style: _text,
                   )
                 ]),
@@ -214,7 +226,7 @@ class InfoBox extends StatelessWidget {
           ],
         ),
       );
-    } else if (index == 3) {
+    } else if (index == 4) {
       useContent = Container(
         margin: EdgeInsets.only(top: 20),
         padding: EdgeInsets.symmetric(horizontal: 20),
@@ -231,14 +243,11 @@ class InfoBox extends StatelessWidget {
                     style: _text,
                   ),
                   TextSpan(
-                    text: '请一定一定一定要点击“继续”按钮',
-                    style: TextStyle(
-                        color: Theme.of(context).primaryColor,
-                        fontSize: 14,
-                        fontWeight: FontWeight.w600),
+                    text: '请一定要点击查看游戏最后的分数名次结算页面',
+                    style: TextStyle(color:Color(0xFFFFB726), fontSize: 14, fontWeight: FontWeight.w600),
                   ),
                   TextSpan(
-                    text: ',显示到上图所示画面,然后再切换到我们全民APP中,点击完成比赛,方可成功上传本次成绩,赢取大奖',
+                    text: ',返回游戏主页,最后再切换到我们竞赛app中,点击完成比赛,方可成功长传本次成绩,赢取大奖',
                     style: _text,
                   )
                 ]),

+ 43 - 5
lib/pages/HomePage.dart

@@ -1,10 +1,17 @@
 import 'package:flutter/material.dart';
+import 'package:wanna_battle/model/PlayerInfo.dart';
 import 'package:flutter/cupertino.dart';
 import 'GuidePage.dart';
 import 'MatchPage.dart';
 import 'RankList.dart';
 import '../widget/BottomTabs.dart';
 import 'UserPage.dart';
+import '../net/HttpManager.dart';
+import '../net/Result.dart';
+import '../widget/Dialog.dart';
+import 'Appeal.dart';
+import '../model/HouseInfo.dart';
+import 'RoomInfo.dart';
 
 class HomePage extends StatefulWidget {
   @override
@@ -14,14 +21,45 @@ class HomePage extends StatefulWidget {
 class _HomePageState extends State<HomePage> with SingleTickerProviderStateMixin {
   TabController controller;
 
+  Future<void> checkErrorPlayerInfo() async {
+    final Result res = await HttpManager.get('playerInfo/getErrorPlayerInfo');
+    print('&********');
+    print(res.error);
+    if (res.success) {
+      final PlayerInfo playerInfo = PlayerInfo.fromJson(res.data);
+      // MyDialog.showDialog(
+      //   context,
+      //   '由于系统性能安全策略问题导致本次比赛结果上传失败,你可以上传本次比赛结果照片进行结果申诉',
+      //   isCancel: true,
+      //   onsubmit: () {
+      //     Navigator.push(context, CupertinoPageRoute(builder: (context) => Appeal(playerInfo)));
+      //   },
+      // );
+      final res1 = await HttpManager.get('houseInfo/getOne', data: {'id': playerInfo.houseId});
+      if (res1.success && res1.data != null) {
+        Navigator.push(
+          context,
+          CupertinoPageRoute(
+            builder: (context) => RoomInfo(
+                  roomId:res1.data['id'].toString(),
+                  // playerInfo: playerInfo,
+                  // interrupted: true,
+                ),
+          ),
+        );
+      }
+    } else {
+      //引导页
+      showGruide();
+    }
+  }
+
   @override
   void initState() {
     super.initState();
     controller = new TabController(length: 3, vsync: this);
     Future.delayed(Duration.zero, () {
-      ;
-      //引导页
-      showGruide();
+      checkErrorPlayerInfo();
     });
   }
 
@@ -39,7 +77,7 @@ class _HomePageState extends State<HomePage> with SingleTickerProviderStateMixin
             color: Color(0xFF2E3049),
             child: new MyTabBarView(
               controller: controller,
-              children: <Widget>[MatchPage(),RankList(), UserPage()],
+              children: <Widget>[MatchPage(), RankList(), UserPage()],
             ),
           ),
           onWillPop: () {
@@ -91,4 +129,4 @@ class _HomePageState extends State<HomePage> with SingleTickerProviderStateMixin
           return GuidePage();
         }));
   }
-}
+}

+ 5 - 0
lib/pages/MatchPage.dart

@@ -172,6 +172,11 @@ class _MatchPageState extends State<MatchPage> with WidgetsBindingObserver {
     });
   }
 
+  @override
+  void dispose() {
+    super.dispose();
+  }
+
   @override
   Widget build(BuildContext context) {
     return WillPopScope(

+ 170 - 170
lib/pages/RecordList.dart

@@ -13,7 +13,7 @@ import 'package:flutter_redux/flutter_redux.dart';
 import '../redux/AppState.dart';
 import '../widget/ScoreType.dart';
 import 'package:cached_network_image/cached_network_image.dart';
-
+import '../widget/HouseItem.dart';
 class RecordList extends StatefulWidget {
   @override
   RecordListState createState() => RecordListState();
@@ -176,7 +176,7 @@ class RecordInfoState extends State<RecordInfo> {
                           textAlign: TextAlign.center,
                         );
                       }
-                      return houseItem(roomInfo: houseList[index], gameInfo: houseList[index].gameInfo, type: 1);
+                      return HouseItem(houseList[index],houseList[index].gameInfo);
                     })
                 : ListView.builder(
                     physics: AlwaysScrollableScrollPhysics(),
@@ -190,180 +190,180 @@ class RecordInfoState extends State<RecordInfo> {
                           textAlign: TextAlign.center,
                         );
                       }
-                      return houseItem(roomInfo: playerList[index].houseInfo, gameInfo: playerList[index].gameInfo, playerInfo: playerList[index], type: 2);
+                      return HouseItem( playerList[index].houseInfo, playerList[index].gameInfo, playerInfo: playerList[index]);
                     }),
           )),
     );
   }
 }
 
-class houseItem extends StatelessWidget {
-  houseItem({Key key, this.roomInfo, this.gameInfo, this.playerInfo, this.type = 0}) : super(key: key);
-  final HouseInfo roomInfo;
-  final GameInfo gameInfo;
-  final PlayerInfo playerInfo;
-  final int type;
+// class houseItem extends StatelessWidget {
+//   houseItem({Key key, this.roomInfo, this.gameInfo, this.playerInfo, this.type = 0}) : super(key: key);
+//   final HouseInfo roomInfo;
+//   final GameInfo gameInfo;
+//   final PlayerInfo playerInfo;
+//   final int type;
 
-  @override
-  Widget build(BuildContext context) {
-    List imageList = [
-      'images/jiangpai_huangjin.png',
-      'images/jiangpai_baiyin.png',
-      'images/jiangpai_qingtong.png',
-      'images/zhanji_icon_04.png',
-      'images/jiangpai_bojin.png'
-    ];
-    String imageSrc = '';
-    String tishiStr = '';
-    Color tishiColor;
-    bool isImport = false;
-    if (playerInfo != null) {
-      if (playerInfo.medal != null) {
-        if (playerInfo.medal == 'platinum') {
-          imageSrc = imageList[4];
-        } else if (playerInfo.medal == 'gold') {
-          imageSrc = imageList[0];
-        } else if (playerInfo.medal == 'silver') {
-          imageSrc = imageList[1];
-        } else if (playerInfo.medal == 'bronze') {
-          imageSrc = imageList[2];
-        }
-        else if(playerInfo.rank!=null){
-          tishiStr='第${playerInfo.rank}名';
-        }
-        // if (playerInfo.houseRank < 4) {
-        //   imageSrc = imageList[playerInfo.houseRank - 1];
-        // } else {
-        //   imageSrc = imageList[3];
-        // }
-      }
+//   @override
+//   Widget build(BuildContext context) {
+//     List imageList = [
+//       'images/jiangpai_huangjin.png',
+//       'images/jiangpai_baiyin.png',
+//       'images/jiangpai_qingtong.png',
+//       'images/zhanji_icon_04.png',
+//       'images/jiangpai_bojin.png'
+//     ];
+//     String imageSrc = '';
+//     String tishiStr = '';
+//     Color tishiColor;
+//     bool isImport = false;
+//     if (playerInfo != null) {
+//       if (playerInfo.medal != null) {
+//         if (playerInfo.medal == 'platinum') {
+//           imageSrc = imageList[4];
+//         } else if (playerInfo.medal == 'gold') {
+//           imageSrc = imageList[0];
+//         } else if (playerInfo.medal == 'silver') {
+//           imageSrc = imageList[1];
+//         } else if (playerInfo.medal == 'bronze') {
+//           imageSrc = imageList[2];
+//         }
+//         else if(playerInfo.rank!=null){
+//           tishiStr='第${playerInfo.rank}名';
+//         }
+//         // if (playerInfo.houseRank < 4) {
+//         //   imageSrc = imageList[playerInfo.houseRank - 1];
+//         // } else {
+//         //   imageSrc = imageList[3];
+//         // }
+//       }
 
-      if (playerInfo.statusFlag != null) {
-        if (playerInfo.statusFlag == 6) {
-          imageSrc = imageList[3];
-        } else if (playerInfo.statusFlag == 0) {
-          tishiStr = '未开始';
-        } else if (playerInfo.statusFlag == 2) {
-          tishiStr = '进行中';
-        } else if (playerInfo.statusFlag < 4 || (roomInfo.statusFlag >= 2 && roomInfo.statusFlag < 4)) {
-          tishiStr = '结算中';
-        }
-      }
-    } else {
-      if (roomInfo.statusFlag == 0) {
-        tishiStr = '未开始';
-        tishiColor = Theme.of(context).primaryColor;
-      } else if (roomInfo.statusFlag == 2) {
-        tishiStr = '进行中';
-        tishiColor = Color(0xFFA9AABA);
-      } else if (roomInfo.statusFlag == 4) {
-        tishiStr = '已结束';
-        tishiColor = Color(0xFF595B77);
-      } else {
-        tishiStr = '结算中';
-        tishiColor = Color(0xFF595B77);
-      }
-    }
+//       if (playerInfo.statusFlag != null) {
+//         if (playerInfo.statusFlag == 6) {
+//           imageSrc = imageList[3];
+//         } else if (playerInfo.statusFlag == 0) {
+//           tishiStr = '未开始';
+//         } else if (playerInfo.statusFlag == 2) {
+//           tishiStr = '进行中';
+//         } else if (playerInfo.statusFlag < 4 || (roomInfo.statusFlag >= 2 && roomInfo.statusFlag < 4)) {
+//           tishiStr = '结算中';
+//         }
+//       }
+//     } else {
+//       if (roomInfo.statusFlag == 0) {
+//         tishiStr = '未开始';
+//         tishiColor = Theme.of(context).primaryColor;
+//       } else if (roomInfo.statusFlag == 2) {
+//         tishiStr = '进行中';
+//         tishiColor = Color(0xFFA9AABA);
+//       } else if (roomInfo.statusFlag == 4) {
+//         tishiStr = '已结束';
+//         tishiColor = Color(0xFF595B77);
+//       } else {
+//         tishiStr = '结算中';
+//         tishiColor = Color(0xFF595B77);
+//       }
+//     }
 
-    if (roomInfo == null) {
-      return Container();
-    }
-    return Container(
-      decoration: BoxDecoration(
-        // gradient: LinearGradient(
-        //   colors: [Color(0xFF3F4261), Color(0xFF323456)],
-        //   begin: Alignment.topCenter,
-        //   end: Alignment.bottomCenter,
-        // ),
-        color: Color(0xFF363759),
-      ),
-      child: Column(
-        children: <Widget>[
-          Material(
-            color: Colors.transparent,
-            child: InkWell(
-              child: Padding(
-                padding: EdgeInsets.all(15),
-                child: Row(
-                  children: <Widget>[
-                    Image.network(
-                      gameInfo.icon,
-                      width: 48,
-                      height: 48,
-                    ),
-                    Container(
-                      width: 10,
-                    ),
-                    Expanded(
-                      flex: 1,
-                      child: Column(
-                        crossAxisAlignment: CrossAxisAlignment.start,
-                        children: <Widget>[
-                          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(
-                                width: 5,
-                              ),
-                              ScoreType(roomInfo.scoreType)
-                              // 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(
-                            roomInfo.houseAbstract ?? '',
-                            style: TextStyle(fontSize: 12, fontWeight: FontWeight.w400, color: Color(0xFF9BA0AE)),
-                            maxLines: 2,
-                            overflow: TextOverflow.ellipsis,
-                          )
-                        ],
-                      ),
-                    ),
-                    imageSrc != ''
-                        ? Image.asset(imageSrc)
-                        : (type == 2
-                            ? Text(tishiStr, style: TextStyle(color: isImport ? PRIMARY_COLOR : Colors.white54, fontSize: 14))
-                            : Container(
-                                color: tishiColor,
-                                padding: EdgeInsets.symmetric(vertical: 4, horizontal: 9),
-                                child: Text(
-                                  tishiStr,
-                                  style: TextStyle(color: Color(0xFF252532), fontSize: 12),
-                                ),
-                              ))
-                  ],
-                ),
-              ),
-              onTap: () {
-                Navigator.push(context, CupertinoPageRoute(builder: (context) => RoomInfo(roomId: roomInfo.id.toString())));
-              },
-            ),
-          ),
-          Container(
-            margin: EdgeInsets.symmetric(horizontal: 15),
-            height: 1,
-            color: Color(0xFF2B2B42),
-          )
-        ],
-      ),
-    );
-  }
-}
+//     if (roomInfo == null) {
+//       return Container();
+//     }
+//     return Container(
+//       decoration: BoxDecoration(
+//         // gradient: LinearGradient(
+//         //   colors: [Color(0xFF3F4261), Color(0xFF323456)],
+//         //   begin: Alignment.topCenter,
+//         //   end: Alignment.bottomCenter,
+//         // ),
+//         color: Color(0xFF363759),
+//       ),
+//       child: Column(
+//         children: <Widget>[
+//           Material(
+//             color: Colors.transparent,
+//             child: InkWell(
+//               child: Padding(
+//                 padding: EdgeInsets.all(15),
+//                 child: Row(
+//                   children: <Widget>[
+//                     Image.network(
+//                       gameInfo.icon,
+//                       width: 48,
+//                       height: 48,
+//                     ),
+//                     Container(
+//                       width: 10,
+//                     ),
+//                     Expanded(
+//                       flex: 1,
+//                       child: Column(
+//                         crossAxisAlignment: CrossAxisAlignment.start,
+//                         children: <Widget>[
+//                           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(
+//                                 width: 5,
+//                               ),
+//                               ScoreType(roomInfo.scoreType)
+//                               // 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(
+//                             roomInfo.houseAbstract ?? '',
+//                             style: TextStyle(fontSize: 12, fontWeight: FontWeight.w400, color: Color(0xFF9BA0AE)),
+//                             maxLines: 2,
+//                             overflow: TextOverflow.ellipsis,
+//                           )
+//                         ],
+//                       ),
+//                     ),
+//                     imageSrc != ''
+//                         ? Image.asset(imageSrc)
+//                         : (type == 2
+//                             ? Text(tishiStr, style: TextStyle(color: isImport ? PRIMARY_COLOR : Colors.white54, fontSize: 14))
+//                             : Container(
+//                                 color: tishiColor,
+//                                 padding: EdgeInsets.symmetric(vertical: 4, horizontal: 9),
+//                                 child: Text(
+//                                   tishiStr,
+//                                   style: TextStyle(color: Color(0xFF252532), fontSize: 12),
+//                                 ),
+//                               ))
+//                   ],
+//                 ),
+//               ),
+//               onTap: () {
+//                 Navigator.push(context, CupertinoPageRoute(builder: (context) => RoomInfo(roomId: roomInfo.id.toString())));
+//               },
+//             ),
+//           ),
+//           Container(
+//             margin: EdgeInsets.symmetric(horizontal: 15),
+//             height: 1,
+//             color: Color(0xFF2B2B42),
+//           )
+//         ],
+//       ),
+//     );
+//   }
+// }

+ 267 - 153
lib/pages/RoomInfo.dart

@@ -1,6 +1,8 @@
 import 'dart:async';
 import 'dart:ui';
+import 'package:flutter/cupertino.dart' as prefix0;
 import 'package:flutter/material.dart';
+import 'package:flutter/material.dart' as prefix1;
 import 'package:flutter_screenutil/flutter_screenutil.dart';
 import 'package:url_launcher/url_launcher.dart';
 import 'package:battery/battery.dart';
@@ -23,6 +25,7 @@ import 'VideoPlayer.dart';
 import '../model/UserInfo.dart';
 import '../widget/LinearButton.dart';
 import '../widget/ScoreType.dart';
+import 'Appeal.dart';
 
 class RoomInfo extends StatefulWidget {
   RoomInfo({Key key, this.roomId}) : super(key: key);
@@ -50,9 +53,12 @@ class RoomInfoState extends State<RoomInfo> with SingleTickerProviderStateMixin
   UserInfo userInfo;
   int myRank = 0;
   String mymedal = '';
+  bool canAppeal = false;
+  int appealState = 0;
 
 //获取房间信息
-  Future<void> getRoomInfo() async {
+  Future<void> getRoomInfo(type) async {
+    print('现在时间:' + DateTime.now().millisecondsSinceEpoch.toString());
     Toast.show(context, '加载中', -1, 'loading');
     Result res = await HttpManager.get('houseInfo/getOne', data: {'id': widget.roomId});
     Toast.hide();
@@ -65,8 +71,13 @@ class RoomInfoState extends State<RoomInfo> with SingleTickerProviderStateMixin
       if (houseInfo.statusFlag == 0 && houseInfo.userId != StoreProvider.of<AppState>(context).state.userInfo.id) {
         showNotice();
       }
-    } else {}
 
+      if (houseInfo.statusFlag < 2 && type == 'first') {
+        final battery = Battery();
+        final batteryLevel = await battery.batteryLevel;
+        await MyDialog.showDialog(context, (batteryLevel < 50 ? '系统检测到你的电量低于50%' : '') + ' 为了正常上传比赛结果,建议插上电源线保持电量充足', submitText: '知道了');
+      }
+    } else {}
     checkJoinInfo();
   }
 
@@ -119,6 +130,7 @@ class RoomInfoState extends State<RoomInfo> with SingleTickerProviderStateMixin
     if (result) {
       success = await ScreenStreamPlugin.start(playerInfo.id.toString());
       if (success) {
+        data['beginTime'] = DateTime.now().millisecondsSinceEpoch;
         data['statusFlag'] = 2;
         data['played'] = true;
       } else {
@@ -163,7 +175,7 @@ class RoomInfoState extends State<RoomInfo> with SingleTickerProviderStateMixin
 //开始录屏提示框
   void showSucessInfo() {
     MyDialog.showDialog(context, '您已经完成比赛了吗,确认完成,那就点击下方完成竞赛按钮,上传本次成绩,祝您赢取大奖', title: '完成比赛', submitText: '我已完成比赛', onsubmit: () async {
-      HttpManager.post('playerInfo/update', data: {'id': playerInfo.id, 'statusFlag': 3});
+      HttpManager.post('playerInfo/update', data: {'id': playerInfo.id, 'statusFlag': 3, 'endTime': DateTime.now().millisecondsSinceEpoch});
       bool success = await ScreenStreamPlugin.stop();
 
       Timer(Duration(seconds: 1), () {
@@ -204,18 +216,25 @@ class RoomInfoState extends State<RoomInfo> with SingleTickerProviderStateMixin
         });
         if (houseInfo.statusFlag == 0) {
           if (houseInfo.createUser == StoreProvider.of<AppState>(context).state.userInfo.id.toString()) {
-            roomTipsList.add(['房间创建成功,待人数满员时会自动开启比赛,房主也可以手动开启比赛,请在此页面耐心等待其他人的加入,加入房间后再次退出则视为自动放弃比赛,已支付金币概不退换,快快点击右上角分享给好友加入战局吧']);
+            roomTipsList.add(['房间创建成功,待人数满员时会自动开启比赛,房主也可以手动开启比赛,同时,你也可以加入本次比赛']);
             changeScroll();
-          } else {
-            roomTipsList.add(['待人数满员时会自动开启比赛,房主也可以手动开启比赛,请在此页面耐心等待其他人的加入,加入房间后再次退出则视为自动放弃比赛,已支付门票概不退换,快快点击右上角分享给好友加入战局吧']);
+          }
+
+          if (isJoin) {
+            roomTipsList
+                .add(['待人数满员时会自动开启比赛,房主也可以手动开启比赛,请在此页面耐心等待其他人的加入,加入房间后再次退出则视为自动放弃比赛。', '由于部分手机在低电量情况下无法在后台正常运行竞赛APP,为了你比赛数据的正常获取,请保持手机电量在50%以上', '', '', '']);
           }
 
           changeScroll();
         }
       } else {
+        if (houseInfo.statusFlag == 0) {
+          roomTipsList
+              .add(['待人数满员时会自动开启比赛,房主也可以手动开启比赛,请在此页面耐心等待其他人的加入,加入房间后再次退出则视为自动放弃比赛。', '由于部分手机在低电量情况下无法在后台正常运行竞赛APP,为了你比赛数据的正常获取,请保持手机电量在50%以上', '', '', '']);
+        }
         playerInfo = PlayerInfo.fromJson(res.data);
 
-        if (res.data.containsKey('medal')) {
+        if (playerInfo.medal != null) {
           mymedal = res.data['medal'];
         }
 
@@ -261,11 +280,35 @@ class RoomInfoState extends State<RoomInfo> with SingleTickerProviderStateMixin
       }
     }
 
-    if (isJoin && houseInfo.statusFlag != 4 || isJoin == 0) {
+    if (isJoin && houseInfo.statusFlag != 4 || houseInfo.statusFlag == 0) {
       timer = Timer.periodic(Duration(seconds: 1), (timer) {
+        print('检查');
         getNowStatus();
       });
     }
+
+    if (isJoin && houseInfo.statusFlag == 4) {
+      HttpManager.get('appealInfo/getOne', data: {
+        'userId': StoreProvider.of<AppState>(context).state.userInfo.id,
+        'playerInfoId': playerInfo.id,
+      }).then((res) {
+        if (res.success && res.data != null) {
+          setState(() {
+            canAppeal = true;
+            appealState = 1;
+          });
+        } else {
+          setState(() {
+            canAppeal = true;
+            appealState = 0;
+          });
+        }
+      });
+    }
+
+    if (houseInfo.statusFlag == 2 && playerInfo.beginTime != null && playerInfo.endTime == null) {
+      showSucessInfo();
+    }
   }
 
 //加入房间
@@ -368,11 +411,7 @@ class RoomInfoState extends State<RoomInfo> with SingleTickerProviderStateMixin
     };
 
     Future.delayed(Duration.zero, () async {
-      final battery = Battery();
-      final batteryLevel = await battery.batteryLevel;
-      await MyDialog.showDialog(context, (batteryLevel < 50 ? '系统检测到你的电量低于50%' : '') + ' 为了正常上传比赛结果,建议插上电源线保持电量充足', submitText: '知道了');
-
-      getRoomInfo();
+      getRoomInfo('first');
       userInfo = StoreProvider.of<AppState>(context).state.userInfo;
       // showStart();
     });
@@ -469,6 +508,33 @@ class RoomInfoState extends State<RoomInfo> with SingleTickerProviderStateMixin
       }
     }
 
+    String timeStr = '';
+    int _time;
+    if (houseInfo == null) {
+    } else if (houseInfo.statusFlag == 0) {
+      //房价未开始比赛
+      _time = houseInfo.createTime + 600000 - DateTime.now().millisecondsSinceEpoch;
+      timeStr = '最迟 ${getSecondsMIn(_time)} 后自动开始比赛';
+    }
+    // else if (isJoin && (houseInfo.statusFlag == 2 || houseInfo.statusFlag == 3)) {
+    //   _time = houseInfo.beginTime + 3600000 - DateTime.now().millisecondsSinceEpoch;
+    //   timeStr = '最迟 ${getSecondsMIn(_time)} 后结算';
+    // }
+    List jiangpaiImg = ['images/jiangpai_huangjin.png', 'images/jiangpai_baiyin.png', 'images/jiangpai_qingtong.png', 'images/jiangpai_bojin.png'];
+
+    String img = '';
+    if (playerInfo != null) {
+      if (playerInfo.medal == 'platinum') {
+        img = jiangpaiImg[3];
+      } else if (playerInfo.medal == 'gold') {
+        img = jiangpaiImg[0];
+      } else if (playerInfo.medal == 'silver') {
+        img = jiangpaiImg[1];
+      } else if (playerInfo.medal == 'bronze') {
+        img = jiangpaiImg[2];
+      }
+    }
+
     return LayoutBuilder(
       builder: (BuildContext context, BoxConstraints viewportConstraints) {
         return Container(
@@ -479,12 +545,11 @@ class RoomInfoState extends State<RoomInfo> with SingleTickerProviderStateMixin
               onRefresh: () async {
                 await Future.delayed(const Duration(seconds: 1));
               },
-              child: SingleChildScrollView(
-                  controller: _tipController,
-                  physics: AlwaysScrollableScrollPhysics(),
-                  child: Stack(
-                    children: <Widget>[
-                      Column(
+              child: houseInfo != null
+                  ? SingleChildScrollView(
+                      controller: _tipController,
+                      physics: AlwaysScrollableScrollPhysics(),
+                      child: Column(
                         children: <Widget>[
                           houseInfo != null ? VideoWidget(videoSrc: houseInfo.video) : Container(),
                           // Image.network(topImg, width: double.infinity),
@@ -495,7 +560,7 @@ class RoomInfoState extends State<RoomInfo> with SingleTickerProviderStateMixin
                                 children: <Widget>[
                                   Container(
                                     child: Text(
-                                      roomInfo.containsKey('houseName') ? roomInfo['houseName'] : '',
+                                      houseInfo != null ? houseInfo.houseName : '',
                                       style: TextStyle(color: Colors.white, fontSize: 16, fontWeight: FontWeight.w500),
                                     ),
                                   ),
@@ -543,73 +608,152 @@ class RoomInfoState extends State<RoomInfo> with SingleTickerProviderStateMixin
                                   // )
                                 ],
                               )),
-                         Container(
-                           padding: EdgeInsets.symmetric(horizontal: 15),
-                           child:  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)),
-                              ),
-                              Text('房间ID:' + (houseInfo.houseCode != null ? houseInfo.houseCode : ''))
-                            ],
-                          ),),
-                          // Container(
-                          //   margin: EdgeInsets.only(top: 14),
-                          //   width: 200,
-                          //   height: 40,
-                          //   decoration: BoxDecoration(
-                          //     border: Border.all(
-                          //         width: 1,
-                          //         color: PRIMARY_COLOR,
-                          //         style: BorderStyle.solid),
-                          //     borderRadius:
-                          //         BorderRadius.all(Radius.circular(2)),
-                          //   ),
-                          //   child: Row(
-                          //     mainAxisAlignment: MainAxisAlignment.center,
-                          //     children: <Widget>[
-                          //       Text(
-                          //         '奖金',
-                          //         style: TextStyle(
-                          //           color: PRIMARY_COLOR,
-                          //           fontSize: 13,
-                          //           fontWeight: FontWeight.w500,
-                          //         ),
-                          //       ),
-                          //       Container(
-                          //         padding: EdgeInsets.only(left: 10, right: 6),
-                          //         child: Image.asset(
-                          //           'images/icon_jinbi_da_hong.png',
-                          //           width: 20,
-                          //         ),
-                          //       ),
-                          //       Text(
-                          //         '×' +
-                          //             (houseInfo != null
-                          //                 ? houseInfo.bonus.toString()
-                          //                 : '0'),
-                          //         style: TextStyle(
-                          //           color: PRIMARY_COLOR,
-                          //           fontSize: 22,
-                          //           fontWeight: FontWeight.w900,
-                          //         ),
-                          //       )
-                          //     ],
-                          //   ),
-                          // ),
+                          Container(
+                            padding: EdgeInsets.symmetric(horizontal: 15),
+                            child: 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(
+                                  width: 30,
+                                ),
+                                Text.rich(TextSpan(children: [
+                                  TextSpan(text: "模式 ", style: TextStyle(color: Colors.white30, fontSize: 14)),
+                                  TextSpan(text: houseInfo.houseType == 0 ? '评分模式' : '吃鸡模式', style: TextStyle(color: Colors.white70, fontSize: 14)),
+                                ])),
+                                Container(
+                                  width: 30,
+                                ),
+                                Text.rich(TextSpan(children: [
+                                  TextSpan(text: "房间ID ", style: TextStyle(color: Colors.white30, fontSize: 14)),
+                                  TextSpan(text: houseInfo.houseCode != null ? houseInfo.houseCode : '', style: TextStyle(color: Colors.white70, fontSize: 14)),
+                                ])),
+                              ],
+                            ),
+                          ),
+
+                          timeStr != ''
+                              ? Container(
+                                  decoration: BoxDecoration(
+                                    color: Color.fromARGB(10, 212, 80, 75),
+                                    borderRadius: BorderRadius.all(Radius.circular(4)),
+                                  ),
+                                  margin: EdgeInsets.fromLTRB(15, 15, 15, 0),
+                                  padding: EdgeInsets.symmetric(vertical: 10),
+                                  height: 40,
+                                  width: double.infinity,
+                                  child: Text(timeStr,
+                                      textAlign: TextAlign.center, style: TextStyle(fontSize: 15, color: Color(0xFFD4504B), fontWeight: FontWeight.w500)),
+                                )
+                              : Container(),
 
                           statuFlag != 4
                               ? TipsListContent(tipsList: roomTipsList, houseInfo: houseInfo)
-                              : RankContent(
-                                  roomId: widget.roomId,
+                              : Container(
+                                  child: playerInfo != null
+                                      ? Column(
+                                          children: <Widget>[
+                                            Container(
+                                              margin: EdgeInsets.symmetric(vertical: 10, horizontal: 15),
+                                              padding: EdgeInsets.all(15),
+                                              height: 80,
+                                              decoration: BoxDecoration(
+                                                  color: Color(0xFF3A3E61),
+                                                  borderRadius: BorderRadius.only(
+                                                      topRight: Radius.circular(8), bottomLeft: Radius.circular(8), bottomRight: Radius.circular(8))),
+                                              child: Column(
+                                                crossAxisAlignment: CrossAxisAlignment.start,
+                                                mainAxisAlignment: MainAxisAlignment.spaceBetween,
+                                                children: <Widget>[
+                                                  Text('和平精英游戏结果', style: TextStyle(color: Colors.white54, fontSize: 13)),
+                                                  Row(
+                                                    mainAxisAlignment: MainAxisAlignment.spaceBetween,
+                                                    children: <Widget>[
+                                                      Text.rich(TextSpan(children: [
+                                                        TextSpan(text: "名次 ", style: TextStyle(color: Colors.white, fontSize: 14)),
+                                                        TextSpan(
+                                                            text: '${myRank}',
+                                                            style: TextStyle(color: Color(0xFFFFB726), fontWeight: FontWeight.w500, fontSize: 14)),
+                                                      ])),
+                                                      Text.rich(TextSpan(children: [
+                                                        TextSpan(text: "时长 ", style: TextStyle(color: Colors.white, fontSize: 14)),
+                                                        TextSpan(
+                                                            text: playerInfo.liveTime != null ? '${playerInfo.liveTime}' : '0',
+                                                            style: TextStyle(color: Color(0xFFFFB726), fontWeight: FontWeight.w500, fontSize: 14)),
+                                                      ])),
+                                                      Text.rich(TextSpan(children: [
+                                                        TextSpan(text: "评分 ", style: TextStyle(color: Colors.white, fontSize: 14)),
+                                                        TextSpan(
+                                                            text: '${playerInfo.score}',
+                                                            style: TextStyle(color: Color(0xFFFFB726), fontWeight: FontWeight.w500, fontSize: 14)),
+                                                      ])),
+                                                    ],
+                                                  )
+                                                ],
+                                              ),
+                                            ),
+                                            Container(
+                                              margin: EdgeInsets.symmetric(vertical: 10, horizontal: 15),
+                                              padding: EdgeInsets.all(15),
+                                              height: 140,
+                                              decoration: BoxDecoration(
+                                                  color: Color(0xFF3A3E61),
+                                                  borderRadius: BorderRadius.only(
+                                                      topRight: Radius.circular(8), bottomLeft: Radius.circular(8), bottomRight: Radius.circular(8))),
+                                              child: Column(
+                                                crossAxisAlignment: CrossAxisAlignment.start,
+                                                mainAxisAlignment: MainAxisAlignment.spaceBetween,
+                                                children: <Widget>[
+                                                  Text('比赛结果', style: TextStyle(color: Colors.white54, fontSize: 13)),
+                                                  Row(
+                                                    mainAxisAlignment: MainAxisAlignment.spaceBetween,
+                                                    children: <Widget>[
+                                                      Text("参数成员 ", style: TextStyle(color: Colors.white, fontSize: 14)),
+                                                      Text("${houseInfo.playerNumber}人 ",
+                                                          style: TextStyle(color: Color(0xFFFFB726), fontWeight: FontWeight.w500, fontSize: 14))
+                                                    ],
+                                                  ),
+                                                  Row(
+                                                    mainAxisAlignment: MainAxisAlignment.spaceBetween,
+                                                    children: <Widget>[
+                                                      Text("是否吃鸡 ", style: TextStyle(color: Colors.white, fontSize: 14)),
+                                                      Text(playerInfo.ranking == 1 ? '是' : '否',
+                                                          style: TextStyle(color: Color(0xFFFFB726), fontWeight: FontWeight.w500, fontSize: 14))
+                                                    ],
+                                                  ),
+                                                  Row(
+                                                    mainAxisAlignment: MainAxisAlignment.spaceBetween,
+                                                    children: <Widget>[
+                                                      Text("获得奖牌 ", style: TextStyle(color: Colors.white, fontSize: 14)),
+                                                      img != ''
+                                                          ? Row(
+                                                              children: <Widget>[
+                                                                prefix1.Image.asset(
+                                                                  img,
+                                                                  width: 20,
+                                                                ),
+                                                                Text("+1",
+                                                                    style: TextStyle(color: Color(0xFFFFB726), fontWeight: FontWeight.w500, fontSize: 14))
+                                                              ],
+                                                            )
+                                                          : Text("无", style: TextStyle(color: Color(0xFFFFB726), fontWeight: FontWeight.w500, fontSize: 14))
+                                                    ],
+                                                  )
+                                                ],
+                                              ),
+                                            )
+                                          ],
+                                        )
+                                      : Container(),
                                 ),
                           Container(
                             width: double.infinity,
@@ -617,24 +761,8 @@ class RoomInfoState extends State<RoomInfo> with SingleTickerProviderStateMixin
                           )
                         ],
                       ),
-                      roomInfo.isNotEmpty
-                          ? Positioned(
-                              left: 0,
-                              top: 20,
-                              child: Container(
-                                padding: EdgeInsets.fromLTRB(4, 6, 15, 6),
-                                decoration: BoxDecoration(
-                                    color: Theme.of(context).primaryColor.withOpacity(0.76),
-                                    borderRadius: BorderRadius.only(topRight: Radius.circular(30), bottomRight: Radius.circular(30))),
-                                child: Text(
-                                  '房间号:' + (houseInfo.houseCode != null ? houseInfo.houseCode : ''),
-                                  style: TextStyle(color: Colors.white, fontSize: 13, fontWeight: FontWeight.w500),
-                                ),
-                              ),
-                            )
-                          : Container()
-                    ],
-                  ))),
+                    )
+                  : Container()),
         );
       },
     );
@@ -771,12 +899,12 @@ class RoomInfoState extends State<RoomInfo> with SingleTickerProviderStateMixin
                 child: Text.rich(TextSpan(children: [
                   TextSpan(
                     text: '开始比赛',
-                    style: TextStyle(fontSize: 16),
+                    style: TextStyle(fontSize: 16, color: Colors.white),
                   ),
-                  TextSpan(
-                    text: '(${getSecondsMIn(_time)}秒后将自动开始)',
-                    style: TextStyle(fontSize: 12),
-                  )
+                  // TextSpan(
+                  //   text: '(${getSecondsMIn(_time)}秒后将自动开始)',
+                  //   style: TextStyle(fontSize: 12),
+                  // )
                 ])),
               ),
               onTapHomeMenu: () {
@@ -811,7 +939,7 @@ class RoomInfoState extends State<RoomInfo> with SingleTickerProviderStateMixin
             width: double.infinity,
             padding: EdgeInsets.symmetric(horizontal: 15, vertical: 20),
             height: 88,
-            child: LinearButton(btntext: '预计' + getSecondsMIn(_time) + '后开始', colorList: [Color(0xFFAF4946), Color(0xFFAF4946)], textColor: Color(0xFF252532)));
+            child: LinearButton(btntext: '等待开始中', colorList: [Color(0xFFAF4946), Color(0xFFAF4946)], textColor: Color(0xFF252532)));
       }
     } else if (isJoin && statusFlag == 8) {
       return Container(
@@ -838,23 +966,37 @@ class RoomInfoState extends State<RoomInfo> with SingleTickerProviderStateMixin
         width: double.infinity,
         padding: EdgeInsets.symmetric(horizontal: 15, vertical: 20),
         height: 88,
-        child: LinearButton(btntext: '最迟在' + getSecondsMIn(_time) + '后结算', colorList: [Color(0xFFAF4946), Color(0xFFAF4946)], textColor: Color(0xFF252532)),
+        child: LinearButton(btntext: '预计还有 ' + getSecondsMIn(_time) + ' 结算', colorList: [Color(0xFFAF4946), Color(0xFFAF4946)], textColor: Color(0xFF252532)),
       );
     } else if (statusFlag == 4 && tabIndex == 0) {
-      return Container(
-        width: double.infinity,
-        padding: EdgeInsets.symmetric(horizontal: 15, vertical: 20),
-        height: 88,
-        child: RaisedButton(
-          disabledColor: Color(0xFF727785),
-          disabledTextColor: Color(0xFF15151D),
-          child: Text(
-            '已结束',
-            style: TextStyle(fontSize: 16),
-          ),
-          onPressed: null,
-        ),
-      );
+      if (isJoin && canAppeal && appealState == 0) {
+        return Container(
+            width: double.infinity,
+            padding: EdgeInsets.symmetric(horizontal: 15, vertical: 20),
+            height: 88,
+            child: LinearButton(
+              btntext: '申诉结果',
+              colorList: [Color(0xFFAF4946), Color(0xFFAF4946)],
+              textColor: Colors.white,
+              onTapHomeMenu: () async {
+                final success = await Navigator.push(context, CupertinoPageRoute(builder: (context) => Appeal(playerInfo)));
+                if (success != null && success) {
+                  Toast.show(context, '提交成功', 1500, 'success');
+                  setState(() {
+                    appealState = 1;
+                  });
+                }
+              },
+            ));
+      } else if (isJoin && canAppeal && appealState == 1) {
+        return Container(
+            width: double.infinity,
+            padding: EdgeInsets.symmetric(horizontal: 15, vertical: 20),
+            height: 88,
+            child: LinearButton(btntext: '已提交申诉', colorList: [Color(0xFFAF4946), Color(0xFFAF4946)], textColor: Color(0xFF252532)));
+      } else {
+        return Container();
+      }
     } else if (statusFlag == 4 && tabIndex == 1) {
       return Container(
         height: 48,
@@ -969,34 +1111,6 @@ class Tips extends StatelessWidget {
                     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: () => {
-                          Navigator.of(context).push(PageRouteBuilder(
-                              opaque: false,
-                              transitionDuration: Duration(milliseconds: 300),
-                              transitionsBuilder: (BuildContext context, Animation<double> animation, Animation<double> secondaryAnimation, Widget child) {
-                                return FadeTransition(
-                                  opacity: CurvedAnimation(parent: animation, curve: Curves.linear),
-                                  child: child,
-                                );
-                              },
-                              pageBuilder: (BuildContext context, _, __) {
-                                return CompetitionInformation(houseInfo);
-                              }))
-                        },
-                  )
-                : Container()
           ],
         ));
   }
@@ -1009,7 +1123,7 @@ class Tips extends StatelessWidget {
       ),
       TextSpan(
         text: content[1],
-        style: TextStyle(color: Color(0xFFC2524D), fontSize: 13, fontWeight: FontWeight.w500),
+        style: TextStyle(color: Color(0xFFFFB726), fontSize: 13, fontWeight: FontWeight.w500),
       ),
       TextSpan(
         text: content[2],
@@ -1017,7 +1131,7 @@ class Tips extends StatelessWidget {
       ),
       TextSpan(
         text: content[3],
-        style: TextStyle(color: Color(0xFFC2524D), fontSize: 13, fontWeight: FontWeight.w500),
+        style: TextStyle(color: Color(0xFFFFB726), fontSize: 13, fontWeight: FontWeight.w500),
       ),
       TextSpan(
         text: content[4],

+ 1 - 1
lib/pages/SecondRoomInfo.dart

@@ -106,7 +106,7 @@ class SecondPageState extends State<SecondPage> {
 
   Widget PersonItem(PlayerInfo info, int index) {
     String img = '';
-    if (info == 'platinum') {
+    if (info.medal == 'platinum') {
       img = jiangpaiImg[3];
     } else if (info.medal == 'gold') {
       img = jiangpaiImg[0];

+ 1 - 4
lib/pages/ShoppingMall.dart

@@ -1,7 +1,6 @@
 import 'package:flutter/material.dart';
 import 'package:flutter_redux/flutter_redux.dart';
 import 'package:flutter/cupertino.dart';
-import 'package:fluwx/fluwx.dart' as fluwx;
 import '../redux/AppState.dart';
 import '../model/ProductInfo.dart';
 import '../widget/Dialog.dart';
@@ -113,7 +112,6 @@ class RechargeState extends State<Recharge> {
   @override
   void initState() {
     super.initState();
-    fluwx.register(appId: "wx62f8a9c1d3d70245");
     getInfoList();
   }
 
@@ -211,8 +209,7 @@ class RechargeState extends State<Recharge> {
           textColor: Colors.white,
           child: Text('立即充值'),
           onPressed: () async {
-            fluwx.launchMiniProgram(username: "gh_a6a98cd9b3cd");
-            // Navigator.push(context, CupertinoPageRoute(builder: (context) => ChoosePay(widget.type, chooseProduct)));
+            Navigator.push(context, CupertinoPageRoute(builder: (context) => ChoosePay(widget.type, chooseProduct)));
             // Toast.show(context, '加载中', -1, 'loading');
             // final Result res = await HttpManager.post('productInfo/buy', data: {
             //   'userId': StoreProvider.of<AppState>(context).state.userInfo.id,

+ 260 - 133
lib/pages/TipInfo.dart

@@ -14,6 +14,9 @@ import '../widget/LinearButton.dart';
 import '../model/PlayerInfo.dart';
 import '../widget/ScoreType.dart';
 import '../widget/HouseItem.dart';
+import '../redux/AppState.dart';
+import 'package:flutter_redux/flutter_redux.dart';
+import 'Appeal.dart';
 
 class TipInfo extends StatefulWidget {
   TipInfo({Key key, this.tipId}) : super(key: key);
@@ -25,6 +28,9 @@ class TipInfo extends StatefulWidget {
 class TipInfoState extends State<TipInfo> {
   SystemNotice tipInfo = SystemNotice.fromJson({'content': '', 'createTime': DateTime.now().microsecondsSinceEpoch});
   HouseInfo houseInfo;
+  PlayerInfo playerInfo;
+  bool canAppeal = false;
+  int appealState = 0;
   Future<void> getInfo() async {
     Toast.show(context, '加载中', -1, 'loading');
     Result res = await HttpManager.get('systemNotice/getOne', data: {'id': widget.tipId});
@@ -50,6 +56,30 @@ class TipInfoState extends State<TipInfo> {
       });
     }
 
+    Result res3 =
+        await HttpManager.get('playerInfo/getOne', data: {'userId': StoreProvider.of<AppState>(context).state.userInfo.id, 'houseId': tipInfo.houseId});
+    if (res3.success) {
+      playerInfo = PlayerInfo.fromJson(res3.data);
+      print(res3.data);
+    }
+
+    HttpManager.get('appealInfo/getOne', data: {
+      'userId': StoreProvider.of<AppState>(context).state.userInfo.id,
+      'playerInfoId': playerInfo.id,
+    }).then((res) {
+      if (res.success && res.data != null) {
+        setState(() {
+          canAppeal = true;
+          appealState = 1;
+        });
+      } else {
+        setState(() {
+          canAppeal = true;
+          appealState = 0;
+        });
+      }
+    });
+
     // showSuccess(1000);
   }
 
@@ -87,145 +117,149 @@ class TipInfoState extends State<TipInfo> {
     }
     return WillPopScope(
       child: Scaffold(
-          appBar: AppBar(
-            // backgroundColor: PRIMARY_COLOR,
-            title: Text('通知详情'),
-            centerTitle: true,
-            elevation: 0,
-          ),
-          body: Container(
-            color: Color(0xFF2B2B42),
-            width: double.infinity,
-            height: double.infinity,
-            child: SingleChildScrollView(
-              child: Column(
-                children: <Widget>[
-                  Padding(
-                    padding: EdgeInsets.only(left: 15, right: 15),
-                    child: Column(
-                      crossAxisAlignment: CrossAxisAlignment.start,
-                      children: <Widget>[
-                        Padding(
-                          padding: EdgeInsets.symmetric(vertical: 12),
-                          child: Text(readTimestamp(tipInfo.createTime, 'yyyy.MM.dd HH:mm:ss'), style: TextStyle(color: Colors.white24, fontSize: 13)),
-                        ),
-                        Container(
-                          height: 1,
-                          color: Colors.black26,
-                        ),
-                        Padding(
-                            padding: EdgeInsets.only(top: 10, bottom: 0),
-                            child: Text.rich(TextSpan(style: TextStyle(color: Colors.white, fontSize: 14), children: _tipContent(tipInfo.content, context)))),
-                      ],
-                    ),
+        appBar: AppBar(
+          // backgroundColor: PRIMARY_COLOR,
+          title: Text('通知详情'),
+          centerTitle: true,
+          elevation: 0,
+        ),
+        body: Container(
+          color: Color(0xFF2B2B42),
+          width: double.infinity,
+          height: double.infinity,
+          child: SingleChildScrollView(
+            child: Column(
+              children: <Widget>[
+                Padding(
+                  padding: EdgeInsets.only(left: 15, right: 15),
+                  child: Column(
+                    crossAxisAlignment: CrossAxisAlignment.start,
+                    children: <Widget>[
+                      Padding(
+                        padding: EdgeInsets.symmetric(vertical: 12),
+                        child: Text(readTimestamp(tipInfo.createTime, 'yyyy.MM.dd HH:mm:ss'), style: TextStyle(color: Colors.white24, fontSize: 13)),
+                      ),
+                      Container(
+                        height: 1,
+                        color: Colors.black26,
+                      ),
+                      Padding(
+                          padding: EdgeInsets.only(top: 10, bottom: 0),
+                          child: Text.rich(TextSpan(style: TextStyle(color: Colors.white, fontSize: 14), children: _tipContent(tipInfo.content, context)))),
+                    ],
                   ),
-                  tipInfo.typeFlag == 4
-                      ? Padding(
-                          padding: EdgeInsets.symmetric(horizontal: 15, vertical: 20),
-                          child: DefaultTextStyle(
-                            style: TextStyle(
-                              fontSize: 13,
-                              color: Colors.white54,
-                            ),
-                            child: Column(
-                              crossAxisAlignment: CrossAxisAlignment.start,
-                              children: <Widget>[
-                                Text('造成此情况等原因可能是:'),
-                                Text('1、确认开始游戏后没有授权系统进行录屏'),
-                                Text('2、视频没有录制到最后的分数名次结算页面就回到APP点击完成比赛了 '),
-                                Text('3、在游戏过程中,猿人点击APP后台进程被退出 '),
-                                Text('4、没有实际进行游戏比赛 '),
-                                Text('5、使用作弊手段录制视频'),
-                              ],
-                            ),
+                ),
+                tipInfo.typeFlag == 4
+                    ? Padding(
+                        padding: EdgeInsets.symmetric(horizontal: 15, vertical: 20),
+                        child: DefaultTextStyle(
+                          style: TextStyle(
+                            fontSize: 13,
+                            color: Colors.white54,
+                          ),
+                          child: Column(
+                            crossAxisAlignment: CrossAxisAlignment.start,
+                            children: <Widget>[
+                              Text('造成此情况等原因可能是:'),
+                              Text('1、确认开始游戏后没有授权系统进行录屏'),
+                              Text('2、视频没有录制到最后的分数名次结算页面就回到APP点击完成比赛了 '),
+                              Text('3、在游戏过程中,猿人点击APP后台进程被退出 '),
+                              Text('4、没有实际进行游戏比赛 '),
+                              Text('5、使用作弊手段录制视频'),
+                            ],
                           ),
-                        )
-                      : Container(),
-                  tipInfo.typeFlag == 5
-                      ? Padding(
-                          padding: EdgeInsets.symmetric(horizontal: 15, vertical: 20),
-                          child: DefaultTextStyle(
-                            style: TextStyle(
-                              fontSize: 13,
-                              color: Colors.white54,
-                            ),
-                            child: Column(
-                              crossAxisAlignment: CrossAxisAlignment.start,
-                              children: <Widget>[
-                                Text('造成此情况等原因可能是:'),
-                                Text('1、游戏结束后没有在规定时间内返回APP点击完成比赛按钮'),
-                              ],
-                            ),
+                        ),
+                      )
+                    : Container(),
+                tipInfo.typeFlag == 5
+                    ? Padding(
+                        padding: EdgeInsets.symmetric(horizontal: 15, vertical: 20),
+                        child: DefaultTextStyle(
+                          style: TextStyle(
+                            fontSize: 13,
+                            color: Colors.white54,
                           ),
-                        )
-                      : Container(),
-                  // houseInfo != null && tipInfo.typeFlag != 4 && tipInfo.typeFlag != 5 ? RankContent(roomId: houseInfo.id.toString()) : Container(),
-                  houseInfo != null && type != 3 ? HouseItem( houseInfo,  gameInfo) : Container(),
-                  (type == 2 || type == 3)
-                      ? Container(
-                          width: double.infinity,
-                          height: 48,
-                          padding: EdgeInsets.symmetric(horizontal: 15),
-                          child: status == 0
-                              ? LinearButton(
-                                  btntext: '立即领取',
-                                  onTapHomeMenu: () async {
-                                    Toast.show(context, '加载中', -1, 'loading');
-                                    Result res = type == 2
-                                        ? await HttpManager.post('playerInfo/receive', data: {'id': tipInfo.playerId})
-                                        : await HttpManager.post('systemNotice/receive', data: {'id': widget.tipId});
-                                    Toast.hide();
-                                    if (res.success) {
-                                      if (tipInfo.playerInfo != null) {
-                                        showSuccess(tipInfo.playerInfo.bonus);
-                                      } else {
-                                        showSuccess(tipInfo.bonus);
-                                      }
-                                      getInfo();
+                          child: Column(
+                            crossAxisAlignment: CrossAxisAlignment.start,
+                            children: <Widget>[
+                              Text('造成此情况等原因可能是:'),
+                              Text('1、游戏结束后没有在规定时间内返回APP点击完成比赛按钮'),
+                            ],
+                          ),
+                        ),
+                      )
+                    : Container(),
+                // houseInfo != null && tipInfo.typeFlag != 4 && tipInfo.typeFlag != 5 ? RankContent(roomId: houseInfo.id.toString()) : Container(),
+                houseInfo != null && type != 3 ? HouseItem(houseInfo, gameInfo) : Container(),
+                houseInfo != null && playerInfo != null && type != 3 ? _resultContent(houseInfo, playerInfo) : Container(),
+                (type == 2 || type == 3)
+                    ? Container(
+                        width: double.infinity,
+                        height: 48,
+                        padding: EdgeInsets.symmetric(horizontal: 15),
+                        child: status == 0
+                            ? LinearButton(
+                                btntext: '立即领取',
+                                onTapHomeMenu: () async {
+                                  Toast.show(context, '加载中', -1, 'loading');
+                                  Result res = type == 2
+                                      ? await HttpManager.post('playerInfo/receive', data: {'id': tipInfo.playerId})
+                                      : await HttpManager.post('systemNotice/receive', data: {'id': widget.tipId});
+                                  Toast.hide();
+                                  if (res.success) {
+                                    if (tipInfo.playerInfo != null) {
+                                      showSuccess(tipInfo.playerInfo.bonus);
                                     } else {
-                                      Toast.show(context, res.error, 1000, 'info');
+                                      showSuccess(tipInfo.bonus);
                                     }
-                                  },
-                                )
-                              : LinearButton(btntext: '已领取', colorList: [Color(0xFFC99C09), Color(0xFFC7873E)], textColor: Color(0xFF252532)),
-                        )
+                                    getInfo();
+                                  } else {
+                                    Toast.show(context, res.error, 1000, 'info');
+                                  }
+                                },
+                              )
+                            : LinearButton(btntext: '已领取', colorList: [Color(0xFFC99C09), Color(0xFFC7873E)], textColor: Color(0xFF252532)),
+                      )
 
-                      // RaisedButton(
-                      //   textColor: Colors.white,
-                      //   disabledColor: Color(0xFF763939),
-                      //   disabledTextColor: Color(0xFF252532),
-                      //   child: Text(status==0?'立即领取':'已领取'),
-                      //   onPressed: status==0?() async {
-                      //     Toast.show(context, '加载中', -1, 'loading');
-                      //     Result res = type == 2
-                      //         ? await HttpManager.post('playerInfo/receive',
-                      //             data: {'id': tipInfo.playerId})
-                      //         : await HttpManager.post('systemNotice/receive',
-                      //             data: {'id': widget.tipId});
-                      //     Toast.hide();
-                      //     if (res.success) {
-                      //       if (tipInfo.playerInfo != null) {
-                      //         showSuccess(tipInfo.playerInfo.bonus);
-                      //       } else {
-                      //         showSuccess(tipInfo.bonus);
-                      //       }
-                      //       getInfo();
-                      //     } else {
-                      //       Toast.show(context, res.error, 1000, 'info');
-                      //     }
-                      //   }:null,
-                      // ),
+                    // RaisedButton(
+                    //   textColor: Colors.white,
+                    //   disabledColor: Color(0xFF763939),
+                    //   disabledTextColor: Color(0xFF252532),
+                    //   child: Text(status==0?'立即领取':'已领取'),
+                    //   onPressed: status==0?() async {
+                    //     Toast.show(context, '加载中', -1, 'loading');
+                    //     Result res = type == 2
+                    //         ? await HttpManager.post('playerInfo/receive',
+                    //             data: {'id': tipInfo.playerId})
+                    //         : await HttpManager.post('systemNotice/receive',
+                    //             data: {'id': widget.tipId});
+                    //     Toast.hide();
+                    //     if (res.success) {
+                    //       if (tipInfo.playerInfo != null) {
+                    //         showSuccess(tipInfo.playerInfo.bonus);
+                    //       } else {
+                    //         showSuccess(tipInfo.bonus);
+                    //       }
+                    //       getInfo();
+                    //     } else {
+                    //       Toast.show(context, res.error, 1000, 'info');
+                    //     }
+                    //   }:null,
+                    // ),
 
-                      : Container(),
-                  // CustomPaint(
-                  //   painter: CircleProgressBarPainter(
-                  //       Color(0xFFDCA659), Color(0xFFAE4945), 0.0, 270.0, 360.0, 18.0),
-                  //   size: Size(108.0, 108.0),
-                  // )
-                ],
-              ),
+                    : Container(),
+                // CustomPaint(
+                //   painter: CircleProgressBarPainter(
+                //       Color(0xFFDCA659), Color(0xFFAE4945), 0.0, 270.0, 360.0, 18.0),
+                //   size: Size(108.0, 108.0),
+                // )
+              ],
             ),
-          )),
+          ),
+        ),
+        floatingActionButton: _btnContent(),
+        floatingActionButtonLocation: FloatingActionButtonLocation.centerDocked,
+      ),
       onWillPop: () {
         Navigator.of(context).pop(true);
         Toast.hide();
@@ -234,6 +268,37 @@ class TipInfoState extends State<TipInfo> {
     );
   }
 
+  Widget _btnContent() {
+    if (tipInfo.typeFlag != 3 && canAppeal && appealState == 0) {
+      return Container(
+          width: double.infinity,
+          padding: EdgeInsets.symmetric(horizontal: 15, vertical: 20),
+          height: 88,
+          child: LinearButton(
+            btntext: '申诉结果',
+            colorList: [Color(0xFFAF4946), Color(0xFFAF4946)],
+            textColor: Colors.white,
+            onTapHomeMenu: () async {
+              final success = await Navigator.push(context, CupertinoPageRoute(builder: (context) => Appeal(playerInfo)));
+              if (success != null && success) {
+                Toast.show(context, '提交成功', 1500, 'success');
+                setState(() {
+                  appealState = 1;
+                });
+              }
+            },
+          ));
+    } else if (tipInfo.typeFlag != 3 && canAppeal && appealState == 1) {
+      return Container(
+          width: double.infinity,
+          padding: EdgeInsets.symmetric(horizontal: 15, vertical: 20),
+          height: 88,
+          child: LinearButton(btntext: '已提交申诉', colorList: [Color(0xFFAF4946), Color(0xFFAF4946)], textColor: Color(0xFF252532)));
+    } else {
+      return Container();
+    }
+  }
+
   List<TextSpan> _tipContent(content, context) {
     // String content = '很遗憾,你在2019-06-05 09:23开始的游戏竞赛 [15166的吃鸡房间],[无有效结果],无法获得奖励,该局参赛人数[2]人。';
     List<String> contentlist1 = content.split('[');
@@ -260,7 +325,7 @@ class TipInfoState extends State<TipInfo> {
     List<TextSpan> _widgetList = [];
     totalContent.forEach((item) {
       if (item['isImport']) {
-        _widgetList.add(TextSpan(text: ' ' + item['content'] + ' ', style: TextStyle(color: Theme.of(context).primaryColor, fontWeight: FontWeight.w600)));
+        _widgetList.add(TextSpan(text: ' ' + item['content'] + ' ', style: TextStyle(color: Color(0xFFFFB726), fontWeight: FontWeight.w600)));
       } else {
         _widgetList.add(TextSpan(text: item['content']));
       }
@@ -268,8 +333,70 @@ class TipInfoState extends State<TipInfo> {
 
     return _widgetList;
   }
-}
 
+  Widget _resultContent(HouseInfo houseInfo, PlayerInfo playerInfo) {
+    List jiangpaiImg = ['images/jiangpai_huangjin.png', 'images/jiangpai_baiyin.png', 'images/jiangpai_qingtong.png', 'images/jiangpai_bojin.png'];
+
+    String img = '';
+    if (playerInfo != null) {
+      if (playerInfo.medal == 'platinum') {
+        img = jiangpaiImg[3];
+      } else if (playerInfo.medal == 'gold') {
+        img = jiangpaiImg[0];
+      } else if (playerInfo.medal == 'silver') {
+        img = jiangpaiImg[1];
+      } else if (playerInfo.medal == 'bronze') {
+        img = jiangpaiImg[2];
+      }
+    }
+    return Container(
+      margin: EdgeInsets.symmetric(vertical: 10, horizontal: 15),
+      padding: EdgeInsets.all(15),
+      height: 140,
+      decoration: BoxDecoration(
+          color: Color(0xFF3A3E61),
+          borderRadius: BorderRadius.only(topRight: Radius.circular(8), bottomLeft: Radius.circular(8), bottomRight: Radius.circular(8))),
+      child: Column(
+        crossAxisAlignment: CrossAxisAlignment.start,
+        mainAxisAlignment: MainAxisAlignment.spaceBetween,
+        children: <Widget>[
+          Text('比赛结果', style: TextStyle(color: Colors.white54, fontSize: 13)),
+          Row(
+            mainAxisAlignment: MainAxisAlignment.spaceBetween,
+            children: <Widget>[
+              Text("参数成员 ", style: TextStyle(color: Colors.white, fontSize: 14)),
+              Text("${houseInfo.playerNumber}人 ", style: TextStyle(color: Color(0xFFFFB726), fontWeight: FontWeight.w500, fontSize: 14))
+            ],
+          ),
+          Row(
+            mainAxisAlignment: MainAxisAlignment.spaceBetween,
+            children: <Widget>[
+              Text("是否吃鸡 ", style: TextStyle(color: Colors.white, fontSize: 14)),
+              Text(playerInfo.ranking == 1 ? '是' : '否', style: TextStyle(color: Color(0xFFFFB726), fontWeight: FontWeight.w500, fontSize: 14))
+            ],
+          ),
+          Row(
+            mainAxisAlignment: MainAxisAlignment.spaceBetween,
+            children: <Widget>[
+              Text("获得奖牌 ", style: TextStyle(color: Colors.white, fontSize: 14)),
+              img != ''
+                  ? Row(
+                      children: <Widget>[
+                        Image.asset(
+                          img,
+                          width: 20,
+                        ),
+                        Text("+1", style: TextStyle(color: Color(0xFFFFB726), fontWeight: FontWeight.w500, fontSize: 14))
+                      ],
+                    )
+                  : Text("无", style: TextStyle(color: Color(0xFFFFB726), fontWeight: FontWeight.w500, fontSize: 14))
+            ],
+          )
+        ],
+      ),
+    );
+  }
+}
 
 //比赛结束排名
 class RankContent extends StatefulWidget {

+ 25 - 6
lib/widget/HouseItem.dart

@@ -1,5 +1,7 @@
 import 'package:flutter/material.dart';
 import 'package:flutter/cupertino.dart';
+import 'package:flutter/material.dart' as prefix0;
+import 'package:wanna_battle/model/PlayerInfo.dart';
 import '../model/HouseInfo.dart';
 import '../model/GameInfo.dart';
 import '../pages/RoomInfo.dart';
@@ -7,9 +9,10 @@ import 'package:cached_network_image/cached_network_image.dart';
 import 'dart:ui';
 
 class HouseItem extends StatelessWidget {
-  HouseItem(this.houseInfo, this.gameInfo);
+  HouseItem(this.houseInfo, this.gameInfo, {this.playerInfo = null});
   HouseInfo houseInfo;
   GameInfo gameInfo;
+  PlayerInfo playerInfo;
 
   List<String> imageList = ['images/img_fangjian_hong.png', 'images/img_fangjian_huise.png'];
 
@@ -34,9 +37,9 @@ class HouseItem extends StatelessWidget {
                   child: Row(
                     children: <Widget>[
                       ClipRRect(
-                       borderRadius: BorderRadius.circular(4.0),
+                        borderRadius: BorderRadius.circular(4.0),
                         child: CachedNetworkImage(
-                          imageUrl:gameInfo.icon,
+                          imageUrl: gameInfo.icon,
                           width: 60,
                           height: 60,
                           fit: BoxFit.cover,
@@ -63,12 +66,11 @@ class HouseItem extends StatelessWidget {
                       Column(
                         mainAxisAlignment: MainAxisAlignment.center,
                         children: <Widget>[
-                          Image.asset('images/join.png'),
+                          _topWidget(playerInfo),
                           Row(
                             children: <Widget>[
-                              Image.asset('images/活动详情/icon_renshu.png'),
                               Text(
-                                '26/50',
+                                '${houseInfo.playerNumber!=null?houseInfo.playerNumber:0}/${houseInfo.maxNumber}',
                                 style: TextStyle(color: Colors.white, fontSize: 14),
                               )
                             ],
@@ -79,4 +81,21 @@ class HouseItem extends StatelessWidget {
                   ),
                 ))));
   }
+
+  Widget _topWidget(PlayerInfo playerInfo) {
+    if (playerInfo == null) {
+      return Image.asset('images/join.png');
+    } else {
+      if (playerInfo.ranking == 1) {
+        return Text(
+          '吃鸡',
+          style: prefix0.TextStyle(color: Color(0xFFD4504B), fontSize: 14, fontWeight: FontWeight.w600)
+        );
+      } else {
+        return Text('未吃鸡',
+          style: prefix0.TextStyle(color: Color(0xFF5C5C5C), fontSize: 14, fontWeight: FontWeight.w600));
+      }
+    }
+    // return Container();
+  }
 }

+ 7 - 0
pubspec.lock

@@ -261,6 +261,13 @@ packages:
       url: "https://pub.dartlang.org"
     source: hosted
     version: "0.1.18"
+  get_ip:
+    dependency: "direct main"
+    description:
+      name: get_ip
+      url: "https://pub.dartlang.org"
+    source: hosted
+    version: "0.3.0"
   glob:
     dependency: transitive
     description:

+ 1 - 0
pubspec.yaml

@@ -42,6 +42,7 @@ dependencies:
   cached_network_image: ^0.8.0
   image_picker: ^0.6.0+4
   fluwx: ^1.0.4
+  get_ip: ^0.3.0
 
 dev_dependencies:
   build_runner: ^1.1.1