daxu0403 7 years ago
parent
commit
2408c4da90
2 changed files with 13 additions and 16 deletions
  1. 12 15
      lib/pages/order_management_page/order_detail_page.dart
  2. 1 1
      lib/util/util.dart

+ 12 - 15
lib/pages/order_management_page/order_detail_page.dart

@@ -449,8 +449,7 @@ class _ItemInfoWidgetState extends State < ItemInfoWidget > {
             barrierDismissible: false,
             builder: (BuildContext context) {
               //打印
-              OrderDetailObj parentObj = OrderDetailObj.fromJson(resp.data);
-              if (parentObj.success) {
+               OrderDetailObj parentObj = OrderDetailObj.fromJson(resp.data);
                 OrderDetailData data = parentObj.data;
                 getKey('printType').then((printType) {
                   getKey('stationName').then((stationName) {
@@ -529,27 +528,25 @@ class _ItemInfoWidgetState extends State < ItemInfoWidget > {
                   //调用对话框
                   text: '订单修改成功!',
                   childCallback: (val) {
-                    if (val) {
                       Navigator.pop(context, true);
-                    }
                   },
                 );
-              } else {
-                showDialog < Null > (
-                  context: context,
-                  barrierDismissible: false,
-                  builder: (BuildContext context) {
-                    return MyAlertDialog(
-                      text: parentObj.msg, childCallback: (val) {
-                          Navigator.pop(context, true);
-                      });
-                  });
-              }
             });
         } else {
           setState(() {
             submitStatus = true;
           });
+          OrderDetailObj parentObj = OrderDetailObj.fromJson(resp.data);
+          showDialog < Null > (
+            context: context, //BuildContext对象
+            barrierDismissible: false,
+            builder: (BuildContext context) {
+              return MyAlertDialog( //调用对话框
+                text: parentObj.msg, childCallback: (val) {
+                  Navigator.pop(context, true);
+                },
+              );
+            });
         }
       });
   }

+ 1 - 1
lib/util/util.dart

@@ -11,7 +11,7 @@ bool isNotError(BuildContext context,json){
   }else if( json.data['success']&& json.data['code']==1){
     return true;
   }else{
-    alertError(context, json.data['msg']);
+    //alertError(context, json.data['msg']);
     return false;
   }
 }