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

RedAnt Mobile

增加query数据接口及测试用假数据。
Ray Zhang 8 лет назад
Родитель
Сommit
9f80a088d5

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

@@ -98,6 +98,7 @@
 		71FF60251FA7209F00C5523A /* EnumSelectAndSortViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 71FF60241FA7209F00C5523A /* EnumSelectAndSortViewController.m */; };
 		71FF60251FA7209F00C5523A /* EnumSelectAndSortViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 71FF60241FA7209F00C5523A /* EnumSelectAndSortViewController.m */; };
 		71FF60291FA7236200C5523A /* EnumModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 71FF60281FA7236200C5523A /* EnumModel.m */; };
 		71FF60291FA7236200C5523A /* EnumModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 71FF60281FA7236200C5523A /* EnumModel.m */; };
 		71FF602B1FA802AB00C5523A /* loginUI.json in Resources */ = {isa = PBXBuildFile; fileRef = 71FF602A1FA802AB00C5523A /* loginUI.json */; };
 		71FF602B1FA802AB00C5523A /* loginUI.json in Resources */ = {isa = PBXBuildFile; fileRef = 71FF602A1FA802AB00C5523A /* loginUI.json */; };
+		71FF602F1FA8449C00C5523A /* predef_query.json in Resources */ = {isa = PBXBuildFile; fileRef = 71FF602E1FA8449C00C5523A /* predef_query.json */; };
 /* End PBXBuildFile section */
 /* End PBXBuildFile section */
 
 
 /* Begin PBXFileReference section */
 /* Begin PBXFileReference section */
@@ -265,6 +266,7 @@
 		71FF60281FA7236200C5523A /* EnumModel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = EnumModel.m; path = "../../RedAnt ERP Mobile/common/CommonEditor/EnumSelectAndSort/EnumModel.m"; sourceTree = "<group>"; };
 		71FF60281FA7236200C5523A /* EnumModel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = EnumModel.m; path = "../../RedAnt ERP Mobile/common/CommonEditor/EnumSelectAndSort/EnumModel.m"; sourceTree = "<group>"; };
 		71FF602A1FA802AB00C5523A /* loginUI.json */ = {isa = PBXFileReference; lastKnownFileType = text.json; path = loginUI.json; sourceTree = "<group>"; };
 		71FF602A1FA802AB00C5523A /* loginUI.json */ = {isa = PBXFileReference; lastKnownFileType = text.json; path = loginUI.json; sourceTree = "<group>"; };
 		71FF602D1FA8076700C5523A /* RA Mobile.txt */ = {isa = PBXFileReference; lastKnownFileType = text; path = "RA Mobile.txt"; sourceTree = "<group>"; };
 		71FF602D1FA8076700C5523A /* RA Mobile.txt */ = {isa = PBXFileReference; lastKnownFileType = text; path = "RA Mobile.txt"; sourceTree = "<group>"; };
+		71FF602E1FA8449C00C5523A /* predef_query.json */ = {isa = PBXFileReference; lastKnownFileType = text.json; path = predef_query.json; sourceTree = "<group>"; };
 /* End PBXFileReference section */
 /* End PBXFileReference section */
 
 
 /* Begin PBXFrameworksBuildPhase section */
 /* Begin PBXFrameworksBuildPhase section */
@@ -419,6 +421,7 @@
 			children = (
 			children = (
 				71F3A9C01F5FA11F001036C8 /* login.json */,
 				71F3A9C01F5FA11F001036C8 /* login.json */,
 				71CB70B31FA1CCDB009FDCB7 /* server.json */,
 				71CB70B31FA1CCDB009FDCB7 /* server.json */,
+				71FF602E1FA8449C00C5523A /* predef_query.json */,
 			);
 			);
 			name = "fake data";
 			name = "fake data";
 			sourceTree = "<group>";
 			sourceTree = "<group>";
@@ -772,6 +775,7 @@
 				71F3A9AB1F5F8E22001036C8 /* Main.storyboard in Resources */,
 				71F3A9AB1F5F8E22001036C8 /* Main.storyboard in Resources */,
 				71F3A9C91F5FA11F001036C8 /* login.json in Resources */,
 				71F3A9C91F5FA11F001036C8 /* login.json in Resources */,
 				71F3AA361F612369001036C8 /* CommonEditor.storyboard in Resources */,
 				71F3AA361F612369001036C8 /* CommonEditor.storyboard in Resources */,
+				71FF602F1FA8449C00C5523A /* predef_query.json in Resources */,
 				71F3AA081F5FDDFE001036C8 /* LICENSE in Resources */,
 				71F3AA081F5FDDFE001036C8 /* LICENSE in Resources */,
 			);
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 			runOnlyForDeploymentPostprocessing = 0;

BIN
RedAnt Mobile/RedAnt Mobile.xcodeproj/project.xcworkspace/xcuserdata/ray.xcuserdatad/UserInterfaceState.xcuserstate


+ 1 - 1
RedAnt Mobile/RedAnt Mobile/RA Mobile.txt

@@ -156,7 +156,7 @@ sample:
           "f_color": "0x654321"
           "f_color": "0x654321"
         },
         },
         {
         {
-        r
+        "type":"text",
           "h_align": "center",
           "h_align": "center",
           "v_center": "center",
           "v_center": "center",
           "bg_color": "0x123456",
           "bg_color": "0x123456",

+ 16 - 0
RedAnt Mobile/RedAnt Mobile/RANetwork.m

@@ -37,6 +37,22 @@
     return resultDic;
     return resultDic;
 }
 }
 
 
++(NSDictionary*)query : (NSMutableDictionary*) params
+{
+    NSString *Path =nil;
+    Path=[[NSBundle mainBundle] pathForResource:@"predef_query.json" ofType:nil];
+    
+    NSData* data1 = [NSData dataWithContentsOfFile:Path];
+    return [[NSJSONSerialization JSONObjectWithData:data1 options:NSJSONReadingMutableContainers error:nil] mutableCopy];
+    
+    
+    // params[@"_operate"]=@"valid_upload";
+    AppDelegate *appDelegate = (AppDelegate *)[UIApplication sharedApplication].delegate;
+    
+    NSData *data = [self get_json:[self get_url:URL_QUERY] parameters:params file:nil];
+    NSDictionary *resultDic = [NSJSONSerialization JSONObjectWithData:data options:NSJSONReadingMutableLeaves error:nil];
+    return resultDic;
+}
 
 
 
 
 +(NSData*)get_json : (NSString*) url parameters:(NSMutableDictionary *) params file:(NSString *) file //delegate:(id < NSURLConnectionDelegate >)delegate
 +(NSData*)get_json : (NSString*) url parameters:(NSMutableDictionary *) params file:(NSString *) file //delegate:(id < NSURLConnectionDelegate >)delegate

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

@@ -35,6 +35,7 @@
 #ifdef test_server
 #ifdef test_server
 #define URL_CUSTOMER_ADV_SEARCH @""
 #define URL_CUSTOMER_ADV_SEARCH @""
 #define URL_LOGIN @""
 #define URL_LOGIN @""
+#define URL_QUERY @""
 #define  URL_REQUIRE_SERVER  @""
 #define  URL_REQUIRE_SERVER  @""
 
 
 #define URL_UPLOAD_IMG @""
 #define URL_UPLOAD_IMG @""

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

@@ -6,7 +6,7 @@
                   "type": "submode",
                   "type": "submode",
                   "mode_list": [
                   "mode_list": [
                                 {
                                 {
-                                "name": "mode0",
+                                "name": "Demo Predefine Query",
                                 "type": "predef_query",
                                 "type": "predef_query",
                                 "query_id": 123456
                                 "query_id": 123456
                                 },
                                 },

+ 131 - 0
RedAnt Mobile/RedAnt Mobile/predef_query.json

@@ -0,0 +1,131 @@
+{
+    "result": 2,
+    "data": {
+        "count": 4,
+        "item_0": [
+                   "1",
+                   "8533-UPK",
+                   "$ 123.45",
+                   "43",
+                   "metal table with 4 chairs"
+                   ],
+        "item_1": [
+                   "2",
+                   "315318",
+                   "$ 99.49",
+                   "13",
+                   "WOOD table with 4 chairs"
+                   ],
+        "item_2": [
+                   "3",
+                   "7033566",
+                   "$ 13.45",
+                   "57",
+                   "bed"
+                   ],
+        "item_3": [
+                   "4",
+                   "8533-UVR",
+                   "$ 1123.45",
+                   "143",
+                   "Desk & chair UILongPressGestureRecognizer *longPress"
+                   ]
+    },
+    "layout": {
+        "header": {
+            "width": 810,
+            "height": 44,
+            "margin_r": 10,
+            "margin_l": 10,
+            "margin_t": 10,
+            "margin_b": 10,
+            "bg_color": "0x123456",
+            "f_color": "0x987654",
+            "col": [
+                    {
+                    "width": 100,
+                    "name": "id",
+                    "h_align": "center",
+                    "v_center": "center",
+                    "bg_color": "0x123456",
+                    "f_color": "0x654321"
+                    },
+                    {
+                    "width": 160,
+                    "name": "model",
+                    "h_align": "center",
+                    "v_center": "center",
+                    "bg_color": "0x123456",
+                    "f_color": "0x654321"
+                    },
+                    {
+                    "width": 180,
+                    "name": "price",
+                    "h_align": "center",
+                    "v_center": "center",
+                    "bg_color": "0x123456",
+                    "f_color": "0x654321"
+                    },
+                    {
+                    "width": 120,
+                    "name": "stock",
+                    "h_align": "center",
+                    "v_center": "center",
+                    "bg_color": "0x123456",
+                    "f_color": "0x654321"
+                    },
+                    {
+                    "width": 250,
+                    "name": "description",
+                    "h_align": "center",
+                    "v_center": "center",
+                    "bg_color": "0x123456",
+                    "f_color": "0x654321"
+                    }
+                    ]
+        },
+        "row": {
+            "height": 44,
+            "f_color": "0x654321",
+            "color_0": "0xffffff",
+            "color_1": "0x666666",
+            "val": [
+                    {
+                    "type":"image",
+                    "h_align": "center",
+                    "v_center": "center",
+                    "bg_color": "0x123456",
+                    "f_color": "0x654321"
+                    },
+                    {
+                    "type":"text",
+                    "h_align": "center",
+                    "v_center": "center",
+                    "bg_color": "0x123456",
+                    "f_color": "0x654321"
+                    },
+                    {
+                    "type":"text",
+                    "h_align": "center",
+                    "v_center": "center",
+                    "bg_color": "0x123456",
+                    "f_color": "0x654321"
+                    },
+                    {
+                    "type":"text",
+                    "h_align": "center",
+                    "v_center": "center",
+                    "bg_color": "0x123456",
+                    "f_color": "0x654321"
+                    },
+                    {
+                    "type":"text",
+                    "h_align": "center",
+                    "v_center": "center",
+                    "bg_color": "0x123456",
+                    "f_color": "0x654321"
+                    }
+                    ]
+        }
+    }
+}