Explorar el Código

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

学丽 %!s(int64=5) %!d(string=hace) años
padre
commit
a79ca7724a

+ 4 - 4
KuDianProject.xcodeproj/project.pbxproj

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

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


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

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

+ 57 - 1
KuDianProject/Public/KDPNetworkRequestHTTP.m

@@ -9,6 +9,7 @@
9 9
 #import "KDPNetworkRequestHTTP.h"
10 10
 #import <AdSupport/AdSupport.h>
11 11
 #import "KDPPhoneLoginViewController.h"
12
+#import "KDPTabBarVC.h"
12 13
 @implementation KDPNetworkRequestHTTP
13 14
 + (void)postURL:(NSString *)url params:(NSDictionary *)params success:(void(^)(id json))success failure:(void(^)(NSError *error))failure
14 15
 {
@@ -85,9 +86,64 @@
85 86
 {
86 87
     [[NSNotificationCenter defaultCenter]postNotificationName:@"exitLogin" object:nil];
87 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
 /**