Browse Source

Merge branch 'master' of http://101.200.220.49:8001/liuxueli/KDProject

学丽 5 years ago
parent
commit
a79ca7724a

+ 4 - 4
KuDianProject.xcodeproj/project.pbxproj

1596
 				ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage;
1596
 				ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage;
1597
 				CODE_SIGN_ENTITLEMENTS = KuDianProject/KuDianProject.entitlements;
1597
 				CODE_SIGN_ENTITLEMENTS = KuDianProject/KuDianProject.entitlements;
1598
 				CODE_SIGN_IDENTITY = "iPhone Developer";
1598
 				CODE_SIGN_IDENTITY = "iPhone Developer";
1599
-				CODE_SIGN_STYLE = Manual;
1599
+				CODE_SIGN_STYLE = Automatic;
1600
 				DEVELOPMENT_TEAM = WV23VEMQV8;
1600
 				DEVELOPMENT_TEAM = WV23VEMQV8;
1601
 				ENABLE_BITCODE = NO;
1601
 				ENABLE_BITCODE = NO;
1602
 				FRAMEWORK_SEARCH_PATHS = (
1602
 				FRAMEWORK_SEARCH_PATHS = (
1679
 				);
1679
 				);
1680
 				PRODUCT_BUNDLE_IDENTIFIER = com.KuDianProject.eight;
1680
 				PRODUCT_BUNDLE_IDENTIFIER = com.KuDianProject.eight;
1681
 				PRODUCT_NAME = "$(TARGET_NAME)";
1681
 				PRODUCT_NAME = "$(TARGET_NAME)";
1682
-				PROVISIONING_PROFILE_SPECIFIER = dev;
1682
+				PROVISIONING_PROFILE_SPECIFIER = "";
1683
 				TARGETED_DEVICE_FAMILY = 1;
1683
 				TARGETED_DEVICE_FAMILY = 1;
1684
 			};
1684
 			};
1685
 			name = Debug;
1685
 			name = Debug;
1692
 				ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage;
1692
 				ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage;
1693
 				CODE_SIGN_ENTITLEMENTS = KuDianProject/KuDianProject.entitlements;
1693
 				CODE_SIGN_ENTITLEMENTS = KuDianProject/KuDianProject.entitlements;
1694
 				CODE_SIGN_IDENTITY = "iPhone Developer";
1694
 				CODE_SIGN_IDENTITY = "iPhone Developer";
1695
-				CODE_SIGN_STYLE = Manual;
1695
+				CODE_SIGN_STYLE = Automatic;
1696
 				DEVELOPMENT_TEAM = WV23VEMQV8;
1696
 				DEVELOPMENT_TEAM = WV23VEMQV8;
1697
 				ENABLE_BITCODE = NO;
1697
 				ENABLE_BITCODE = NO;
1698
 				FRAMEWORK_SEARCH_PATHS = (
1698
 				FRAMEWORK_SEARCH_PATHS = (
1775
 				);
1775
 				);
1776
 				PRODUCT_BUNDLE_IDENTIFIER = com.KuDianProject.eight;
1776
 				PRODUCT_BUNDLE_IDENTIFIER = com.KuDianProject.eight;
1777
 				PRODUCT_NAME = "$(TARGET_NAME)";
1777
 				PRODUCT_NAME = "$(TARGET_NAME)";
1778
-				PROVISIONING_PROFILE_SPECIFIER = dev;
1778
+				PROVISIONING_PROFILE_SPECIFIER = "";
1779
 				TARGETED_DEVICE_FAMILY = 1;
1779
 				TARGETED_DEVICE_FAMILY = 1;
1780
 			};
1780
 			};
1781
 			name = Release;
1781
 			name = Release;

BIN
KuDianProject.xcworkspace/xcuserdata/kaipeng.xcuserdatad/UserInterfaceState.xcuserstate


+ 6 - 1
KuDianProject/Login/controller/KDPPhoneLoginViewController.m

21
 @property (nonatomic, strong) UIButton *sendCodeBtn;
21
 @property (nonatomic, strong) UIButton *sendCodeBtn;
22
 
22
 
23
 @property (nonatomic, strong) NSTimer *timer;
23
 @property (nonatomic, strong) NSTimer *timer;
24
+// 保存的手机验证码
25
+@property (nonatomic, strong) NSString *saveCode;
24
 
26
 
25
 @end
27
 @end
26
 
28
 
67
     phoneField.textColor = [UIColor colorWithHex:0x333333];
69
     phoneField.textColor = [UIColor colorWithHex:0x333333];
68
     phoneField.font = FONT_SYS(16);
70
     phoneField.font = FONT_SYS(16);
69
     phoneField.placeholder = @"请输入手机号";
71
     phoneField.placeholder = @"请输入手机号";
72
+    phoneField.clearButtonMode = UITextFieldViewModeWhileEditing;
70
     [phoneField addTarget:self action:@selector(valueChanged:) forControlEvents:UIControlEventValueChanged];
73
     [phoneField addTarget:self action:@selector(valueChanged:) forControlEvents:UIControlEventValueChanged];
71
     self.phoneTextField = phoneField;
74
     self.phoneTextField = phoneField;
72
     [self.view addSubview:self.phoneTextField];
75
     [self.view addSubview:self.phoneTextField];
85
     phoneLine.backgroundColor = [UIColor colorWithHex:0xD1D1D1];
88
     phoneLine.backgroundColor = [UIColor colorWithHex:0xD1D1D1];
86
     [self.view addSubview:phoneLine];
89
     [self.view addSubview:phoneLine];
87
     
90
     
88
-    self.codeField = [[UITextField alloc] initWithFrame:CGRectMake(32, phoneLine.bottom + 27, self.phoneTextField.width, self.phoneTextField.height)];
91
+    self.codeField = [[UITextField alloc] initWithFrame:CGRectMake(32, phoneLine.bottom + 27, phoneLine.width, self.phoneTextField.height)];
89
     self.codeField.keyboardType = UIKeyboardTypePhonePad;
92
     self.codeField.keyboardType = UIKeyboardTypePhonePad;
90
     self.codeField.textColor = [UIColor colorWithHex:0x333333];
93
     self.codeField.textColor = [UIColor colorWithHex:0x333333];
91
     self.codeField.font = FONT_SYS(16);
94
     self.codeField.font = FONT_SYS(16);
92
     self.codeField.placeholder = @"请输入验证码";
95
     self.codeField.placeholder = @"请输入验证码";
96
+    self.codeField.clearButtonMode = UITextFieldViewModeWhileEditing;
93
     [self.view addSubview:self.codeField];
97
     [self.view addSubview:self.codeField];
94
     
98
     
95
     UIView *lineView = [[UIView alloc] initWithFrame:CGRectMake(32, self.codeField.bottom + 12, SCREEN_WIDTH-64, 1)];
99
     UIView *lineView = [[UIView alloc] initWithFrame:CGRectMake(32, self.codeField.bottom + 12, SCREEN_WIDTH-64, 1)];
150
                 [vc dismissViewControllerAnimated:YES completion:nil];
154
                 [vc dismissViewControllerAnimated:YES completion:nil];
151
             }
155
             }
152
         } failure:^(NSError * _Nonnull error) {
156
         } failure:^(NSError * _Nonnull error) {
157
+            [MBProgressHUD showError:@"验证码输入错误"];
153
             [LoadingView dismiss];
158
             [LoadingView dismiss];
154
         }];
159
         }];
155
 
160
 

+ 57 - 1
KuDianProject/Public/KDPNetworkRequestHTTP.m

9
 #import "KDPNetworkRequestHTTP.h"
9
 #import "KDPNetworkRequestHTTP.h"
10
 #import <AdSupport/AdSupport.h>
10
 #import <AdSupport/AdSupport.h>
11
 #import "KDPPhoneLoginViewController.h"
11
 #import "KDPPhoneLoginViewController.h"
12
+#import "KDPTabBarVC.h"
12
 @implementation KDPNetworkRequestHTTP
13
 @implementation KDPNetworkRequestHTTP
13
 + (void)postURL:(NSString *)url params:(NSDictionary *)params success:(void(^)(id json))success failure:(void(^)(NSError *error))failure
14
 + (void)postURL:(NSString *)url params:(NSDictionary *)params success:(void(^)(id json))success failure:(void(^)(NSError *error))failure
14
 {
15
 {
85
 {
86
 {
86
     [[NSNotificationCenter defaultCenter]postNotificationName:@"exitLogin" object:nil];
87
     [[NSNotificationCenter defaultCenter]postNotificationName:@"exitLogin" object:nil];
87
     [KDPAccountTool deleteAccount];
88
     [KDPAccountTool deleteAccount];
89
+
90
+    [[UIApplication sharedApplication].keyWindow.rootViewController presentViewController:[[UINavigationController alloc]initWithRootViewController:[[KDPPhoneLoginViewController alloc]init]] animated:YES completion:^{
91
+        UIViewController *currentVC = [[self alloc] getCurrentVC];
92
+        
93
+        [currentVC.navigationController popToRootViewControllerAnimated:YES];
94
+        
95
+        KDPTabBarVC *tabbar = (KDPTabBarVC *)[UIApplication sharedApplication].keyWindow.rootViewController;
96
+        tabbar.selectedIndex = 0;
97
+    }];
88
     
98
     
89
-    [[UIApplication sharedApplication].keyWindow.rootViewController presentViewController:[[UINavigationController alloc]initWithRootViewController:[[KDPPhoneLoginViewController alloc]init]] animated:YES completion:nil];
99
+}
100
+
101
+- (UIViewController *)getCurrentVC {
102
+    // Find best view controller
103
+    UIViewController* viewController = [UIApplication sharedApplication].keyWindow.rootViewController;
104
+    return [self findBestViewController:viewController];
105
+}
106
+
107
+-(UIViewController*) findBestViewController:(UIViewController*)vc {
90
     
108
     
109
+    if (vc.presentedViewController) {
110
+        
111
+        // Return presented view controller
112
+        return [self findBestViewController:vc.presentedViewController];
113
+        
114
+    } else if ([vc isKindOfClass:[UISplitViewController class]]) {
115
+        
116
+        // Return right hand side
117
+        UISplitViewController* svc = (UISplitViewController*) vc;
118
+        if (svc.viewControllers.count > 0)
119
+            return [self findBestViewController:svc.viewControllers.lastObject];
120
+        else
121
+            return vc;
122
+        
123
+    } else if ([vc isKindOfClass:[UINavigationController class]]) {
124
+        
125
+        // Return top view
126
+        UINavigationController* svc = (UINavigationController*) vc;
127
+        if (svc.viewControllers.count > 0)
128
+            return [self findBestViewController:svc.topViewController];
129
+        else
130
+            return vc;
131
+        
132
+    } else if ([vc isKindOfClass:[UITabBarController class]]) {
133
+        
134
+        // Return visible view
135
+        UITabBarController* svc = (UITabBarController*) vc;
136
+        if (svc.viewControllers.count > 0)
137
+            return [self findBestViewController:svc.selectedViewController];
138
+        else
139
+            return vc;
140
+        
141
+    } else {
142
+        
143
+        // Unknown view controller type, return last child view controller
144
+        return vc;
145
+        
146
+    }
91
 }
147
 }
92
 
148
 
93
 /**
149
 /**