panhui 6 anni fa
parent
commit
2721a20a23

BIN
images/2x/icon_renshu.png


BIN
images/2x/icon_renshu_hong.png


BIN
images/2x/jiangpai_bojin.png


BIN
images/2x/list_icon_shouji.png


BIN
images/2x/list_icon_yanzhengma.png


BIN
images/3x/icon_renshu.png


BIN
images/3x/icon_renshu_hong.png


BIN
images/3x/jiangpai_bojin.png


BIN
images/3x/list_icon_shouji.png


BIN
images/3x/list_icon_yanzhengma.png


BIN
images/icon_renshu.png


BIN
images/icon_renshu_hong.png


BIN
images/jiangpai_bojin.png


BIN
images/list_icon_shouji.png


BIN
images/list_icon_yanzhengma.png


+ 2 - 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.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);
   int id;
   int houseId; //房间id
   int userId; //用户id
@@ -24,6 +24,7 @@ class PlayerInfo {
   int gold;//金牌
   int  silver;//银牌
   int bronze;//铜牌
+  String medal;//奖牌
   
   factory PlayerInfo.fromJson(Map<String, dynamic> json) =>
       _$PlayerInfoFromJson(json);

+ 11 - 10
lib/model/PlayerInfo.g.dart

@@ -18,11 +18,12 @@ PlayerInfo _$PlayerInfoFromJson(Map<String, dynamic> json) {
       json['houseInfo'] != null ? HouseInfo.fromJson(json['houseInfo']) : null,
       json['rank'] ?? null,
       json['houseRank'] ?? null,
-      json['video']??'',
+      json['video'] ?? '',
       json['platinum'] as int,
       json['gold'] as int,
       json['silver'] as int,
-      json['bronze'] as int,);
+      json['bronze'] as int,
+      json['medal'] != null ? json['medal'] as String : '');
 }
 
 //  int id;
@@ -30,12 +31,11 @@ PlayerInfo _$PlayerInfoFromJson(Map<String, dynamic> json) {
 //   int userId;//用户id
 //   int statusFlag;//状态 0加入 1准备 2开始 3结束 6未比赛
 //   UserInfo userInfo;
-  // int platinum; //铂金
-  // int gold;//金牌
-  // int  silver;//银牌
-  // int bronze;//铜牌
-Map<String, dynamic> _$PlayerInfoToJson(PlayerInfo instance) =>
-    <String, dynamic>{
+// int platinum; //铂金
+// int gold;//金牌
+// int  silver;//银牌
+// int bronze;//铜牌
+Map<String, dynamic> _$PlayerInfoToJson(PlayerInfo instance) => <String, dynamic>{
       'id': instance.id,
       'houseId': instance.houseId,
       'userId': instance.userId,
@@ -46,9 +46,10 @@ Map<String, dynamic> _$PlayerInfoToJson(PlayerInfo instance) =>
       'houseInfo': instance.houseInfo,
       'rank': instance.rank,
       'houseRank': instance.houseRank,
-      'video':instance.video,
+      'video': instance.video,
       'platinum': instance.platinum,
       'gold': instance.gold,
       'silver': instance.silver,
-      'bronze':instance.bronze
+      'bronze': instance.bronze,
+      'medal': instance.medal
     };

+ 1 - 1
lib/pages/CompetitionInformation.dart

@@ -120,7 +120,7 @@ class InfoBox extends StatelessWidget {
                   child:
                   LinearButton(
                     btntext: typeIndex != 3 ? '下一个' : '知道了',
-                    onTapHomeMenu:typeIndex != 4 ? next : end ,
+                    onTapHomeMenu:typeIndex != 3 ? next : end ,
                     
                   )
                   //  RaisedButton(

+ 15 - 44
lib/pages/LoginFirst.dart

@@ -5,6 +5,7 @@ import 'dart:ui';
 import '../styles/totast.dart';
 import 'LoginSecond.dart';
 import '../utils/Utils.dart';
+import '../widget/LinearButton.dart';
 
 class LoginFirst extends StatefulWidget {
   @override
@@ -46,11 +47,7 @@ class LoginFirstState extends State<LoginFirst> {
                       Image.asset('images/icon_logo.png'),
                       Container(
                         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.w500)),
                       ),
                       Container(
                           margin: EdgeInsets.only(top: 20),
@@ -58,10 +55,7 @@ class LoginFirstState extends State<LoginFirst> {
                               autofocus: true,
                               keyboardType: TextInputType.phone,
                               maxLength: 11,
-                              style: TextStyle(
-                                  color: Colors.white,
-                                  fontSize: 18,
-                                  fontWeight: FontWeight.w500),
+                              style: TextStyle(color: Colors.white, fontSize: 18, fontWeight: FontWeight.w500),
                               decoration: InputDecoration(
                                   hintText: '输入手机号',
                                   hintStyle: TextStyle(
@@ -84,31 +78,17 @@ class LoginFirstState extends State<LoginFirst> {
                                   //     width: 20,
                                   //   ),
                                   // ),
-                                  counterStyle: TextStyle(
-                                      color: BG_SUB_COLOR, fontSize: 0)),
+                                  counterStyle: TextStyle(color: BG_SUB_COLOR, fontSize: 0)),
                               onChanged: (value) {
                                 inputVal = value;
                               })),
-                      Text('未注册的手机号验证后自动创建账户',
-                          style: TextStyle(
-                              color: Color(0xFF727785), fontSize: 13)),
-                      Container(
-                        margin: EdgeInsets.symmetric(vertical: 22),
-                        decoration: BoxDecoration(
-                            gradient: LinearGradient(
-                                begin: Alignment.topCenter,
-                                end: Alignment.bottomCenter,
-                                colors: [
-                              Color(0xFFFFC30F),
-                              Color(0xFFFFA54C)
-                            ])),
-                        width: double.infinity,
-                        height: 48,
-                        child: Material(
-                          color: Colors.transparent,
-                          child: InkWell(
-                            onTap: () {
-                              if (!checkPhone(inputVal)) {
+                      Text('未注册的手机号验证后自动创建账户', style: TextStyle(color: Color(0xFF727785), fontSize: 13)),
+                      Container(height: 20,),
+                      LinearButton(
+                        btntext: '下一步',
+                        onTapHomeMenu: ()  {
+                          
+                           if (!checkPhone(inputVal)) {
                                 Toast.show(context, '手机号格式错误', 1500, 'info');
                               } else {
                                 Navigator.push(
@@ -119,18 +99,9 @@ class LoginFirstState extends State<LoginFirst> {
                                   ),
                                 );
                               }
-                            },
-                            child: Center(
-                                child: Text(
-                              '下一步',
-                              style: TextStyle(
-                                  fontSize: 16,
-                                  fontWeight: FontWeight.w500,
-                                  color: Colors.white),
-                            )),
-                          ),
-                        ),
-
+                        }
+                      ),
+                     
                         //  FlatButton(
                         //   textColor: Colors.white,
                         //   color: PRIMARY_COLOR,
@@ -149,7 +120,7 @@ class LoginFirstState extends State<LoginFirst> {
                         //     }
                         //   },
                         // ),
-                      )
+                      
                     ],
                   ),
                 ),

+ 6 - 26
lib/pages/LoginSecond.dart

@@ -13,6 +13,7 @@ import 'HomePage.dart';
 import '../redux/AppState.dart';
 import '../redux/UserRedux.dart';
 import '../model/UserInfo.dart';
+import '../widget/LinearButton.dart';
 
 class LoginSecond extends StatefulWidget {
   LoginSecond({Key key, this.phone}) : super(key: key);
@@ -124,22 +125,10 @@ class LoginSecondState extends State<LoginSecond> {
                                     TextStyle(color: BG_SUB_COLOR, fontSize: 0),
                               ),
                             ),
-                            Container(
-                              margin: EdgeInsets.only(top: 63, bottom: 20),
-                              decoration: BoxDecoration(
-                                  gradient: LinearGradient(
-                                      begin: Alignment.topCenter,
-                                      end: Alignment.bottomCenter,
-                                      colors: [
-                                    Color(0xFFFFC30F),
-                                    Color(0xFFFFA54C)
-                                  ])),
-                              width: double.infinity,
-                              height: 48,
-                              child: Material(
-                                color: Colors.transparent,
-                                child: InkWell(
-                                  onTap: () async {
+                            Container(height: 20,),
+                            LinearButton(
+                              btntext:'注册/登录',
+                              onTapHomeMenu: () async {
                                     if (_sessionID == null) {
                                       Toast.show(
                                           context, '请发送验证码', 1500, 'info');
@@ -183,17 +172,8 @@ class LoginSecondState extends State<LoginSecond> {
                                       }
                                     }
                                   },
-                                  child: Center(
-                                      child: Text(
-                                    '注册/登录',
-                                    style: TextStyle(
-                                        fontSize: 16,
-                                        fontWeight: FontWeight.w500,
-                                        color: Colors.white),
-                                  )),
-                                ),
-                              ),
                             ),
+                            
                           ],
                         ),
                       ),

+ 0 - 1
lib/pages/MyTeam.dart

@@ -78,7 +78,6 @@ class MyTeamState extends State<MyTeam> {
 
   @override
   void initState() {
-    // TODO: implement initState
     super.initState();
     Future.delayed(Duration.zero, () {
       if (StoreProvider.of<AppState>(context).state.userInfo.recommender !=

+ 39 - 8
lib/pages/RoomInfo.dart

@@ -48,6 +48,7 @@ class RoomInfoState extends State<RoomInfo> with SingleTickerProviderStateMixin
   int tabIndex = 0;
   UserInfo userInfo;
   int myRank = 0;
+  String mymedal = '';
 
 //获取房间信息
   Future<void> getRoomInfo() async {
@@ -210,6 +211,10 @@ class RoomInfoState extends State<RoomInfo> with SingleTickerProviderStateMixin
       } else {
         playerInfo = PlayerInfo.fromJson(res.data);
 
+        if (res.data.hashCode('medal')) {
+          mymedal = res.data['medal'];
+        }
+
         if (houseInfo.statusFlag == 4) {
           _myUrl = await ScreenStreamPlugin.getVideo(playerInfo.id.toString());
           print('本地视频' + playerInfo.id.toString());
@@ -612,7 +617,20 @@ class RoomInfoState extends State<RoomInfo> with SingleTickerProviderStateMixin
     int statusFlag = houseInfo != null ? houseInfo.statusFlag : 1;
     int playerStatus = playerInfo != null ? playerInfo.statusFlag : 0;
 
-    List jiangpaiImg = ['金牌', '银牌', '铜牌'];
+    List jiangpaiImg = ['金牌', '银牌', '铜牌', '铂金'];
+    String img = '';
+    if (mymedal != null) {
+      if (mymedal == 'platinum') {
+        img = jiangpaiImg[3];
+      } else if (mymedal == 'gold') {
+        img = jiangpaiImg[0];
+      } else if (mymedal == 'silver') {
+        img = jiangpaiImg[1];
+      } else if (mymedal == 'bronze') {
+        img = jiangpaiImg[2];
+      }
+    }
+
     if (!isJoin && statusFlag == 0 && houseInfo.userId == StoreProvider.of<AppState>(context).state.userInfo.id) {
       return Container(
         padding: EdgeInsets.symmetric(vertical: 15, horizontal: 10),
@@ -857,7 +875,7 @@ class RoomInfoState extends State<RoomInfo> with SingleTickerProviderStateMixin
                     : Container(),
                 myRank != 0 && myRank < 4
                     ? Text(
-                        jiangpaiImg[myRank - 1],
+                        img,
                         style: TextStyle(fontSize: 14, color: Color(0xFF252532), fontWeight: FontWeight.w500),
                       )
                     : Text(
@@ -1041,7 +1059,17 @@ class RankContentState extends State<RankContent> {
       [Color(0xFFC5C5C5), Color(0xFFE3E3E3)],
       [Color(0xFFE77023), Color(0xFFF89E58)]
     ];
-    List imgList = ['images/jiangpai_huangjin.png', 'images/jiangpai_baiyin.png', 'images/jiangpai_qingtong.png'];
+    List imgList = ['images/jiangpai_huangjin.png', 'images/jiangpai_baiyin.png', 'images/jiangpai_qingtong.png', 'images/jiangpai_bojin.png'];
+    String img = '';
+    if (topList[_num - 1].medal == 'platinum') {
+      img = imgList[3];
+    } else if (topList[_num - 1].medal == 'gold') {
+      img = imgList[0];
+    } else if (topList[_num - 1].medal == 'silver') {
+      img = imgList[1];
+    } else if (topList[_num - 1].medal == 'bronze') {
+      img = imgList[2];
+    }
     return Container(
       padding: EdgeInsets.only(left: 15, right: 15, top: _num == 1 ? 0 : 15),
       width: 107,
@@ -1077,13 +1105,15 @@ class RankContentState extends State<RankContent> {
                 ),
                 Positioned(
                   top: 0,
-                  left: _num == 1 ? 19 : 14,
+                  left: 19,
                   child: Center(
-                    child: Image.asset(
-                      imgList[_num - 1],
-                    ),
+                    child: img != ''
+                        ? Image.asset(
+                            img,
+                          )
+                        : Container(),
                   ),
-                ),
+                )
               ],
             ),
           ),
@@ -1096,6 +1126,7 @@ class RankContentState extends State<RankContent> {
             overflow: TextOverflow.ellipsis,
             textAlign: TextAlign.center,
           ),
+
           // SizedBox(
           //   height: 5,
           // ),

+ 20 - 27
lib/pages/SecondRoomInfo.dart

@@ -21,17 +21,13 @@ class SecondPageState extends State<SecondPage> {
   int currentPage = 1;
   bool ismore = true;
   ScrollController _perController;
-  List jiangpaiImg=['images/jiangpai_huangjin.png','images/jiangpai_baiyin.png','images/jiangpai_qingtong.png'];
+  List jiangpaiImg = ['images/jiangpai_huangjin.png', 'images/jiangpai_baiyin.png', 'images/jiangpai_qingtong.png', 'images/jiangpai_bojin.png'];
 
   //获取房间用户
   Future<void> getPlayerPage() async {
     ismore = false;
     Toast.show(context, '加载中', -1, 'loading');
-    Result res = await HttpManager.get('playerInfo/rankPage', data: {
-      'houseId': widget.roomId,
-      'currentPage': currentPage,
-      'pageNumber': 20
-    });
+    Result res = await HttpManager.get('playerInfo/rankPage', data: {'houseId': widget.roomId, 'currentPage': currentPage, 'pageNumber': 20});
     Toast.hide();
     List<PlayerInfo> list = joinList;
     if (currentPage == 1) {
@@ -60,8 +56,7 @@ class SecondPageState extends State<SecondPage> {
     Future.delayed(Duration.zero, () {
       getPlayerPage();
       _perController.addListener(() {
-        if (_perController.position.pixels ==
-            _perController.position.maxScrollExtent) {
+        if (_perController.position.pixels == _perController.position.maxScrollExtent) {
           if (ismore) {
             currentPage++;
             getPlayerPage();
@@ -110,6 +105,16 @@ class SecondPageState extends State<SecondPage> {
   }
 
   Widget PersonItem(PlayerInfo info, int index) {
+    String img = '';
+    if (info == 'platinum') {
+      img = jiangpaiImg[3];
+    } else if (info.medal == 'gold') {
+      img = jiangpaiImg[0];
+    } else if (info.medal == 'silver') {
+      img = jiangpaiImg[1];
+    } else if (info.medal == 'bronze') {
+      img = jiangpaiImg[2];
+    }
     return Container(
       width: double.infinity,
       height: 60,
@@ -117,10 +122,7 @@ class SecondPageState extends State<SecondPage> {
       margin: EdgeInsets.only(top: index == 0 ? 10 : 0),
       padding: EdgeInsets.only(left: 15, right: 15),
       child: Container(
-        decoration: BoxDecoration(
-            border: Border(
-                bottom: BorderSide(
-                    width: 1, color: BG_SUB_COLOR, style: BorderStyle.solid))),
+        decoration: BoxDecoration(border: Border(bottom: BorderSide(width: 1, color: BG_SUB_COLOR, style: BorderStyle.solid))),
         child: Row(
           children: <Widget>[
             Container(
@@ -145,10 +147,7 @@ class SecondPageState extends State<SecondPage> {
                 overflow: TextOverflow.ellipsis,
               ),
             ),
-            widget.status == 4 &&
-                    index < 3 &&
-                    info.video != '' &&
-                    info.video != null
+            widget.status == 4 && index < 3 && info.video != '' && info.video != null
                 ? Container(
                     width: 68,
                     height: 24,
@@ -163,23 +162,17 @@ class SecondPageState extends State<SecondPage> {
                         '查看回放',
                         style: TextStyle(fontSize: 12),
                       ),
-                      onPressed: () => {
-                            Navigator.push(
-                                context,
-                                CupertinoPageRoute(
-                                    builder: (context) => VideoPlayerPage(
-                                        videoUrl: info.video,
-                                        fileType: 'netWork')))
-                          },
+                      onPressed: () =>
+                          {Navigator.push(context, CupertinoPageRoute(builder: (context) => VideoPlayerPage(videoUrl: info.video, fileType: 'netWork')))},
                     ),
                   )
                 : Container(),
-            widget.status == 4 && index < 3
+            img!=''
                 ? Image.asset(
-                    jiangpaiImg[index],
+                   img,
                     width: 32,
                   )
-                : Container()
+                : Text('')
           ],
         ),
       ),

+ 2 - 2
lib/widget/RoomItem.dart

@@ -85,10 +85,10 @@ class HouseItem extends StatelessWidget {
                 Row(
                   mainAxisAlignment: MainAxisAlignment.center,
                   children: <Widget>[
-                    Image.asset('images/icon_renshu.png', width: 20),
+                    Image.asset(roomInfo.statusFlag==0?'images/icon_renshu_hong.png':'images/icon_renshu.png', width: 20),
                     Text(
                       (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.w500, color:roomInfo.statusFlag==0? Theme.of(context).primaryColor: Color(0xFFB1B2C0)),
                     )
                   ],
                 )