Przeglądaj źródła

Apex mobile

移动result 到common 目录
Ray Zhang 8 lat temu
rodzic
commit
3a0a4a013a

BIN
Apex Mobile/Apex Mobile.xcodeproj/project.xcworkspace/xcuserdata/Ray.xcuserdatad/UserInterfaceState.xcuserstate


+ 118 - 118
common/customUI/ResultViewController.m

@@ -744,58 +744,58 @@ static const int delta = 25;
 }
 -(void)Export:(NSString*) url
 {
-    if(self.download_query )
-    {
-        self.documentPath = self.download_query;
-        [self.navigationController pushViewController:self.quickLook animated:NO];
-        return;
-    }
-    
-    __weak typeof(self) weakSelf = self;
-    dispatch_async(dispatch_get_global_queue(0, 0), ^{
-        
-//        NSMutableDictionary *params = self.params.mutableCopy;
-//        if(add_params!=nil)
-//           [params addEntriesFromDictionary:add_params];
-        NSString *path = [RANetwork download_query:url];
-        weakSelf.download_query = path;
-        weakSelf.documentPath = path;
-        
-        if (path) {
-            dispatch_async(dispatch_get_main_queue(), ^{
-                [weakSelf.navigationController pushViewController:weakSelf.quickLook animated:NO];
-            });
-        }
-        
-    });
+//    if(self.download_query )
+//    {
+//        self.documentPath = self.download_query;
+//        [self.navigationController pushViewController:self.quickLook animated:NO];
+//        return;
+//    }
+//
+//    __weak typeof(self) weakSelf = self;
+//    dispatch_async(dispatch_get_global_queue(0, 0), ^{
+//
+////        NSMutableDictionary *params = self.params.mutableCopy;
+////        if(add_params!=nil)
+////           [params addEntriesFromDictionary:add_params];
+//        NSString *path = [RANetwork download_query:url];
+//        weakSelf.download_query = path;
+//        weakSelf.documentPath = path;
+//
+//        if (path) {
+//            dispatch_async(dispatch_get_main_queue(), ^{
+//                [weakSelf.navigationController pushViewController:weakSelf.quickLook animated:NO];
+//            });
+//        }
+//
+//    });
 }
 - (void)downloadItemClick:(UIBarButtonItem *)sender {
     
-    
-    
-    if(self.download_query )
-    {
-        self.documentPath = self.download_query;
-        [self.navigationController pushViewController:self.quickLook animated:NO];
-        return;
-    }
-
-    __weak typeof(self) weakSelf = self;
-    dispatch_async(dispatch_get_global_queue(0, 0), ^{
-       
-        NSMutableDictionary *params = self.params.mutableCopy;
-        NSString *path = [RANetwork download_query:params];
-        weakSelf.download_query = path;
-        weakSelf.documentPath = path;
-        
-        if (path) {
-            dispatch_async(dispatch_get_main_queue(), ^{
-                [weakSelf.navigationController pushViewController:weakSelf.quickLook animated:NO];
-            });
-        }
-        
-    });
-    
+//
+//
+//    if(self.download_query )
+//    {
+//        self.documentPath = self.download_query;
+//        [self.navigationController pushViewController:self.quickLook animated:NO];
+//        return;
+//    }
+//
+//    __weak typeof(self) weakSelf = self;
+//    dispatch_async(dispatch_get_global_queue(0, 0), ^{
+//
+//        NSMutableDictionary *params = self.params.mutableCopy;
+//        NSString *path = [RANetwork download_query:params];
+//        weakSelf.download_query = path;
+//        weakSelf.documentPath = path;
+//
+//        if (path) {
+//            dispatch_async(dispatch_get_main_queue(), ^{
+//                [weakSelf.navigationController pushViewController:weakSelf.quickLook animated:NO];
+//            });
+//        }
+//
+//    });
+//
 }
 
 - (NSInteger)resultItemCount {
@@ -811,75 +811,75 @@ static const int delta = 25;
  * 2: load more
  */
 - (void)loadContentWithOption:(int)option Complete:(void (^)(int result,int count))finish {
-    if (self.params) {
-        
-        NSMutableDictionary *dic = self.params.mutableCopy;
-        switch (option) {
-            case 0:
-            case 1: {
-                self.offset = 0;
-                self.content_layout =nil;
-                self.content_action = nil;
-                self.content_menu = nil;
-                self.content_data = nil;
-            }
-            break;
-            case 2: {
-                self.offset = [self resultItemCount];
-            }
-            break;
-        }
-        
-//        dic[@"criteria"] = self.params;
-        
-        [dic setObject:@(self.offset) forKey:@"offset"];
-        [dic setObject:@(delta) forKey:@"limit"];
-//        dic[@"criteria"] = [NSArray arrayWithObjects:@"aaa",@"bbb", nil];
-        
-        __weak typeof(self) weakSelf = self;
-        dispatch_async(dispatch_get_global_queue(0, 0), ^{
-            NSDictionary *contentDic = [RANetwork query:dic];
-            NSInteger result = [[contentDic objectForKey:@"result"] integerValue];
-            dispatch_async(dispatch_get_main_queue(), ^{
-                if (weakSelf) {
-                    __strong typeof(weakSelf) strongSelf = weakSelf;
-                    if (result == RESULT_TRUE) {
-                        strongSelf.content_layout = [contentDic objectForKey:@"layout"];
-                        strongSelf.content_action = [contentDic objectForKey:@"row_action"];
-                        strongSelf.content_menu = [[contentDic objectForKey:@"menu"] mutableCopy];
-                        [strongSelf setupNavigationBar];
-                        
-                            UILabel * headerview=(UILabel *)self.tableview.tableHeaderView;
-                            headerview.text = contentDic[@"table_title"];
-                            [self resize_tableHeader];
-           
-                        if(strongSelf.content_data==nil)
-                            strongSelf.content_data = [NSMutableDictionary new];
-                        NSMutableDictionary* newdata = [[contentDic objectForKey:@"data"] mutableCopy];
-                        for(int dc = 0;dc<[newdata[@"count"] intValue];dc++)
-                        {
-                            NSMutableDictionary * newdata_item = newdata[[NSString stringWithFormat:@"item_%d",dc]];
-                            
-                            strongSelf.content_data[[NSString stringWithFormat:@"item_%d",[strongSelf.content_data[@"count"] intValue] ]] = newdata_item;
-                            strongSelf.content_data[@"count"] = @([strongSelf.content_data[@"count"] intValue]+1);
-                        }
-                        
-//                        strongSelf.content_data = [contentDic objectForKey:@"data"];
-                        [strongSelf updateTableFrame];
-                        [strongSelf.tableview reloadData];
-                    } else {
-                        [RAUtils message_alert:[contentDic objectForKey:@"err_msg"] title:@"Warning" controller:strongSelf];
-                    }
-                    
-                    if (finish) {
-                        finish((int)result,(int)[self resultItemCount]);
-                    }
-                    
-                }
-                
-            });
-        });
-    }
+//    if (self.params) {
+//        
+//        NSMutableDictionary *dic = self.params.mutableCopy;
+//        switch (option) {
+//            case 0:
+//            case 1: {
+//                self.offset = 0;
+//                self.content_layout =nil;
+//                self.content_action = nil;
+//                self.content_menu = nil;
+//                self.content_data = nil;
+//            }
+//            break;
+//            case 2: {
+//                self.offset = [self resultItemCount];
+//            }
+//            break;
+//        }
+//        
+////        dic[@"criteria"] = self.params;
+//        
+//        [dic setObject:@(self.offset) forKey:@"offset"];
+//        [dic setObject:@(delta) forKey:@"limit"];
+////        dic[@"criteria"] = [NSArray arrayWithObjects:@"aaa",@"bbb", nil];
+//        
+//        __weak typeof(self) weakSelf = self;
+//        dispatch_async(dispatch_get_global_queue(0, 0), ^{
+//            NSDictionary *contentDic = [RANetwork query:dic];
+//            NSInteger result = [[contentDic objectForKey:@"result"] integerValue];
+//            dispatch_async(dispatch_get_main_queue(), ^{
+//                if (weakSelf) {
+//                    __strong typeof(weakSelf) strongSelf = weakSelf;
+//                    if (result == RESULT_TRUE) {
+//                        strongSelf.content_layout = [contentDic objectForKey:@"layout"];
+//                        strongSelf.content_action = [contentDic objectForKey:@"row_action"];
+//                        strongSelf.content_menu = [[contentDic objectForKey:@"menu"] mutableCopy];
+//                        [strongSelf setupNavigationBar];
+//                        
+//                            UILabel * headerview=(UILabel *)self.tableview.tableHeaderView;
+//                            headerview.text = contentDic[@"table_title"];
+//                            [self resize_tableHeader];
+//           
+//                        if(strongSelf.content_data==nil)
+//                            strongSelf.content_data = [NSMutableDictionary new];
+//                        NSMutableDictionary* newdata = [[contentDic objectForKey:@"data"] mutableCopy];
+//                        for(int dc = 0;dc<[newdata[@"count"] intValue];dc++)
+//                        {
+//                            NSMutableDictionary * newdata_item = newdata[[NSString stringWithFormat:@"item_%d",dc]];
+//                            
+//                            strongSelf.content_data[[NSString stringWithFormat:@"item_%d",[strongSelf.content_data[@"count"] intValue] ]] = newdata_item;
+//                            strongSelf.content_data[@"count"] = @([strongSelf.content_data[@"count"] intValue]+1);
+//                        }
+//                        
+////                        strongSelf.content_data = [contentDic objectForKey:@"data"];
+//                        [strongSelf updateTableFrame];
+//                        [strongSelf.tableview reloadData];
+//                    } else {
+//                        [RAUtils message_alert:[contentDic objectForKey:@"err_msg"] title:@"Warning" controller:strongSelf];
+//                    }
+//                    
+//                    if (finish) {
+//                        finish((int)result,(int)[self resultItemCount]);
+//                    }
+//                    
+//                }
+//                
+//            });
+//        });
+//    }
 }
 
 - (void)updateTableFrame {