ソースを参照

1.修改NPD Cart提交订单后依然请求数据。

Pen Li 8 年 前
コミット
7fe873abd9

+ 28 - 1
RedAnt ERP Mobile/common/Functions/cart/CartViewController.m

@@ -616,7 +616,10 @@
 }
 
 - (void)checkProductAvailable:(NSArray *)contents {
-    
+    if (contents == nil) {
+        self.available = NO;
+        return;
+    }
     [contents enumerateObjectsUsingBlock:^(id  _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
         
         if ([obj isKindOfClass:[NSDictionary class]]) {
@@ -630,11 +633,35 @@
     }];
 }
 
+- (void)clearContent {
+    dispatch_async(dispatch_get_main_queue(), ^{
+        self.freejson = nil;
+        self.notes = nil;
+        self.content_arr = nil;
+        self.currentOrderIsMerged = nil;
+        self.cart_json = nil;
+        [Singleton sharedInstance].currentOrderIsMerged = NO;
+        self.print_url = nil;
+        
+        [self checkProductAvailable:self.content_arr];
+        [self refresh_total];
+        [self.itemListTable reloadData];
+    });
+}
+
 -(void) operation_reload_data
 {
     if (self.dataOperationQueue.operationCount > 1) {
         return;
     }
+    
+    AppDelegate *appDelegate = (AppDelegate *)[UIApplication sharedApplication].delegate;
+    if (appDelegate.order_code == nil || appDelegate.order_code.length == 0) {
+        [self clearContent];
+        return;
+    }
+    
+    
     __weak typeof(self) weakself = self;
     dispatch_async(dispatch_get_main_queue(), ^{
         if(weakself.isrefreshing)

+ 1 - 1
RedAnt ERP Mobile/common/Functions/order/RABackOrderSubmitAlertController.m

@@ -136,7 +136,7 @@
     _line.frame = CGRectMake(0, CGRectGetMaxY(self.messageLabel.frame) + V_DISTANCE - 0.5, width, 0.5);
     
     bounds = self.confirmBtn.bounds;
-    self.confirmBtn.frame = CGRectMake((width - bounds.size.width) * 0.5, V_DISTANCE + CGRectGetMaxY(self.messageLabel.frame), bounds.size.width, bounds.size.height);
+    self.confirmBtn.frame = CGRectMake((width - self.messageLabel.bounds.size.width) * 0.5, V_DISTANCE + CGRectGetMaxY(self.messageLabel.frame), self.messageLabel.bounds.size.width, bounds.size.height);
 }
 
 - (void)didReceiveMemoryWarning {