Browse Source

ios不进入充值页面

panhui 6 years ago
parent
commit
69c0eddc5e
2 changed files with 39 additions and 31 deletions
  1. 19 14
      lib/pages/RoomInfo.dart
  2. 20 17
      lib/pages/UserPage.dart

+ 19 - 14
lib/pages/RoomInfo.dart

@@ -376,7 +376,9 @@ class RoomInfoState extends State<RoomInfo> with SingleTickerProviderStateMixin
 
     if (myUser.moneyTicket < houseInfo.houseLevel.entryCoin) {
       MyDialog.showDialog(context, '门票不足不能加入', onsubmit: () {
-        Navigator.push(context, CupertinoPageRoute(builder: (context) => ShoppingMall()));
+        if (Platform.isAndroid) {
+          Navigator.push(context, CupertinoPageRoute(builder: (context) => ShoppingMall()));
+        }
       });
       return;
     }
@@ -391,19 +393,19 @@ class RoomInfoState extends State<RoomInfo> with SingleTickerProviderStateMixin
           showDialog(
             context: context,
             builder: (context) => AlertDialog(
-                  title: Text('需要悬浮窗权限'),
-                  contentTextStyle: TextStyle(color: Colors.black87),
-                  content: Text('请在点击确定后,勾选"允许显示在其他应用的上层"'),
-                  actions: <Widget>[
-                    FlatButton(
-                      child: Text('确定'),
-                      onPressed: () {
-                        Navigator.of(context).pop();
-                        ScreenStreamPlugin.requestPermission();
-                      },
-                    ),
-                  ],
+              title: Text('需要悬浮窗权限'),
+              contentTextStyle: TextStyle(color: Colors.black87),
+              content: Text('请在点击确定后,勾选"允许显示在其他应用的上层"'),
+              actions: <Widget>[
+                FlatButton(
+                  child: Text('确定'),
+                  onPressed: () {
+                    Navigator.of(context).pop();
+                    ScreenStreamPlugin.requestPermission();
+                  },
                 ),
+              ],
+            ),
           );
           return;
         } else {
@@ -781,7 +783,10 @@ class RoomInfoState extends State<RoomInfo> with SingleTickerProviderStateMixin
                                   Container(
                                     height: 10,
                                   ),
-                                  Text('注:上方显示数值为前三名的“当前奖励/最高奖励”',style: TextStyle(color: Colors.white30,fontSize: 12),)
+                                  Text(
+                                    '注:上方显示数值为前三名的“当前奖励/最高奖励”',
+                                    style: TextStyle(color: Colors.white30, fontSize: 12),
+                                  )
                                 ],
                               )),
 

+ 20 - 17
lib/pages/UserPage.dart

@@ -1,3 +1,5 @@
+import 'dart:io';
+
 import 'package:flutter/material.dart';
 import 'package:redux/redux.dart';
 import 'package:flutter_redux/flutter_redux.dart';
@@ -26,7 +28,7 @@ class UserPage extends StatefulWidget {
 
 class _UserPageState extends State<UserPage> with WidgetsBindingObserver {
   CustomerService customerService;
-  bool isManage=false;
+  bool isManage = false;
 
   Future<void> getUserInfo() async {
     Result res = await HttpManager.get('userInfo/getUserInfo');
@@ -40,12 +42,11 @@ class _UserPageState extends State<UserPage> with WidgetsBindingObserver {
         if (res2.success) {
           if (res2.data['channelManager'] != null && res2.data['channelManager'] == res.data['id']) {
             setState(() {
-              isManage=true;
+              isManage = true;
             });
-          }
-          else{
-              setState(() {
-              isManage=false;
+          } else {
+            setState(() {
+              isManage = false;
             });
           }
         }
@@ -102,7 +103,7 @@ class _UserPageState extends State<UserPage> with WidgetsBindingObserver {
                               height: 2,
                             ),
                             Text(
-                              userInfo.nickname+(isManage?'(代理)':''),
+                              userInfo.nickname + (isManage ? '(代理)' : ''),
                               style: TextStyle(fontSize: 20, color: Colors.white, fontWeight: FontWeight.w700),
                             ),
                             Container(
@@ -153,16 +154,18 @@ class _UserPageState extends State<UserPage> with WidgetsBindingObserver {
                                 //     },
                                 //   ),
                                 // ),
-                                Container(
-                                    width: 250,
-                                    child: LinearButton(
-                                      btntext: '充值参赛券',
-                                      btnHeight: 38.0,
-                                      textSize: 13.0,
-                                      onTapHomeMenu: () {
-                                        Navigator.push(context, CupertinoPageRoute(builder: (context) => ShoppingMall()));
-                                      },
-                                    ))
+                                Platform.isAndroid
+                                    ? Container(
+                                        width: 250,
+                                        child: LinearButton(
+                                          btntext: '充值参赛券',
+                                          btnHeight: 38.0,
+                                          textSize: 13.0,
+                                          onTapHomeMenu: () {
+                                            Navigator.push(context, CupertinoPageRoute(builder: (context) => ShoppingMall()));
+                                          },
+                                        ))
+                                    : Container()
                               ],
                             )
                           ],