panhui 6 жил өмнө
parent
commit
7adf913e7b

BIN
images/2x/img_chijizhanchang.png


BIN
images/3x/img_chijizhanchang.png


BIN
images/img_chijizhanchang.png


+ 5 - 0
lib/main.dart

@@ -31,6 +31,11 @@ class MobileCyberGamesApp extends StatelessWidget {
               textSelectionColor: Colors.white,
               textTheme: TextTheme(
                 subhead: TextStyle(color: Colors.white),
+              ),
+              buttonTheme: ButtonThemeData(
+                buttonColor: Color(0xFFC2524D),
+                highlightColor: Color(0xFF9B4040),
+                splashColor: Color(0xFF9B4040),
               )),
           home: store.state.isLogin ? HomePage() : LoginFirst(),
         ));

+ 110 - 0
lib/pages/BindGame.dart

@@ -0,0 +1,110 @@
+import 'package:flutter/material.dart';
+import '../styles/colors.dart';
+import 'dart:ui';
+import '../styles/totast.dart';
+import 'package:flutter_redux/flutter_redux.dart';
+import '../redux/AppState.dart';
+import '../net/HttpManager.dart';
+import '../net/Result.dart';
+
+class BindGame extends StatefulWidget {
+  @override
+  BindGameState createState() => BindGameState();
+}
+
+class BindGameState extends State<BindGame> {
+  String bindName = '';
+  bool isBind = false;
+
+  void bindEvent() async{
+    if (bindName == '') {
+      Toast.show(context, '请输入绑定角色名称', 1500, 'info');
+      return;
+    }
+Toast.show(context, '加载中', -1, 'loading');
+    Result res = await HttpManager.post("assets/uploadFile", data: {
+      
+    });
+    Toast.hide();
+    if (res.success) {
+      
+    } else {}
+
+  }
+
+  @override
+  Widget build(BuildContext context) {
+    return new WillPopScope(
+        child: Scaffold(
+            appBar: AppBar(
+              backgroundColor: PRIMARY_COLOR,
+              title: Text('绑定账号'),
+              centerTitle: true,
+              elevation: 0,
+            ),
+            body: Container(
+              color: BG_SUB_COLOR,
+              padding: EdgeInsets.all(15),
+              child: Column(
+                children: <Widget>[
+                  Container(
+                    height: 220,
+                    width: double.infinity,
+                    padding: EdgeInsets.symmetric(vertical: 15, horizontal: 34),
+                    decoration: BoxDecoration(
+                        image: DecorationImage(
+                            image: AssetImage('images/img_chijizhanchang.png'),
+                            fit: BoxFit.cover)),
+                    child: Column(
+                      mainAxisAlignment: MainAxisAlignment.end,
+                      children: _bindWidegt(),
+                    ),
+                  )
+                ],
+              ),
+            )));
+  }
+
+  List<Widget> _bindWidegt() {
+    List<Widget> widgetList = [];
+    if (isBind) {
+    } else {
+      widgetList = [
+        Container(
+          margin: EdgeInsets.only(bottom: 10),
+          decoration: BoxDecoration(
+            borderRadius: BorderRadius.all(Radius.circular(2)),
+            color: Colors.white,
+          ),
+          height: 40,
+          child: TextField(
+            style: TextStyle(
+                color: Color(0xFFAF4946), fontWeight: FontWeight.w500),
+            textAlign: TextAlign.center,
+            decoration: InputDecoration(
+                hintText: '请输入刺激战场游戏昵称',
+                border: InputBorder.none,
+                hintStyle: TextStyle(fontSize: 12, color: Color(0xFF727785))),
+            onChanged: (value) {
+              setState(() {
+                bindName = value;
+              });
+            },
+          ),
+        ),
+        Container(
+          width: double.infinity,
+          height: 40,
+          child: RaisedButton(
+            textTheme: ButtonTextTheme.primary,
+            child: Text('绑定角色'),
+            onPressed: () {
+              bindEvent();
+            },
+          ),
+        )
+      ];
+    }
+    return widgetList;
+  }
+}

+ 15 - 5
lib/widgets/HomeDrawer.dart

@@ -5,6 +5,7 @@ import 'package:flutter/cupertino.dart';
 import '../redux/AppState.dart';
 import '../model/UserInfo.dart';
 import '../pages/MyWallet.dart'; //我的钱包
+import '../pages/BindGame.dart'; //游戏绑定
 
 class HomeDrawer extends StatelessWidget {
   @override
@@ -87,16 +88,25 @@ class HomeDrawer extends StatelessWidget {
                         "images/icon_qianbao.png",
                         "我的钱包",
                         onTap: () {
-                           Navigator.push(
-                            context,
-                            new CupertinoPageRoute(
-                                builder: (context) => new MyWallet()));
+                          Navigator.push(
+                              context,
+                              new CupertinoPageRoute(
+                                  builder: (context) => new MyWallet()));
                         },
                       ),
                       Divder(),
                       DrawerMenu("images/icon_zhanji.png", "我的战绩"),
                       Divder(),
-                      DrawerMenu("images/icon_bangding.png", "游戏绑定")
+                      DrawerMenu(
+                        "images/icon_bangding.png",
+                        "游戏绑定",
+                        onTap: () {
+                          Navigator.push(
+                              context,
+                              new CupertinoPageRoute(
+                                  builder: (context) => new BindGame()));
+                        },
+                      )
                     ],
                   ),
                 ),