Browse Source

Merge remote-tracking branch 'origin/master'

# Conflicts:
#	android/app/build.gradle
#	lib/pages/HomePage.dart
x1ongzhu 6 năm trước cách đây
mục cha
commit
93c04280ea

BIN
images/0.png


BIN
images/1.png


BIN
images/2.png


BIN
images/3.png


BIN
images/4.png


BIN
images/5.png


BIN
images/6.png


BIN
images/7.png


BIN
images/8.png


BIN
images/9.png


BIN
images/Create.png


BIN
images/centerBtn.png


BIN
images/email.png


BIN
images/home_icon_yuan.png


BIN
images/icon_xuanzhong.png


BIN
images/join.png


BIN
images/person.png


BIN
images/search.png


BIN
images/setting.png


BIN
images/shoppingmall.png


+ 3 - 18
lib/pages/CompetitionInformation.dart

@@ -125,24 +125,9 @@ class InfoBox extends StatelessWidget {
                   textColor: Color(0xFF727785),
                   highlightColor: Colors.transparent,
                   splashColor: Colors.transparent,
-                  child: Text('不再提醒'),
-                  onPressed: () async {
-                    Result res =
-                        await HttpManager.post('userInfo/update', data: {
-                      "id":
-                          StoreProvider.of<AppState>(context).state.userInfo.id,
-                      'remindFlag': 'N'
-                    });
-                    if (res.success) {
-                      Result res2 =
-                          await HttpManager.get("userInfo/getUserInfo");
-                      if (res2.success) {
-                        StoreProvider.of<AppState>(context).dispatch(
-                            UpdateUserAction(UserInfo.fromJson(res2.data)));
-                      }
-                    }
-
-                    Navigator.of(context).pop();
+                  child: Text('关闭'),
+                  onPressed: (){
+                    end();
                   },
                 )
               ],

+ 271 - 133
lib/pages/HomePage.dart

@@ -4,6 +4,7 @@ import 'CreateRoom.dart';
 import 'RoomList.dart';
 import 'rankList.dart';
 import 'roomInfo.dart';
+import 'ShoppingMall.dart';
 import 'package:flutter/cupertino.dart';
 import 'package:flutter_swiper/flutter_swiper.dart';
 import '../model/GameInfoSeasons.dart';
@@ -73,11 +74,16 @@ class _HomePageState extends State<HomePage> with WidgetsBindingObserver {
 
   void getOneRoom() async {
     Toast.show(context, '加载中', -1, 'loading');
-    Result res = await HttpManager.get("houseInfo/getOne", data: {'statusFlag': 0});
+    Result res =
+        await HttpManager.get("houseInfo/getOne", data: {'statusFlag': 0});
     Toast.hide();
     if (res.success) {
       if (res.data != null) {
-        Navigator.push(context, new CupertinoPageRoute(builder: (context) => new RoomInfo(roomId: res.data['id'].toString())));
+        Navigator.push(
+            context,
+            new CupertinoPageRoute(
+                builder: (context) =>
+                    new RoomInfo(roomId: res.data['id'].toString())));
       } else {
         showBackDialog();
       }
@@ -85,7 +91,10 @@ class _HomePageState extends State<HomePage> with WidgetsBindingObserver {
   }
 
   void getUnreadMsg() async {
-    Result res = await HttpManager.get("systemNotice/unread", data: {'userId': StoreProvider.of<AppState>(context).state.userInfo.id, 'statusFlag': 0});
+    Result res = await HttpManager.get("systemNotice/unread", data: {
+      'userId': StoreProvider.of<AppState>(context).state.userInfo.id,
+      'statusFlag': 0
+    });
     if (res.success && res.data != null) {
       if (res.data > 0) {
         setState(() {
@@ -132,8 +141,10 @@ class _HomePageState extends State<HomePage> with WidgetsBindingObserver {
           width: double.infinity,
           height: double.infinity,
           decoration: BoxDecoration(
-              gradient: LinearGradient(
-                  colors: [Color.fromARGB(255, 177, 59, 56), Color.fromARGB(255, 147, 64, 61)], begin: Alignment.topCenter, end: Alignment.bottomCenter)),
+              gradient: LinearGradient(colors: [
+            Color.fromARGB(255, 177, 59, 56),
+            Color.fromARGB(255, 147, 64, 61)
+          ], begin: Alignment.topCenter, end: Alignment.bottomCenter)),
           child: SafeArea(
             child: centerWidget(context),
           ),
@@ -142,10 +153,52 @@ class _HomePageState extends State<HomePage> with WidgetsBindingObserver {
           Future.value(true);
         },
       ),
+      floatingActionButton: floatWidget(),
+      floatingActionButtonLocation: FloatingActionButtonLocation.centerDocked,
+    );
+  }
+
+  Widget floatWidget() {
+    return Container(
+      decoration: BoxDecoration(
+          borderRadius: BorderRadius.all(Radius.circular(100)),
+          border: Border.all(width: 1, color: Color(0xFF1B1C28))),
+      width: 166,
+      height: 166,
+      margin: EdgeInsets.only(bottom: 84),
+      child: CircleAvatar(
+          backgroundImage: AssetImage('images/centerBtn.png'),
+          child: ClipOval(
+              child: Material(
+                  color: Colors.transparent,
+                  child: InkWell(
+                    child: Container(
+                      width: 166,
+                      height: 166,
+                      child: Center(
+                        child: UnconstrainedBox(
+                          child: Image.asset('images/join.png', width: 85),
+                        ),
+                      ),
+                    ),
+                    onTap: () {
+                      getOneRoom();
+                    },
+                  )))),
     );
   }
 
   Widget centerWidget(BuildContext context) {
+    double width = MediaQuery.of(context).size.width;
+    double height = MediaQuery.of(context).size.height;
+    String endSTring = '';
+    if (seasonList.length > 0) {
+      int _time = seasonList[nowIndex].competitionSeason.endTime -
+          DateTime.now().millisecondsSinceEpoch;
+      _time = _time ~/ 1000 ~/ 3600 ~/ 24;
+      endSTring = '倒计时 ' + _time.toString() + ' 天';
+    }
+
     return Column(
       children: <Widget>[
         Expanded(
@@ -162,8 +215,13 @@ class _HomePageState extends State<HomePage> with WidgetsBindingObserver {
                             Navigator.push(
                                 context,
                                 new CupertinoPageRoute(
-                                    builder: (context) =>
-                                        new RankList(raceId: seasonList[index].competitionSeason.id, gameId: seasonList[index].competitionSeason.gameId)));
+                                    builder: (context) => new RankList(
+                                        raceId: seasonList[index]
+                                            .competitionSeason
+                                            .id,
+                                        gameId: seasonList[index]
+                                            .competitionSeason
+                                            .gameId)));
                           },
                           onIndexChanged: (index) {
                             setState(() {
@@ -172,72 +230,52 @@ class _HomePageState extends State<HomePage> with WidgetsBindingObserver {
                           },
                           itemBuilder: (context, index) {
                             return Center(
-                              child: SizedBox(
-                                  width: 214,
-                                  height: 214,
-                                  child: Stack(
+                                child: Container(
+                              width: 0.64 * (height - 334),
+                              height: 0.64 * (height - 334),
+                              decoration: BoxDecoration(
+                                  image: DecorationImage(
+                                      image: AssetImage(
+                                          "images/home_icon_yuan.png"),
+                                      fit: BoxFit.contain)),
+                              child: Column(
+                                mainAxisAlignment: MainAxisAlignment.center,
+                                children: <Widget>[
+                                  Text('赛季奖金',
+                                      style: TextStyle(
+                                          color: Color(0xFFFFFFFF),
+                                          fontSize: 13)),
+                                  Container(
+                                    height: 0.1 * (height - 334),
+                                  ),
+                                  Row(
+                                    mainAxisAlignment: MainAxisAlignment.center,
+                                    crossAxisAlignment: CrossAxisAlignment.end,
+                                    children: _moneyList(),
+                                  ),
+                                  Container(
+                                    height: 0.06 * (height - 334),
+                                  ),
+                                  Column(
                                     children: <Widget>[
-                                      Image.asset("images/home_icon_yuan.png"),
-                                      Center(
-                                        child: Row(
-                                          mainAxisAlignment: MainAxisAlignment.center,
-                                          crossAxisAlignment: CrossAxisAlignment.baseline,
-                                          textBaseline: TextBaseline.alphabetic,
-                                          children: <Widget>[
-                                            Text(
-                                              (seasonList[index].competitionSeason.bonus / 1000).toStringAsFixed(1),
-                                              style: TextStyle(
-                                                color: Colors.white,
-                                                fontSize: 68,
-                                                fontFamily: 'DINEngschrift',
-                                              ),
-                                            ),
-                                            Text(
-                                              "K",
-                                              style: TextStyle(
-                                                color: Colors.white,
-                                                fontSize: 36,
-                                                fontFamily: 'DINEngschrift',
-                                              ),
-                                            )
-                                          ],
-                                        ),
-                                      ),
-                                      Positioned(
-                                        bottom: 30,
-                                        left: 0,
-                                        right: 0,
-                                        child: Column(
-                                          children: <Widget>[
-                                            // Text(
-                                            //   "当前排名",
-                                            //   style: TextStyle(
-                                            //       color: Colors.white, fontSize: 13),
-                                            // ),
-                                            // Text(
-                                            //   "98686",
-                                            //   style: TextStyle(
-                                            //       color: Colors.white, fontSize: 13),
-                                            // )
-                                          ],
-                                        ),
-                                      ),
-                                      Center(
-                                        child: MaterialButton(
-                                          child: Text("data"),
-                                          onPressed: () async {
-                                            ScreenStreamPlugin.start('rtmp://123');
-                                          },
-                                        ),
-                                      )
+                                      Text('当前排名',
+                                          style: TextStyle(
+                                              color: Color(0xFFFFFFFF),
+                                              fontSize: 13)),
+                                      Text('2',
+                                          style: TextStyle(
+                                              color: Color(0xFFFFFFFF),
+                                              fontSize: 13))
                                     ],
-                                  )),
-                            );
+                                  )
+                                ],
+                              ),
+                            ));
                           },
                         )
                       : Container()),
               Positioned(
-                left: 0,
+                left: 10,
                 top: 0,
                 width: 48,
                 height: 48,
@@ -250,14 +288,14 @@ class _HomePageState extends State<HomePage> with WidgetsBindingObserver {
                           },
                           child: Padding(
                             padding: EdgeInsets.all(12),
-                            child: Image.asset("images/home_icon_wode.png"),
+                            child: Image.asset("images/person.png",width: 24,),
                           ),
                         ),
                   ),
                 ),
               ),
               Positioned(
-                right: 0,
+                right: 10,
                 top: 0,
                 width: 48,
                 height: 48,
@@ -265,29 +303,51 @@ class _HomePageState extends State<HomePage> with WidgetsBindingObserver {
                   color: Colors.transparent,
                   child: InkWell(
                     onTap: () {
-                      Navigator.push(context, new CupertinoPageRoute(builder: (context) => new Setting()));
+                      Navigator.push(
+                          context,
+                          new CupertinoPageRoute(
+                              builder: (context) => new Setting()));
                     },
                     child: Padding(
                       padding: EdgeInsets.all(12),
-                      child: Image.asset("images/home_icon_shezhi.png"),
+                      child: Image.asset("images/setting.png",width: 24),
                     ),
                   ),
                 ),
               ),
               Positioned(
-                bottom: 11,
+                top: 15,
                 left: 0,
                 right: 0,
                 child: Column(
                   mainAxisAlignment: MainAxisAlignment.center,
                   crossAxisAlignment: CrossAxisAlignment.center,
                   children: <Widget>[
+                    // Text(
+                    //   seasonList.length > 0
+                    //       ? seasonList[nowIndex].competitionSeason.season
+                    //       : '',
+                    //   style: TextStyle(color: Colors.white, fontSize: 14),
+                    // ),
                     Text(
-                      seasonList.length > 0 ? seasonList[nowIndex].competitionSeason.season : '',
+                      seasonList.length > 0
+                          ? seasonList[nowIndex].gameName
+                          : '',
                       style: TextStyle(color: Colors.white, fontSize: 14),
-                    ),
+                    )
+                  ],
+                ),
+              ),
+              Positioned(
+                bottom: 20,
+                left: 0,
+                right: 0,
+                child: Column(
+                  mainAxisAlignment: MainAxisAlignment.center,
+                  crossAxisAlignment: CrossAxisAlignment.center,
+                  children: <Widget>[
                     Text(
-                      seasonList.length > 0 ? seasonList[nowIndex].gameName : '',
+                      endSTring,
                       style: TextStyle(color: Colors.white, fontSize: 14),
                     )
                   ],
@@ -298,13 +358,8 @@ class _HomePageState extends State<HomePage> with WidgetsBindingObserver {
         ),
         Builder(
           builder: (BuildContext context) {
-            double width = MediaQuery.of(context).size.width;
-            double height = MediaQuery.of(context).size.height;
             double aspectRatio = 1;
-            // if (height / width < 20 / 9) {
-
-            // }
-            aspectRatio = width / (height - 350);
+            aspectRatio = width / 334;
             return Container(
               child: GridView.count(
                 physics: new BouncingScrollPhysics(),
@@ -313,15 +368,19 @@ class _HomePageState extends State<HomePage> with WidgetsBindingObserver {
                 childAspectRatio: aspectRatio,
                 children: <Widget>[
                   HomeMenu(
-                    "images/home_icon_fangjian.png",
-                    "创建房间",
+                    "images/Create.png",
+                    57,
                     onTapHomeMenu: () {
                       Navigator.of(context).push(PageRouteBuilder(
                           opaque: false,
                           transitionDuration: Duration(milliseconds: 300),
-                          transitionsBuilder: (BuildContext context, Animation<double> animation, Animation<double> secondaryAnimation, Widget child) {
+                          transitionsBuilder: (BuildContext context,
+                              Animation<double> animation,
+                              Animation<double> secondaryAnimation,
+                              Widget child) {
                             return FadeTransition(
-                              opacity: CurvedAnimation(parent: animation, curve: Curves.linear),
+                              opacity: CurvedAnimation(
+                                  parent: animation, curve: Curves.linear),
                               child: child,
                             );
                           },
@@ -331,30 +390,40 @@ class _HomePageState extends State<HomePage> with WidgetsBindingObserver {
                     },
                   ),
                   HomeMenu(
-                    "images/home_icon_kuaisu.png",
-                    "快速进入",
-                    onTapHomeMenu: () {
-                      getOneRoom();
-                    },
-                  ),
-                  HomeMenu(
-                    "images/home_icon_sousuo.png",
-                    "搜索",
+                    "images/search.png",
+                    31,
                     onTapHomeMenu: () {
-                      Navigator.push(context, new CupertinoPageRoute(builder: (context) => new RoomList()));
+                      Navigator.push(
+                          context,
+                          new CupertinoPageRoute(
+                              builder: (context) => new RoomList()));
                     },
                   ),
                   HomeMenu(
-                    "images/home_icon_youjian.png",
-                    "邮件",
+                    "images/email.png",
+                    41,
                     onTapHomeMenu: () async {
-                      bool result = await Navigator.push(context, new CupertinoPageRoute(builder: (context) => new TipList()));
+                      bool result = await Navigator.push(
+                          context,
+                          new CupertinoPageRoute(
+                              builder: (context) => new TipList()));
                       if (result) {
                         getUnreadMsg();
                       }
                     },
                     showBadge: showBadge,
                   ),
+                  HomeMenu(
+                    "images/shoppingmall.png",
+                    39,
+                    onTapHomeMenu: () {
+                       Navigator.push(
+                          context,
+                          new CupertinoPageRoute(
+                              builder: (context) => new ShoppingMall()));
+                      
+                    },
+                  ),
                 ],
               ),
             );
@@ -363,24 +432,117 @@ class _HomePageState extends State<HomePage> with WidgetsBindingObserver {
       ],
     );
   }
+
+  List<Widget> _moneyList() {
+        double height = MediaQuery.of(context).size.height;
+    List<Widget> _list = [];
+
+    String bouns = (seasonList[nowIndex].competitionSeason.bonus / 1000)
+        .toStringAsFixed(1);
+    List<String> _bounsList = bouns.split('');
+    List<String> _imageList = [];
+    for (var item in _bounsList) {
+      print(item);
+      switch (item) {
+        case '0':
+          _imageList.add('images/0.png');
+          break;
+        case '1':
+          _imageList.add('images/1.png');
+          break;
+        case '2':
+          _imageList.add('images/2.png');
+          break;
+        case '3':
+          _imageList.add('images/3.png');
+          break;
+        case '4':
+          _imageList.add('images/4.png');
+          break;
+        case '5':
+          _imageList.add('images/5.png');
+          break;
+        case '6':
+          _imageList.add('images/6.png');
+          break;
+        case '7':
+          _imageList.add('images/7.png');
+          break;
+        case '8':
+          _imageList.add('images/8.png');
+          break;
+        case '9':
+          _imageList.add('images/9.png');
+          break;
+        case '.':
+          _imageList.add('.');
+          break;
+      }
+    }
+    if (_bounsList.length == 0) {
+      _imageList.add('images/0.png');
+    }
+    print(_imageList.toString());
+
+    for (var item in _imageList) {
+      if (item != '.') {
+        _list.add(Image.asset(item, height:  0.18*0.64 * (height - 334)));
+         _list.add(Container(width: 5));
+      } else {
+        _list.add(Text(
+          ".",
+          style: TextStyle(
+            color: Colors.white,
+            fontSize: 36,
+            fontFamily: 'DINEngschrift',
+            height: 0
+          ),
+        ));
+      }
+    }
+    _list.add(Text(
+      "K",
+      style: TextStyle(
+        color: Colors.white,
+        fontSize: 24,
+        fontFamily: 'DINEngschrift',
+        height: .5
+      ),
+    ));
+    return _list;
+  }
 }
 
 typedef void OnTapHomeMenu();
 
 class HomeMenu extends StatelessWidget {
   final String icon;
-  final String title;
+  final double _width;
   final OnTapHomeMenu onTapHomeMenu;
   final bool showBadge;
-  HomeMenu(this.icon, this.title, {this.onTapHomeMenu, this.showBadge = false});
+  HomeMenu(this.icon, this._width,
+      {this.onTapHomeMenu, this.showBadge = false});
   @override
   Widget build(BuildContext context) {
     return Container(
-      decoration:
-          BoxDecoration(gradient: LinearGradient(begin: Alignment.topCenter, end: Alignment.bottomCenter, colors: [Color(0xFF626C85), Color(0xFF3D3E6C)])),
+      decoration: BoxDecoration(
+          gradient: LinearGradient(
+              begin: Alignment.topCenter,
+              end: Alignment.bottomCenter,
+              stops: [
+            0.0,
+            0.01,
+            0.8
+          ],
+              colors: [
+            Color(0xFF7E89B7),
+            Color(0xFF4E536F),
+            Color(0xFF333558)
+          ])),
       child: Container(
         decoration: BoxDecoration(
             border: Border(
+                // top: BorderSide(width: 2,color: Color(0xFF7E89B7)),
                 left: BorderSide(width: 0.5, color: Color(0x80000000)),
                 right: BorderSide(width: 0.5, color: Color(0x80000000)),
                 bottom: BorderSide(width: 1, color: Color(0x80000000)))),
@@ -388,38 +550,14 @@ class HomeMenu extends StatelessWidget {
           color: Colors.transparent,
           child: InkWell(
             onTap: onTapHomeMenu,
-            child: Column(
-              mainAxisAlignment: MainAxisAlignment.center,
-              children: <Widget>[
-                Container(
-                  width: 44,
-                  height: 34,
-                  child: Stack(
-                    children: <Widget>[
-                      Image.asset(
-                        icon,
-                        fit: BoxFit.contain,
-                        width: 44,
-                        height: 34,
-                      ),
-                      Positioned(
-                        right: 0,
-                        top: 0,
-                        child: Container(
-                          width: showBadge ? 10 : 0,
-                          height: showBadge ? 10 : 0,
-                          decoration: BoxDecoration(color: Color.fromARGB(255, 239, 0, 9), borderRadius: BorderRadius.all(Radius.circular(10))),
-                        ),
-                      )
-                    ],
-                  ),
+            child: Container(
+              child: Center(
+                child: Image.asset(
+                  icon,
+                  fit: BoxFit.contain,
+                  width: _width,
                 ),
-                Text(
-                  title,
-                  style: TextStyle(color: Colors.white, fontSize: 14),
-                  textAlign: TextAlign.center,
-                )
-              ],
+              ),
             ),
           ),
         ),

+ 172 - 0
lib/pages/ShoppingMall.dart

@@ -0,0 +1,172 @@
+import 'package:flutter/material.dart';
+import '../styles/colors.dart';
+
+class ShoppingMall extends StatefulWidget {
+  @override
+  ShoppingMallState createState() => ShoppingMallState();
+}
+
+class ShoppingMallState extends State<ShoppingMall> {
+  final List<Tab> myTabs = <Tab>[Tab(text: '金币充值'), Tab(text: '会员充值')];
+
+  @override
+  Widget build(BuildContext context) {
+    return DefaultTabController(
+      length: myTabs.length,
+      child: Scaffold(
+        appBar: AppBar(
+          backgroundColor: PRIMARY_COLOR,
+          title: Padding(
+            padding: EdgeInsets.only(right: 56),
+            child: TabBar(
+              tabs: myTabs,
+              indicatorColor: Colors.white,   
+              labelColor: Colors.white,
+              indicatorSize: TabBarIndicatorSize.label,
+            ),
+          ),
+        ),
+        body: TabBarView(
+          children: <Widget>[Recharge(
+            type:0
+          ), Recharge(
+            type: 1,
+          )],
+        ),
+      ),
+    );
+  }
+}
+
+class Recharge extends StatefulWidget {
+    Recharge({Key key, this.type}) : super(key: key);
+final int type;//类型 0 金币 1 会员
+  @override
+  RechargeState createState() => RechargeState();
+}
+
+class RechargeState extends State<Recharge> {
+  List moneyList = [100, 300, 500, 1000, 2000, 5000];
+   List vipList = [{
+     "name":'VIP1',
+     "value":100
+   },{
+     "name":'VIP2',
+     "value":300
+   },{
+     "name":'VIP3',
+     "value":500
+   },{
+     "name":'VIP4',
+     "value":1000
+   },{
+     "name":'VIP5',
+     "value":2000
+   },{
+     "name":'VIP6',
+     "value":5000
+   }];
+  int chooseMoney = 100;
+  @override
+  void initState() {
+    // TODO: implement initState
+    super.initState();
+    print(widget.type);
+  }
+  @override
+  Widget build(BuildContext context) {
+    return Scaffold(
+      body: Container(
+        color: BG_COLOR,
+        child: ListView.builder(
+            itemCount: widget.type==0?moneyList.length:vipList.length,
+            itemBuilder: (BuildContext context, int index) {
+              bool isChoose=false;
+              if(widget.type==0){
+                if(moneyList[index]==chooseMoney){
+                  isChoose=true;
+                }
+              }
+              else{
+                if(vipList[index]['value']==chooseMoney){
+                  isChoose=true;
+                }
+              }
+              return Container(
+                padding: EdgeInsets.symmetric(horizontal: 15),
+                margin: EdgeInsets.only(top: 10),
+                height: 60,
+                child: FlatButton(
+                  color: Color(0xFF222335),
+                  padding: EdgeInsets.all(0),
+                  shape: Border.all(
+                      color: isChoose
+                          ? Color(0xFFC2524D)
+                          : Colors.transparent,
+                      width: 1),
+                  disabledColor: Color(0xFF222335),
+                  child: Container(
+                    child: Stack(
+                      children: <Widget>[
+                        Center(
+                          child: Row(
+                            mainAxisAlignment: MainAxisAlignment.center,
+                            children: <Widget>[
+                              Text(widget.type==0?(moneyList[index].toString() + "金币"):vipList[index]['name'],
+                                  style: TextStyle(
+                                      color: Color(0xFFFFFFFF),
+                                      fontWeight: FontWeight.w500,
+                                      fontSize: 15)),
+                              Container(
+                                width: 10,
+                              ),
+                              Text(
+                                widget.type==0?("¥"+moneyList[index].toString()):("¥"+vipList[index]['value'].toString()),
+                                style: TextStyle(
+                                    color: Color(0xFF727785),
+                                    fontWeight: FontWeight.w400,
+                                    fontSize: 14),
+                              )
+                            ],
+                          ),
+                        ),
+                        Positioned(
+                          right: 0,
+                          bottom: 0,
+                          child: isChoose
+                              ? Image.asset('images/icon_xuanzhong.png',
+                                  width: 36)
+                              : Container(),
+                        )
+                      ],
+                    ),
+                  ),
+                  onPressed: isChoose
+                      ? null
+                      : () {
+
+                          setState(() {
+                            chooseMoney =  widget.type==0?moneyList[index]:vipList[index]['value'];
+                          });
+                        },
+                ),
+              );
+            }),
+      ),
+      floatingActionButton: Container(
+        width: double.infinity,
+        padding: EdgeInsets.symmetric(horizontal:15),
+        height: 48,
+        child: FlatButton(
+          color: PRIMARY_COLOR,
+          textColor: Colors.white,
+          child: Text('立即充值'),
+          onPressed: (){
+              
+          },
+        ),
+      ),
+      floatingActionButtonLocation:FloatingActionButtonLocation.centerFloat,
+    );
+  }
+}

+ 1 - 1
lib/pages/loginSecond.dart

@@ -1,5 +1,4 @@
 import 'dart:async';
-
 import 'package:flutter/material.dart';
 import 'package:shared_preferences/shared_preferences.dart';
 import 'package:flutter/cupertino.dart';
@@ -172,6 +171,7 @@ class LoginSecondState extends State<LoginSecond> {
   void sendMsg() async {
     Toast.show(context, '加载中', -1, 'loading');
     final Result res = await HttpManager.get('rong/sendCode', data: {"phone": widget.phone});
+    print('错误'+res.error);
     Toast.hide();
     if (res.success) {
       Toast.show(context, '发送成功', 1500, 'success');

+ 107 - 70
lib/pages/roomInfo.dart

@@ -51,20 +51,13 @@ class RoomInfoState extends State<RoomInfo>
       setState(() {
         roomInfo = res.data;
         houseInfo = HouseInfo.fromJson(res.data);
-      
       });
 
-      
       if (houseInfo.statusFlag == 0) {
-        if (StoreProvider.of<AppState>(context).state.userInfo.remindFlag) {
-          showNotice();
-        }
+        showNotice();
       }
-      
-      
     } else {}
 
-   
     checkJoinInfo();
   }
 
@@ -153,7 +146,7 @@ class RoomInfoState extends State<RoomInfo>
           data: {'id': playerInfo.id, 'statusFlag': 3});
       bool success = await ScreenStreamPlugin.stop();
 
-      Timer(Duration(seconds: 1),(){
+      Timer(Duration(seconds: 1), () {
         getEndTips();
       });
 
@@ -211,7 +204,7 @@ class RoomInfoState extends State<RoomInfo>
         }
       } else {
         playerInfo = PlayerInfo.fromJson(res.data);
-      
+
         setState(() {
           isJoin = true;
         });
@@ -227,21 +220,21 @@ class RoomInfoState extends State<RoomInfo>
             ]);
             changeScroll();
           } else {
-            roomTipsList.add([
-              '请在此页面耐心等待,竞赛即将开始,届时玩家有10秒的时间进行确认,点击确认方可正式进入竞赛,若没有点击,则视为自动放弃此次竞赛,已支付金币概不退换'
-            ]);
-            changeScroll();
+            // roomTipsList.add([
+            //   '请在此页面耐心等待,竞赛即将开始,届时玩家有10秒的时间进行确认,点击确认方可正式进入竞赛,若没有点击,则视为自动放弃此次竞赛,已支付金币概不退换'
+            // ]);
+            // changeScroll();
           }
-          Timer(Duration(seconds: 1), () {
-            roomTipsList.add([
-              '游戏开始后会有弹窗提示授权进行录屏的操作,',
-              '请一定点击“确定”或“允许”此操作',
-              ',系统会自动跳转打开游戏app,若长时间没有自动跳转,请手动打开游戏app进行比赛,在游戏比赛结束后,请',
-              '一定要点击查看游戏最后的分数名次结算页面',
-              ',返回游戏主页,最后再切换到我们竞赛app中,点击完成比赛,方可成功上传本次成绩。从游戏开始一小时之内必须返回全民App点击完成比赛,否则判定游戏失败,祝你取得好成绩。'
-            ]);
-            changeScroll();
-          });
+          // Timer(Duration(seconds: 1), () {
+          //   roomTipsList.add([
+          //     '游戏开始后会有弹窗提示授权进行录屏的操作,',
+          //     '请一定点击“确定”或“允许”此操作',
+          //     ',系统会自动跳转打开游戏app,若长时间没有自动跳转,请手动打开游戏app进行比赛,在游戏比赛结束后,请',
+          //     '一定要点击查看游戏最后的分数名次结算页面',
+          //     ',返回游戏主页,最后再切换到我们竞赛app中,点击完成比赛,方可成功上传本次成绩。从游戏开始一小时之内必须返回全民App点击完成比赛,否则判定游戏失败,祝你取得好成绩。'
+          //   ]);
+          //   changeScroll();
+          // });
         } else if (houseInfo.statusFlag != 4) {
           if (playerInfo.statusFlag == 3 ||
               playerInfo.statusFlag == 8 ||
@@ -252,10 +245,10 @@ class RoomInfoState extends State<RoomInfo>
       }
     }
 
-    if(isJoin&&houseInfo.statusFlag!=4){
-         timer = Timer.periodic(new Duration(seconds: 1), (timer) {
-          getNowStatus();
-        });
+    if (isJoin && houseInfo.statusFlag != 4) {
+      timer = Timer.periodic(new Duration(seconds: 1), (timer) {
+        getNowStatus();
+      });
     }
   }
 
@@ -301,12 +294,14 @@ class RoomInfoState extends State<RoomInfo>
   }
 
   //获取分秒
-  String getSecondsMIn(int time){
-    if(time==null){
+  String getSecondsMIn(int time) {
+    if (time == null) {
       return '';
-    }
-    else{
-      return ((time ~/ 1000 ~/ 60) % 60).toString()+'分'+(time ~/ 1000 % 60).toString()+'秒';
+    } else {
+      return ((time ~/ 1000 ~/ 60) % 60).toString() +
+          '分' +
+          (time ~/ 1000 % 60).toString() +
+          '秒';
     }
   }
 
@@ -398,8 +393,8 @@ class RoomInfoState extends State<RoomInfo>
       ),
       onWillPop: () {
         if (houseInfo == null || (houseInfo.statusFlag != 0) || !isJoin) {
-          if(timer!=null){
-             timer.cancel();
+          if (timer != null) {
+            timer.cancel();
           }
           isPop = true;
           Toast.hide();
@@ -506,7 +501,7 @@ class RoomInfoState extends State<RoomInfo>
                           ),
                           Text(
                             (houseInfo != null
-                                    ? (houseInfo.playerNumber??0).toString()
+                                    ? (houseInfo.playerNumber ?? 0).toString()
                                     : '0') +
                                 '/' +
                                 (houseInfo != null
@@ -642,10 +637,12 @@ class RoomInfoState extends State<RoomInfo>
         ),
       );
     } else if (isJoin && statusFlag == 0) {
-        int _time;
-        if(houseInfo!=null){
-          _time=houseInfo.createTime+600000-DateTime.now().millisecondsSinceEpoch;
-        }
+      int _time;
+      if (houseInfo != null) {
+        _time = houseInfo.createTime +
+            600000 -
+            DateTime.now().millisecondsSinceEpoch;
+      }
       return Container(
         width: double.infinity,
         padding: EdgeInsets.symmetric(horizontal: 15, vertical: 20),
@@ -654,7 +651,7 @@ class RoomInfoState extends State<RoomInfo>
           disabledColor: Color(0xFF914244),
           disabledTextColor: Color(0xFF252532),
           child: Text(
-            '预计'+getSecondsMIn(_time)+'后开始',
+            '预计' + getSecondsMIn(_time) + '后开始',
             style: TextStyle(fontSize: 16),
           ),
           onPressed: null,
@@ -669,17 +666,19 @@ class RoomInfoState extends State<RoomInfo>
           disabledColor: Color(0xFF914244),
           disabledTextColor: Color(0xFF252532),
           child: Text(
-             '正在努力解析视频中',
+            '正在努力解析视频中',
             style: TextStyle(fontSize: 16),
           ),
           onPressed: null,
         ),
       );
-    } else if (isJoin && (statusFlag == 2||statusFlag == 3)) {
+    } else if (isJoin && (statusFlag == 2 || statusFlag == 3)) {
       int _time;
-        if(houseInfo!=null){
-          _time=houseInfo.beginTime+3600000-DateTime.now().millisecondsSinceEpoch;
-        }
+      if (houseInfo != null) {
+        _time = houseInfo.beginTime +
+            3600000 -
+            DateTime.now().millisecondsSinceEpoch;
+      }
       return Container(
         width: double.infinity,
         padding: EdgeInsets.symmetric(horizontal: 15, vertical: 20),
@@ -688,7 +687,7 @@ class RoomInfoState extends State<RoomInfo>
           disabledColor: Color(0xFF914244),
           disabledTextColor: Color(0xFF252532),
           child: Text(
-            '最迟在'+getSecondsMIn(_time)+'后结算',
+            '最迟在' + getSecondsMIn(_time) + '后结算',
             style: TextStyle(fontSize: 16),
           ),
           onPressed: null,
@@ -732,40 +731,78 @@ class TipsListContent extends StatelessWidget {
   }
 
   List<Widget> _list() {
-    List<Tips> myList = [];
-    for (var item in tipsList) {
+    List<Widget> myList = [];
+    for (int i = 0; i < tipsList.length; i++) {
       myList.add(Tips(
-        content: item,
-      ));
+        content: tipsList[i],
+        showTongzhi: (tipsList[i].length==1&&i == 0 )? true : false,
+      ));  
     }
+
     return myList;
   }
 }
 
 class Tips extends StatelessWidget {
-  Tips({Key key, this.content}) : super(key: key);
+  Tips({Key key, this.content, this.showTongzhi}) : super(key: key);
   final List<String> content;
+  final bool showTongzhi;
   @override
   Widget build(BuildContext context) {
     return Container(
-      padding: EdgeInsets.all(15),
-      margin: EdgeInsets.fromLTRB(15, 10, 15, 0),
-      decoration: BoxDecoration(
-          gradient: LinearGradient(
-              colors: [Color(0xFF464B6A), Color(0xFF35395E)],
-              begin: Alignment.topCenter,
-              end: Alignment.bottomCenter),
-          borderRadius: BorderRadius.only(
-              topRight: Radius.circular(8),
-              bottomLeft: Radius.circular(8),
-              bottomRight: Radius.circular(8))),
-      child: content.length == 1
-          ? Text(
-              content[0],
-              style: TextStyle(color: Colors.white, fontSize: 13),
-            )
-          : _textList(),
-    );
+        padding: EdgeInsets.all(15),
+        margin: EdgeInsets.fromLTRB(15, 10, 15, 0),
+        decoration: BoxDecoration(
+            gradient: LinearGradient(
+                colors: [Color(0xFF464B6A), Color(0xFF35395E)],
+                begin: Alignment.topCenter,
+                end: Alignment.bottomCenter),
+            borderRadius: BorderRadius.only(
+                topRight: Radius.circular(8),
+                bottomLeft: Radius.circular(8),
+                bottomRight: Radius.circular(8))),
+        child: Column(
+          children: <Widget>[
+            content.length == 1
+                ? Text(
+                    content[0],
+                    style: TextStyle(color: Colors.white, fontSize: 13),
+                  )
+                : _textList(),
+            showTongzhi
+                ? FlatButton(
+                    padding: EdgeInsets.all(0),
+                    textColor: PRIMARY_COLOR,
+                    highlightColor: Colors.transparent,
+                    splashColor: Colors.transparent,
+                    child: Text(
+                      "查看竞赛须知",
+                      style: TextStyle(
+                        decoration: TextDecoration.underline,
+                      ),
+                    ),
+                    onPressed: () => {
+                          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();
+                              }))
+                        },
+                  )
+                : Container()
+          ],
+        ));
   }
 
   Widget _textList() {