Pārlūkot izejas kodu

1.修复NPD Cart结束编辑后,Table高度不正确。
2.修复NPD Place Order Shipping修改后没有刷新Total。

Pen Li 8 gadi atpakaļ
vecāks
revīzija
948aa070e5

+ 10 - 5
RedAnt ERP Mobile/common/CommonEditor/CommonEditorViewController.m

@@ -5958,12 +5958,17 @@
         // table -> top > offset: table.y = -offset
         // 事实上top:topLayoutGuide
         CGFloat topAvailableHeight = (CGRectGetMinY(table_origin_screen_frame) - self.topLayoutGuide.length);
-        if (topAvailableHeight > offset) {
-            table_frame.origin.y = -offset;
+        if (topAvailableHeight > 0) {
+            if (topAvailableHeight > offset) {
+                table_frame.origin.y = -offset;
+            } else {
+                // 向上移动到topLayoutGuide,不足部分通过缩减高度到达keyboard顶部
+                table_frame.origin.y = -topAvailableHeight;
+                table_frame.size.height = (end_y - self.topLayoutGuide.length);
+            }
         } else {
-            // 向上移动到topLayoutGuide,不足部分通过缩减高度到达keyboard顶部
-            table_frame.origin.y = -topAvailableHeight;
-            table_frame.size.height = (end_y - self.topLayoutGuide.length);
+            // contentInset = (top = 64, left = 0, bottom = 0, right = 0),topAvailableHeight = -64
+            table_frame.size.height = table_origin_screen_frame.size.height - offset;
         }
         
 //        table_frame.size.height = CGRectGetHeight(table_origin_screen_frame) - (CGRectGetMaxY(table_origin_screen_frame) - end_y);

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

@@ -352,9 +352,9 @@
     //   DebugLog(@"begin edit %@",NSStringFromCGRect(self.cartItemView.frame));
     UIInterfaceOrientation orientation = [[UIApplication sharedApplication]statusBarOrientation];
     if ( UIInterfaceOrientationIsPortrait(orientation))
-        self.cartItemView.frame = CGRectMake(0,40,768,880);
+        self.cartItemView.frame = CGRectMake(0,40,768,840);
     else
-        self.cartItemView.frame = CGRectMake(0,40,1024,624);
+        self.cartItemView.frame = CGRectMake(0,40,1024,584);
     [self.itemListTable setEditing:true animated:YES];
     [self.itemListTable reloadData];
 }
@@ -367,9 +367,9 @@
     
     UIInterfaceOrientation orientation = [[UIApplication sharedApplication]statusBarOrientation];
     if ( UIInterfaceOrientationIsPortrait(orientation))
-        self.cartItemView.frame = CGRectMake(0,40,768,824);
+        self.cartItemView.frame = CGRectMake(0,40,768,760);
     else
-        self.cartItemView.frame = CGRectMake(0,40,1024,568);
+        self.cartItemView.frame = CGRectMake(0,40,1024,508);
     
     [self.itemListTable setEditing:false animated:YES];
     [self.edit_select_arr removeAllObjects];

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

@@ -780,7 +780,7 @@ static const int totalPage = 3;
         for(int i=0;i<count;i++)
         {
             NSDictionary * olditem=[[section_json objectForKey:[NSString stringWithFormat:@"item_%d",i ]] mutableCopy];
-            if([[olditem valueForKey:@"name"] isEqualToString:@"totalPrice" ])
+            if([[olditem valueForKey:@"name"] isEqualToString:@"totalPrice" ] || [[olditem valueForKey:@"name"] isEqualToString:@"totalPrice_a" ])
             {
                 [olditem setValue:[NSString stringWithFormat:@"%.2f",totalprice] forKey:@"value"];
                 [olditem setValue:@"true" forKey:@"dirty"];