|
@@ -150,6 +150,8 @@
|
|
|
@property (nonatomic,strong) NSMutableArray *sectionArray;
|
|
@property (nonatomic,strong) NSMutableArray *sectionArray;
|
|
|
@property (nonatomic,copy) NSString *photoDir;
|
|
@property (nonatomic,copy) NSString *photoDir;
|
|
|
@property (nonatomic,strong) UIRefreshControl *refreshControl;
|
|
@property (nonatomic,strong) UIRefreshControl *refreshControl;
|
|
|
|
|
+@property (nonatomic,strong) UIBarButtonItem *updateItem;
|
|
|
|
|
+
|
|
|
|
|
|
|
|
@end
|
|
@end
|
|
|
|
|
|
|
@@ -216,7 +218,7 @@
|
|
|
- (void)configureNavigationBar {
|
|
- (void)configureNavigationBar {
|
|
|
|
|
|
|
|
UIBarButtonItem *updateItem = [[UIBarButtonItem alloc] initWithTitle:NSLocalizedString(@"Update", nil) style:UIBarButtonItemStylePlain target:self action:@selector(updateBtnClick:)];
|
|
UIBarButtonItem *updateItem = [[UIBarButtonItem alloc] initWithTitle:NSLocalizedString(@"Update", nil) style:UIBarButtonItemStylePlain target:self action:@selector(updateBtnClick:)];
|
|
|
- self.navigationItem.rightBarButtonItem = updateItem;
|
|
|
|
|
|
|
+ self.updateItem = updateItem;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- (void)registKeyboardListener {
|
|
- (void)registKeyboardListener {
|
|
@@ -269,6 +271,11 @@
|
|
|
|
|
|
|
|
#pragma mark - Setter
|
|
#pragma mark - Setter
|
|
|
|
|
|
|
|
|
|
+- (void)setUpdateItem:(UIBarButtonItem *)updateItem {
|
|
|
|
|
+ _updateItem = updateItem;
|
|
|
|
|
+ self.navigationItem.rightBarButtonItem = updateItem;
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
- (void)addModelAtIndex:(NSIndexPath *)indexPath withJsonItem:(NSDictionary *)item {
|
|
- (void)addModelAtIndex:(NSIndexPath *)indexPath withJsonItem:(NSDictionary *)item {
|
|
|
RAEditSectionModel *section = [self.sectionArray objectAtIndex:indexPath.section];
|
|
RAEditSectionModel *section = [self.sectionArray objectAtIndex:indexPath.section];
|
|
|
[section addModelAtIndex:indexPath.row withJsonItem:item];
|
|
[section addModelAtIndex:indexPath.row withJsonItem:item];
|
|
@@ -394,6 +401,8 @@
|
|
|
|
|
|
|
|
- (void)updateBtnClick:(UIBarButtonItem *)sender {
|
|
- (void)updateBtnClick:(UIBarButtonItem *)sender {
|
|
|
|
|
|
|
|
|
|
+ self.updateItem.enabled = NO; // 失败返回时重新开启enable
|
|
|
|
|
+
|
|
|
NSMutableDictionary *params = [NSMutableDictionary dictionary];
|
|
NSMutableDictionary *params = [NSMutableDictionary dictionary];
|
|
|
if (self.orderType2) {
|
|
if (self.orderType2) {
|
|
|
[params setObject:self.orderType2 forKey:@"orderType2"];
|
|
[params setObject:self.orderType2 forKey:@"orderType2"];
|
|
@@ -418,6 +427,8 @@
|
|
|
RAEditRequiredAlert *alertVC = [RAEditRequiredAlert alertWithTile:NSLocalizedString(@"Warning", nil) message:[NSString localizedStringWithFormat:NSLocalizedString(@"please complete missing field:\n%@", nil),[emptyArr componentsJoinedByString:@"\n"]]];
|
|
RAEditRequiredAlert *alertVC = [RAEditRequiredAlert alertWithTile:NSLocalizedString(@"Warning", nil) message:[NSString localizedStringWithFormat:NSLocalizedString(@"please complete missing field:\n%@", nil),[emptyArr componentsJoinedByString:@"\n"]]];
|
|
|
|
|
|
|
|
[self presentViewController:alertVC animated:YES completion:nil];
|
|
[self presentViewController:alertVC animated:YES completion:nil];
|
|
|
|
|
+
|
|
|
|
|
+ self.updateItem.enabled = YES;
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -453,6 +464,8 @@
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
[weakSelf showAlert:msg];
|
|
[weakSelf showAlert:msg];
|
|
|
|
|
+
|
|
|
|
|
+ weakSelf.updateItem.enabled = YES;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
}];
|
|
}];
|
|
@@ -473,6 +486,7 @@
|
|
|
|
|
|
|
|
dispatch_async(dispatch_get_main_queue(), ^{
|
|
dispatch_async(dispatch_get_main_queue(), ^{
|
|
|
|
|
|
|
|
|
|
+
|
|
|
// if (photoArr.count > 0) {
|
|
// if (photoArr.count > 0) {
|
|
|
// [strongSelf syncUploadPhotos:photoArr Json:json HUD:hud];
|
|
// [strongSelf syncUploadPhotos:photoArr Json:json HUD:hud];
|
|
|
// } else {
|
|
// } else {
|
|
@@ -499,6 +513,8 @@
|
|
|
|
|
|
|
|
NSString *msg = [json objectForKey:@"err_msg"];
|
|
NSString *msg = [json objectForKey:@"err_msg"];
|
|
|
[strongSelf showAlertTilte:NSLocalizedString(@"Warning", nil) message:msg];
|
|
[strongSelf showAlertTilte:NSLocalizedString(@"Warning", nil) message:msg];
|
|
|
|
|
+
|
|
|
|
|
+ strongSelf.updateItem.enabled = YES;
|
|
|
}];
|
|
}];
|
|
|
|
|
|
|
|
});
|
|
});
|