Просмотр исходного кода

1.修复NPD Place Order在编辑Shipping时将其滑出屏幕再关闭键盘,此时未更新Total。

Pen Li 8 лет назад
Родитель
Сommit
af7a9f86ab
1 измененных файлов с 8 добавлено и 1 удалено
  1. 8 1
      RedAnt ERP Mobile/common/Functions/order/RAOrderEditorViewController.m

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

@@ -746,11 +746,18 @@ static const int totalPage = 3;
 - (void)textFieldDidEndEditing:(UITextField *)textField
 - (void)textFieldDidEndEditing:(UITextField *)textField
 {
 {
     
     
-    [super textFieldDidEndEditing:textField];
+//    [super textFieldDidEndEditing:textField];
     
     
     UITableViewCell *cell = (UITableViewCell *) textField.superview.superview;
     UITableViewCell *cell = (UITableViewCell *) textField.superview.superview;
     NSIndexPath *   indexPath = [self.editorTable indexPathForCell:cell];
     NSIndexPath *   indexPath = [self.editorTable indexPathForCell:cell];
     
     
+    // table滑动后,cell可能会滚出table visible范围,此时indexPath为nil
+    if (indexPath == nil) {
+        indexPath = self.lastedit_from;
+    }
+    
+    // 避免提前将lastedit_from置空
+    [super textFieldDidEndEditing:textField];
     
     
     NSMutableDictionary* section_json=nil;
     NSMutableDictionary* section_json=nil;