panhui há 6 anos atrás
pai
commit
4c978029f5

+ 2 - 1
lib/model/SystemNotice.dart

@@ -6,7 +6,7 @@ part 'SystemNotice.g.dart';
 
 @JsonSerializable()
 class SystemNotice {
-  SystemNotice(this.id, this.gameId, this.houseId, this.userId,this.seasonId,this.content,this.icon,this.typeFlag,this.statusFlag,this.createTime,this.playerId,this.gameInfo,this.houseInfo,this.playerInfo);
+  SystemNotice(this.id, this.gameId, this.houseId, this.userId,this.seasonId,this.content,this.icon,this.typeFlag,this.statusFlag,this.createTime,this.playerId,this.gameInfo,this.houseInfo,this.playerInfo,this.bonus);
   int id;
   int gameId;//游戏ID
   int houseId;//房间ID
@@ -21,6 +21,7 @@ class SystemNotice {
   GameInfo gameInfo;//游戏信息
   HouseInfo houseInfo;//房间信息
   PlayerInfo playerInfo;//玩家信息
+  int bonus;//奖金
 
   factory SystemNotice.fromJson(Map<String, dynamic> json) =>
       _$SystemNoticeFromJson(json);

+ 4 - 2
lib/model/SystemNotice.g.dart

@@ -21,7 +21,8 @@ SystemNotice _$SystemNoticeFromJson(Map<String, dynamic> json) {
       json['playerId'] as int,
       json['gameInfo'] != null ? GameInfo.fromJson(json['gameInfo']) : null,
       json['houseInfo'] != null ? HouseInfo.fromJson(json['houseInfo']) : null,
-      json['playerInfo']!=null?PlayerInfo.fromJson(json['playerInfo']):null);
+      json['playerInfo']!=null?PlayerInfo.fromJson(json['playerInfo']):null,
+      json['bonus']??0);
 }
 
 // int id;
@@ -51,5 +52,6 @@ Map<String, dynamic> _$SystemNoticeToJson(SystemNotice instance) =>
       'playerId': instance.playerId != null ? instance.playerId : 0,
       'gameInfo': instance.gameInfo != null ? instance.gameInfo : Map(),
       'HouseInfo': instance.houseInfo != null ? instance.houseInfo : Map(),
-      'playerInfo':instance.playerInfo
+      'playerInfo':instance.playerInfo,
+      'bonus':instance.bonus
     };

+ 29 - 26
lib/pages/HomePage.dart

@@ -14,6 +14,7 @@ import 'TipList.dart';
 import 'package:flutter_redux/flutter_redux.dart';
 import '../redux/AppState.dart';
 import 'setting.dart';
+import '../widget/Dialog.dart';
 
 class HomePage extends StatefulWidget {
   @override
@@ -42,29 +43,30 @@ class _HomePageState extends State<HomePage> with WidgetsBindingObserver {
   }
 
   void showBackDialog() {
-    showDialog<Null>(
-      context: context,
-      barrierDismissible: false,
-      builder: (BuildContext context) {
-        return new AlertDialog(
-          content: Container(
-            height: 50,
-            child: Text(
-              '暂时没有进行中的房间,敬请期待...',
-              style: TextStyle(color: Colors.black),
-            ),
-          ),
-          actions: <Widget>[
-            new FlatButton(
-              child: new Text('确定'),
-              onPressed: () {
-                Navigator.of(context).pop();
-              },
-            ),
-          ],
-        );
-      },
-    ).then((val) {});
+     MyDialog.showDialog(context, '暂时没有进行中的房间,敬请期待...');
+    // showDialog<Null>(
+    //   context: context,
+    //   barrierDismissible: false,
+    //   builder: (BuildContext context) {
+    //     return new AlertDialog(
+    //       content: Container(
+    //         height: 50,
+    //         child: Text(
+    //           '暂时没有进行中的房间,敬请期待...',
+    //           style: TextStyle(color: Colors.black),
+    //         ),
+    //       ),
+    //       actions: <Widget>[
+    //         new FlatButton(
+    //           child: new Text('确定'),
+    //           onPressed: () {
+    //             Navigator.of(context).pop();
+    //           },
+    //         ),
+    //       ],
+    //     );
+    //   },
+    // ).then((val) {});
   }
 
   void getOneRoom() async {
@@ -288,9 +290,10 @@ class _HomePageState extends State<HomePage> with WidgetsBindingObserver {
             double width = MediaQuery.of(context).size.width;
             double height = MediaQuery.of(context).size.height;
             double aspectRatio = 1;
-            if (height / width < 17 / 9) {
-              aspectRatio = width / (height - 334);
-            }
+            // if (height / width < 20 / 9) {
+             
+            // }
+             aspectRatio = width / (height - 350);
             return Container(
               child: GridView.count(
                 physics: new BouncingScrollPhysics(),

+ 13 - 4
lib/pages/TipInfo.dart

@@ -33,6 +33,8 @@ class TipInfoState extends State<TipInfo> {
       });
     }
 
+    print(tipInfo.bonus);
+
     if (tipInfo.statusFlag == 0 &&
         tipInfo.typeFlag != 2 &&
         tipInfo.typeFlag != 3) {
@@ -51,6 +53,8 @@ class TipInfoState extends State<TipInfo> {
         houseInfo = HouseInfo.fromJson(res2.data);
       });
     }
+
+    showSuccess(100);
   }
 
   void showSuccess(money) {
@@ -76,6 +80,7 @@ class TipInfoState extends State<TipInfo> {
   void initState() {
     super.initState();
     Future.delayed(Duration.zero, () => getInfo());
+    
   }
 
   @override
@@ -140,15 +145,19 @@ class TipInfoState extends State<TipInfo> {
                           child: Text('立即领取'),
                           onPressed: () async {
                             Toast.show(context, '加载中', -1, 'loading');
-                            Result res = await HttpManager.post(
-                                "playerInfo/receive",
-                                data: {"id": tipInfo.playerId});
+                            Result res = type == 2
+                                ? await HttpManager.post("playerInfo/receive",
+                                    data: {"id": tipInfo.playerId})
+                                : await HttpManager.post("systemNotice/receive",
+                                    data: {"id": widget.tipId});
                             Toast.hide();
                             if (res.success) {
                               if (tipInfo.playerInfo != null) {
                                 showSuccess(tipInfo.playerInfo.bonus);
-                                getInfo();
+                              } else {
+                                showSuccess(tipInfo.bonus);
                               }
+                              getInfo();
                             } else {
                               Toast.show(context, res.error, 1000, 'info');
                             }

+ 2 - 2
lib/pages/roomInfo.dart

@@ -440,8 +440,8 @@ class RoomInfoState extends State<RoomInfo>
                   physics: AlwaysScrollableScrollPhysics(),
                   child: ConstrainedBox(
                     constraints: BoxConstraints(
-                        minHeight: 600,
-                        maxHeight: viewportConstraints.maxHeight>600?viewportConstraints.maxHeight:600
+                        minHeight: 640,
+                        maxHeight: viewportConstraints.maxHeight>640?viewportConstraints.maxHeight:640
                         ),
                     child: IntrinsicHeight(
                       child: Column(

+ 4 - 4
lib/widget/SuccessfulReception.dart

@@ -29,8 +29,8 @@ class SuccessfulReceptionState extends State<SuccessfulReception> {
           child: Center(
               child: Container(
                   padding: EdgeInsets.only(top: 29, bottom: 49),
-                  width: 212,
-                  height: 220,
+                  width: 268,
+                  height: 160,
                   decoration: BoxDecoration(
                       image: DecorationImage(
                           image: AssetImage('images/img_kaishiyouxi.png'),
@@ -41,8 +41,8 @@ class SuccessfulReceptionState extends State<SuccessfulReception> {
                     children: <Widget>[
                       Text('领取成功',
                           style: TextStyle(
-                              color: Color(0xFFC2524D),
-                              fontSize: 20,
+                              color: Color(0xFFFDC372),
+                              fontSize:18,
                               fontWeight: FontWeight.w600)),
                       Row(
                         mainAxisAlignment: MainAxisAlignment.center,