Przeglądaj źródła

默认颜色&地址&修改密码

panhui 6 lat temu
rodzic
commit
37c6905e5b

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


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


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


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


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


BIN
images/2x/icon_logo.png


BIN
images/3x/icon_logo.png


BIN
images/icon_logo.png


+ 4 - 4
lib/main.dart

@@ -38,9 +38,9 @@ class MobileCyberGamesApp extends StatelessWidget {
         theme: ThemeData(
             cardColor: Color(0xFF2B2B42),
             backgroundColor: Color(0xFF222335),
-            primaryColor: Color(0xFFC2524D),
-            buttonColor: Color(0xFFC2524D),
-            accentColor: Color(0xFFC2524D),
+            primaryColor: Color(0xFFD4504B),
+            buttonColor: Color(0xFFD4504B),
+            accentColor: Color(0xFFD4504B),
             textSelectionColor: Colors.white,
             textTheme: TextTheme(
               subhead: TextStyle(color: Colors.white),
@@ -52,7 +52,7 @@ class MobileCyberGamesApp extends StatelessWidget {
             primaryIconTheme: IconThemeData(color: Colors.white),
             appBarTheme: AppBarTheme(color: Color(0xFF23253C)),
             buttonTheme: ButtonThemeData(
-              buttonColor: Color(0xFFC2524D),
+              buttonColor: Color(0xFFD4504B),
               highlightColor: Color(0xFF8E3B36),
               splashColor: Color(0xFF8E3B36),
               shape: RoundedRectangleBorder(borderRadius: BorderRadius.all(Radius.circular(0))),

+ 3 - 1
lib/net/HttpManager.dart

@@ -3,8 +3,10 @@ import 'Result.dart';
 import 'package:intl/intl.dart';
 
 class HttpManager {
-  static String baseUrl = 'http://117.81.233.142:8206/';
+  // static String baseUrl = 'http://117.81.233.142:8206/';
   // static String baseUrl='http://192.168.50.15:8080/';
+
+  static String baseUrl = 'http://202.79.174.56:8206/';
   static String token;
   static bool debug;
 

+ 142 - 0
lib/pages/ChangePassword.dart

@@ -0,0 +1,142 @@
+import 'package:flutter/material.dart';
+import '../widget/ITextInput.dart';
+import '../widget/LinearButton.dart';
+import '../net/HttpManager.dart';
+import '../net/Result.dart';
+import 'package:redux/redux.dart';
+import 'package:flutter_redux/flutter_redux.dart';
+import '../redux/AppState.dart';
+import '../model/UserInfo.dart';
+import '../styles/totast.dart';
+
+class ChangePassword extends StatefulWidget {
+  @override
+  _ChangePasswordState createState() => _ChangePasswordState();
+}
+
+class _ChangePasswordState extends State<ChangePassword> with WidgetsBindingObserver {
+  String password_old = '';
+  String password_new = '';
+  String password_se = '';
+
+  @override
+  Widget build(BuildContext context) {
+    return StoreConnector<AppState, UserInfo>(
+        converter: (Store store) => store.state.userInfo,
+        builder: (context, userInfo) {
+          return Scaffold(
+            appBar: AppBar(
+              title: Text('修改密码'),
+            ),
+            backgroundColor: Color(0xFF23253C),
+            body: Column(
+              children: <Widget>[
+                Container(
+                  height: 10,
+                ),
+                ITextField(
+                  maxLength: 6,
+                  keyboardType: ITextInputType.password,
+                  prefixIcon: Container(
+                    child: Image.asset(
+                      'images/list_icon_yanzhengma.png',
+                      width: 20,
+                    ),
+                  ),
+                  hintText: '请输入您的原始密码',
+                  hintStyle: TextStyle(
+                    fontSize: 16,
+                    color: Color(0xFF727785),
+                  ),
+                  textStyle: TextStyle(color: Colors.white),
+                  fieldCallBack: (content) {
+                    setState(() {
+                      password_old = content;
+                    });
+                  },
+                  counterStyle: TextStyle(color: Color(0xFF000000), fontSize: 0),
+                ),
+                Container(
+                  height: 10,
+                ),
+                ITextField(
+                  maxLength: 6,
+                  keyboardType: ITextInputType.password,
+                  prefixIcon: Container(
+                    child: Image.asset(
+                      'images/list_icon_yanzhengma.png',
+                      width: 20,
+                    ),
+                  ),
+                  hintText: '请设置您的新密码',
+                  hintStyle: TextStyle(
+                    fontSize: 16,
+                    color: Color(0xFF727785),
+                  ),
+                  textStyle: TextStyle(color: Colors.white),
+                  fieldCallBack: (content) {
+                    setState(() {
+                      password_new = content;
+                    });
+                  },
+                  counterStyle: TextStyle(color: Color(0xFF000000), fontSize: 0),
+                ),
+                Container(
+                  height: 10,
+                ),
+                ITextField(
+                  maxLength: 6,
+                  keyboardType: ITextInputType.password,
+                  prefixIcon: Container(
+                    child: Image.asset(
+                      'images/list_icon_yanzhengma.png',
+                      width: 20,
+                    ),
+                  ),
+                  hintText: '请确认您的新密码',
+                  hintStyle: TextStyle(
+                    fontSize: 16,
+                    color: Color(0xFF727785),
+                  ),
+                  textStyle: TextStyle(color: Colors.white),
+                  fieldCallBack: (content) {
+                    setState(() {
+                      password_se = content;
+                    });
+                  },
+                  counterStyle: TextStyle(color: Color(0xFF000000), fontSize: 0),
+                ),
+                Container(
+                  height: 52,
+                ),
+                Padding(
+                  padding: EdgeInsets.symmetric(horizontal: 15),
+                  child: LinearButton(
+                    btnHeight: 48.0,
+                    btntext: '确认修改',
+                    textColor: (password_new == password_se && password_se != '' && password_old != '') ? Colors.white : Color(0xFF15151D),
+                    colorList: (password_new == password_se && password_se != '' && password_old != '')
+                        ? [Color(0xFFD4504B), Color(0xFFD4504B)]
+                        : [Color(0xFF727785), Color(0xFF727785)],
+                    onTapHomeMenu: (password_new == password_se && password_se != '' && password_old != '')
+                        ? () async {
+                            Toast.show(context, '加载中', -1, 'loading');
+                            Result res = await HttpManager.post('userInfo/updatePassword',
+                                data: {"userId": userInfo.id, "oldPassword": password_old, "newPassword": password_new});
+                            Toast.hide();
+                            if (res.success) {
+                              Toast.show(context, '修改成功', 1500, 'success');
+                              Navigator.of(context).pop();
+                            } else {
+                              Toast.show(context, res.error, 1500, 'info');
+                            }
+                          }
+                        : null,
+                  ),
+                )
+              ],
+            ),
+          );
+        });
+  }
+}

+ 1 - 1
lib/pages/CompetitionInformation.dart

@@ -79,7 +79,7 @@ class InfoBox extends StatelessWidget {
             padding: EdgeInsets.only(top: 25),
             child: Column(
               children: <Widget>[
-                Text('注意啦!', style: TextStyle(color: Color(0xFFC2524D), fontSize: 20, fontWeight: FontWeight.w600)),
+                Text('注意啦!', style: TextStyle(color: Color(0xFFD4504B), fontSize: 20, fontWeight: FontWeight.w600)),
                 Container(height: 10,),
                 Text(
                   '本次任务:游戏中最短时间内杀戮${killNum}人',

+ 17 - 8
lib/pages/HomePage.dart

@@ -31,7 +31,7 @@ class _HomePageState extends State<HomePage> with SingleTickerProviderStateMixin
   List<PhoneInfo> phoneList;
   List<PopNotice> popNoticeList;
 
-  Future<void> getPhoneInfo() async {
+  Future<bool> getPhoneInfo() async {
     List<PhoneInfo> _phoneList = [];
     Result res = await HttpManager.get('phoneInfo/all');
     if (res.success && res.data != null) {
@@ -49,7 +49,7 @@ class _HomePageState extends State<HomePage> with SingleTickerProviderStateMixin
     var timeStr = now.year.toString() + '/' + now.month.toString() + '/' + now.day.toString();
     prefs.setString('showPhoneInfo', timeStr);
 
-    Navigator.of(context).push(
+    bool reslt = await Navigator.of(context).push(
       PageRouteBuilder(
         opaque: false,
         transitionDuration: Duration(milliseconds: 300),
@@ -67,6 +67,12 @@ class _HomePageState extends State<HomePage> with SingleTickerProviderStateMixin
         },
       ),
     );
+
+    if (reslt != null && reslt) {
+      return true;
+    } else {
+      return false;
+    }
   }
 
   Future<void> checkErrorPlayerInfo() async {
@@ -97,12 +103,6 @@ class _HomePageState extends State<HomePage> with SingleTickerProviderStateMixin
         );
       }
     } else {
-      final prefs = await SharedPreferences.getInstance();
-      var now = new DateTime.now();
-      var timeStr = now.year.toString() + '/' + now.month.toString() + '/' + now.day.toString();
-      if (prefs.getString('showPhoneInfo') != timeStr) {
-        getPhoneInfo();
-      }
       //引导页
       popNoticeList = [];
       Result res = await HttpManager.get('popNotice/all');
@@ -111,6 +111,15 @@ class _HomePageState extends State<HomePage> with SingleTickerProviderStateMixin
           popNoticeList.add(PopNotice.fromJson(item));
         }
       }
+
+      final prefs = await SharedPreferences.getInstance();
+      var now = new DateTime.now();
+      var timeStr = now.year.toString() + '/' + now.month.toString() + '/' + now.day.toString();
+      bool show = false;
+      if (prefs.getString('showPhoneInfo') != timeStr) {
+        await getPhoneInfo();
+      }
+
       showGruide(context, popNoticeList);
     }
   }

+ 1 - 1
lib/pages/MyWallet.dart

@@ -184,7 +184,7 @@ class MyWalletState extends State<MyWallet> {
                         Container(width: 5,),
                         Text('我的参赛券',
                             style: TextStyle(
-                              color: Color(0xFFC2524D),
+                              color: Color(0xFFD4504B),
                               fontSize: 14,
                             ))
                       ],

+ 3 - 2
lib/pages/PhoneLogin.dart

@@ -85,7 +85,7 @@ class PhoneLogin extends Dialog {
                                           ),
                                         );
                                         if (res != null && res) {
-                                          Navigator.of(context).pop();
+                                          Navigator.of(context).pop(true);
                                         }
                                       },
                                     );
@@ -98,7 +98,7 @@ class PhoneLogin extends Dialog {
                               textColor: Color(0xFFD4504B),
                               textWeight: FontWeight.w400,
                               onTapHomeMenu: () {
-                                Navigator.of(context).pop();
+                                Navigator.of(context).pop(true);
                               },
                             ),
                           ),
@@ -132,6 +132,7 @@ class PhoneLogin extends Dialog {
         ),
       ),
       onWillPop: () {
+      
         return Future.value(false);
       },
     );

+ 2 - 2
lib/pages/RoomInfo.dart

@@ -1110,7 +1110,7 @@ class RoomInfoState extends State<RoomInfo> with SingleTickerProviderStateMixin
           height: 88,
           child: LinearButton(btntext: '房间已经开始,加入通道关闭', colorList: [Color(0xFFB34A4A), Color(0xFFB34A4A)], textColor: Color(0xFF252532))
           // RaisedButton(
-          //   disabledColor: Color(0xFFC2524D),
+          //   disabledColor: Color(0xFFD4504B),
           //   disabledTextColor: Color(0xFF252532),
           //   child: Text(
           //     '房间已经开始,加入通道关闭',
@@ -1183,7 +1183,7 @@ class RoomInfoState extends State<RoomInfo> with SingleTickerProviderStateMixin
           height: 88,
           child: LinearButton(btntext: '正在努力解析视频中', colorList: [Color(0xFFB34A4A), Color(0xFFB34A4A)], textColor: Color(0xFF252532))
           //   RaisedButton(
-          //   disabledColor: Color(0xFFC2524D),
+          //   disabledColor: Color(0xFFD4504B),
           //   disabledTextColor: Color(0xFF252532),
           //   child: Text(
           //     '正在努力解析视频中',

+ 7 - 0
lib/pages/Setting.dart

@@ -4,6 +4,7 @@ import 'package:flutter_screenutil/flutter_screenutil.dart';
 import 'package:jpush_flutter/jpush_flutter.dart';
 import 'package:package_info/package_info.dart';
 import 'package:shared_preferences/shared_preferences.dart';
+import 'ChangePassword.dart';
 import '../styles/colors.dart';
 import 'dart:async';
 import 'dart:ui';
@@ -67,6 +68,12 @@ class SettingState extends State<Setting> {
                       physics: AlwaysScrollableScrollPhysics(),
                       child: Column(
                         children: <Widget>[
+                          _sectionDivier(),
+                          _section([
+                            _cell('修改密码', ' ', onTap: () {
+                           Navigator.push(context, MaterialPageRoute(builder: (context) => ChangePassword()));
+                            })
+                          ]),
                           _sectionDivier(),
                           _section([
                             _cell(

+ 11 - 3
lib/pages/ShoppingMall.dart

@@ -126,7 +126,7 @@ class RechargeState extends State<Recharge> {
             itemCount: productInfoList.length,
             itemBuilder: (BuildContext context, int index) {
               bool isChoose = false;
-              if (chooseProduct!=null&&productInfoList[index].id == chooseProduct.id) {
+              if (chooseProduct != null && productInfoList[index].id == chooseProduct.id) {
                 isChoose = true;
               }
               return Container(
@@ -147,13 +147,16 @@ class RechargeState extends State<Recharge> {
                           child: Row(
                             mainAxisAlignment: MainAxisAlignment.center,
                             children: <Widget>[
-                              Text(productInfoList[index].productName, style: TextStyle(color: productInfoList[index].canUse?Color(0xFFFFFFFF):Color(0xFF666666), fontWeight: FontWeight.w500, fontSize: 15)),
+                              Text(productInfoList[index].productName,
+                                  style: TextStyle(
+                                      color: productInfoList[index].canUse ? Color(0xFFFFFFFF) : Color(0xFF666666), fontWeight: FontWeight.w500, fontSize: 15)),
                               Container(
                                 width: 10,
                               ),
                               Text(
                                 '¥' + productInfoList[index].money.toString(),
-                                style: TextStyle(color: productInfoList[index].canUse?Color(0xFF727785):Color(0xFF666666), fontWeight: FontWeight.w400, fontSize: 14),
+                                style: TextStyle(
+                                    color: productInfoList[index].canUse ? Color(0xFF727785) : Color(0xFF666666), fontWeight: FontWeight.w400, fontSize: 14),
                               )
                             ],
                           ),
@@ -188,6 +191,11 @@ class RechargeState extends State<Recharge> {
           textColor: Colors.white,
           child: Text('立即充值'),
           onPressed: () async {
+            if (chooseProduct == null) {
+              Toast.show(context, '请选择充值的门票', 1500, 'info');
+              return;
+            }
+
             Navigator.push(context, CupertinoPageRoute(builder: (context) => ChoosePay(widget.type, chooseProduct)));
             // Toast.show(context, '加载中', -1, 'loading');
             // final Result res = await HttpManager.post('productInfo/buy', data: {

+ 1 - 1
lib/pages/VideoPlayer.dart

@@ -21,7 +21,7 @@ class _VideoPlayerPageState extends State<VideoPlayerPage> {
 
     if (widget.videoUrl != '' && widget.videoUrl != null) {
       if (widget.fileType == 'netWork') {
-        String url = widget.videoUrl.replaceAll('/var', 'http://123.58.240.138:8080');
+        String url = widget.videoUrl.replaceAll('/var', 'http://202.79.174.56:8206');
         _defalutUrl = url;
         isNet = true;
       } else {

+ 1 - 1
lib/styles/colors.dart

@@ -1,7 +1,7 @@
 import 'package:flutter/material.dart';
 
 //主颜色
-const PRIMARY_COLOR = Color(0xFFC2524D);
+const PRIMARY_COLOR = Color(0xFFD4504B);
 
 //辅助色
 const SUB_COLOR = Color(0xFFA6554F);

+ 2 - 2
lib/widget/LinearButton.dart

@@ -15,12 +15,12 @@ class LinearButton extends StatelessWidget {
   LinearButton(
       {this.btntext = '',
       this.onTapHomeMenu,
-      this.colorList = const [Color(0xFFC2524D), Color(0xFFC2524D)],
+      this.colorList = const [Color(0xFFD4504B), Color(0xFFD4504B)],
       this.btnHeight = 48.0,
       this.childWidget,
       this.textColor = Colors.white,
       this.textSize = 16.0,
-      this.radius = 4.0,
+      this.radius = 0.0,
       this.textWeight=FontWeight.w600});
 
   @override

+ 1 - 1
lib/widget/SuccessfulReception.dart

@@ -55,7 +55,7 @@ class SuccessfulReceptionState extends State<SuccessfulReception> {
                       Container(
                         height: 25,
                       ),
-                      Text('恭喜你获得${widget.money}积分', style: TextStyle(color: Color(0xFFC2524D), fontSize: 18, fontWeight: FontWeight.w600)),
+                      Text('恭喜你获得${widget.money}积分', style: TextStyle(color: Color(0xFFD4504B), fontSize: 18, fontWeight: FontWeight.w600)),
                       Container(
                         height: 44,
                       ),

+ 1 - 1
screen_stream_plugin/android/src/main/java/com/izouma/screen_stream_plugin/VideoProcessService.java

@@ -104,7 +104,7 @@ public class VideoProcessService extends Service implements ImageAvailableListen
                             e.printStackTrace();
                         }
                         try {
-                            String uploadId = new MultipartUploadRequest(VideoProcessService.this, "http://117.81.233.142:8206/playerInfo/uploadVideo")
+                            String uploadId = new MultipartUploadRequest(VideoProcessService.this, "http://202.79.174.56:8206/playerInfo/uploadVideo")
                                     .addFileToUpload(imageAvailableListener.getVideoPath(), "video")
                                     // .addFileToUpload("/storage/emulated/0/Android/data/com.izouma.mobilecybergames/files/record/record1553655902913.flv", "video")
                                     .addParameter("id", String.valueOf(playerInfoId))

+ 1 - 1
screen_stream_plugin/android/src/main/res/drawable/bg_dialog.xml

@@ -3,5 +3,5 @@
     <solid android:color="#FF15151D" />
     <stroke
         android:width="1dp"
-        android:color="#FFC2524D" />
+        android:color="#FFD4504B" />
 </shape>

+ 1 - 1
screen_stream_plugin/android/src/main/res/layout/dialog.xml

@@ -54,7 +54,7 @@
                 android:layout_width="100dp"
                 android:layout_height="36dp"
                 android:layout_marginLeft="20dp"
-                android:background="#FFC2524D"
+                android:background="#FFD4504B"
                 android:padding="0dp"
                 android:text="确认"
                 android:textColor="@android:color/white"