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

Redant Mobile
新增KVViewController

Ray Zhang 8 лет назад
Родитель
Сommit
1576209980

+ 48 - 0
RedAnt Mobile/RedAnt Mobile.xcodeproj/project.pbxproj

@@ -37,6 +37,13 @@
 		7197D4041FB438B60063EFBB /* demo_row.pdf in Resources */ = {isa = PBXBuildFile; fileRef = 7197D4031FB4388F0063EFBB /* demo_row.pdf */; };
 		7197D4081FB57E270063EFBB /* SearchViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 7197D4071FB57E270063EFBB /* SearchViewController.m */; };
 		7197D40A1FB58E530063EFBB /* search_ui.json in Resources */ = {isa = PBXBuildFile; fileRef = 7197D4091FB58E530063EFBB /* search_ui.json */; };
+		7197D40E1FBBE1260063EFBB /* KVViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 7197D40D1FBBE1260063EFBB /* KVViewController.m */; };
+		7197D4121FBBE1490063EFBB /* ModelDetailViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 7197D4111FBBE1490063EFBB /* ModelDetailViewController.m */; };
+		7197D4151FBBE1610063EFBB /* OrderDetailViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 7197D4141FBBE1610063EFBB /* OrderDetailViewController.m */; };
+		7197D4181FBC10710063EFBB /* DetailKVCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 7197D4171FBC10710063EFBB /* DetailKVCell.m */; };
+		7197D41A1FBC1BE80063EFBB /* Detail.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 7197D4191FBC1BE80063EFBB /* Detail.storyboard */; };
+		7197D41C1FBD1CD60063EFBB /* kv.json in Resources */ = {isa = PBXBuildFile; fileRef = 7197D41B1FBD1CD60063EFBB /* kv.json */; };
+		7197D41F1FBD2EA60063EFBB /* LineView.m in Sources */ = {isa = PBXBuildFile; fileRef = 7197D41E1FBD2EA60063EFBB /* LineView.m */; };
 		71CB70B41FA1CCDB009FDCB7 /* server.json in Resources */ = {isa = PBXBuildFile; fileRef = 71CB70B31FA1CCDB009FDCB7 /* server.json */; };
 		71E9F6C81F8C5CCB0052C78E /* NetworkUtils.m in Sources */ = {isa = PBXBuildFile; fileRef = 71E9F6C61F8C5CCA0052C78E /* NetworkUtils.m */; };
 		71F3A9A21F5F8E22001036C8 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 71F3A9A11F5F8E22001036C8 /* main.m */; };
@@ -160,6 +167,18 @@
 		7197D4061FB57E270063EFBB /* SearchViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SearchViewController.h; sourceTree = "<group>"; };
 		7197D4071FB57E270063EFBB /* SearchViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SearchViewController.m; sourceTree = "<group>"; };
 		7197D4091FB58E530063EFBB /* search_ui.json */ = {isa = PBXFileReference; lastKnownFileType = text.json; path = search_ui.json; sourceTree = "<group>"; };
+		7197D40C1FBBE1260063EFBB /* KVViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = KVViewController.h; sourceTree = "<group>"; };
+		7197D40D1FBBE1260063EFBB /* KVViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = KVViewController.m; sourceTree = "<group>"; };
+		7197D4101FBBE1490063EFBB /* ModelDetailViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ModelDetailViewController.h; sourceTree = "<group>"; };
+		7197D4111FBBE1490063EFBB /* ModelDetailViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ModelDetailViewController.m; sourceTree = "<group>"; };
+		7197D4131FBBE1610063EFBB /* OrderDetailViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = OrderDetailViewController.h; sourceTree = "<group>"; };
+		7197D4141FBBE1610063EFBB /* OrderDetailViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = OrderDetailViewController.m; sourceTree = "<group>"; };
+		7197D4161FBC10710063EFBB /* DetailKVCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = DetailKVCell.h; path = ../../../common/detail/DetailKVCell.h; sourceTree = "<group>"; };
+		7197D4171FBC10710063EFBB /* DetailKVCell.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = DetailKVCell.m; path = ../../../common/detail/DetailKVCell.m; sourceTree = "<group>"; };
+		7197D4191FBC1BE80063EFBB /* Detail.storyboard */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; path = Detail.storyboard; sourceTree = "<group>"; };
+		7197D41B1FBD1CD60063EFBB /* kv.json */ = {isa = PBXFileReference; lastKnownFileType = text.json; path = kv.json; sourceTree = "<group>"; };
+		7197D41D1FBD2EA60063EFBB /* LineView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = LineView.h; path = ../../../common/detail/LineView.h; sourceTree = "<group>"; };
+		7197D41E1FBD2EA60063EFBB /* LineView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = LineView.m; path = ../../../common/detail/LineView.m; sourceTree = "<group>"; };
 		71CB70B01FA1BA5E009FDCB7 /* data.json */ = {isa = PBXFileReference; lastKnownFileType = text.json; path = data.json; sourceTree = "<group>"; };
 		71CB70B11FA1BA5E009FDCB7 /* layout.json */ = {isa = PBXFileReference; lastKnownFileType = text.json; path = layout.json; sourceTree = "<group>"; };
 		71CB70B31FA1CCDB009FDCB7 /* server.json */ = {isa = PBXFileReference; lastKnownFileType = text.json; path = server.json; sourceTree = "<group>"; };
@@ -519,6 +538,24 @@
 			name = search;
 			sourceTree = "<group>";
 		};
+		7197D40B1FBBE0EF0063EFBB /* detail */ = {
+			isa = PBXGroup;
+			children = (
+				7197D41D1FBD2EA60063EFBB /* LineView.h */,
+				7197D41E1FBD2EA60063EFBB /* LineView.m */,
+				7197D4161FBC10710063EFBB /* DetailKVCell.h */,
+				7197D4171FBC10710063EFBB /* DetailKVCell.m */,
+				7197D40C1FBBE1260063EFBB /* KVViewController.h */,
+				7197D40D1FBBE1260063EFBB /* KVViewController.m */,
+				7197D4101FBBE1490063EFBB /* ModelDetailViewController.h */,
+				7197D4111FBBE1490063EFBB /* ModelDetailViewController.m */,
+				7197D4131FBBE1610063EFBB /* OrderDetailViewController.h */,
+				7197D4141FBBE1610063EFBB /* OrderDetailViewController.m */,
+				7197D4191FBC1BE80063EFBB /* Detail.storyboard */,
+			);
+			path = detail;
+			sourceTree = "<group>";
+		};
 		71CB70B21FA1CCBC009FDCB7 /* fake data */ = {
 			isa = PBXGroup;
 			children = (
@@ -528,6 +565,7 @@
 				7197D4031FB4388F0063EFBB /* demo_row.pdf */,
 				71FF602E1FA8449C00C5523A /* predef_query.json */,
 				7197D4091FB58E530063EFBB /* search_ui.json */,
+				7197D41B1FBD1CD60063EFBB /* kv.json */,
 			);
 			name = "fake data";
 			sourceTree = "<group>";
@@ -576,6 +614,7 @@
 				71F3A9BA1F5F8E89001036C8 /* result */,
 				7197D4051FB57DD00063EFBB /* search */,
 				42F2EB3B1FA80EB300BC6468 /* Model */,
+				7197D40B1FBBE0EF0063EFBB /* detail */,
 				4221EFA51FA853660026E1EC /* Refresh */,
 				71F3A9A31F5F8E22001036C8 /* AppDelegate.h */,
 				71F3A9A41F5F8E22001036C8 /* AppDelegate.m */,
@@ -861,7 +900,9 @@
 				42973AD81FBAB9C300A3C164 /* EnumSelectAndSort.storyboard in Resources */,
 				7197D4041FB438B60063EFBB /* demo_row.pdf in Resources */,
 				71FF60371FA96F4F00C5523A /* download_query.xls in Resources */,
+				7197D41A1FBC1BE80063EFBB /* Detail.storyboard in Resources */,
 				71FF60321FA871DD00C5523A /* data.json in Resources */,
+				7197D41C1FBD1CD60063EFBB /* kv.json in Resources */,
 				7197D40A1FB58E530063EFBB /* search_ui.json in Resources */,
 				71FF60331FA871DD00C5523A /* layout.json in Resources */,
 				42DFAE6B1F9B2B73009AFCCC /* Phone_Action_Cell.xib in Resources */,
@@ -910,6 +951,7 @@
 				71F3AA441F612369001036C8 /* EnumSelectViewController.m in Sources */,
 				71F3A9E31F5FA531001036C8 /* JLKeyboardListener.m in Sources */,
 				71F3A9A81F5F8E22001036C8 /* RARootViewController.m in Sources */,
+				7197D40E1FBBE1260063EFBB /* KVViewController.m in Sources */,
 				71F3AA921F627700001036C8 /* DefaultTableHeaderView.m in Sources */,
 				71F3AA5F1F624AD4001036C8 /* StrikethroughLabel.m in Sources */,
 				42973AD71FBA8F4A00A3C164 /* CommonEditorRangeCell.m in Sources */,
@@ -949,6 +991,7 @@
 				71F3A9CD1F5FA11F001036C8 /* LoginViewController.m in Sources */,
 				71E9F6C81F8C5CCB0052C78E /* NetworkUtils.m in Sources */,
 				71F3A9D01F5FA277001036C8 /* BasicViewController.m in Sources */,
+				7197D4121FBBE1490063EFBB /* ModelDetailViewController.m in Sources */,
 				71F3AA531F6125ED001036C8 /* ImageViewController.m in Sources */,
 				71F3AA411F612369001036C8 /* CommonEditorViewController.m in Sources */,
 				71F3A9ED1F5FA557001036C8 /* ioapi.c in Sources */,
@@ -956,7 +999,10 @@
 				71F3AA3A1F612369001036C8 /* CommonEditorCellImg.m in Sources */,
 				71F3A9EF1F5FA557001036C8 /* unzip.c in Sources */,
 				71F3AA071F5FDDFE001036C8 /* AESCrypt.m in Sources */,
+				7197D4181FBC10710063EFBB /* DetailKVCell.m in Sources */,
 				71F3AA831F6263B2001036C8 /* MainViewController.m in Sources */,
+				7197D41F1FBD2EA60063EFBB /* LineView.m in Sources */,
+				7197D4151FBBE1610063EFBB /* OrderDetailViewController.m in Sources */,
 				71F3A9CB1F5FA11F001036C8 /* LoginSwitchCell.m in Sources */,
 				71F3AA801F626309001036C8 /* CustomIOSAlertView.m in Sources */,
 				71F3AA5C1F624A88001036C8 /* SignatureViewController.m in Sources */,
@@ -1108,6 +1154,7 @@
 				ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
 				DEVELOPMENT_TEAM = HXWLAA5YN5;
 				INFOPLIST_FILE = "RedAnt Mobile/Info.plist";
+				IPHONEOS_DEPLOYMENT_TARGET = 10.3;
 				LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
 				ONLY_ACTIVE_ARCH = YES;
 				PRODUCT_BUNDLE_IDENTIFIER = "usai.redant.RedAnt-Mobile";
@@ -1121,6 +1168,7 @@
 				ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
 				DEVELOPMENT_TEAM = HXWLAA5YN5;
 				INFOPLIST_FILE = "RedAnt Mobile/Info.plist";
+				IPHONEOS_DEPLOYMENT_TARGET = 10.3;
 				LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
 				ONLY_ACTIVE_ARCH = NO;
 				PRODUCT_BUNDLE_IDENTIFIER = "usai.redant.RedAnt-Mobile";

+ 6 - 2
RedAnt Mobile/RedAnt Mobile/LoginSettingViewController.m

@@ -9,7 +9,7 @@
 #import "LoginSettingViewController.h"
 //#import "ScannerViewController.h"
 #import "CommonEditorViewController.h"
-
+#import "AESCrypt.h"
 
 @interface LoginSettingViewController ()<UITextFieldDelegate>
 
@@ -62,6 +62,10 @@ if (password.length==0)
         return;
     }
     NSMutableDictionary* params = [@{@"company_id":company,@"password":password} mutableCopy];
+    
+    [params setValue:[AESCrypt AES128Encrypt:company  key:@"Usai2010"] forKey:@"company_id"];
+    [params setValue:[AESCrypt AES128Encrypt:password  key:@"Usai2010"] forKey:@"pwd"];
+//    [params setValue:[NSString stringWithFormat:@"%ld",ver]  forKey:@"auth_ver"];
     AppDelegate *appDelegate = (AppDelegate *)[UIApplication sharedApplication].delegate;
     //    appDelegate.address = self.address;
     __weak typeof(self) weakself = self;
@@ -79,7 +83,7 @@ if (password.length==0)
                 {
                     //code not exist;
                     
-//                    [RAUtils message_alert:weakself.verify_msg0 title:@"Warring" controller:weakself];
+                    [RAUtils message_alert:result_json[@"msg"] title:@"Warring" controller:weakself];
                     //                            [weakself.view makeToast:weakself.verify_msg0 duration:3.0 position:CSToastPositionCenter];
                     break;
                 }

+ 142 - 40
RedAnt Mobile/RedAnt Mobile/RA Mobile.txt

@@ -1,3 +1,10 @@
+result:
+
+#define RESULT_FALSE 0
+#define RESULT_TRUE         2
+
+
+
 
 model_detail
 
@@ -177,46 +184,141 @@ mode type: query; predef_query; local_func; submode;
 sample:
 {
 "result":2,
-  "mode_list": [
-    {
-      "name": "mode0",
-      "type": "predef_query",
-      "query_id": 123456
-    },
-    {
-      "name": "mode1",
-      "type": "query",
-      "url": "http://..."
-    },
-    {
-      "name": "mode2",
-      "type": "local_func",
-      "module": "change_pwd"
-    },
-    {
-      "name": "mode3",
-      "type": "submode",
-      "mode_list": [
-        {
-          "name": "mode0",
-          "type": "predef_query",
-          "query_id": 123456
-        },
-        {
-          "name": "mode1",
-          "type": "query",
-          "url": "http://..."
-        },
-        {
-          "name": "mode2",
-          "type": "local_func",
-          "module": "change_pwd"
-        }
-      ]
-    }
-  ]
+"mode_list": [
+{
+"name": "Management Report",
+"type": "submode",
+"mode_list": [
+{
+"name": "Demo Predefine Query",
+"type": "predef_query",
+"query_id": 123456
+},
+{
+"name": "mode1",
+"type": "query",
+"url": "http://..."
+},
+{
+"name": "mode2",
+"type": "local_func",
+"module": "change_pwd"
 }
+]
+},
+{
+"name": "RA Image",
+"type": "submode",
+"mode_list": [
+{
+"name": "POP",
+"type": "local_func",
+"module": "raimage_pop"
+},
+{
+"name": "Model",
+"type": "local_func",
+"module": "raimage_model"
+},
+{
+"name": "Receiving",
+"type": "local_func",
+"module": "raimage_receiving"
+},
+{
+"name": "Returns",
+"type": "local_func",
+"module": "raimage_returns"
+}
+]
+},
+{
+"name": "Sales Order",
+"type": "submode",
+"mode_list": [
+{
+"name": "mode0",
+"type": "predef_query",
+"query_id": 123456
+},
+{
+"name": "mode1",
+"type": "query",
+"url": "http://..."
+},
+{
+"name": "mode2",
+"type": "local_func",
+"module": "change_pwd"
+}
+]
+},
+{
+"name": "Pick Order",
+"type": "submode",
+"mode_list": [
+{
+"name": "mode0",
+"type": "predef_query",
+"query_id": 123456
+},
+{
+"name": "mode1",
+"type": "query",
+"url": "http://..."
+},
+{
+"name": "mode2",
+"type": "local_func",
+"module": "change_pwd"
+}
+]
+},
+{
+"name": "CRM",
+"type": "submode",
+"mode_list": [
+{
+"name": "mode0",
+"type": "predef_query",
+"query_id": 123456
+},
+{
+"name": "mode1",
+"type": "query",
+"url": "http://..."
+},
+{
+"name": "mode2",
+"type": "local_func",
+"module": "change_pwd"
+}
+]
+},
+{
+"name": "Tools",
+"type": "submode",
+"mode_list": [
+
+{
+"name": "Change Password",
+"type": "local_func",
+"module": "tools_change_pwd"
+}
+]
+}
+
+]
+}
+
+
+active 根据company id 和 密码,取得服务器地址
 
-active 取得公司服务器url
 up: company_id, pwd;
-down: result,url;
+down: result,url; result 成功 2 失败 0
+sample:
+{
+"result":2,
+"url":"http://xxx.xxx.xxx/"
+}
+

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

@@ -18,4 +18,5 @@
 +(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;
 @end

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

@@ -23,12 +23,19 @@
 }
 +(NSDictionary*)require_server : (NSMutableDictionary*) params
 {
+#ifdef FAKE_DATA
     NSString *Path = [[NSBundle mainBundle] pathForResource:@"server.json" ofType:nil];
     
     NSData* data1 = [NSData dataWithContentsOfFile:Path];
     return [[NSJSONSerialization JSONObjectWithData:data1 options:NSJSONReadingMutableContainers error:nil] mutableCopy];
+#endif
+    
     
     
+    params[@"_action"]=@"ant_mobile";
+    params[@"_operate"]=@"getUrl";
+
+    
     // params[@"_operate"]=@"valid_upload";
     AppDelegate *appDelegate = (AppDelegate *)[UIApplication sharedApplication].delegate;
     
@@ -68,7 +75,23 @@
     NSDictionary *resultDic = [NSJSONSerialization JSONObjectWithData:data options:NSJSONReadingMutableLeaves error:nil];
     return resultDic;
 }
-
++(NSString*)kv_detail : (NSMutableDictionary*) params
+{
+#ifdef FAKE_DATA
+    NSString *Path = [[NSBundle mainBundle] pathForResource:@"kv.json" ofType:nil];
+    
+    NSData* data1 = [NSData dataWithContentsOfFile:Path];
+    return [[NSJSONSerialization JSONObjectWithData:data1 options:NSJSONReadingMutableContainers error:nil] mutableCopy];
+#endif
+    
+    
+    // params[@"_operate"]=@"valid_upload";
+    AppDelegate *appDelegate = (AppDelegate *)[UIApplication sharedApplication].delegate;
+    
+    NSData *data = [self get_json:[self get_url:URL_KV_DETAIL] parameters:params file:nil];
+    NSDictionary *resultDic = [NSJSONSerialization JSONObjectWithData:data options:NSJSONReadingMutableLeaves error:nil];
+    return resultDic;
+}
 +(NSString*)download_file : (NSMutableDictionary*) params url:(NSString*) url
 {
     NSString *Path =nil;

+ 86 - 6
RedAnt Mobile/RedAnt Mobile/ResultViewController.m

@@ -13,6 +13,7 @@
 #import "RAUtils.h"
 #import "JLRefreshHeader.h"
 #import "JLRefreshFooter.h"
+#import "KVViewController.h"
 #import <QuickLook/QuickLook.h>
 
 static const int delta = 25;
@@ -117,12 +118,57 @@ static const int delta = 25;
                 
                 if (path) {
                     dispatch_async(dispatch_get_main_queue(), ^{
-                        [weakSelf.navigationController pushViewController:weakSelf.quickLook animated:YES];
+                        [weakSelf.navigationController pushViewController:weakSelf.quickLook animated:NO];
                     });
                 }
                 
             });
         }
+        else if([module isEqualToString:@"kv_detail"])
+        {
+                NSMutableDictionary *params = self.content_action[@"params"];
+            
+            
+            UIAlertView * waitalert = [RAUtils waiting_alert:@"Loading..." title:@"Please wait"];
+            
+          
+            __weak typeof(self) weakself = self;
+            dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
+                
+                
+                
+                NSDictionary* json =[RANetwork kv_detail:params];
+                
+                dispatch_async(dispatch_get_main_queue(), ^{
+                    [waitalert dismissWithClickedButtonIndex:0 animated:FALSE];
+                    
+                    
+                    if([[json valueForKey:@"result"] intValue]==2)
+                    {
+                        KVViewController *vc = [[UIStoryboard storyboardWithName:@"Detail" bundle:nil] instantiateViewControllerWithIdentifier:@"KVViewController"];
+                        vc.content = [json mutableCopy];
+                        [weakself.navigationController pushViewController:vc animated:NO];
+                        
+//                        weakself.content_data_download = [weakself CopyDirty:weakself.content_data_download to:[editor_json mutableCopy]];//[editor_json mutableCopy];
+//
+//                        weakself.content_data_control = [weakself translate_json:weakself.content_data_download changed: weakself.changed_data];
+//
+//
+//                        [weakself download_success];
+//                        [weakself.editorTable reloadData];
+                        
+                    }
+                    else
+                    {
+                        [RAUtils message_alert:json[@"msg"] title:nil controller:weakself] ;
+                    }
+                    
+                    
+                    
+                    
+                });
+            });
+        }
     }
     
   
@@ -437,17 +483,18 @@ static const int delta = 25;
     UIAlertController *alertControl = [UIAlertController alertControllerWithTitle:@"Menu" message:nil preferredStyle:UIAlertControllerStyleAlert];
     //block代码块取代了delegate
     
-    
+        __weak typeof(self) weakSelf = self;
     for(int i=0;i<self.content_menu.count;i++)
     {
         NSMutableDictionary* json = self.content_menu[i];
         NSString* title =json[@"title"];
         NSString* actiontype = json[@"action"];
         NSMutableDictionary* add_params = json[@"params"];
-        UIAlertAction *actioni = [UIAlertAction actionWithTitle:title style:UIAlertActionStyleCancel handler:^(UIAlertAction *action) {
+        UIAlertAction *actioni = [UIAlertAction actionWithTitle:title style:UIAlertActionStyleDefault handler:^(UIAlertAction *action) {
             // DebugLog(@"Cancel");
             if([actiontype isEqualToString:@"download"])
             {
+                [weakSelf Export:add_params];
             }
             else if([actiontype isEqualToString:@"save"])
             {
@@ -456,11 +503,44 @@ static const int delta = 25;
         [alertControl addAction:actioni];
     }
     
+    UIAlertAction *actionCancel = [UIAlertAction actionWithTitle:@"Cancel" style:UIAlertActionStyleCancel handler:^(UIAlertAction *action) {
+        // DebugLog(@"Cancel");
+       
+    }];
+    [alertControl addAction:actionCancel];
+    
   
     
     
     
-    [self presentViewController:alertControl animated:YES completion:nil];
+    [self presentViewController:alertControl animated:NO completion:nil];
+}
+-(void)Export:(NSDictionary*) add_params
+{
+    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:params];
+        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 {
     
@@ -469,7 +549,7 @@ static const int delta = 25;
     if(self.download_query )
     {
         self.documentPath = self.download_query;
-        [self.navigationController pushViewController:self.quickLook animated:YES];
+        [self.navigationController pushViewController:self.quickLook animated:NO];
         return;
     }
 
@@ -483,7 +563,7 @@ static const int delta = 25;
         
         if (path) {
             dispatch_async(dispatch_get_main_queue(), ^{
-                [weakSelf.navigationController pushViewController:weakSelf.quickLook animated:YES];
+                [weakSelf.navigationController pushViewController:weakSelf.quickLook animated:NO];
             });
         }
         

+ 3 - 2
RedAnt Mobile/RedAnt Mobile/config.h

@@ -31,13 +31,14 @@
 #define PDF_DEBUG false
 
 
+#define FAKE_DATA
 
 #ifdef test_server
 #define URL_CUSTOMER_ADV_SEARCH @""
 #define URL_LOGIN @""
 #define URL_QUERY @""
-#define  URL_REQUIRE_SERVER  @""
-
+#define  URL_REQUIRE_SERVER  @"http://192.168.0.155/wm_postgresql/ant_mobile_company_valid.php"
+#define URL_KV_DETAIL @""
 #define URL_UPLOAD_IMG @""
 
 #define  URL_ERR_LOG  @""

+ 71 - 0
RedAnt Mobile/RedAnt Mobile/detail/Detail.storyboard

@@ -0,0 +1,71 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="13196" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
+    <device id="retina4_7" orientation="portrait">
+        <adaptation id="fullscreen"/>
+    </device>
+    <dependencies>
+        <deployment identifier="iOS"/>
+        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="13173"/>
+        <capability name="Safe area layout guides" minToolsVersion="9.0"/>
+        <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
+    </dependencies>
+    <scenes>
+        <!--View Controller-->
+        <scene sceneID="211-xU-pr1">
+            <objects>
+                <viewController storyboardIdentifier="KVViewController" useStoryboardIdentifierAsRestorationIdentifier="YES" id="Hu0-Pd-979" customClass="KVViewController" sceneMemberID="viewController">
+                    <view key="view" contentMode="scaleToFill" id="Q1f-rh-4Hw">
+                        <rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
+                        <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
+                        <subviews>
+                            <tableView clipsSubviews="YES" contentMode="scaleToFill" fixedFrame="YES" alwaysBounceVertical="YES" dataMode="prototypes" style="plain" separatorStyle="default" rowHeight="-1" estimatedRowHeight="-1" sectionHeaderHeight="28" sectionFooterHeight="28" translatesAutoresizingMaskIntoConstraints="NO" id="bvX-PC-zYc">
+                                <rect key="frame" x="0.0" y="20" width="375" height="647"/>
+                                <autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMaxX="YES" heightSizable="YES" flexibleMaxY="YES"/>
+                                <color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
+                                <prototypes>
+                                    <tableViewCell contentMode="scaleToFill" selectionStyle="blue" hidesAccessoryWhenEditing="NO" indentationLevel="1" indentationWidth="0.0" reuseIdentifier="detail_item_kv" id="Mg2-ri-gLF" customClass="DetailKVCell">
+                                        <rect key="frame" x="0.0" y="28" width="375" height="44"/>
+                                        <autoresizingMask key="autoresizingMask"/>
+                                        <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="Mg2-ri-gLF" id="Dw4-Mr-tl1">
+                                            <rect key="frame" x="0.0" y="0.0" width="375" height="43.5"/>
+                                            <autoresizingMask key="autoresizingMask"/>
+                                            <subviews>
+                                                <label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" text="Label" lineBreakMode="wordWrap" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Auw-1f-Lef">
+                                                    <rect key="frame" x="0.0" y="0.0" width="148" height="43"/>
+                                                    <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
+                                                    <fontDescription key="fontDescription" type="system" pointSize="17"/>
+                                                    <nil key="highlightedColor"/>
+                                                </label>
+                                                <view contentMode="scaleToFill" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="bHM-Sv-dCK" customClass="RTLabel">
+                                                    <rect key="frame" x="150" y="11" width="160" height="22"/>
+                                                    <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
+                                                    <color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
+                                                </view>
+                                            </subviews>
+                                            <color key="backgroundColor" red="0.0" green="0.0" blue="0.0" alpha="0.0" colorSpace="custom" customColorSpace="sRGB"/>
+                                        </tableViewCellContentView>
+                                        <connections>
+                                            <outlet property="keyLabel" destination="Auw-1f-Lef" id="4Yg-g2-ZH0"/>
+                                            <outlet property="valLabel" destination="bHM-Sv-dCK" id="7H8-6j-pv5"/>
+                                        </connections>
+                                    </tableViewCell>
+                                </prototypes>
+                                <connections>
+                                    <outlet property="dataSource" destination="Hu0-Pd-979" id="bkN-WR-S1b"/>
+                                    <outlet property="delegate" destination="Hu0-Pd-979" id="7jt-hi-38Q"/>
+                                </connections>
+                            </tableView>
+                        </subviews>
+                        <color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
+                        <viewLayoutGuide key="safeArea" id="IST-YM-Gib"/>
+                    </view>
+                    <connections>
+                        <outlet property="tableView" destination="bvX-PC-zYc" id="NTd-s4-Jew"/>
+                    </connections>
+                </viewController>
+                <placeholder placeholderIdentifier="IBFirstResponder" id="vWC-2y-F0U" userLabel="First Responder" sceneMemberID="firstResponder"/>
+            </objects>
+            <point key="canvasLocation" x="-42.399999999999999" y="202.84857571214394"/>
+        </scene>
+    </scenes>
+</document>

+ 15 - 0
RedAnt Mobile/RedAnt Mobile/detail/KVViewController.h

@@ -0,0 +1,15 @@
+//
+//  KVViewController.h
+//  RedAnt Mobile
+//
+//  Created by Ray on 15/11/2017.
+//  Copyright © 2017 Ray. All rights reserved.
+//
+
+#import <UIKit/UIKit.h>
+
+@interface KVViewController : UIViewController
+@property (weak, nonatomic) IBOutlet UITableView *tableView;
+@property (strong,nonatomic) NSMutableDictionary* content;
+@property (strong,nonatomic) NSMutableDictionary* params;
+@end

+ 283 - 0
RedAnt Mobile/RedAnt Mobile/detail/KVViewController.m

@@ -0,0 +1,283 @@
+//
+//  KVViewController.m
+//  RedAnt Mobile
+//
+//  Created by Ray on 15/11/2017.
+//  Copyright © 2017 Ray. All rights reserved.
+//
+#define  DEF_CELL_HEIGHT 44
+#define  DEF_TABLE_HEIGHT 44
+#define  LINE_WIDTH 0
+#define  CELL_MARGIN 0
+#define  LABEL_MARGIN 5
+#import "KVViewController.h"
+#import "RTLabel.h"
+#import "DetailKVCell.h"
+#import "LineView.h"
+
+@interface KVViewController ()
+
+@end
+
+@implementation KVViewController
+
+- (void)viewDidLoad {
+    [super viewDidLoad];
+    // Do any additional setup after loading the view.
+}
+
+- (void)didReceiveMemoryWarning {
+    [super didReceiveMemoryWarning];
+    // Dispose of any resources that can be recreated.
+}
+
+/*
+#pragma mark - Navigation
+
+// In a storyboard-based application, you will often want to do a little preparation before navigation
+- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
+    // Get the new view controller using [segue destinationViewController].
+    // Pass the selected object to the new view controller.
+}
+*/
+
+#pragma mark - Table view data source
+
+//- (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section
+//{
+//    return 40;
+//}
+- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath;
+{
+//    DebugLog(@"heightForRowAtIndexPath");
+    
+    //    float height = [self.content itemHeightAtIndexPath:indexPath];
+
+    
+    
+
+        float width = tableView.frame.size.width;
+        width-=CELL_MARGIN*2;
+        CGSize constraintkey = CGSizeMake(width*0.4-2*LABEL_MARGIN, 20000.0f);//key label width is 40% cell width;
+        CGSize constraintval = CGSizeMake(width*0.6-2*LABEL_MARGIN, 20000.0f);//val label width is 60% cell width;
+        
+        
+    NSDictionary* section = self.content[[NSString stringWithFormat:@"section_%ld",indexPath.section] ];
+    
+    NSDictionary* item = section[@"data"][indexPath.row];
+    NSString* key =item[@"key"];
+        //   [cell.keyLabel sizeToFit];
+        NSString* val=item[@"val"];
+        if([val isEqual:[NSNull null]])
+            val=@"";
+        if(val==nil)
+            val=@"";
+        if([val isEqualToString:@"null"])
+            val=@"";
+        
+        
+        
+        CGRect frame;
+        frame.size = constraintval;
+        frame.origin.x=0;
+        frame.origin.y=0;
+        RTLabel* rtlabel = [[RTLabel alloc] initWithFrame:frame];
+        [rtlabel setLineBreakMode: RTTextLineBreakModeWordWrapping];
+        //        rtlabel.lineSpacing = 20.0;
+        [rtlabel setText: val];
+        CGSize sizeval=rtlabel.optimumSize;
+        
+        
+        CGSize sizekey = [key sizeWithFont:[UIFont systemFontOfSize:17.0] constrainedToSize:constraintkey lineBreakMode:NSLineBreakByWordWrapping];
+        //           CGSize sizeval = [val sizeWithFont:[UIFont systemFontOfSize:17.0] constrainedToSize:constraintval lineBreakMode:NSLineBreakByWordWrapping];
+        float height = MAX(sizekey.height,sizeval.height);
+        height = MAX(height+LINE_WIDTH, DEF_CELL_HEIGHT);
+        
+        /*
+         NSString *text = [items objectAtIndex:[indexPath row]];
+         
+         CGSize constraint = CGSizeMake(CELL_CONTENT_WIDTH - (CELL_CONTENT_MARGIN * 2), 20000.0f);
+         
+         CGSize size = [text sizeWithFont:[UIFont systemFontOfSize:FONT_SIZE] constrainedToSize:constraint lineBreakMode:UILineBreakModeWordWrap];
+         
+         CGFloat height = MAX(size.height, 44.0f);
+         
+         return height + (CELL_CONTENT_MARGIN * 2);
+         */
+        //        NSString *CellIdentifier = @"detail_item_kv";
+        //        DetailCellKV *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier forIndexPath:indexPath];
+        //        NSDictionary* item = [self.content get_item_seg:indexPath.section row:indexPath.row];
+        //        cell.keyLabel.text=[item allKeys][0];
+        //        [cell.keyLabel sizeToFit];
+        //        cell.valLabel.text= [item valueForKey:cell.keyLabel.text];
+        //        [cell.valLabel sizeToFit];
+        //
+        //        return MAX(cell.keyLabel.frame.size.height,cell.valLabel.frame.size.height);
+        return height;
+   
+    
+    //    return height;
+}
+
+- (UIView *) tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section
+{
+    UIView* myView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, tableView.bounds.size.width, 30)];
+    myView.backgroundColor = [UIColor colorWithRed:0.10 green:0.68 blue:0.94 alpha:0.7];
+    UILabel *titleLabel = [[UILabel alloc] initWithFrame:CGRectMake(10, 5, 90, 22)];
+    titleLabel.textColor=[UIColor whiteColor];
+    titleLabel.backgroundColor = [UIColor clearColor];
+    
+    NSDictionary* json = self.content[[NSString stringWithFormat:@"section_%ld",section] ];
+    
+    
+    
+    titleLabel.text =json[@"title"];
+    [titleLabel sizeToFit];
+    [myView addSubview:titleLabel];
+    
+    return myView;
+}
+
+//- (UIView *)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section
+//{
+//    UIView* myView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, tableView.bounds.size.width, 30)];
+//    myView.backgroundColor = [UIColor colorWithRed:0.10 green:0.68 blue:0.94 alpha:0.7];
+////    UILabel *titleLabel = [[UILabel alloc] initWithFrame:CGRectMake(10, 0, 90, 22)];
+////    titleLabel.textColor=[UIColor whiteColor];
+////    titleLabel.backgroundColor = [UIColor grayColor];
+////    titleLabel.text =[self.content get_segmentname:section];
+////    [titleLabel sizeToFit];
+////    [myView addSubview:titleLabel];
+//
+//    return myView;
+//}
+- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
+{
+    
+    
+    return [self.content[@"count"] intValue];
+    
+}
+
+- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
+{
+    
+     NSDictionary* json = self.content[[NSString stringWithFormat:@"section_%ld",section] ];
+    return [json[@"data"] count];
+    
+}
+- (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section {
+    
+    NSDictionary* json = self.content[[NSString stringWithFormat:@"section_%ld",section] ];
+    
+    
+    
+  return json[@"title"];
+}
+//- (UIImage *) imageWithTintColor:(UIImage*)source Color:(UIColor *)tintColor blendMode:(CGBlendMode)blendMode {
+//    //We want to keep alpha, set opaque to NO; Use 0.0f for scale to use the scale factor of the device’s main screen.
+//    UIGraphicsBeginImageContextWithOptions(source.size, NO, 0.0f); [tintColor setFill];
+//    CGRect bounds = CGRectMake(0, 0, source.size.width, source.size.height); UIRectFill(bounds);
+//    //Draw the tinted image in context
+//    [source drawInRect:bounds blendMode:blendMode alpha:1.0f];
+//    if (blendMode != kCGBlendModeDestinationIn)
+//    {
+//        [source drawInRect:bounds blendMode:kCGBlendModeDestinationIn alpha:1.0f];
+//    }
+//    UIImage *tintedImage = UIGraphicsGetImageFromCurrentImageContext();
+//    UIGraphicsEndImageContext();
+//    return tintedImage;
+//}
+- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
+{
+    
+    
+    
+    //    NSString *CellIdentifier = @"testcell";
+    //    return [tableView dequeueReusableCellWithIdentifier:CellIdentifier forIndexPath:indexPath];
+    
+    
+    
+    
+    
+    
+        float width = tableView.frame.size.width;
+        
+        width-=CELL_MARGIN*2;
+        CGSize constraintkey = CGSizeMake(width*0.4-2*LABEL_MARGIN, 20000.0f);//key label width is 40% cell width;
+        CGSize constraintval = CGSizeMake(width*0.6-2*LABEL_MARGIN, 20000.0f);//val label width is 60% cell width;
+    NSDictionary* section = self.content[[NSString stringWithFormat:@"section_%ld",indexPath.section] ];
+    
+    NSDictionary* item = section[@"data"][indexPath.row];
+    NSString* key =item[@"key"];
+    //   [cell.keyLabel sizeToFit];
+    NSString* val=item[@"val"];
+        if([val isEqual:[NSNull null]])
+            val=@"";
+        if(val==nil)
+            val=@"";
+        if([val isEqualToString:@"null"])
+            val=@"";
+        
+        
+        
+        
+        CGRect frame;
+        frame.size = constraintval;
+        frame.origin.x=0;
+        frame.origin.y=0;
+        RTLabel* rtlabel = [[RTLabel alloc] initWithFrame:frame];
+        [rtlabel setLineBreakMode: RTTextLineBreakModeWordWrapping];
+        //        rtlabel.lineSpacing = 20.0;
+        [rtlabel setText: val];
+        CGSize sizeval=rtlabel.optimumSize;
+        CGSize sizekey = [key sizeWithFont:[UIFont systemFontOfSize:17.0] constrainedToSize:constraintkey lineBreakMode:NSLineBreakByWordWrapping];
+
+        float height = MAX(sizekey.height,sizeval.height);
+        height = MAX(height, DEF_CELL_HEIGHT-LINE_WIDTH);
+        sizekey.height = height;
+        sizekey.width = constraintkey.width;
+        // sizeval.height = height;
+        sizeval.width =constraintval.width;
+        
+        NSString *CellIdentifier = @"detail_item_kv";
+        DetailKVCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier forIndexPath:indexPath];
+
+        
+
+        CGRect framekey = cell.keyLabel.frame;
+        framekey.origin.x=CELL_MARGIN+LABEL_MARGIN;
+        framekey.origin.y=LINE_WIDTH;
+        framekey.size = sizekey;
+        cell.keyLabel.frame = framekey;
+        cell.keyLabel.text=key;
+        CGRect frameval = cell.valLabel.frame;
+        frameval.origin.x=constraintkey.width+CELL_MARGIN+3*LABEL_MARGIN; //2 margin for key 1 margin for value self
+        frameval.origin.y=LINE_WIDTH;
+        frameval.size = sizeval;
+        cell.valLabel.frame = frameval;
+        //        [cell.valLabel setTextAlignment:RTTextAlignmentCenter];
+        cell.valLabel.text= val;
+        CGPoint rcenter;
+        rcenter.x = width * 0.4+width * 0.6/2;
+        rcenter.y = height /2;
+        cell.valLabel.center=rcenter;
+        //        cell.valLabel.backgroundColor =[UIColor redColor];
+        
+        //        cell.contentView.superview.backgroundColor = [UIColor clearColor];
+        //        cell.backgroundColor = [UIColor whiteColor];
+        UIView * lineview = [[LineView alloc] initWithFrame:cell.contentView.frame];
+        lineview.userInteractionEnabled = NO;// 不设为NO会屏蔽cell的点击事件
+        lineview.backgroundColor = [UIColor clearColor];// 设为透明从而使得cell.backgroundColor有效.
+        lineview.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
+        [cell.contentView addSubview:lineview];// cell.contentView是个readonly属性,所以别想着替换contentView了.
+        
+        
+
+    
+        return cell;
+    
+   
+    return nil;
+}
+@end

+ 13 - 0
RedAnt Mobile/RedAnt Mobile/detail/ModelDetailViewController.h

@@ -0,0 +1,13 @@
+//
+//  ModelDetailViewController.h
+//  RedAnt Mobile
+//
+//  Created by Ray on 15/11/2017.
+//  Copyright © 2017 Ray. All rights reserved.
+//
+
+#import <UIKit/UIKit.h>
+
+@interface ModelDetailViewController : UIViewController
+
+@end

+ 37 - 0
RedAnt Mobile/RedAnt Mobile/detail/ModelDetailViewController.m

@@ -0,0 +1,37 @@
+//
+//  ModelDetailViewController.m
+//  RedAnt Mobile
+//
+//  Created by Ray on 15/11/2017.
+//  Copyright © 2017 Ray. All rights reserved.
+//
+
+#import "ModelDetailViewController.h"
+
+@interface ModelDetailViewController ()
+
+@end
+
+@implementation ModelDetailViewController
+
+- (void)viewDidLoad {
+    [super viewDidLoad];
+    // Do any additional setup after loading the view.
+}
+
+- (void)didReceiveMemoryWarning {
+    [super didReceiveMemoryWarning];
+    // Dispose of any resources that can be recreated.
+}
+
+/*
+#pragma mark - Navigation
+
+// In a storyboard-based application, you will often want to do a little preparation before navigation
+- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
+    // Get the new view controller using [segue destinationViewController].
+    // Pass the selected object to the new view controller.
+}
+*/
+
+@end

+ 13 - 0
RedAnt Mobile/RedAnt Mobile/detail/OrderDetailViewController.h

@@ -0,0 +1,13 @@
+//
+//  OrderDetailViewController.h
+//  RedAnt Mobile
+//
+//  Created by Ray on 15/11/2017.
+//  Copyright © 2017 Ray. All rights reserved.
+//
+
+#import <UIKit/UIKit.h>
+
+@interface OrderDetailViewController : UIViewController
+
+@end

+ 37 - 0
RedAnt Mobile/RedAnt Mobile/detail/OrderDetailViewController.m

@@ -0,0 +1,37 @@
+//
+//  OrderDetailViewController.m
+//  RedAnt Mobile
+//
+//  Created by Ray on 15/11/2017.
+//  Copyright © 2017 Ray. All rights reserved.
+//
+
+#import "OrderDetailViewController.h"
+
+@interface OrderDetailViewController ()
+
+@end
+
+@implementation OrderDetailViewController
+
+- (void)viewDidLoad {
+    [super viewDidLoad];
+    // Do any additional setup after loading the view.
+}
+
+- (void)didReceiveMemoryWarning {
+    [super didReceiveMemoryWarning];
+    // Dispose of any resources that can be recreated.
+}
+
+/*
+#pragma mark - Navigation
+
+// In a storyboard-based application, you will often want to do a little preparation before navigation
+- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
+    // Get the new view controller using [segue destinationViewController].
+    // Pass the selected object to the new view controller.
+}
+*/
+
+@end

+ 29 - 0
RedAnt Mobile/RedAnt Mobile/kv.json

@@ -0,0 +1,29 @@
+{
+    "result": 2,
+    "count": 1,
+    "section_0": {
+        "title": "section title",
+        "data": [
+                 {
+                 "key": "abc",
+                 "val": "123"
+                 },
+                 {
+                 "key": "def",
+                 "val": "dddd \n abc"
+                 },
+                 {
+                 "key": "adfas",
+                 "val": "rfds fs dfaf erqfd ddd fjian fjdiao rnenqwiv hdf fhisab r q fhdiarehf fdan"
+                 },
+                 {
+                 "key": "bgfg",
+                 "val": "trs fds"
+                 },
+                 {
+                 "key": "hff",
+                 "val": "43"
+                 }
+                 ]
+    }
+}

+ 1 - 1
RedAnt Mobile/RedAnt Mobile/login.json

@@ -13,7 +13,7 @@
                                 {
                                 "name": "mode1",
                                 "type": "query",
-                                "url": "http://..."
+                                "query_id": 123488
                                 },
                                 {
                                 "name": "mode2",

+ 2 - 1
RedAnt Mobile/RedAnt Mobile/predef_query.json

@@ -22,7 +22,8 @@
              ],
     "row_action": {
         "title": "demo title",
-        "module": "quick_look",
+        "module":"quick_look",
+        "module1": "kv_detail",
         "url": "http://1.1.1.1",
         "params": {
             "order#": 0

+ 15 - 0
common/detail/DetailKVCell.h

@@ -0,0 +1,15 @@
+//
+//  DetailKVCell.h
+//  RedAnt ERP Mobile
+//
+//  Created by Ray on 14-7-5.
+//  Copyright (c) 2014年 United Software Applications, Inc. All rights reserved.
+//
+
+#import <UIKit/UIKit.h>
+#import "RTLabel.h"
+@interface DetailKVCell : UITableViewCell
+@property (strong, nonatomic) IBOutlet UILabel *keyLabel;
+
+@property (strong, nonatomic) IBOutlet RTLabel *valLabel;
+@end

+ 34 - 0
common/detail/DetailKVCell.m

@@ -0,0 +1,34 @@
+//
+//  DetailKVCell.m
+//  RedAnt ERP Mobile
+//
+//  Created by Ray on 14-7-5.
+//  Copyright (c) 2014年 United Software Applications, Inc. All rights reserved.
+//
+
+#import "DetailKVCell.h"
+
+@implementation DetailKVCell
+
+- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
+{
+    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
+    if (self) {
+        // Initialization code
+    }
+    return self;
+}
+
+- (void)awakeFromNib
+{
+    // Initialization code
+}
+
+- (void)setSelected:(BOOL)selected animated:(BOOL)animated
+{
+    [super setSelected:selected animated:animated];
+
+    // Configure the view for the selected state
+}
+
+@end

+ 14 - 0
common/detail/LineView.h

@@ -0,0 +1,14 @@
+//
+//  LineView.h
+//  Apex Mobile
+//
+//  Created by Ray on 14-3-21.
+//  Copyright (c) 2014年 United Software Applications, Inc. All rights reserved.
+//
+
+#import <UIKit/UIKit.h>
+
+@interface LineView : UIView
+@property (strong,nonatomic) UIColor* linecolor;
+@property float linewidth;
+@end

+ 59 - 0
common/detail/LineView.m

@@ -0,0 +1,59 @@
+//
+//  LineView.m
+//  Apex Mobile
+//
+//  Created by Ray on 14-3-21.
+//  Copyright (c) 2014年 United Software Applications, Inc. All rights reserved.
+//
+
+#import "LineView.h"
+
+@implementation LineView
+
+- (id)initWithFrame:(CGRect)frame
+{
+    self = [super initWithFrame:frame];
+    if (self) {
+        // Initialization code
+    }
+    return self;
+}
+
+- (void)drawRect:(CGRect)rect
+{
+    CGContextRef context = UIGraphicsGetCurrentContext();
+    
+//    CGRect frame = self.contentView.frame;
+    
+    //   CGContextAddRect(context,frame);
+    
+    if(self.linewidth==0)
+        self.linewidth=0.5;
+    CGContextSetLineWidth(context, 0.5);
+    if(self.linecolor==nil)
+        self.linecolor = [UIColor lightGrayColor];
+    CGContextSetStrokeColorWithColor(context, [self.linecolor CGColor]/*[[UIColor colorWithRed:0.10 green:0.68 blue:0.94 alpha:0.7] CGColor]*/);
+    
+//    CGRect selrect = self.bounds;
+    
+    CGContextMoveToPoint(context, self.bounds.size.width*0.4, self.bounds.origin.y);
+    
+    CGContextAddLineToPoint(context, self.bounds.size.width*0.4, self.bounds.size.height);
+    
+//    CGContextStrokePath(context);
+    
+    CGContextMoveToPoint(context, self.linewidth/2, self.bounds.origin.y);
+    
+    CGContextAddLineToPoint(context, self.linewidth/2, self.bounds.size.height);
+    
+    
+    CGContextMoveToPoint(context, self.bounds.size.width-self.linewidth/2, self.bounds.origin.y);
+    
+    CGContextAddLineToPoint(context, self.bounds.size.width-self.linewidth/2, self.bounds.size.height);
+    
+    CGContextStrokePath(context);
+    
+    [super drawRect:rect];
+}
+
+@end