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

1.修改RedAnt Mobile,增加Mode List界面。

Pen Li 8 лет назад
Родитель
Сommit
50e6c251a9

+ 68 - 6
RedAnt Mobile/RedAnt Mobile.xcodeproj/project.pbxproj

@@ -7,6 +7,12 @@
 	objects = {
 
 /* Begin PBXBuildFile section */
+		4221EF931FA813030026E1EC /* RARootModeCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 4221EF921FA813030026E1EC /* RARootModeCell.m */; };
+		4221EF961FA814400026E1EC /* RARootNavigationController.m in Sources */ = {isa = PBXBuildFile; fileRef = 4221EF951FA814400026E1EC /* RARootNavigationController.m */; };
+		4221EF9A1FA81D070026E1EC /* RAPredefQueryViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 4221EF991FA81D070026E1EC /* RAPredefQueryViewController.m */; };
+		4221EF9D1FA81D5B0026E1EC /* RAQueryViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 4221EF9C1FA81D5B0026E1EC /* RAQueryViewController.m */; };
+		4221EF9F1FA81E150026E1EC /* RAPredefQuery.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 4221EF9E1FA81E150026E1EC /* RAPredefQuery.storyboard */; };
+		4221EFA11FA81E580026E1EC /* RAQuery.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 4221EFA01FA81E580026E1EC /* RAQuery.storyboard */; };
 		42DFAE6B1F9B2B73009AFCCC /* Phone_Action_Cell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 42DFAE6A1F9B2B73009AFCCC /* Phone_Action_Cell.xib */; };
 		42DFAE6D1F9B2BE4009AFCCC /* Phone_Edit_Cell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 42DFAE6C1F9B2BE4009AFCCC /* Phone_Edit_Cell.xib */; };
 		42DFAE6F1F9B2C18009AFCCC /* Phone_Enum_Cell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 42DFAE6E1F9B2C18009AFCCC /* Phone_Enum_Cell.xib */; };
@@ -17,11 +23,12 @@
 		42DFAE791F9B2CBD009AFCCC /* Phone_Signature_Cell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 42DFAE781F9B2CBD009AFCCC /* Phone_Signature_Cell.xib */; };
 		42DFAE7B1F9B2CE6009AFCCC /* Phone_Switch_Cell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 42DFAE7A1F9B2CE6009AFCCC /* Phone_Switch_Cell.xib */; };
 		42DFAE7D1F9B2D02009AFCCC /* Phone_TextView_Cell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 42DFAE7C1F9B2D02009AFCCC /* Phone_TextView_Cell.xib */; };
+		42F2EB3E1FA80EDC00BC6468 /* RAModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 42F2EB3D1FA80EDC00BC6468 /* RAModel.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 */; };
 		71F3A9A51F5F8E22001036C8 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 71F3A9A41F5F8E22001036C8 /* AppDelegate.m */; };
-		71F3A9A81F5F8E22001036C8 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 71F3A9A71F5F8E22001036C8 /* ViewController.m */; };
+		71F3A9A81F5F8E22001036C8 /* RARootViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 71F3A9A71F5F8E22001036C8 /* RARootViewController.m */; };
 		71F3A9AB1F5F8E22001036C8 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 71F3A9A91F5F8E22001036C8 /* Main.storyboard */; };
 		71F3A9AD1F5F8E22001036C8 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 71F3A9AC1F5F8E22001036C8 /* Assets.xcassets */; };
 		71F3A9B01F5F8E22001036C8 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 71F3A9AE1F5F8E22001036C8 /* LaunchScreen.storyboard */; };
@@ -94,6 +101,16 @@
 /* End PBXBuildFile section */
 
 /* Begin PBXFileReference section */
+		4221EF911FA813030026E1EC /* RARootModeCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RARootModeCell.h; sourceTree = "<group>"; };
+		4221EF921FA813030026E1EC /* RARootModeCell.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RARootModeCell.m; sourceTree = "<group>"; };
+		4221EF941FA814400026E1EC /* RARootNavigationController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RARootNavigationController.h; sourceTree = "<group>"; };
+		4221EF951FA814400026E1EC /* RARootNavigationController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RARootNavigationController.m; sourceTree = "<group>"; };
+		4221EF981FA81D070026E1EC /* RAPredefQueryViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RAPredefQueryViewController.h; sourceTree = "<group>"; };
+		4221EF991FA81D070026E1EC /* RAPredefQueryViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RAPredefQueryViewController.m; sourceTree = "<group>"; };
+		4221EF9B1FA81D5B0026E1EC /* RAQueryViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RAQueryViewController.h; sourceTree = "<group>"; };
+		4221EF9C1FA81D5B0026E1EC /* RAQueryViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RAQueryViewController.m; sourceTree = "<group>"; };
+		4221EF9E1FA81E150026E1EC /* RAPredefQuery.storyboard */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; path = RAPredefQuery.storyboard; sourceTree = "<group>"; };
+		4221EFA01FA81E580026E1EC /* RAQuery.storyboard */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; path = RAQuery.storyboard; sourceTree = "<group>"; };
 		42DFAE6A1F9B2B73009AFCCC /* Phone_Action_Cell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = Phone_Action_Cell.xib; sourceTree = "<group>"; };
 		42DFAE6C1F9B2BE4009AFCCC /* Phone_Edit_Cell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = Phone_Edit_Cell.xib; sourceTree = "<group>"; };
 		42DFAE6E1F9B2C18009AFCCC /* Phone_Enum_Cell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = Phone_Enum_Cell.xib; sourceTree = "<group>"; };
@@ -104,6 +121,8 @@
 		42DFAE781F9B2CBD009AFCCC /* Phone_Signature_Cell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = Phone_Signature_Cell.xib; sourceTree = "<group>"; };
 		42DFAE7A1F9B2CE6009AFCCC /* Phone_Switch_Cell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = Phone_Switch_Cell.xib; sourceTree = "<group>"; };
 		42DFAE7C1F9B2D02009AFCCC /* Phone_TextView_Cell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = Phone_TextView_Cell.xib; sourceTree = "<group>"; };
+		42F2EB3C1FA80EDC00BC6468 /* RAModel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RAModel.h; sourceTree = "<group>"; };
+		42F2EB3D1FA80EDC00BC6468 /* RAModel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RAModel.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>"; };
@@ -113,8 +132,8 @@
 		71F3A9A11F5F8E22001036C8 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
 		71F3A9A31F5F8E22001036C8 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = "<group>"; };
 		71F3A9A41F5F8E22001036C8 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = "<group>"; };
-		71F3A9A61F5F8E22001036C8 /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = "<group>"; };
-		71F3A9A71F5F8E22001036C8 /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = "<group>"; };
+		71F3A9A61F5F8E22001036C8 /* RARootViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RARootViewController.h; sourceTree = "<group>"; };
+		71F3A9A71F5F8E22001036C8 /* RARootViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RARootViewController.m; sourceTree = "<group>"; };
 		71F3A9AA1F5F8E22001036C8 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; };
 		71F3A9AC1F5F8E22001036C8 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
 		71F3A9AF1F5F8E22001036C8 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
@@ -260,6 +279,19 @@
 /* End PBXFrameworksBuildPhase section */
 
 /* Begin PBXGroup section */
+		4221EF971FA81CBB0026E1EC /* Mode */ = {
+			isa = PBXGroup;
+			children = (
+				4221EF981FA81D070026E1EC /* RAPredefQueryViewController.h */,
+				4221EF991FA81D070026E1EC /* RAPredefQueryViewController.m */,
+				4221EF9E1FA81E150026E1EC /* RAPredefQuery.storyboard */,
+				4221EF9B1FA81D5B0026E1EC /* RAQueryViewController.h */,
+				4221EF9C1FA81D5B0026E1EC /* RAQueryViewController.m */,
+				4221EFA01FA81E580026E1EC /* RAQuery.storyboard */,
+			);
+			name = Mode;
+			sourceTree = "<group>";
+		};
 		42DFAE601F9B2A01009AFCCC /* ActionCell */ = {
 			isa = PBXGroup;
 			children = (
@@ -360,6 +392,28 @@
 			name = TextViewCell;
 			sourceTree = "<group>";
 		};
+		42F2EB3A1FA80E3F00BC6468 /* RootViewController */ = {
+			isa = PBXGroup;
+			children = (
+				71F3A9A61F5F8E22001036C8 /* RARootViewController.h */,
+				71F3A9A71F5F8E22001036C8 /* RARootViewController.m */,
+				4221EF911FA813030026E1EC /* RARootModeCell.h */,
+				4221EF921FA813030026E1EC /* RARootModeCell.m */,
+				4221EF941FA814400026E1EC /* RARootNavigationController.h */,
+				4221EF951FA814400026E1EC /* RARootNavigationController.m */,
+			);
+			name = RootViewController;
+			sourceTree = "<group>";
+		};
+		42F2EB3B1FA80EB300BC6468 /* Model */ = {
+			isa = PBXGroup;
+			children = (
+				42F2EB3C1FA80EDC00BC6468 /* RAModel.h */,
+				42F2EB3D1FA80EDC00BC6468 /* RAModel.m */,
+			);
+			name = Model;
+			sourceTree = "<group>";
+		};
 		71CB70B21FA1CCBC009FDCB7 /* fake data */ = {
 			isa = PBXGroup;
 			children = (
@@ -406,13 +460,14 @@
 				71F3A9CF1F5FA277001036C8 /* BasicViewController.m */,
 				71F3A9E11F5FA531001036C8 /* JLKeyboardListener.h */,
 				71F3A9E21F5FA531001036C8 /* JLKeyboardListener.m */,
+				4221EF971FA81CBB0026E1EC /* Mode */,
+				42F2EB3A1FA80E3F00BC6468 /* RootViewController */,
 				71F3A9BF1F5FA109001036C8 /* login */,
 				71CB70B21FA1CCBC009FDCB7 /* fake data */,
 				71F3A9BA1F5F8E89001036C8 /* result */,
+				42F2EB3B1FA80EB300BC6468 /* Model */,
 				71F3A9A31F5F8E22001036C8 /* AppDelegate.h */,
 				71F3A9A41F5F8E22001036C8 /* AppDelegate.m */,
-				71F3A9A61F5F8E22001036C8 /* ViewController.h */,
-				71F3A9A71F5F8E22001036C8 /* ViewController.m */,
 				71F3A9A91F5F8E22001036C8 /* Main.storyboard */,
 				71F3A9AC1F5F8E22001036C8 /* Assets.xcassets */,
 				71F3A9AE1F5F8E22001036C8 /* LaunchScreen.storyboard */,
@@ -703,6 +758,7 @@
 				71F3AA0D1F61151D001036C8 /* commoneditor.phone.xib in Resources */,
 				71FF602B1FA802AB00C5523A /* loginUI.json in Resources */,
 				71F3AA5A1F624A88001036C8 /* signature.storyboard in Resources */,
+				4221EF9F1FA81E150026E1EC /* RAPredefQuery.storyboard in Resources */,
 				42DFAE771F9B2C9B009AFCCC /* Phone_Model_Cell.xib in Resources */,
 				71F3AA121F611FC4001036C8 /* testViewController.xib in Resources */,
 				71F3A9AD1F5F8E22001036C8 /* Assets.xcassets in Resources */,
@@ -711,6 +767,7 @@
 				42DFAE731F9B2C67009AFCCC /* Phone_Label_Cell.xib in Resources */,
 				42DFAE751F9B2C83009AFCCC /* Phone_MAction_Cell.xib in Resources */,
 				42DFAE6F1F9B2C18009AFCCC /* Phone_Enum_Cell.xib in Resources */,
+				4221EFA11FA81E580026E1EC /* RAQuery.storyboard in Resources */,
 				42DFAE7B1F9B2CE6009AFCCC /* Phone_Switch_Cell.xib in Resources */,
 				71F3A9AB1F5F8E22001036C8 /* Main.storyboard in Resources */,
 				71F3A9C91F5FA11F001036C8 /* login.json in Resources */,
@@ -729,7 +786,7 @@
 				71F3AA3E1F612369001036C8 /* CommonEditorCellSignature.m in Sources */,
 				71F3AA441F612369001036C8 /* EnumSelectViewController.m in Sources */,
 				71F3A9E31F5FA531001036C8 /* JLKeyboardListener.m in Sources */,
-				71F3A9A81F5F8E22001036C8 /* ViewController.m in Sources */,
+				71F3A9A81F5F8E22001036C8 /* RARootViewController.m in Sources */,
 				71F3AA921F627700001036C8 /* DefaultTableHeaderView.m in Sources */,
 				71F3AA5F1F624AD4001036C8 /* StrikethroughLabel.m in Sources */,
 				71F3A9EE1F5FA557001036C8 /* mztools.c in Sources */,
@@ -741,6 +798,7 @@
 				71F3AA651F624B2F001036C8 /* BundleModelViewController.m in Sources */,
 				71F3AA5B1F624A88001036C8 /* SignatureView.m in Sources */,
 				71F3A9CC1F5FA11F001036C8 /* LoginTextFiledCell.m in Sources */,
+				4221EF9A1FA81D070026E1EC /* RAPredefQueryViewController.m in Sources */,
 				71F3AA371F612369001036C8 /* CommonEditorCellAction.m in Sources */,
 				71F3AA381F612369001036C8 /* CommonEditorCellEdit.m in Sources */,
 				71F3AA641F624B2F001036C8 /* BundleModelCell.m in Sources */,
@@ -753,12 +811,14 @@
 				71F3AA111F611FC4001036C8 /* testViewController.m in Sources */,
 				71F3AA431F612369001036C8 /* EnumSelectorCell.m in Sources */,
 				71F3AA3F1F612369001036C8 /* CommonEditorCellSwitch.m in Sources */,
+				4221EF931FA813030026E1EC /* RARootModeCell.m in Sources */,
 				71F3A9E01F5FA484001036C8 /* RAUtils.m in Sources */,
 				71F3AA401F612369001036C8 /* CommonEditorCellTextView.m in Sources */,
 				71F3AA4A1F612415001036C8 /* RTLabel.m in Sources */,
 				71F3AA3C1F612369001036C8 /* CommonEditorCellMAction.m in Sources */,
 				71F3AA501F6124C4001036C8 /* ImageUploadViewController.m in Sources */,
 				71F3AA451F612369001036C8 /* MonthPickerViewController.m in Sources */,
+				4221EF961FA814400026E1EC /* RARootNavigationController.m in Sources */,
 				71F3A9A21F5F8E22001036C8 /* main.m in Sources */,
 				71F3AA951F6277DE001036C8 /* DefaultAppearance.m in Sources */,
 				71F3A9CD1F5FA11F001036C8 /* LoginViewController.m in Sources */,
@@ -780,6 +840,8 @@
 				71F3AA421F612369001036C8 /* DatePickerViewController.m in Sources */,
 				71F3A9D91F5FA3B9001036C8 /* RANetwork.m in Sources */,
 				71F3AA091F5FDDFE001036C8 /* NSData+Base64.m in Sources */,
+				42F2EB3E1FA80EDC00BC6468 /* RAModel.m in Sources */,
+				4221EF9D1FA81D5B0026E1EC /* RAQueryViewController.m in Sources */,
 				71F3A9DC1F5FA458001036C8 /* RANetworkTaskDelegate.m in Sources */,
 				71F3AA3D1F612369001036C8 /* CommonEditorCellModel.m in Sources */,
 				71F3AA681F624E19001036C8 /* JKTimerManager.m in Sources */,

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


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

@@ -20,9 +20,10 @@
 
 @property bool can_see_price;
 @property bool price_hidden;
-
 @property bool bEnable_Cache;//图片缓存
-
 @property (nonatomic,strong) NSMutableDictionary *urgencyDic;///<程序闪退需要保存的数据
+
+- (void)showNormalRootVCWithModeList:(NSArray *)modeList;
+
 @end
 

+ 14 - 0
RedAnt Mobile/RedAnt Mobile/AppDelegate.m

@@ -7,6 +7,8 @@
 //
 
 #import "AppDelegate.h"
+#import "RARootNavigationController.h"
+#import "RARootViewController.h"
 
 @interface AppDelegate ()
 
@@ -49,5 +51,17 @@
     // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
 }
 
+#pragma mark - Public
+
+- (void)showNormalRootVCWithModeList:(NSArray *)modeList {
+    
+    RARootViewController *rootVC = [[UIStoryboard storyboardWithName:@"Main" bundle:nil] instantiateViewControllerWithIdentifier:@"RARootViewController"];
+    rootVC.title = @"RedAnt Mobile";
+    [rootVC setModeList:modeList];
+    
+    RARootNavigationController *nav = [[RARootNavigationController alloc] initWithRootViewController:rootVC];
+    [self.window setRootViewController:nav];
+}
+
 
 @end

+ 56 - 8
RedAnt Mobile/RedAnt Mobile/Base.lproj/Main.storyboard

@@ -1,19 +1,19 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="12120" systemVersion="16F73" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="Oh6-Jk-fWH">
+<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="13196" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="Oh6-Jk-fWH">
     <device id="retina4_7" orientation="portrait">
         <adaptation id="fullscreen"/>
     </device>
     <dependencies>
         <deployment identifier="iOS"/>
-        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="12088"/>
+        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="13173"/>
         <capability name="Constraints to layout margins" minToolsVersion="6.0"/>
         <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
     </dependencies>
     <scenes>
-        <!--View Controller-->
+        <!--Root View Controller-->
         <scene sceneID="tne-QT-ifu">
             <objects>
-                <viewController id="BYZ-38-t0r" customClass="ViewController" sceneMemberID="viewController">
+                <viewController storyboardIdentifier="RARootViewController" useStoryboardIdentifierAsRestorationIdentifier="YES" id="BYZ-38-t0r" customClass="RARootViewController" sceneMemberID="viewController">
                     <layoutGuides>
                         <viewControllerLayoutGuide type="top" id="y3c-jy-aDJ"/>
                         <viewControllerLayoutGuide type="bottom" id="wfy-db-euE"/>
@@ -21,11 +21,59 @@
                     <view key="view" contentMode="scaleToFill" id="8bC-Xf-vdC">
                         <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" alwaysBounceVertical="YES" dataMode="prototypes" style="plain" separatorStyle="default" rowHeight="-1" estimatedRowHeight="-1" sectionHeaderHeight="28" sectionFooterHeight="28" translatesAutoresizingMaskIntoConstraints="NO" id="f2w-Gb-iUG">
+                                <rect key="frame" x="0.0" y="20" width="375" height="647"/>
+                                <color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
+                                <prototypes>
+                                    <tableViewCell clipsSubviews="YES" contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" reuseIdentifier="mode_cell" rowHeight="40" id="dIs-Xr-nJO" customClass="RARootModeCell">
+                                        <rect key="frame" x="0.0" y="28" width="375" height="40"/>
+                                        <autoresizingMask key="autoresizingMask"/>
+                                        <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" insetsLayoutMarginsFromSafeArea="NO" tableViewCell="dIs-Xr-nJO" id="0xv-T2-kkQ">
+                                            <rect key="frame" x="0.0" y="0.0" width="375" height="39.5"/>
+                                            <autoresizingMask key="autoresizingMask"/>
+                                            <subviews>
+                                                <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="dbw-1x-pdX">
+                                                    <rect key="frame" x="10" y="0.0" width="365" height="39.5"/>
+                                                    <fontDescription key="fontDescription" type="system" pointSize="17"/>
+                                                    <nil key="textColor"/>
+                                                    <nil key="highlightedColor"/>
+                                                </label>
+                                            </subviews>
+                                            <constraints>
+                                                <constraint firstAttribute="trailing" secondItem="dbw-1x-pdX" secondAttribute="trailing" id="Uth-IV-FRY"/>
+                                                <constraint firstAttribute="bottom" secondItem="dbw-1x-pdX" secondAttribute="bottom" id="ZED-OB-kBf"/>
+                                                <constraint firstItem="dbw-1x-pdX" firstAttribute="leading" secondItem="0xv-T2-kkQ" secondAttribute="leading" constant="10" id="duh-Bk-yhC"/>
+                                                <constraint firstItem="dbw-1x-pdX" firstAttribute="top" secondItem="0xv-T2-kkQ" secondAttribute="top" id="qAf-ky-bFn"/>
+                                            </constraints>
+                                        </tableViewCellContentView>
+                                        <connections>
+                                            <outlet property="modeNameLabel" destination="dbw-1x-pdX" id="INi-W8-tYE"/>
+                                        </connections>
+                                    </tableViewCell>
+                                </prototypes>
+                                <connections>
+                                    <outlet property="dataSource" destination="BYZ-38-t0r" id="Gdz-vZ-Sqw"/>
+                                    <outlet property="delegate" destination="BYZ-38-t0r" id="ze2-MY-EAn"/>
+                                </connections>
+                            </tableView>
+                        </subviews>
                         <color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
+                        <constraints>
+                            <constraint firstAttribute="trailing" secondItem="f2w-Gb-iUG" secondAttribute="trailing" id="0AP-qe-qAS"/>
+                            <constraint firstItem="f2w-Gb-iUG" firstAttribute="leading" secondItem="8bC-Xf-vdC" secondAttribute="leading" id="68d-Ep-80R"/>
+                            <constraint firstItem="f2w-Gb-iUG" firstAttribute="top" secondItem="y3c-jy-aDJ" secondAttribute="bottom" id="eOK-Xt-Cae"/>
+                            <constraint firstItem="wfy-db-euE" firstAttribute="top" secondItem="f2w-Gb-iUG" secondAttribute="bottom" id="oB7-rD-4Af"/>
+                        </constraints>
                     </view>
+                    <navigationItem key="navigationItem" id="mXM-00-q4Y"/>
+                    <connections>
+                        <outlet property="modeTableView" destination="f2w-Gb-iUG" id="GZn-PV-qBn"/>
+                    </connections>
                 </viewController>
                 <placeholder placeholderIdentifier="IBFirstResponder" id="dkx-z0-nzr" sceneMemberID="firstResponder"/>
             </objects>
+            <point key="canvasLocation" x="34" y="21"/>
         </scene>
         <!--Login View Controller-->
         <scene sceneID="GQN-dS-T2m">
@@ -59,7 +107,7 @@
                                         <rect key="frame" x="0.0" y="28" width="375" height="50"/>
                                         <autoresizingMask key="autoresizingMask"/>
                                         <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="XVx-Pj-3l6" id="j2k-Zt-2jZ">
-                                            <rect key="frame" x="0.0" y="0.0" width="375" height="50"/>
+                                            <rect key="frame" x="0.0" y="0.0" width="375" height="49.5"/>
                                             <autoresizingMask key="autoresizingMask"/>
                                             <subviews>
                                                 <textField opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" placeholder="place order" textAlignment="natural" minimumFontSize="17" clearButtonMode="whileEditing" translatesAutoresizingMaskIntoConstraints="NO" id="O29-II-M5r">
@@ -87,7 +135,7 @@
                                         <rect key="frame" x="0.0" y="78" width="375" height="50"/>
                                         <autoresizingMask key="autoresizingMask"/>
                                         <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="5oS-6f-gIz" id="Tg3-Nx-TXI">
-                                            <rect key="frame" x="0.0" y="0.0" width="375" height="50"/>
+                                            <rect key="frame" x="0.0" y="0.0" width="375" height="49.5"/>
                                             <autoresizingMask key="autoresizingMask"/>
                                             <subviews>
                                                 <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="记住我的登录状态" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="68b-FX-thz">
@@ -299,7 +347,7 @@
                                                 <rect key="frame" x="0.0" y="28" width="712" height="44"/>
                                                 <autoresizingMask key="autoresizingMask"/>
                                                 <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="Z8S-HU-HU3" id="dk1-pX-E1r">
-                                                    <rect key="frame" x="0.0" y="0.0" width="712" height="44"/>
+                                                    <rect key="frame" x="0.0" y="0.0" width="712" height="43.5"/>
                                                     <autoresizingMask key="autoresizingMask"/>
                                                 </tableViewCellContentView>
                                             </tableViewCell>
@@ -334,7 +382,7 @@
                 </viewController>
                 <placeholder placeholderIdentifier="IBFirstResponder" id="wtL-wa-ubV" sceneMemberID="firstResponder"/>
             </objects>
-            <point key="canvasLocation" x="-718" y="-34"/>
+            <point key="canvasLocation" x="-1564" y="160"/>
         </scene>
     </scenes>
     <resources>

+ 40 - 30
RedAnt Mobile/RedAnt Mobile/LoginViewController.m

@@ -194,46 +194,56 @@ static NSString *kLoginUserInfo = @"UserInfo";
 #pragma mark - Button Click
 
 - (IBAction)loginBtnClick:(UIButton *)sender {
-    [self prepareUserData];
-    if (!self.ServerName.length) {
-        [RAUtils message_alert:@"Please choose an address in setting" title:@"Warning" controller:self];
-        return;
-    }
-    
-    if (!self.user.length) {
-        [RAUtils message_alert:@"User name cann't be blank" title:@"Warning" controller:self];
-        return;
-    }
-    
-    if (!self.pwd.length) {
-        [RAUtils message_alert:@"Password cann't be blank" title:@"Warning" controller:self];
-        return;
-    }
-/*    AppDelegate *appDelegate = (AppDelegate *)[UIApplication sharedApplication].delegate;
-    appDelegate.address = self.address;
+//    [self prepareUserData];
+//    if (!self.ServerName.length) {
+//        [RAUtils message_alert:@"Please choose an address in setting" title:@"Warning" controller:self];
+//        return;
+//    }
+//
+//    if (!self.user.length) {
+//        [RAUtils message_alert:@"User name cann't be blank" title:@"Warning" controller:self];
+//        return;
+//    }
+//
+//    if (!self.pwd.length) {
+//        [RAUtils message_alert:@"Password cann't be blank" title:@"Warning" controller:self];
+//        return;
+//    }
+   AppDelegate *appDelegate = (AppDelegate *)[UIApplication sharedApplication].delegate;
+//    appDelegate.address = self.address;
     __weak typeof(self) weakself = self;
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wdeprecated-declarations"
     UIAlertView *alert = [RAUtils waiting_alert:@"Please wait" title:@"Login"];
+#pragma clang diagnostic pop
     dispatch_async(dispatch_get_global_queue(0, 0), ^{
         if (weakself) {
             __strong typeof(weakself) strongself = weakself;
-            NSDictionary *loginDic = [RAINetwork Login:strongself.user password:strongself.pwd];
+            NSDictionary *loginDic = [RANetwork Login:strongself.user password:strongself.pwd];
             dispatch_async(dispatch_get_main_queue(), ^{
                 [alert dismissWithClickedButtonIndex:0 animated:YES];
                 int result = [[loginDic objectForKey:@"result"] intValue];
-                BOOL rememberLogin = [[strongself userDefaultsValue:kRememberLogin] boolValue];
+//                BOOL rememberLogin = [[strongself userDefaultsValue:kRememberLogin] boolValue];
                 if (result == RESULT_TRUE) {
-                    if (!rememberLogin) {
-                        [self setUserDefaultsValue:nil forKey:kLoginUserInfo];
+                    NSArray *modeList = [loginDic objectForKey:@"mode_list"];
+                    if (modeList != nil) {
+                        [appDelegate showNormalRootVCWithModeList:modeList];
                     } else {
-                        [strongself setUserDefaultsValue:@{@"address" : strongself.address,@"user" : strongself.user,@"pwd" : strongself.pwd} forKey:kLoginUserInfo];
+                        [RAUtils message_alert:@"Something error" title:@"Warning" controller:strongself];
                     }
-                    appDelegate.bLogin = YES;
-                    appDelegate.user = strongself.user;
-                    appDelegate.password = strongself.pwd;
-                    appDelegate.companyName = [loginDic objectForKey:@"company_name"];
-                    [appDelegate loadCompanyIcon:[loginDic objectForKey:@"company_icon"]];
-                    appDelegate.modeList = [loginDic objectForKey:@"modellist"];
-                    [appDelegate showNormalRootVC];
+                    
+//                    if (!rememberLogin) {
+//                        [self setUserDefaultsValue:nil forKey:kLoginUserInfo];
+//                    } else {
+//                        [strongself setUserDefaultsValue:@{@"address" : strongself.address,@"user" : strongself.user,@"pwd" : strongself.pwd} forKey:kLoginUserInfo];
+//                    }
+//                    appDelegate.bLogin = YES;
+//                    appDelegate.user = strongself.user;
+//                    appDelegate.password = strongself.pwd;
+//                    appDelegate.companyName = [loginDic objectForKey:@"company_name"];
+//                    [appDelegate loadCompanyIcon:[loginDic objectForKey:@"company_icon"]];
+//                    appDelegate.modeList = [loginDic objectForKey:@"modellist"];
+//                    [appDelegate showNormalRootVC];
                 } else {
                     NSString *msg = [loginDic objectForKey:@"err_msg"];
                     [RAUtils message_alert:msg title:@"Warning" controller:strongself];
@@ -241,7 +251,7 @@ static NSString *kLoginUserInfo = @"UserInfo";
             });
 
         }
-    });*/
+    });
 }
 
 - (IBAction)settingBtnClick:(UIButton *)sender {

+ 20 - 0
RedAnt Mobile/RedAnt Mobile/RAModel.h

@@ -0,0 +1,20 @@
+//
+//  RAModel.h
+//  RedAnt Mobile
+//
+//  Created by Jack on 2017/10/31.
+//  Copyright © 2017年 Ray. All rights reserved.
+//
+
+#import <Foundation/Foundation.h>
+
+@interface RAModel : NSObject
+
+@property (nonatomic,copy) NSString *name;///<显示名字
+@property (nonatomic,copy) NSString *type;///<模型类型
+@property (nonatomic,assign) NSNumber *query_id;///<查询Id,服务器预先设定好的查询
+@property (nonatomic,copy) NSString *url;///<查询接口,通过本地设置查询条件和查询元组
+@property (nonatomic,copy) NSString *module;///<本地功能类型
+@property (nonatomic,strong) NSArray<NSDictionary *> *mode_list;///<模型列表
+
+@end

+ 17 - 0
RedAnt Mobile/RedAnt Mobile/RAModel.m

@@ -0,0 +1,17 @@
+//
+//  RAModel.m
+//  RedAnt Mobile
+//
+//  Created by Jack on 2017/10/31.
+//  Copyright © 2017年 Ray. All rights reserved.
+//
+
+#import "RAModel.h"
+
+@implementation RAModel
+
+- (void)setValue:(id)value forUndefinedKey:(NSString *)key {
+    
+}
+
+@end

+ 29 - 0
RedAnt Mobile/RedAnt Mobile/RAPredefQuery.storyboard

@@ -0,0 +1,29 @@
+<?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" initialViewController="ces-c6-x2d">
+    <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>
+        <!--Predef Query View Controller-->
+        <scene sceneID="Eh1-Ib-QgG">
+            <objects>
+                <viewController useStoryboardIdentifierAsRestorationIdentifier="YES" id="ces-c6-x2d" customClass="RAPredefQueryViewController" sceneMemberID="viewController">
+                    <view key="view" contentMode="scaleToFill" id="KeQ-Y4-TMR">
+                        <rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
+                        <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
+                        <color key="backgroundColor" red="1" green="0.26163493300000001" blue="0.20555324629999999" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
+                        <viewLayoutGuide key="safeArea" id="MRq-jk-uGW"/>
+                    </view>
+                </viewController>
+                <placeholder placeholderIdentifier="IBFirstResponder" id="7dz-5I-ffP" userLabel="First Responder" sceneMemberID="firstResponder"/>
+            </objects>
+            <point key="canvasLocation" x="158" y="208"/>
+        </scene>
+    </scenes>
+</document>

+ 15 - 0
RedAnt Mobile/RedAnt Mobile/RAPredefQueryViewController.h

@@ -0,0 +1,15 @@
+//
+//  RAPredefQueryViewController.h
+//  RedAnt Mobile
+//
+//  Created by Jack on 2017/10/31.
+//  Copyright © 2017年 Ray. All rights reserved.
+//
+
+#import <UIKit/UIKit.h>
+
+@interface RAPredefQueryViewController : UIViewController
+
+@property (nonatomic,assign) NSInteger query_id;
+
+@end

+ 37 - 0
RedAnt Mobile/RedAnt Mobile/RAPredefQueryViewController.m

@@ -0,0 +1,37 @@
+//
+//  RAPredefQueryViewController.m
+//  RedAnt Mobile
+//
+//  Created by Jack on 2017/10/31.
+//  Copyright © 2017年 Ray. All rights reserved.
+//
+
+#import "RAPredefQueryViewController.h"
+
+@interface RAPredefQueryViewController ()
+
+@end
+
+@implementation RAPredefQueryViewController
+
+- (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/RAQuery.storyboard

@@ -0,0 +1,29 @@
+<?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" initialViewController="0Oo-dp-nNr">
+    <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>
+        <!--Query View Controller-->
+        <scene sceneID="3L0-UN-kdU">
+            <objects>
+                <viewController useStoryboardIdentifierAsRestorationIdentifier="YES" id="0Oo-dp-nNr" customClass="RAQueryViewController" sceneMemberID="viewController">
+                    <view key="view" contentMode="scaleToFill" id="NTu-1T-7We">
+                        <rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
+                        <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
+                        <color key="backgroundColor" red="0.18151141800000001" green="1" blue="0.69469557609999999" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
+                        <viewLayoutGuide key="safeArea" id="mIx-8v-FX4"/>
+                    </view>
+                </viewController>
+                <placeholder placeholderIdentifier="IBFirstResponder" id="R4R-aa-IF1" userLabel="First Responder" sceneMemberID="firstResponder"/>
+            </objects>
+            <point key="canvasLocation" x="-266" y="80"/>
+        </scene>
+    </scenes>
+</document>

+ 15 - 0
RedAnt Mobile/RedAnt Mobile/RAQueryViewController.h

@@ -0,0 +1,15 @@
+//
+//  RAQueryViewController.h
+//  RedAnt Mobile
+//
+//  Created by Jack on 2017/10/31.
+//  Copyright © 2017年 Ray. All rights reserved.
+//
+
+#import <UIKit/UIKit.h>
+
+@interface RAQueryViewController : UIViewController
+
+@property (nonatomic,copy) NSString *url;
+
+@end

+ 37 - 0
RedAnt Mobile/RedAnt Mobile/RAQueryViewController.m

@@ -0,0 +1,37 @@
+//
+//  RAQueryViewController.m
+//  RedAnt Mobile
+//
+//  Created by Jack on 2017/10/31.
+//  Copyright © 2017年 Ray. All rights reserved.
+//
+
+#import "RAQueryViewController.h"
+
+@interface RAQueryViewController ()
+
+@end
+
+@implementation RAQueryViewController
+
+- (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

+ 16 - 0
RedAnt Mobile/RedAnt Mobile/RARootModeCell.h

@@ -0,0 +1,16 @@
+//
+//  RARootModeCell.h
+//  RedAnt Mobile
+//
+//  Created by Jack on 2017/10/31.
+//  Copyright © 2017年 Ray. All rights reserved.
+//
+
+#import <UIKit/UIKit.h>
+
+@class RAModel;
+@interface RARootModeCell : UITableViewCell
+
+@property (nonatomic,strong) RAModel *model;
+
+@end

+ 36 - 0
RedAnt Mobile/RedAnt Mobile/RARootModeCell.m

@@ -0,0 +1,36 @@
+//
+//  RARootModeCell.m
+//  RedAnt Mobile
+//
+//  Created by Jack on 2017/10/31.
+//  Copyright © 2017年 Ray. All rights reserved.
+//
+
+#import "RARootModeCell.h"
+#import "RAModel.h"
+
+@interface RARootModeCell ()
+@property (weak, nonatomic) IBOutlet UILabel *modeNameLabel;
+
+@end
+
+@implementation RARootModeCell
+
+- (void)awakeFromNib {
+    [super awakeFromNib];
+    // Initialization code
+}
+
+- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
+    [super setSelected:selected animated:animated];
+
+    // Configure the view for the selected state
+}
+
+- (void)setModel:(RAModel *)model {
+    _model = model;
+    
+    self.modeNameLabel.text = model.name;
+}
+
+@end

+ 13 - 0
RedAnt Mobile/RedAnt Mobile/RARootNavigationController.h

@@ -0,0 +1,13 @@
+//
+//  RARootNavigationController.h
+//  RedAnt Mobile
+//
+//  Created by Jack on 2017/10/31.
+//  Copyright © 2017年 Ray. All rights reserved.
+//
+
+#import <UIKit/UIKit.h>
+
+@interface RARootNavigationController : UINavigationController
+
+@end

+ 37 - 0
RedAnt Mobile/RedAnt Mobile/RARootNavigationController.m

@@ -0,0 +1,37 @@
+//
+//  RARootNavigationController.m
+//  RedAnt Mobile
+//
+//  Created by Jack on 2017/10/31.
+//  Copyright © 2017年 Ray. All rights reserved.
+//
+
+#import "RARootNavigationController.h"
+
+@interface RARootNavigationController ()
+
+@end
+
+@implementation RARootNavigationController
+
+- (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

+ 16 - 0
RedAnt Mobile/RedAnt Mobile/RARootViewController.h

@@ -0,0 +1,16 @@
+//
+//  ViewController.h
+//  RedAnt Mobile
+//
+//  Created by Ray on 06/09/2017.
+//  Copyright © 2017 Ray. All rights reserved.
+//
+
+#import "BasicViewController.h"
+
+@interface RARootViewController : BasicViewController
+
+- (void)setModeList:(NSArray *)modeList;
+
+@end
+

+ 113 - 0
RedAnt Mobile/RedAnt Mobile/RARootViewController.m

@@ -0,0 +1,113 @@
+//
+//  ViewController.m
+//  RedAnt Mobile
+//
+//  Created by Ray on 06/09/2017.
+//  Copyright © 2017 Ray. All rights reserved.
+//
+
+#import "RARootViewController.h"
+#import "RARootModeCell.h"
+#import "RAModel.h"
+#import "RAPredefQueryViewController.h"
+#import "RAQueryViewController.h"
+
+@interface RARootViewController () <UITableViewDelegate,UITableViewDataSource>
+
+@property (weak, nonatomic) IBOutlet UITableView *modeTableView;
+@property (nonatomic,strong) NSMutableArray<RAModel *> *modeArray;
+
+@end
+
+@implementation RARootViewController
+
+- (void)viewDidLoad {
+    [super viewDidLoad];
+    // Do any additional setup after loading the view, typically from a nib.
+    [self removeFirstResponderTap]; // 截断了Cell响应
+    
+    self.modeTableView.tableHeaderView = [UIView new];
+    self.modeTableView.tableFooterView = [UIView new];
+    
+}
+
+
+- (void)didReceiveMemoryWarning {
+    [super didReceiveMemoryWarning];
+    // Dispose of any resources that can be recreated.
+}
+
+#pragma mark - Private
+
+- (NSMutableArray<RAModel *> *)modeArray {
+    if (!_modeArray) {
+        _modeArray = [NSMutableArray array];
+    }
+    return _modeArray;
+}
+
+
+#pragma mark - Public
+
+- (void)setModeList:(NSArray *)modeList {
+    
+    for (int i = 0; i < modeList.count; i++) {
+        
+        NSDictionary *mode_dic = [modeList objectAtIndex:i];
+        RAModel *model = [[RAModel alloc] init];
+        [model setValuesForKeysWithDictionary:mode_dic];
+        [self.modeArray addObject:model];
+    }
+}
+
+#pragma mark - TableView Delegate & DataSource
+
+- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
+    return self.modeArray.count;
+}
+
+- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
+    RARootModeCell *cell = [tableView dequeueReusableCellWithIdentifier:@"mode_cell" forIndexPath:indexPath];
+    RAModel *model = [self.modeArray objectAtIndex:indexPath.row];
+    [cell setModel:model];
+    return cell;
+}
+
+- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
+    return 40.f;
+}
+
+- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
+    RARootModeCell *cell = [tableView cellForRowAtIndexPath:indexPath];
+    RAModel *model = cell.model;
+    
+    if ([model.type isEqualToString:@"predef_query"]) {
+        RAPredefQueryViewController *preQueryVC = [[UIStoryboard storyboardWithName:@"RAPredefQuery" bundle:nil] instantiateInitialViewController];
+        preQueryVC.query_id = [model.query_id integerValue];
+        preQueryVC.title = model.name;
+        [self.navigationController pushViewController:preQueryVC animated:YES];
+        
+    } else if ([model.type isEqualToString:@"query"]) {
+        RAQueryViewController *queryVC = [[UIStoryboard storyboardWithName:@"RAQuery" bundle:nil] instantiateInitialViewController];
+        queryVC.url = model.url;
+        queryVC.title = model.name;
+        [self.navigationController pushViewController:queryVC animated:YES];
+        
+    } else if ([model.type isEqualToString:@"local_func"]) {
+        
+        if ([model.module isEqualToString:@"tools_change_pwd"]) {
+            NSLog(@"change password");
+        }
+        
+    } else if ([model.type isEqualToString:@"submode"]) {
+        RARootViewController *vc = [[UIStoryboard storyboardWithName:@"Main" bundle:nil] instantiateViewControllerWithIdentifier:@"RARootViewController"];
+        vc.title = model.name;
+        [vc setModeList:model.mode_list];
+        [self.navigationController pushViewController:vc animated:YES];
+        
+    }
+    
+}
+
+
+@end