Ver código fonte

Merge branch 'b_c' of http://git.izouma.com/panhui/mobileCyberGamesApp into b_c

x1ongzhu 6 anos atrás
pai
commit
b434dc75df
2 arquivos alterados com 28 adições e 14 exclusões
  1. 5 2
      lib/pages/RoomInfo.dart
  2. 23 12
      lib/pages/UserPage.dart

+ 5 - 2
lib/pages/RoomInfo.dart

@@ -375,8 +375,11 @@ class RoomInfoState extends State<RoomInfo> with SingleTickerProviderStateMixin
     Toast.hide();
 
     if (myUser.moneyTicket < houseInfo.houseLevel.entryCoin) {
-      MyDialog.showDialog(context, '门票不足不能加入', onsubmit: () {
-        if (Platform.isAndroid) {
+      MyDialog.showDialog(context, '门票不足不能加入', onsubmit: () async {
+        Result res = await HttpManager.get('systemVariable/get', data: {'name': "iosPayHide"});
+        if (Platform.isIOS && res.data != null && res.data == 'true') {
+          MyDialog.showDialog(context, 'ios充值暂未开放');
+        } else {
           Navigator.push(context, CupertinoPageRoute(builder: (context) => ShoppingMall()));
         }
       });

+ 23 - 12
lib/pages/UserPage.dart

@@ -29,8 +29,17 @@ class UserPage extends StatefulWidget {
 class _UserPageState extends State<UserPage> with WidgetsBindingObserver {
   CustomerService customerService;
   bool isManage = false;
+  String iosPayHide = '';
+  bool showPay = false;
 
   Future<void> getUserInfo() async {
+    Result res3 = await HttpManager.get('systemVariable/get', data: {'name': "iosPayHide"});
+    print('iospayHiden:');
+    print(res3.data);
+    setState(() {
+      iosPayHide = res3.data;
+      showPay = true;
+    });
     Result res = await HttpManager.get('userInfo/getUserInfo');
     if (res.success) {
       print(res.data);
@@ -154,18 +163,20 @@ class _UserPageState extends State<UserPage> with WidgetsBindingObserver {
                                 //     },
                                 //   ),
                                 // ),
-                                Platform.isAndroid
-                                    ? Container(
-                                        width: 250,
-                                        child: LinearButton(
-                                          btntext: '充值参赛券',
-                                          btnHeight: 38.0,
-                                          textSize: 13.0,
-                                          onTapHomeMenu: () {
-                                            Navigator.push(context, CupertinoPageRoute(builder: (context) => ShoppingMall()));
-                                          },
-                                        ))
-                                    : Container()
+                                !showPay
+                                    ? Container()
+                                    : (Platform.isIOS && iosPayHide == 'true'
+                                        ? Container()
+                                        : Container(
+                                            width: 250,
+                                            child: LinearButton(
+                                              btntext: '充值参赛券',
+                                              btnHeight: 38.0,
+                                              textSize: 13.0,
+                                              onTapHomeMenu: () {
+                                                Navigator.push(context, CupertinoPageRoute(builder: (context) => ShoppingMall()));
+                                              },
+                                            )))
                               ],
                             )
                           ],