panhui 6 سال پیش
والد
کامیت
85a56d698f
100فایلهای تغییر یافته به همراه971 افزوده شده و 522 حذف شده
  1. 1 0
      .vscode/launch.json
  2. 1 1
      android/app/src/main/AndroidManifest.xml
  3. BIN
      android/app/src/main/res/mipmap-hdpi/icon_qidongye.png
  4. BIN
      android/app/src/main/res/mipmap-mdpi/icon_qidongye.png
  5. BIN
      android/app/src/main/res/mipmap-xhdpi/icon_qidongye.png
  6. BIN
      android/app/src/main/res/mipmap-xxhdpi/icon_qidongye.png
  7. BIN
      android/app/src/main/res/mipmap-xxxhdpi/icon_qidongye.png
  8. BIN
      images/2x/home_banner_01.png
  9. BIN
      images/2x/home_icon_sousuo.png
  10. BIN
      images/2x/home_icon_xiaoxi.png
  11. BIN
      images/2x/icon_inter_000.png
  12. BIN
      images/2x/icon_weixin.png
  13. BIN
      images/2x/icon_weixuanzhong.png
  14. BIN
      images/2x/icon_xuanzhong.png
  15. BIN
      images/2x/icon_xuanzhong2.png
  16. BIN
      images/2x/icon_zhankai_huise.png
  17. BIN
      images/2x/icon_zhifubao.png
  18. BIN
      images/2x/img_fangjian_hong.png
  19. BIN
      images/2x/img_fangjian_huise.png
  20. BIN
      images/2x/info_icon_shezhi.png
  21. BIN
      images/2x/info_img_bg.png
  22. BIN
      images/2x/info/钱包.png
  23. BIN
      images/2x/join.png
  24. BIN
      images/2x/tabbar_icon_01_pre.png
  25. BIN
      images/2x/tabbar_icon_03.png
  26. BIN
      images/2x/text_yonghuduan.png
  27. BIN
      images/2x/yindao_bg_01.png
  28. BIN
      images/2x/yindao_bg_02.png
  29. BIN
      images/2x/yindao_bg_03.png
  30. BIN
      images/2x/yindao_logo.png
  31. BIN
      images/2x/yindao_text_01.png
  32. BIN
      images/2x/yindao_text_02.png
  33. BIN
      images/2x/yindao_text_03.png
  34. BIN
      images/2x/活动详情/icon_renshu.png
  35. BIN
      images/3x/home_banner_01.png
  36. BIN
      images/3x/home_icon_sousuo@3x.png
  37. BIN
      images/3x/home_icon_xiaoxi.png
  38. BIN
      images/3x/icon_inter_000.png
  39. BIN
      images/3x/icon_weixin@3x.png
  40. BIN
      images/3x/icon_weixuanzhong.png
  41. BIN
      images/3x/icon_xuanzhong2.png
  42. BIN
      images/3x/icon_zhankai_huise.png
  43. BIN
      images/3x/icon_zhifubao@3x.png
  44. BIN
      images/3x/img_fangjian_hong.png
  45. BIN
      images/3x/img_fangjian_huise.png
  46. BIN
      images/3x/info_icon_shezhi.png
  47. BIN
      images/3x/info_img_bg.png
  48. BIN
      images/3x/info/钱包.png
  49. BIN
      images/3x/join.png
  50. BIN
      images/3x/tabbar_icon_01_pre.png
  51. BIN
      images/3x/tabbar_icon_03.png
  52. BIN
      images/3x/text_yonghuduan.png
  53. BIN
      images/3x/yindao_bg_01.png
  54. BIN
      images/3x/yindao_bg_02.png
  55. BIN
      images/3x/yindao_bg_03.png
  56. BIN
      images/3x/yindao_logo.png
  57. BIN
      images/3x/yindao_text_01.png
  58. BIN
      images/3x/yindao_text_02.png
  59. BIN
      images/3x/yindao_text_03.png
  60. 0 5
      images/3x/去除文件名中.bat
  61. BIN
      images/3x/活动详情/icon_renshu.png
  62. BIN
      images/home_banner_01.png
  63. BIN
      images/home_icon_sousuo.png
  64. BIN
      images/home_icon_xiaoxi.png
  65. BIN
      images/icon_inter_000.png
  66. BIN
      images/icon_weixin.png
  67. BIN
      images/icon_weixuanzhong.png
  68. BIN
      images/icon_xuanzhong2.png
  69. BIN
      images/icon_zhankai_huise.png
  70. BIN
      images/icon_zhifubao.png
  71. BIN
      images/img_fangjian_hong.png
  72. BIN
      images/img_fangjian_huise.png
  73. BIN
      images/info_icon_shezhi.png
  74. BIN
      images/info_img_bg.png
  75. BIN
      images/info/钱包.png
  76. BIN
      images/join.png
  77. BIN
      images/tabbar_icon_01_pre.png
  78. BIN
      images/tabbar_icon_03.png
  79. BIN
      images/text_yonghuduan.png
  80. BIN
      images/yindao_bg_01.png
  81. BIN
      images/yindao_bg_02.png
  82. BIN
      images/yindao_bg_03.png
  83. BIN
      images/yindao_logo.png
  84. BIN
      images/yindao_text_01.png
  85. BIN
      images/yindao_text_02.png
  86. BIN
      images/yindao_text_03.png
  87. BIN
      images/活动详情/icon_renshu.png
  88. 2 2
      ios/Runner/Info.plist
  89. 2 2
      ios/ScreenRecorder/Info.plist
  90. 3 0
      lib/Localizations.dart
  91. 3 1
      lib/main.dart
  92. 21 0
      lib/model/BannerInfo.dart
  93. 15 0
      lib/model/BannerInfo.g.dart
  94. 1 1
      lib/model/UserInfo.dart
  95. 1 1
      lib/model/UserInfo.g.dart
  96. 166 0
      lib/pages/ChoosePay.dart
  97. 1 1
      lib/pages/CompetitionInformation.dart
  98. 135 0
      lib/pages/GuidePage.dart
  99. 59 508
      lib/pages/HomePage.dart
  100. 560 0
      lib/pages/HomePage1.dart

+ 1 - 0
.vscode/launch.json

@@ -4,6 +4,7 @@
     // 欲了解更多信息,请访问: https://go.microsoft.com/fwlink/?linkid=830387
     "version": "0.2.0",
     "configurations": [
+        
         {
             "name": "Flutter",
             "request": "launch",

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

@@ -9,7 +9,7 @@
     <application
         android:name="com.izouma.screen_stream_plugin.MyApplication"
         android:icon="@mipmap/ic_launcher"
-        android:label="猿人电竞"
+        android:label="战神电竞"
         android:networkSecurityConfig="@xml/network_security_config"
         android:usesCleartextTraffic="true">
         <activity

BIN
android/app/src/main/res/mipmap-hdpi/icon_qidongye.png


BIN
android/app/src/main/res/mipmap-mdpi/icon_qidongye.png


BIN
android/app/src/main/res/mipmap-xhdpi/icon_qidongye.png


BIN
android/app/src/main/res/mipmap-xxhdpi/icon_qidongye.png


BIN
android/app/src/main/res/mipmap-xxxhdpi/icon_qidongye.png


BIN
images/2x/home_banner_01.png


BIN
images/2x/home_icon_sousuo.png


BIN
images/2x/home_icon_xiaoxi.png


BIN
images/2x/icon_inter_000.png


BIN
images/2x/icon_weixin.png


BIN
images/2x/icon_weixuanzhong.png


BIN
images/2x/icon_xuanzhong.png


BIN
images/2x/icon_xuanzhong2.png


BIN
images/2x/icon_zhankai_huise.png


BIN
images/2x/icon_zhifubao.png


BIN
images/2x/img_fangjian_hong.png


BIN
images/2x/img_fangjian_huise.png


BIN
images/2x/info_icon_shezhi.png


BIN
images/2x/info_img_bg.png


BIN
images/2x/info/钱包.png


BIN
images/2x/join.png


BIN
images/2x/tabbar_icon_01_pre.png


BIN
images/2x/tabbar_icon_03.png


BIN
images/2x/text_yonghuduan.png


BIN
images/2x/yindao_bg_01.png


BIN
images/2x/yindao_bg_02.png


BIN
images/2x/yindao_bg_03.png


BIN
images/2x/yindao_logo.png


BIN
images/2x/yindao_text_01.png


BIN
images/2x/yindao_text_02.png


BIN
images/2x/yindao_text_03.png


BIN
images/2x/活动详情/icon_renshu.png


BIN
images/3x/home_banner_01.png


BIN
images/3x/home_icon_sousuo@3x.png


BIN
images/3x/home_icon_xiaoxi.png


BIN
images/3x/icon_inter_000.png


BIN
images/3x/icon_weixin@3x.png


BIN
images/3x/icon_weixuanzhong.png


BIN
images/3x/icon_xuanzhong2.png


BIN
images/3x/icon_zhankai_huise.png


BIN
images/3x/icon_zhifubao@3x.png


BIN
images/3x/img_fangjian_hong.png


BIN
images/3x/img_fangjian_huise.png


BIN
images/3x/info_icon_shezhi.png


BIN
images/3x/info_img_bg.png


BIN
images/3x/info/钱包.png


BIN
images/3x/join.png


BIN
images/3x/tabbar_icon_01_pre.png


BIN
images/3x/tabbar_icon_03.png


BIN
images/3x/text_yonghuduan.png


BIN
images/3x/yindao_bg_01.png


BIN
images/3x/yindao_bg_02.png


BIN
images/3x/yindao_bg_03.png


BIN
images/3x/yindao_logo.png


BIN
images/3x/yindao_text_01.png


BIN
images/3x/yindao_text_02.png


BIN
images/3x/yindao_text_03.png


+ 0 - 5
images/3x/去除文件名中.bat

@@ -1,5 +0,0 @@
-@echo off& setlocal enabledelayedexpansion
-
-for /f "delims=" %%1 in ('dir /a /b') do (set wind=%%1
-
-ren "%%~1" "!wind:@3x=!")

BIN
images/3x/活动详情/icon_renshu.png


BIN
images/home_banner_01.png


BIN
images/home_icon_sousuo.png


BIN
images/home_icon_xiaoxi.png


BIN
images/icon_inter_000.png


BIN
images/icon_weixin.png


BIN
images/icon_weixuanzhong.png


BIN
images/icon_xuanzhong2.png


BIN
images/icon_zhankai_huise.png


BIN
images/icon_zhifubao.png


BIN
images/img_fangjian_hong.png


BIN
images/img_fangjian_huise.png


BIN
images/info_icon_shezhi.png


BIN
images/info_img_bg.png


BIN
images/info/钱包.png


BIN
images/join.png


BIN
images/tabbar_icon_01_pre.png


BIN
images/tabbar_icon_03.png


BIN
images/text_yonghuduan.png


BIN
images/yindao_bg_01.png


BIN
images/yindao_bg_02.png


BIN
images/yindao_bg_03.png


BIN
images/yindao_logo.png


BIN
images/yindao_text_01.png


BIN
images/yindao_text_02.png


BIN
images/yindao_text_03.png


BIN
images/活动详情/icon_renshu.png


+ 2 - 2
ios/Runner/Info.plist

@@ -5,7 +5,7 @@
 	<key>CFBundleDevelopmentRegion</key>
 	<string>en</string>
 	<key>CFBundleDisplayName</key>
-	<string>猿人电竞</string>
+	<string>战神竞技场</string>
 	<key>CFBundleExecutable</key>
 	<string>$(EXECUTABLE_NAME)</string>
 	<key>CFBundleIdentifier</key>
@@ -13,7 +13,7 @@
 	<key>CFBundleInfoDictionaryVersion</key>
 	<string>6.0</string>
 	<key>CFBundleName</key>
-	<string>猿人电竞</string>
+	<string>战神竞技场</string>
 	<key>CFBundlePackageType</key>
 	<string>APPL</string>
 	<key>CFBundleShortVersionString</key>

+ 2 - 2
ios/ScreenRecorder/Info.plist

@@ -5,7 +5,7 @@
 	<key>CFBundleDevelopmentRegion</key>
 	<string>$(DEVELOPMENT_LANGUAGE)</string>
 	<key>CFBundleDisplayName</key>
-	<string>猿人电竞</string>
+	<string>战神竞技场</string>
 	<key>CFBundleExecutable</key>
 	<string>$(EXECUTABLE_NAME)</string>
 	<key>CFBundleIdentifier</key>
@@ -13,7 +13,7 @@
 	<key>CFBundleInfoDictionaryVersion</key>
 	<string>6.0</string>
 	<key>CFBundleName</key>
-	<string>猿人电竞</string>
+	<string>战神竞技场</string>
 	<key>CFBundlePackageType</key>
 	<string>XPC!</string>
 	<key>CFBundleShortVersionString</key>

+ 3 - 0
lib/Localizations.dart

@@ -119,6 +119,9 @@ class ChineseCupertinoLocalizations implements CupertinoLocalizations {
     await localizaltions.init();
     return SynchronousFuture<CupertinoLocalizations>(localizaltions);
   }
+
+  @override
+  String get todayLabel => null;
 }
 
 class _ChineseDelegate extends LocalizationsDelegate<CupertinoLocalizations> {

+ 3 - 1
lib/main.dart

@@ -25,7 +25,7 @@ class MobileCyberGamesApp extends StatelessWidget {
     return StoreProvider<AppState>(
       store: store,
       child: MaterialApp(
-        title: '猿人电竞',
+        title: '战神竞技场',
         supportedLocales: [
           const Locale('en'), // English
           const Locale('zh'), // China
@@ -50,6 +50,7 @@ class MobileCyberGamesApp extends StatelessWidget {
               title: TextStyle(color: Colors.white),
             ),
             primaryIconTheme: IconThemeData(color: Colors.white),
+            appBarTheme: AppBarTheme(color: Color(0xFF23253C)),
             buttonTheme: ButtonThemeData(
               buttonColor: Color(0xFFC2524D),
               highlightColor: Color(0xFF8E3B36),
@@ -58,6 +59,7 @@ class MobileCyberGamesApp extends StatelessWidget {
             )),
         home: store.state.userInfo != null ? HomePage() : LoginFirst(),
         routes: {'/home': (BuildContext context) => HomePage()},
+        color: Color(0xFF2E3049),
       ),
     );
   }

+ 21 - 0
lib/model/BannerInfo.dart

@@ -0,0 +1,21 @@
+import 'package:json_annotation/json_annotation.dart';
+
+part 'BannerInfo.g.dart';
+
+@JsonSerializable()
+class BannerInfo {
+  BannerInfo(this.id, this.imageUrl);
+  int id;
+  String imageUrl;
+  factory BannerInfo.fromJson(Map<String, dynamic> json) => _$BannerInfoFromJson(json);
+
+  Map<String, dynamic> toJson() => _$BannerInfoToJson(this);
+
+  // 命名构造函数
+  BannerInfo.empty();
+
+  @override
+  String toString() {
+    return _$BannerInfoToJson(this).toString();
+  }
+}

+ 15 - 0
lib/model/BannerInfo.g.dart

@@ -0,0 +1,15 @@
+// GENERATED CODE - DO NOT MODIFY BY HAND
+
+part of 'BannerInfo.dart';
+
+// **************************************************************************
+// JsonSerializableGenerator
+// **************************************************************************
+
+BannerInfo _$BannerInfoFromJson(Map<String, dynamic> json) {
+  return BannerInfo(json['id'] as int, json['imageUrl'] as String);
+}
+// int id;
+//   String imageUrl;
+
+Map<String, dynamic> _$BannerInfoToJson(BannerInfo instance) => <String, dynamic>{'id': instance.id, 'nickname': instance.imageUrl};

+ 1 - 1
lib/model/UserInfo.dart

@@ -12,7 +12,7 @@ class UserInfo {
   String icon;
   String phone;
   String sex;
-  int moneyCoin; //余额
+  double moneyCoin; //余额
   double moneyPoint; //积分
   int birthday;
   bool noticeFlag;//是否通知

+ 1 - 1
lib/model/UserInfo.g.dart

@@ -14,7 +14,7 @@ UserInfo _$UserInfoFromJson(Map<String, dynamic> json) {
       json['icon'] as String,
       json['phone'] as String,
       json['sex'] as String,
-      json['moneyCoin'] as int,
+      (json['moneyCoin'] as num)?.toDouble(),
       (json['moneyPoint'] as num)?.toDouble(),
       json['birthday'] as int,
       json['noticeFlag'] == 'Y',

+ 166 - 0
lib/pages/ChoosePay.dart

@@ -0,0 +1,166 @@
+import 'package:flutter/material.dart';
+import 'package:flutter/cupertino.dart';
+import '../net/HttpManager.dart';
+import '../net/Result.dart';
+import '../styles/totast.dart';
+import 'package:flutter_redux/flutter_redux.dart';
+import '../redux/AppState.dart';
+import '../model/ProductInfo.dart';
+import '../redux/UserRedux.dart';
+import '../model/UserInfo.dart';
+
+class ChoosePay extends StatefulWidget {
+  ChoosePay(this.type, this.chooseProduct);
+  int type;
+  ProductInfo chooseProduct;
+  @override
+  _ChoosePayState createState() => _ChoosePayState();
+}
+
+class _ChoosePayState extends State<ChoosePay> with WidgetsBindingObserver {
+  String chooseKey = 'alipay';
+  Future<void> getUserInfo() async {
+    Result res = await HttpManager.get('userInfo/getUserInfo');
+    if (res.success) {
+      print(res.data);
+      StoreProvider.of<AppState>(context).dispatch(UpdateUserAction(UserInfo.fromJson(res.data)));
+    } else {}
+  }
+
+  @override
+  void initState() {
+    super.initState();
+    Future.delayed(Duration.zero, () => getUserInfo());
+  }
+
+  @override
+  Widget build(BuildContext context) {
+    return Scaffold(
+      appBar: AppBar(
+        title: Text('选择支付方式'),
+        centerTitle: true,
+      ),
+      body: Container(
+        color: Color(0xFF2E3049),
+        child: Column(
+          children: <Widget>[
+            Container(
+              height: 142,
+              child: Row(
+                mainAxisAlignment: MainAxisAlignment.center,
+                crossAxisAlignment: CrossAxisAlignment.center,
+                children: <Widget>[
+                  Text(
+                    '需支付',
+                    style: TextStyle(color: Theme.of(context).primaryColor, fontSize: 12),
+                  ),
+                  Container(
+                    width: 10,
+                  ),
+                  Text('¥${widget.chooseProduct.money}', style: TextStyle(color: Theme.of(context).primaryColor, fontSize: 38))
+                ],
+              ),
+            ),
+            PayContent('支付宝', '支持有支付宝,网银的用户使用', 'images/icon_zhifubao.png', 'alipay', chooseKey, () {
+              setState(() {
+                chooseKey = 'alipay';
+              });
+            }),
+            PayContent('微信支付', '使用微信支付,方便快捷', 'images/icon_weixin.png', 'wxpay', chooseKey, () {
+              setState(() {
+                chooseKey = 'wxpay';
+              });
+            })
+          ],
+        ),
+      ),
+      floatingActionButton: Container(
+        width: double.infinity,
+        padding: EdgeInsets.symmetric(horizontal: 15),
+        height: 48,
+        child: FlatButton(
+          color: Theme.of(context).primaryColor,
+          textColor: Colors.white,
+          child: Text('立即支付'),
+          onPressed: () async {
+            Toast.show(context, '加载中', -1, 'loading');
+            final Result res = await HttpManager.post('productInfo/buy', data: {
+              'userId': StoreProvider.of<AppState>(context).state.userInfo.id,
+              'typeFlag': widget.type,
+              'money': 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');
+            }
+          },
+        ),
+      ),
+      floatingActionButtonLocation: FloatingActionButtonLocation.centerFloat,
+    );
+  }
+}
+
+typedef void OnTapMenu();
+
+class PayContent extends StatelessWidget {
+  PayContent(this.name, this.subName, this.image, this.keyVal, this.chooseKey, this.tapMenu);
+  String name;
+  String subName;
+  String image;
+  String keyVal;
+  String chooseKey;
+  OnTapMenu tapMenu;
+
+  List<String> chooseIcon = ['images/icon_weixuanzhong.png', 'images/icon_xuanzhong2.png'];
+
+  @override
+  Widget build(BuildContext context) {
+    return Material(
+        color: Colors.transparent,
+        child: InkWell(
+            onTap: tapMenu,
+            child: Container(
+              height: 86,
+              padding: EdgeInsets.fromLTRB(30, 18, 30, 18),
+              decoration: BoxDecoration(
+                  border: Border(
+                top: BorderSide(width: 1, color: Color(0xFF25273C)),
+              )),
+              child: Row(
+                children: <Widget>[
+                  Image.asset(image),
+                  Container(
+                    width: 10,
+                  ),
+                  Expanded(
+                    flex: 1,
+                    child: Column(
+                      crossAxisAlignment: CrossAxisAlignment.start,
+                      mainAxisAlignment: MainAxisAlignment.center,
+                      children: <Widget>[
+                        Text(
+                          name,
+                          style: TextStyle(color: Colors.white, fontSize: 14),
+                        ),
+                        Container(
+                          height: 6,
+                        ),
+                        Text(
+                          subName,
+                          style: TextStyle(color: Color(0xFF727785), fontSize: 13),
+                        )
+                      ],
+                    ),
+                  ),
+                  Image.asset(chooseIcon[keyVal == chooseKey ? 1 : 0])
+                ],
+              ),
+            )));
+  }
+}

+ 1 - 1
lib/pages/CompetitionInformation.dart

@@ -58,7 +58,7 @@ class CompetitionInformationState extends State<CompetitionInformation> {
   }
 }
 
-typedef OnTapHomeMenu = int Function();
+typedef OnTapHomeMenu = void Function();
 
 class InfoBox extends StatelessWidget {
   InfoBox({Key key, this.typeIndex, this.next, this.end, this.houseInfo})

+ 135 - 0
lib/pages/GuidePage.dart

@@ -0,0 +1,135 @@
+import 'package:flutter/material.dart';
+import 'package:flutter/cupertino.dart';
+import 'package:flutter_swiper/flutter_swiper.dart';
+
+class GuidePage extends StatefulWidget {
+  @override
+  _GuidePageState createState() => _GuidePageState();
+}
+
+class _GuidePageState extends State<GuidePage> with WidgetsBindingObserver {
+  int swiperIndex = 0;
+  @override
+  Widget build(BuildContext context) {
+    return GestureDetector(
+      onTap: () {
+        // Navigator.of(context).pop();
+      },
+      child: Scaffold(
+        backgroundColor: Color(0xCC000000),
+        body: Container(
+          child: new Swiper(
+              itemBuilder: (BuildContext context, int index) {
+                return GuidItem(index);
+              },
+              itemCount: 3,
+              loop: false,
+              onIndexChanged: (index) {
+                setState(() {
+                  swiperIndex = index;
+                });
+              },
+              pagination: new SwiperCustomPagination(
+                builder: (BuildContext context, SwiperPluginConfig config) {
+                  return Stack(
+                    children: <Widget>[
+                      Positioned(
+                        right: 20,
+                        top: 20,
+                        child: Image.asset('images/yindao_logo.png'),
+                      ),
+                      Positioned(
+                          right: 20,
+                          top: 60,
+                          child: Container(
+                              width: 47,
+                              height: 26,
+                              decoration: BoxDecoration(
+                                color: Colors.black12,
+                                borderRadius: BorderRadius.all(Radius.circular(13)),
+                              ),
+                              child: Center(
+                                child: InkWell(
+                                    onTap: () {
+                                      Navigator.of(context).pop();
+                                    },
+                                    child: Text('跳过', style: TextStyle(color: Colors.white, fontSize: 13), textAlign: TextAlign.center)),
+                              )))
+                    ],
+                  );
+                },
+              )),
+        ),
+        floatingActionButton: MyFloat(swiperIndex),
+        floatingActionButtonLocation: FloatingActionButtonLocation.centerDocked,
+      ),
+    );
+  }
+}
+
+class GuidItem extends StatelessWidget {
+  GuidItem(this.index);
+  int index;
+
+  List<String> bgImageList = ['images/yindao_bg_01.png', 'images/yindao_bg_02.png', 'images/yindao_bg_03.png'];
+  List<String> textImageList = ['images/yindao_text_01.png', 'images/yindao_text_02.png', 'images/yindao_text_03.png'];
+
+  @override
+  Widget build(BuildContext context) {
+    return Container(
+      decoration: BoxDecoration(image: DecorationImage(image: AssetImage(bgImageList[index]), fit: BoxFit.fill)),
+      child: Stack(
+        children: <Widget>[
+          Positioned(
+            bottom: 70,
+            left: 0,
+            child: Container(
+              width: 375,
+              child: Center(
+                child: Image.asset(textImageList[index]),
+              ),
+            ),
+          )
+        ],
+      ),
+    );
+  }
+}
+
+class MyFloat extends StatelessWidget {
+  MyFloat(this.index);
+  int index;
+  @override
+  Widget build(BuildContext context) {
+    return Container(
+      height: 70,
+      // color: Colors.black,
+      child: Center(
+          child: Row(
+        mainAxisAlignment: MainAxisAlignment.center,
+        children: index < 2
+            ? <Widget>[_dot(0, index), _dot(1, index), _dot(2, index)]
+            : <Widget>[
+                InkWell(
+                  child: Image.asset('images/icon_inter_000.png'),
+                  onTap: () {
+                    Navigator.of(context).pop();
+                  },
+                )
+              ],
+      )),
+    );
+  }
+
+  Widget _dot(index, activeIndex) {
+    return Container(
+      margin: EdgeInsets.all(2),
+      decoration: BoxDecoration(
+        color: (index == activeIndex ? Colors.white : Colors.white24),
+        borderRadius: BorderRadius.all(Radius.circular(2)),
+      ),
+      width: 8,
+      height: 4,
+    );
+  }
+}

+ 59 - 508
lib/pages/HomePage.dart

@@ -1,546 +1,97 @@
 import 'package:flutter/material.dart';
-import 'package:wanna_battle/model/PlayerInfo.dart';
-import '../widget/HomeDrawer.dart';
-import 'Appeal.dart';
-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';
-import '../styles/totast.dart';
+import '../widget/HomeDrawer.dart';
+import '../widget/LinearButton.dart';
 import '../net/HttpManager.dart';
-import '../net/Result.dart';
-import 'TipList.dart';
 import 'package:flutter_redux/flutter_redux.dart';
 import '../redux/AppState.dart';
-import 'Setting.dart';
-import '../widget/Dialog.dart';
-import '../pages/openRoom.dart';
+import 'GuidePage.dart';
+import 'TipList.dart';
+import '../net/Result.dart';
+import 'MatchPage.dart';
+import '../widget/BottomTabs.dart';
+import 'UserPage.dart';
 
 class HomePage extends StatefulWidget {
   @override
   _HomePageState createState() => _HomePageState();
 }
 
-class _HomePageState extends State<HomePage> with WidgetsBindingObserver {
-  List<GameInfoSeasons> seasonList = [];
-  int nowIndex = 0;
-  PageController _pageController;
-  bool showBadge = false;
-
-  Future<void> getSeasonInfo() async {
-    Toast.show(context, '加载中', -1, 'loading');
-    Result res = await HttpManager.get('gameInfo/seasons', data: {
-      'userId': StoreProvider.of<AppState>(context).state.userInfo.id,
-    });
-    Toast.hide();
-    if (res.success) {
-      List<GameInfoSeasons> list = [];
-      for (var item in res.data) {
-        list.add(GameInfoSeasons.fromJson(item));
-      }
-      setState(() {
-        seasonList = list;
-      });
-    } else {}
-  }
-
-  void showBackDialog() {
-    MyDialog.showDialog(context, '暂时没有进行中的房间,敬请期待...');
-    // showDialog<Null>(
-    //   context: context,
-    //   barrierDismissible: false,
-    //   builder: (BuildContext context) {
-    //     return AlertDialog(
-    //       content: Container(
-    //         height: 50,
-    //         child: Text(
-
-    //           style: TextStyle(color: Colors.black),
-    //         ),
-    //       ),
-    //       actions: <Widget>[
-    //         FlatButton(
-    //           child: Text('确定'),
-    //           onPressed: () {
-    //             Navigator.of(context).pop();
-    //           },
-    //         ),
-    //       ],
-    //     );
-    //   },
-    // ).then((val) {});
-  }
-
-  Future<void> getOneRoom() async {
-    Toast.show(context, '加载中', -1, 'loading');
-    Result res = await HttpManager.get('houseInfo/getOne', data: {'statusFlag': 0});
-    Toast.hide();
-    if (res.success) {
-      if (res.data != null) {
-        Navigator.push(context, CupertinoPageRoute(builder: (context) => RoomInfo(roomId: res.data['id'].toString())));
-      } else {
-        showBackDialog();
-      }
-    }
-  }
-
-  Future<void> getUnreadMsg() async {
-    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(() {
-          showBadge = true;
-        });
-      } else {
-        setState(() {
-          showBadge = false;
-        });
-      }
-    }
-  }
-
-  Future<void> checkErrorPlayerInfo() async {
-    final Result res = await HttpManager.get('playerInfo/getErrorPlayerInfo');
-    if (res.success) {
-      final PlayerInfo playerInfo = PlayerInfo.fromJson(res.data);
-      MyDialog.showDialog(
-        context,
-        '由于系统性能安全策略问题导致本次比赛结果上传失败,你可以上传本次比赛结果照片进行结果申诉',
-        isCancel: true,
-        onsubmit: () {
-          Navigator.push(context, CupertinoPageRoute(builder: (context) => Appeal(playerInfo)));
-        },
-      );
-    }
-  }
+class _HomePageState extends State<HomePage> with SingleTickerProviderStateMixin {
+  TabController controller;
 
   @override
   void initState() {
     super.initState();
-    WidgetsBinding.instance.addObserver(this);
-    _pageController = PageController(initialPage: 0);
+    controller = new TabController(length: 2, vsync: this);
     Future.delayed(Duration.zero, () {
-      getSeasonInfo();
-      getUnreadMsg();
-      checkErrorPlayerInfo();
+      ;
+      //引导页
+      showGruide();
     });
   }
 
   @override
   void dispose() {
+    controller.dispose();
     super.dispose();
-    WidgetsBinding.instance.removeObserver(this);
-  }
-
-  @override
-  void didChangeAppLifecycleState(AppLifecycleState state) {
-    if (state == AppLifecycleState.resumed) {
-      getUnreadMsg();
-    }
   }
 
   @override
   Widget build(BuildContext context) {
     return Scaffold(
-      drawer: HomeDrawer(),
-      body: WillPopScope(
-        child: Container(
-          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)),
-          child: SafeArea(
-            child: centerWidget(context),
+        body: WillPopScope(
+          child: Container(
+            color: Color(0xFF2E3049),
+            child: new MyTabBarView(
+              controller: controller,
+              children: <Widget>[MatchPage(), UserPage()],
+            ),
           ),
+          onWillPop: () {
+            return Future.value(true);
+          },
         ),
-        onWillPop: () {
-          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.isNotEmpty) {
-      int _time = seasonList[nowIndex].competitionSeason.endTime - DateTime.now().millisecondsSinceEpoch;
-      _time = _time ~/ 1000 ~/ 3600 ~/ 24;
-      endSTring = '倒计时 ' + _time.toString() + ' 天';
-    }
-
-    return Column(
-      children: <Widget>[
-        Expanded(
-          child: Stack(
-            children: <Widget>[
-              Container(
-                  child: seasonList.isNotEmpty
-                      ? Swiper(
-                          index: nowIndex,
-                          itemCount: seasonList.length,
-                          scrollDirection: Axis.horizontal,
-                          loop: false,
-                          onTap: (index) {
-                            Navigator.push(
-                                context,
-                                CupertinoPageRoute(
-                                    builder: (context) =>
-                                        RankList(raceId: seasonList[index].competitionSeason.id, gameId: seasonList[index].competitionSeason.gameId)));
-                          },
-                          onIndexChanged: (index) {
-                            setState(() {
-                              nowIndex = index;
-                            });
-                          },
-                          itemBuilder: (context, index) {
-                            return Center(
-                                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>[
-                                      Text('当前排名', style: TextStyle(color: Color(0xFFFFFFFF), fontSize: 13)),
-                                      Text(
-                                          seasonList[index].competitionSeason.playerInfo.rank != null
-                                              ? seasonList[index].competitionSeason.playerInfo.rank.toString()
-                                              : '无排名',
-                                          style: TextStyle(color: Color(0xFFFFFFFF), fontSize: 13))
-                                    ],
-                                  )
-                                ],
-                              ),
-                            ));
-                          },
-                        )
-                      : Container()),
-              Positioned(
-                left: 10,
-                top: 0,
-                width: 48,
-                height: 48,
-                child: Material(
-                  color: Colors.transparent,
-                  child: Builder(
-                    builder: (context) => InkWell(
-                          onTap: () {
-                            Scaffold.of(context).openDrawer();
-                          },
-                          child: Padding(
-                            padding: EdgeInsets.all(12),
-                            child: Image.asset(
-                              'images/person.png',
-                              width: 24,
-                            ),
-                          ),
-                        ),
-                  ),
-                ),
+        bottomNavigationBar: new Container(
+          color: Color(0xFF23253C),
+          height: 49,
+          child: new MyTabBar(
+            controller: controller,
+            labelColor: Theme.of(context).primaryColor,
+            unselectedLabelColor: Color(0xFF46496C),
+            indicatorColor: Color(0xFF171721),
+            labelPadding: EdgeInsets.zero,
+            labelStyle: TextStyle(fontSize: 11, height: 1),
+            tabs: <Widget>[
+              new MyTab(
+                text: "赛事",
+                icon: ImageIcon(AssetImage('images/tabbar_icon_01_pre.png'), size: 28),
               ),
-              Positioned(
-                right: 10,
-                top: 0,
-                width: 48,
-                height: 48,
-                child: Material(
-                  color: Colors.transparent,
-                  child: InkWell(
-                    onTap: () {
-                      Navigator.push(context, CupertinoPageRoute(builder: (context) => Setting()));
-                    },
-                    child: Padding(
-                      padding: EdgeInsets.all(12),
-                      child: Image.asset('images/setting.png', width: 24),
-                    ),
-                  ),
-                ),
-              ),
-              Positioned(
-                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.isNotEmpty ? 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(
-                      endSTring,
-                      style: TextStyle(color: Colors.white, fontSize: 14),
-                    )
-                  ],
-                ),
+              new MyTab(
+                text: "我的",
+                icon: ImageIcon(AssetImage('images/tabbar_icon_03.png'), size: 28),
               ),
             ],
           ),
-        ),
-        Builder(
-          builder: (BuildContext context) {
-            double aspectRatio = 1;
-            aspectRatio = width / 334;
-            return Container(
-              child: GridView.count(
-                physics: BouncingScrollPhysics(),
-                shrinkWrap: true,
-                crossAxisCount: 2,
-                childAspectRatio: aspectRatio,
-                children: <Widget>[
-                  HomeMenu(
-                    'images/home_icon_01.png',
-                    '加入比赛',
-                    onTapHomeMenu: () {
-                      // 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 CreateRoom();
-                      //     }));
-                      Navigator.push(context, CupertinoPageRoute(builder: (context) => RoomList()));
-                    },
-                  ),
-                  HomeMenu(
-                    'images/home_icon_02.png',
-                    '发起赛事',
-                    onTapHomeMenu: () {
-                      Navigator.push(context, CupertinoPageRoute(builder: (context) => OpenRoom(roomFlag: '0')));
-                    },
-                  ),
-                  HomeMenu(
-                    'images/home_icon_03.png',
-                    '系统通知',
-                    onTapHomeMenu: () async {
-                      bool result = await Navigator.push(context, CupertinoPageRoute(builder: (context) => TipList()));
-                      if (result) {
-                        getUnreadMsg();
-                      }
-                    },
-                    showBadge: showBadge,
-                  ),
-                  HomeMenu(
-                    'images/home_icon_04.png',
-                    '充值',
-                    onTapHomeMenu: () {
-                      Navigator.push(context, CupertinoPageRoute(builder: (context) => ShoppingMall()));
-                    },
-                  ),
-                ],
-              ),
-            );
-          },
-        ),
-      ],
-    );
-  }
-
-  List<Widget> _moneyList() {
-    double height = MediaQuery.of(context).size.height;
-    List<Widget> _list = [];
-
-    String bouns = (seasonList[nowIndex].competitionSeason.bonus / 1000).toStringAsFixed(1);
-
-    // String bouns = (900000000100 / 1000).toStringAsFixed(1);
-    // print(bouns);
-    // print(bouns.indexOf('.0'));
-    if (bouns.indexOf('.0') != -1 || num.parse(bouns) > 999) {
-      bouns = bouns.substring(0, bouns.length - 2);
-    }
-
-    List<String> _bounsList = bouns.split('');
-    List<String> _imageList = [];
-    for (var item in _bounsList) {
-      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.isEmpty) {
-      _imageList.add('images/0.png');
-    }
-
-    for (var item in _imageList) {
-      if (item != '.') {
-        if (_imageList.length > 4) {
-          double _scale = 1 - (_imageList.length - 4) * 0.2;
-          _list.add(Image.asset(item, height: 0.18 * 0.64 * (height - 334) * _scale));
-        } else {
-          _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: 1),
-        ));
-      }
-    }
-    _list.add(Text(
-      'K',
-      style: TextStyle(color: Colors.white, fontSize: 24, fontFamily: 'DINEngschrift', height: .5),
-    ));
-    return _list;
+        )
+        // floatingActionButton: floatWidget(),
+        // floatingActionButtonLocation: FloatingActionButtonLocation.centerDocked,
+        );
   }
-}
-
-typedef void OnTapHomeMenu();
 
-class HomeMenu extends StatelessWidget {
-  final String icon;
-  final String name;
-  final OnTapHomeMenu onTapHomeMenu;
-  final bool showBadge;
-  HomeMenu(this.icon, this.name, {this.onTapHomeMenu, this.showBadge = false});
-  @override
-  Widget build(BuildContext context) {
-    return Container(
-      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)))),
-        child: Material(
-          color: Colors.transparent,
-          child: InkWell(
-            onTap: onTapHomeMenu,
-            child: Container(
-              child: Column(
-                mainAxisAlignment: MainAxisAlignment.center,
-                crossAxisAlignment: CrossAxisAlignment.center,
-                children: <Widget>[
-                  Image.asset(
-                    icon,
-                    fit: BoxFit.contain,
-                  ),
-                  Container(
-                    height: 5,
-                  ),
-                  Text(
-                    name,
-                    style: TextStyle(color: Colors.white, fontSize: 13),
-                  )
-                ],
-              ),
-            ),
-          ),
-        ),
-      ),
-    );
+  void showGruide() {
+    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 GuidePage();
+        }));
   }
 }

+ 560 - 0
lib/pages/HomePage1.dart

@@ -0,0 +1,560 @@
+import 'package:flutter/material.dart';
+import 'package:wanna_battle/model/PlayerInfo.dart';
+import '../widget/HomeDrawer.dart';
+import 'Appeal.dart';
+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';
+import '../styles/totast.dart';
+import '../net/HttpManager.dart';
+import '../net/Result.dart';
+import 'TipList.dart';
+import 'package:flutter_redux/flutter_redux.dart';
+import '../redux/AppState.dart';
+import 'Setting.dart';
+import '../widget/Dialog.dart';
+import '../pages/openRoom.dart';
+import 'GuidePage.dart';
+
+class HomePage extends StatefulWidget {
+  @override
+  _HomePageState createState() => _HomePageState();
+}
+
+class _HomePageState extends State<HomePage> with WidgetsBindingObserver {
+  List<GameInfoSeasons> seasonList = [];
+  int nowIndex = 0;
+  PageController _pageController;
+  bool showBadge = false;
+
+  Future<void> getSeasonInfo() async {
+    Toast.show(context, '加载中', -1, 'loading');
+    Result res = await HttpManager.get('gameInfo/seasons', data: {
+      'userId': StoreProvider.of<AppState>(context).state.userInfo.id,
+    });
+    Toast.hide();
+    if (res.success) {
+      List<GameInfoSeasons> list = [];
+      for (var item in res.data) {
+        list.add(GameInfoSeasons.fromJson(item));
+      }
+      setState(() {
+        seasonList = list;
+      });
+    } else {}
+  }
+
+  void showBackDialog() {
+    MyDialog.showDialog(context, '暂时没有进行中的房间,敬请期待...');
+    // showDialog<Null>(
+    //   context: context,
+    //   barrierDismissible: false,
+    //   builder: (BuildContext context) {
+    //     return AlertDialog(
+    //       content: Container(
+    //         height: 50,
+    //         child: Text(
+
+    //           style: TextStyle(color: Colors.black),
+    //         ),
+    //       ),
+    //       actions: <Widget>[
+    //         FlatButton(
+    //           child: Text('确定'),
+    //           onPressed: () {
+    //             Navigator.of(context).pop();
+    //           },
+    //         ),
+    //       ],
+    //     );
+    //   },
+    // ).then((val) {});
+  }
+
+  Future<void> getOneRoom() async {
+    Toast.show(context, '加载中', -1, 'loading');
+    Result res = await HttpManager.get('houseInfo/getOne', data: {'statusFlag': 0});
+    Toast.hide();
+    if (res.success) {
+      if (res.data != null) {
+        Navigator.push(context, CupertinoPageRoute(builder: (context) => RoomInfo(roomId: res.data['id'].toString())));
+      } else {
+        showBackDialog();
+      }
+    }
+  }
+
+  Future<void> getUnreadMsg() async {
+    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(() {
+          showBadge = true;
+        });
+      } else {
+        setState(() {
+          showBadge = false;
+        });
+      }
+    }
+  }
+
+  Future<void> checkErrorPlayerInfo() async {
+    final Result res = await HttpManager.get('playerInfo/getErrorPlayerInfo');
+    if (res.success) {
+      final PlayerInfo playerInfo = PlayerInfo.fromJson(res.data);
+      MyDialog.showDialog(
+        context,
+        '由于系统性能安全策略问题导致本次比赛结果上传失败,你可以上传本次比赛结果照片进行结果申诉',
+        isCancel: true,
+        onsubmit: () {
+          Navigator.push(context, CupertinoPageRoute(builder: (context) => Appeal(playerInfo)));
+        },
+      );
+    }
+  }
+
+  @override
+  void initState() {
+    super.initState();
+    WidgetsBinding.instance.addObserver(this);
+    _pageController = PageController(initialPage: 0);
+    Future.delayed(Duration.zero, () {
+      getSeasonInfo();
+      getUnreadMsg();
+      checkErrorPlayerInfo();
+
+      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 GuidePage();
+          }));
+    });
+  }
+
+  @override
+  void dispose() {
+    super.dispose();
+    WidgetsBinding.instance.removeObserver(this);
+  }
+
+  @override
+  void didChangeAppLifecycleState(AppLifecycleState state) {
+    if (state == AppLifecycleState.resumed) {
+      getUnreadMsg();
+    }
+  }
+
+  @override
+  Widget build(BuildContext context) {
+    return Scaffold(
+      drawer: HomeDrawer(),
+      body: WillPopScope(
+        child: Container(
+          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)),
+          child: SafeArea(
+            child: centerWidget(context),
+          ),
+        ),
+        onWillPop: () {
+          return 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.isNotEmpty) {
+      int _time = seasonList[nowIndex].competitionSeason.endTime - DateTime.now().millisecondsSinceEpoch;
+      _time = _time ~/ 1000 ~/ 3600 ~/ 24;
+      endSTring = '倒计时 ' + _time.toString() + ' 天';
+    }
+
+    return Column(
+      children: <Widget>[
+        Expanded(
+          child: Stack(
+            children: <Widget>[
+              Container(
+                  child: seasonList.isNotEmpty
+                      ? Swiper(
+                          index: nowIndex,
+                          itemCount: seasonList.length,
+                          scrollDirection: Axis.horizontal,
+                          loop: false,
+                          onTap: (index) {
+                            Navigator.push(
+                                context,
+                                CupertinoPageRoute(
+                                    builder: (context) =>
+                                        RankList(raceId: seasonList[index].competitionSeason.id, gameId: seasonList[index].competitionSeason.gameId)));
+                          },
+                          onIndexChanged: (index) {
+                            setState(() {
+                              nowIndex = index;
+                            });
+                          },
+                          itemBuilder: (context, index) {
+                            return Center(
+                                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>[
+                                      Text('当前排名', style: TextStyle(color: Color(0xFFFFFFFF), fontSize: 13)),
+                                      Text(
+                                          seasonList[index].competitionSeason.playerInfo.rank != null
+                                              ? seasonList[index].competitionSeason.playerInfo.rank.toString()
+                                              : '无排名',
+                                          style: TextStyle(color: Color(0xFFFFFFFF), fontSize: 13))
+                                    ],
+                                  )
+                                ],
+                              ),
+                            ));
+                          },
+                        )
+                      : Container()),
+              Positioned(
+                left: 10,
+                top: 0,
+                width: 48,
+                height: 48,
+                child: Material(
+                  color: Colors.transparent,
+                  child: Builder(
+                    builder: (context) => InkWell(
+                          onTap: () {
+                            Scaffold.of(context).openDrawer();
+                          },
+                          child: Padding(
+                            padding: EdgeInsets.all(12),
+                            child: Image.asset(
+                              'images/person.png',
+                              width: 24,
+                            ),
+                          ),
+                        ),
+                  ),
+                ),
+              ),
+              Positioned(
+                right: 10,
+                top: 0,
+                width: 48,
+                height: 48,
+                child: Material(
+                  color: Colors.transparent,
+                  child: InkWell(
+                    onTap: () {
+                      Navigator.push(context, CupertinoPageRoute(builder: (context) => Setting()));
+                    },
+                    child: Padding(
+                      padding: EdgeInsets.all(12),
+                      child: Image.asset('images/setting.png', width: 24),
+                    ),
+                  ),
+                ),
+              ),
+              Positioned(
+                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.isNotEmpty ? 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(
+                      endSTring,
+                      style: TextStyle(color: Colors.white, fontSize: 14),
+                    )
+                  ],
+                ),
+              ),
+            ],
+          ),
+        ),
+        Builder(
+          builder: (BuildContext context) {
+            double aspectRatio = 1;
+            aspectRatio = width / 334;
+            return Container(
+              child: GridView.count(
+                physics: BouncingScrollPhysics(),
+                shrinkWrap: true,
+                crossAxisCount: 2,
+                childAspectRatio: aspectRatio,
+                children: <Widget>[
+                  HomeMenu(
+                    'images/home_icon_01.png',
+                    '加入比赛',
+                    onTapHomeMenu: () {
+                      // 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 CreateRoom();
+                      //     }));
+                      Navigator.push(context, CupertinoPageRoute(builder: (context) => RoomList()));
+                    },
+                  ),
+                  HomeMenu(
+                    'images/home_icon_02.png',
+                    '发起赛事',
+                    onTapHomeMenu: () {
+                      Navigator.push(context, CupertinoPageRoute(builder: (context) => OpenRoom(roomFlag: '0')));
+                    },
+                  ),
+                  HomeMenu(
+                    'images/home_icon_03.png',
+                    '系统通知',
+                    onTapHomeMenu: () async {
+                      bool result = await Navigator.push(context, CupertinoPageRoute(builder: (context) => TipList()));
+                      if (result) {
+                        getUnreadMsg();
+                      }
+                    },
+                    showBadge: showBadge,
+                  ),
+                  HomeMenu(
+                    'images/home_icon_04.png',
+                    '充值',
+                    onTapHomeMenu: () {
+                      Navigator.push(context, CupertinoPageRoute(builder: (context) => ShoppingMall()));
+                    },
+                  ),
+                ],
+              ),
+            );
+          },
+        ),
+      ],
+    );
+  }
+
+  List<Widget> _moneyList() {
+    double height = MediaQuery.of(context).size.height;
+    List<Widget> _list = [];
+
+    String bouns = (seasonList[nowIndex].competitionSeason.bonus / 1000).toStringAsFixed(1);
+
+    // String bouns = (900000000100 / 1000).toStringAsFixed(1);
+    // print(bouns);
+    // print(bouns.indexOf('.0'));
+    if (bouns.indexOf('.0') != -1 || num.parse(bouns) > 999) {
+      bouns = bouns.substring(0, bouns.length - 2);
+    }
+
+    List<String> _bounsList = bouns.split('');
+    List<String> _imageList = [];
+    for (var item in _bounsList) {
+      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.isEmpty) {
+      _imageList.add('images/0.png');
+    }
+
+    for (var item in _imageList) {
+      if (item != '.') {
+        if (_imageList.length > 4) {
+          double _scale = 1 - (_imageList.length - 4) * 0.2;
+          _list.add(Image.asset(item, height: 0.18 * 0.64 * (height - 334) * _scale));
+        } else {
+          _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: 1),
+        ));
+      }
+    }
+    _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 name;
+  final OnTapHomeMenu onTapHomeMenu;
+  final bool showBadge;
+  HomeMenu(this.icon, this.name, {this.onTapHomeMenu, this.showBadge = false});
+  @override
+  Widget build(BuildContext context) {
+    return Container(
+      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)))),
+        child: Material(
+          color: Colors.transparent,
+          child: InkWell(
+            onTap: onTapHomeMenu,
+            child: Container(
+              child: Column(
+                mainAxisAlignment: MainAxisAlignment.center,
+                crossAxisAlignment: CrossAxisAlignment.center,
+                children: <Widget>[
+                  Image.asset(
+                    icon,
+                    fit: BoxFit.contain,
+                  ),
+                  Container(
+                    height: 5,
+                  ),
+                  Text(
+                    name,
+                    style: TextStyle(color: Colors.white, fontSize: 13),
+                  )
+                ],
+              ),
+            ),
+          ),
+        ),
+      ),
+    );
+  }
+}

برخی فایل ها در این مقایسه diff نمایش داده نمی شوند زیرا تعداد فایل ها بسیار زیاد است