|
@@ -27,6 +27,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
@property (strong,nonatomic) NSMutableDictionary* cadedate;
|
|
@property (strong,nonatomic) NSMutableDictionary* cadedate;
|
|
|
|
|
+@property (strong,nonatomic) NSMutableDictionary* online_cadedate;
|
|
|
@property int offset ;
|
|
@property int offset ;
|
|
|
@property int limit ;
|
|
@property int limit ;
|
|
|
//@property (nonatomic,strong) NSArray<NSMutableDictionary *> *dataArray;
|
|
//@property (nonatomic,strong) NSArray<NSMutableDictionary *> *dataArray;
|
|
@@ -48,6 +49,9 @@
|
|
|
{
|
|
{
|
|
|
[super viewDidLoad];
|
|
[super viewDidLoad];
|
|
|
|
|
|
|
|
|
|
+
|
|
|
|
|
+ self.limit = 20;
|
|
|
|
|
+
|
|
|
// self.automaticallyAdjustsScrollViewInsets = NO;
|
|
// self.automaticallyAdjustsScrollViewInsets = NO;
|
|
|
// self.max_select = 0;
|
|
// self.max_select = 0;
|
|
|
|
|
|
|
@@ -150,12 +154,12 @@
|
|
|
{
|
|
{
|
|
|
[super viewWillDisappear:animated];
|
|
[super viewWillDisappear:animated];
|
|
|
if(self.dirty == false)
|
|
if(self.dirty == false)
|
|
|
- return;
|
|
|
|
|
|
|
+ return;
|
|
|
if (self.delegate && [self.delegate respondsToSelector:@selector(EnumValueChanged:indexPath:)]) {
|
|
if (self.delegate && [self.delegate respondsToSelector:@selector(EnumValueChanged:indexPath:)]) {
|
|
|
- [self.delegate EnumValueChanged:self.cadedate indexPath:self.updatePosition];
|
|
|
|
|
|
|
+ [self.delegate EnumValueChanged:self.online_cadedate indexPath:self.updatePosition];
|
|
|
}
|
|
}
|
|
|
if(self.returnValue)
|
|
if(self.returnValue)
|
|
|
- self.returnValue(self.cadedate);
|
|
|
|
|
|
|
+ self.returnValue(self.online_cadedate);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@@ -404,23 +408,31 @@
|
|
|
|
|
|
|
|
if(self.keywords==nil || self.keywords.length==0)
|
|
if(self.keywords==nil || self.keywords.length==0)
|
|
|
{
|
|
{
|
|
|
- for(int i=0;i<[[self.cadedate valueForKey:@"count"] intValue];i++)
|
|
|
|
|
- {
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
- NSMutableDictionary* val_json = [[self.cadedate objectForKey:[NSString stringWithFormat:@"val_%d",i]] mutableCopy];
|
|
|
|
|
- if(i==indexPath.row)
|
|
|
|
|
- [val_json setValue:@"1" forKey:@"check"];
|
|
|
|
|
- else
|
|
|
|
|
- [val_json setValue:@"0" forKey:@"check"];
|
|
|
|
|
- [self.cadedate setObject:val_json forKey:[NSString stringWithFormat:@"val_%d",i]];
|
|
|
|
|
- }
|
|
|
|
|
|
|
+
|
|
|
|
|
+ NSMutableDictionary* val_json = [[self.cadedate objectForKey:[NSString stringWithFormat:@"val_%ld",indexPath.row]] mutableCopy];
|
|
|
|
|
+ [val_json setValue:@true forKey:@"check"];
|
|
|
|
|
+
|
|
|
|
|
+ self.online_cadedate = [NSMutableDictionary new];
|
|
|
|
|
+
|
|
|
|
|
+ self.online_cadedate[@"count"]=@1;
|
|
|
|
|
+ self.online_cadedate[@"val_0"]=val_json;
|
|
|
|
|
+// for(int i=0;i<[[self.cadedate valueForKey:@"count"] intValue];i++)
|
|
|
|
|
+// {
|
|
|
|
|
+//
|
|
|
|
|
+//
|
|
|
|
|
+//
|
|
|
|
|
+//
|
|
|
|
|
+// NSMutableDictionary* val_json = [[self.cadedate objectForKey:[NSString stringWithFormat:@"val_%d",i]] mutableCopy];
|
|
|
|
|
+// if(i==indexPath.row)
|
|
|
|
|
+// [val_json setValue:@"1" forKey:@"check"];
|
|
|
|
|
+// else
|
|
|
|
|
+// [val_json setValue:@"0" forKey:@"check"];
|
|
|
|
|
+// [self.cadedate setObject:val_json forKey:[NSString stringWithFormat:@"val_%d",i]];
|
|
|
|
|
+// }
|
|
|
}
|
|
}
|
|
|
else
|
|
else
|
|
|
{
|
|
{
|
|
|
-
|
|
|
|
|
|
|
+ NSAssert(true, @"NOT IMPL");
|
|
|
|
|
|
|
|
|
|
|
|
|
NSMutableDictionary* val_json =nil;
|
|
NSMutableDictionary* val_json =nil;
|
|
@@ -558,7 +570,7 @@
|
|
|
#pragma mark - searchBar delegate;
|
|
#pragma mark - searchBar delegate;
|
|
|
- (void)searchBarSearchButtonClicked:(UISearchBar *)searchBar
|
|
- (void)searchBarSearchButtonClicked:(UISearchBar *)searchBar
|
|
|
{
|
|
{
|
|
|
- self.keywords=[searchBar.text uppercaseString];
|
|
|
|
|
|
|
+ self.online_keywords=[searchBar.text uppercaseString];
|
|
|
|
|
|
|
|
[self loadData];
|
|
[self loadData];
|
|
|
// [self.tableEnum reloadData];
|
|
// [self.tableEnum reloadData];
|
|
@@ -600,13 +612,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
NSMutableDictionary *params = [self.online_params mutableCopy];
|
|
NSMutableDictionary *params = [self.online_params mutableCopy];
|
|
|
|
|
+ if(params==nil)
|
|
|
|
|
+ params=[NSMutableDictionary new];
|
|
|
[params setObject:[NSNumber numberWithInteger:self.offset] forKey:@"offset"];
|
|
[params setObject:[NSNumber numberWithInteger:self.offset] forKey:@"offset"];
|
|
|
[params setObject:[NSNumber numberWithInteger:self.limit] forKey:@"limit"];
|
|
[params setObject:[NSNumber numberWithInteger:self.limit] forKey:@"limit"];
|
|
|
|
|
|
|
|
if(self.online_keywords.length>0)
|
|
if(self.online_keywords.length>0)
|
|
|
- self.online_params[@"keywords"]=self.online_keywords;
|
|
|
|
|
|
|
+ params[@"keywords"]=self.online_keywords;
|
|
|
|
|
|
|
|
- [RADataProvider GetCadedate:self.online_params completionHandler:^(NSMutableDictionary *result) {
|
|
|
|
|
|
|
+ [RADataProvider GetCadedate:params completionHandler:^(NSMutableDictionary *result) {
|
|
|
|
|
|
|
|
NSMutableDictionary * json = result;
|
|
NSMutableDictionary * json = result;
|
|
|
__strong typeof(weakSelf) strongSelf = weakSelf;
|
|
__strong typeof(weakSelf) strongSelf = weakSelf;
|