Эх сурвалжийг харах

修改fake data 测试common editor图片浏览单元格
修改查询结果行操作接口的传值

Ray Zhang 8 жил өмнө
parent
commit
3403bd9f82

+ 1 - 1
RedAnt Mobile/RedAnt Mobile/RANetwork.h

@@ -18,7 +18,7 @@
 +(NSString*)download_query : (NSMutableDictionary*) params;
 +(NSString*)download_file : (NSMutableDictionary*) params url:(NSString*) url;
 +(NSDictionary*)require_query_ui:(NSString*) request_url params:(NSMutableDictionary*)params;
-+(NSString*)kv_detail : (NSMutableDictionary*) params;
++(NSDictionary*)kv_detail : (NSMutableDictionary*) params;
 +(NSDictionary*)require_orderdetail:(NSString*) request_url params:(NSMutableDictionary*)params;
 
 +(NSDictionary*)Verify : (NSMutableDictionary*) params;

+ 5 - 1
RedAnt Mobile/RedAnt Mobile/RANetwork.m

@@ -89,7 +89,7 @@
     NSDictionary *resultDic = [NSJSONSerialization JSONObjectWithData:data options:NSJSONReadingMutableLeaves error:nil];
     return resultDic;
 }
-+(NSString*)kv_detail : (NSMutableDictionary*) params
++(NSDictionary*)kv_detail : (NSMutableDictionary*) params
 {
 #ifdef FAKE_DATA
     NSString *Path = [[NSBundle mainBundle] pathForResource:@"kv.json" ofType:nil];
@@ -99,6 +99,10 @@
 #endif
     
     
+    params[ @"_action"]=@"ant_mobile";
+    params[ @"module"]=@"kv_detail";
+    params[ @"_operate"]=@"getCondition";
+    
     // params[@"_operate"]=@"valid_upload";
     AppDelegate *appDelegate = (AppDelegate *)[UIApplication sharedApplication].delegate;
     

+ 17 - 2
RedAnt Mobile/RedAnt Mobile/ResultViewController.m

@@ -17,6 +17,7 @@
 #import "KVViewController.h"
 #import <QuickLook/QuickLook.h>
 #import "config.h"
+#import "RAConvertor.h"
 
 static const int delta = 25;
 
@@ -100,7 +101,8 @@ static const int delta = 25;
 -(void)cellDoubleTapAction:(UIGestureRecognizer*)gestureRecognizer
 {
     NSLog(@"cell double tap");
-    
+        UITableViewCell* cell = (UITableViewCell*)[gestureRecognizer view];
+    NSIndexPath* indexPath=[self.tableview indexPathForCell:cell];
     //strongSelf.content_action
     if(self.content_action!=nil)
     {
@@ -132,7 +134,20 @@ static const int delta = 25;
             }
             else if([module isEqualToString:@"kv_detail"])
             {
-                NSMutableDictionary *params = action[@"params"];
+                NSMutableDictionary *params = [NSMutableDictionary new];
+                params[@"query_id"] = self.params[@"query_id"];
+                
+                NSMutableDictionary *criteria =[NSMutableDictionary new];
+                for(NSString* key in [action[@"params"] allKeys] )
+                {
+                    NSArray* item =self.content_data[[NSString stringWithFormat:@"item_%ld",indexPath.row]];
+                    int idx =[action[@"params"][key] intValue];
+                    criteria[key]=item[ idx];
+                }
+                
+                
+                params[@"criteria"]=[RAConvertor dict2string:action[@"params"]] ;
+                
                 
                 
                 UIAlertView * waitalert = [RAUtils waiting_alert:@"Loading..." title:@"Please wait"];

+ 1 - 1
RedAnt Mobile/RedAnt Mobile/config.h

@@ -31,7 +31,7 @@
 #define PDF_DEBUG false
 
 
-//#define FAKE_DATA
+#define FAKE_DATA
 
 #define PROJ_RAMOBILE
 

Файлын зөрүү хэтэрхий том тул дарагдсан байна
+ 1 - 1
RedAnt Mobile/RedAnt Mobile/orderdetail.json


+ 12 - 10
RedAnt Mobile/RedAnt Mobile/predef_query.json

@@ -20,16 +20,18 @@
              "action": "save"
              }
              ],
-    "row_action": [{
-        "title": "demo title",
-        "module0":"quick_look",
-        "module1": "kv_detail",
-        "module": "order_detail",
-        "url": "http://1.1.1.1",
-        "params": {
-            "order#": 0
-        }]
-    },
+    "row_action": [
+                   {
+                   "title": "demo title",
+                   "module0": "quick_look",
+                   "module1": "kv_detail",
+                   "module": "order_detail",
+                   "url": "http://1.1.1.1",
+                   "params": {
+                   "order#": 0
+                   }
+                   }
+                   ],
     "data": {
         "count": 17,
         "item_0": [

Энэ ялгаанд хэт олон файл өөрчлөгдсөн тул зарим файлыг харуулаагүй болно