x1ongzhu 6 лет назад
Родитель
Сommit
2bea08afe2

+ 1 - 1
lib/pages/AppNotice.dart

@@ -18,7 +18,7 @@ Future getAppNotice(context) async {
           );
         },
         barrierLabel: MaterialLocalizations.of(context).modalBarrierDismissLabel,
-        barrierColor: Colors.black54,
+        barrierColor: Colors.black87,
         transitionDuration: const Duration(milliseconds: 300),
       );
     }

+ 1 - 1
lib/pages/BonusDialog.dart

@@ -171,7 +171,7 @@ Future showBonusDialog(context, List<CompetitionInfo> competitions) async {
       );
     },
     barrierLabel: MaterialLocalizations.of(context).modalBarrierDismissLabel,
-    barrierColor: Colors.black54,
+    barrierColor: Colors.black87,
     transitionDuration: const Duration(milliseconds: 300),
   );
 }

+ 1 - 1
lib/pages/CompetitionRooms.dart

@@ -284,7 +284,7 @@ class _CompetitionRoomsState extends State<CompetitionRooms> {
         );
       },
       barrierLabel: MaterialLocalizations.of(context).modalBarrierDismissLabel,
-      barrierColor: Colors.black54,
+      barrierColor: Colors.black87,
       transitionDuration: const Duration(milliseconds: 300),
     );
   }

+ 23 - 22
lib/pages/Competitions.dart

@@ -92,6 +92,7 @@ class _CompetitionState extends State<Competitions> {
                                       margin: EdgeInsets.only(left: 8),
                                       child: Column(
                                         crossAxisAlignment: CrossAxisAlignment.start,
+                                        mainAxisAlignment: MainAxisAlignment.center,
                                         children: <Widget>[
                                           Text(
                                             userInfo.nickname,
@@ -101,8 +102,8 @@ class _CompetitionState extends State<Competitions> {
                                               fontWeight: FontWeight.bold,
                                             ),
                                           ),
-                                          Row(
-                                            children: <Widget>[
+                                          // Row(
+                                          //   children: <Widget>[
                                               // Text(
                                               //   '最强王者',
                                               //   style: TextStyle(
@@ -111,26 +112,26 @@ class _CompetitionState extends State<Competitions> {
                                               //     fontWeight: FontWeight.bold,
                                               //   ),
                                               // ),
-                                              Container(
-                                                margin: EdgeInsets.only(left: 0),
-                                                child: Image.asset('images/icon_jinbi.png'),
-                                              ),
-                                              Container(
-                                                margin: EdgeInsets.only(left: 2),
-                                                child: Text(
-                                                  userInfo.moneyCoin
-                                                      .floor()
-                                                      .toString()
-                                                      .replaceAllMapped(RegExp(r'(\d{1,3})(?=(\d{3})+(?!\d))'), (Match m) => '${m[1]},'),
-                                                  style: TextStyle(
-                                                    color: Colors.white,
-                                                    fontWeight: FontWeight.bold,
-                                                    fontSize: 16,
-                                                  ),
-                                                ),
-                                              )
-                                            ],
-                                          )
+                                              // Container(
+                                              //   margin: EdgeInsets.only(left: 0),
+                                              //   child: Image.asset('images/icon_jinbi.png'),
+                                              // ),
+                                              // Container(
+                                              //   margin: EdgeInsets.only(left: 2),
+                                              //   child: Text(
+                                              //     userInfo.moneyCoin
+                                              //         .floor()
+                                              //         .toString()
+                                              //         .replaceAllMapped(RegExp(r'(\d{1,3})(?=(\d{3})+(?!\d))'), (Match m) => '${m[1]},'),
+                                              //     style: TextStyle(
+                                              //       color: Colors.white,
+                                              //       fontWeight: FontWeight.bold,
+                                              //       fontSize: 16,
+                                              //     ),
+                                              //   ),
+                                              // )
+                                          //   ],
+                                          // )
                                         ],
                                       ),
                                     ),

+ 9 - 3
lib/pages/RoomInfoNew.dart

@@ -2,6 +2,7 @@ import 'dart:async';
 
 import 'package:flutter/material.dart';
 import 'package:flutter_redux/flutter_redux.dart';
+import 'package:shared_preferences/shared_preferences.dart';
 import 'package:url_launcher/url_launcher.dart';
 import 'package:battery/battery.dart';
 import 'package:wanna_battle/model/PlayerInfo.dart';
@@ -49,8 +50,13 @@ class _RoomInfoState extends State<RoomInfo> with SingleTickerProviderStateMixin
       length: 2,
       vsync: this,
     );
-    Future.delayed(Duration.zero, () {
-      showNotice(context);
+    Future.delayed(Duration.zero, () async {
+      final prefs = await SharedPreferences.getInstance();
+      bool showed = prefs.getBool('house_' + mHouseInfo.id.toString()) ?? false;
+      if (!showed) {
+        prefs.setBool('house_' + mHouseInfo.id.toString(), true);
+        showNotice(context);
+      }
       refreshData();
     });
     if (mHouseInfo.statusFlag == HouseStatus.WAIT) {
@@ -244,6 +250,6 @@ class _RoomInfoState extends State<RoomInfo> with SingleTickerProviderStateMixin
   }
 
   void showStartFailDialog(type) {
-    showCustomDialog(context, (type == 1 ? '由于您未在十秒内点击开始按钮' : '由于您未授权录屏') + ',系已经判定您放弃比赛,谢谢您的参与。', title: '很遗憾');
+    showCustomDialog(context, (type == 1 ? '由于您未在十秒内点击开始按钮' : '由于您未授权录屏') + ',系��已经判定您放弃比赛,谢谢您的参与。', title: '很遗憾');
   }
 }

+ 3 - 3
lib/pages/UserGuid.dart

@@ -196,7 +196,7 @@ Future showUserGuide1(BuildContext context) {
       },
       pageBuilder: (BuildContext context, _, __) {
         return Material(
-          color: Colors.black54,
+          color: Colors.black87,
           child: GestureDetector(
             child: Container(
               child: Stack(
@@ -245,7 +245,7 @@ Future showUserGuide2(BuildContext context) {
       },
       pageBuilder: (BuildContext context, _, __) {
         return Material(
-          color: Colors.black54,
+          color: Colors.black87,
           child: GestureDetector(
             child: Container(
               child: Stack(
@@ -298,7 +298,7 @@ Future showUserGuide3(BuildContext context) {
       },
       pageBuilder: (BuildContext context, _, __) {
         return Material(
-          color: Colors.black54,
+          color: Colors.black87,
           child: GestureDetector(
             child: Container(
               child: Stack(

+ 2 - 2
lib/widget/CheckUpgrade.dart

@@ -35,7 +35,7 @@ Future showUpgradeDialog(context, upgradeInfo, key) async {
       );
     },
     barrierLabel: MaterialLocalizations.of(context).modalBarrierDismissLabel,
-    barrierColor: Colors.black54,
+    barrierColor: Colors.black87,
     transitionDuration: const Duration(milliseconds: 300),
   );
 }
@@ -53,7 +53,7 @@ Future downloadApk(context, url) async {
       );
     },
     barrierLabel: MaterialLocalizations.of(context).modalBarrierDismissLabel,
-    barrierColor: Colors.black54,
+    barrierColor: Colors.black87,
     transitionDuration: const Duration(milliseconds: 300),
   );
 }

+ 1 - 1
lib/widget/CheckinDialog.dart

@@ -19,7 +19,7 @@ void showCheckinDialog(BuildContext context) {
     },
     barrierDismissible: true,
     barrierLabel: MaterialLocalizations.of(context).modalBarrierDismissLabel,
-    barrierColor: Colors.black54,
+    barrierColor: Colors.black87,
     transitionBuilder: (BuildContext context, Animation<double> animation, Animation<double> secondaryAnimation, Widget child) {
       final curvedValue = Curves.easeInOutBack.transform(animation.value) - 1.0;
       return Transform(

+ 25 - 2
lib/widget/Competition.dart

@@ -1,10 +1,17 @@
+import 'package:flutter_redux/flutter_redux.dart';
 import 'package:intl/intl.dart';
 import 'package:flutter/material.dart';
 import 'package:flutter/cupertino.dart';
 import 'package:cached_network_image/cached_network_image.dart';
 import 'package:gradient_text/gradient_text.dart';
+import 'package:ttdj_plugin/ttdj_plugin.dart';
+import 'package:wanna_battle/model/UserInfo.dart';
 import 'package:wanna_battle/net/HttpManager.dart';
+import 'package:wanna_battle/redux/AppState.dart';
+import 'package:wanna_battle/redux/UserRedux.dart';
 import 'package:wanna_battle/styles/colors.dart';
+import 'package:wanna_battle/styles/totast.dart';
+import 'package:wanna_battle/widget/Dialog.dart';
 import '../pages/CompetitionRank.dart';
 import '../model/CompetitionInfo.dart';
 import '../pages/CompetitionRooms.dart';
@@ -142,8 +149,24 @@ class Competition extends StatelessWidget {
           ),
         ),
       ),
-      onTap: () {
-        Navigator.push(context, CupertinoPageRoute(builder: (context) => CompetitionRooms(competitionInfo)));
+      onTap: () async {
+        if (competitionInfo.type == 2) {
+          Toast.show(context, '加载中', -1, 'loading');
+          final res = await HttpManager.get('userInfo/getUserInfo');
+          Toast.hide();
+          UserInfo userInfo = UserInfo.fromJson(res.data);
+          StoreProvider.of<AppState>(context).dispatch(UpdateUserAction(userInfo));
+          if (!userInfo.isVip) {
+            showCustomDialog(context, '此赛事仅限会员才可以加入哦\n是否立即成为会员?', isCancel: true, onsubmit: () {
+              TtdjPlugin.init(userInfo.ttdjId, userInfo.token);
+              TtdjPlugin.gotoVipPage();
+            });
+          } else {
+            Navigator.push(context, CupertinoPageRoute(builder: (context) => CompetitionRooms(competitionInfo)));
+          }
+        } else {
+          Navigator.push(context, CupertinoPageRoute(builder: (context) => CompetitionRooms(competitionInfo)));
+        }
       },
     );
   }