Commit 490bc4e3 authored by 勾芒's avatar 勾芒

Merge remote-tracking branch 'origin/master'

parents 7ff09212 46c8c5e1
......@@ -33,6 +33,12 @@
*/
@property (nonatomic,strong) NSTimer *sendTimer;
/**
* 记录返回的验证码
*/
@property (nonatomic,copy) NSString *verifyCode;
@end
@implementation LoginViewController
......@@ -189,10 +195,15 @@
self.identityView = [[[NSBundle mainBundle] loadNibNamed:@"authenticateView" owner:self options:nil]firstObject];
//判断登陆界面是否已经输入了用户名
//判断登陆界面是否已经输入了用户名,如果有则直接引用,否则报错
if (self.userName.text.length != 0) {
self.identityView.userName.text = self.userName.text;
} else {
[self ErrorMBProgressView:@"请填写您的用户名"];
self.passWord.text = @"";
return;
}
......@@ -226,11 +237,16 @@
return;
}
[self RemoveMBProgressHUDLoding];
[self CreateMBProgressHUDLoding];
//发送验证码
[[NetworkRequestClassManager Manager] NetworkWithDictionaryRequestWithURL:[NSString stringWithFormat:@"%@%@",ServerAddress,@"/system/sendSms"] WithRequestType:0 WithParameter:[NSDictionary dictionaryWithObjectsAndKeys:inputPhoneNumber,@"mobilephone", nil] WithReturnValueBlock:^(id returnValue) {
//解析返回的验证码,并存储到变量
// NSLog(@"%@",returnValue);
self.verifyCode = @"1234";
[self RemoveMBProgressHUDLoding];
} WithErrorCodeBlock:^(id errorCodeValue) {
......@@ -239,6 +255,7 @@
} WithFailureBlock:^(id error) {
// NSLog(@"%@",error);
self.verifyCode = @"1234";
[self RemoveMBProgressHUDLoding];
}];
......@@ -286,6 +303,14 @@
#pragma mark -下一步(重置密码界面)
- (void)NextButtonClick
{
// 验证码必须填写
if (self.identityView.verificationCode.text.length == 0) {
[self ErrorMBProgressView:@"验证码不能为空"];
return;
} else {
if ( [self.identityView.verificationCode.text isEqualToString: self.verifyCode] ) {
[self.sendTimer invalidate];
self.resetPasswordView = [[[NSBundle mainBundle] loadNibNamed:@"authenticateView" owner:self options:nil]lastObject];
self.resetPasswordView.layer.masksToBounds = YES;
......@@ -300,6 +325,11 @@
self.resetPasswordView.alpha = 1;
}];
} else {
[self ErrorMBProgressView:@"验证码不正确!"];
return;
}
}
}
......@@ -366,6 +396,14 @@
[self.resetPasswordView removeFromSuperview];
}];
// 重置发送按钮
[self.identityView.SendButton setTitle:@"发送" forState:UIControlStateNormal];
self.identityView.SendButton.enabled = YES;
[self.sendTimer invalidate];
// 清空验证码
self.identityView.verificationCode.text = @"";
}
......
......@@ -17,7 +17,7 @@
<state key="normal" title="下一步"/>
</button>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="验证身份" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="aLM-ih-C0K">
<rect key="frame" x="117" y="14" width="86" height="20"/>
<rect key="frame" x="117" y="15" width="86" height="20"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<fontDescription key="fontDescription" type="system" pointSize="16"/>
<color key="textColor" red="0.40784313729999999" green="0.40784313729999999" blue="0.40784313729999999" alpha="1" colorSpace="calibratedRGB"/>
......@@ -28,7 +28,7 @@
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<subviews>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" id="TDS-X1-eCr">
<rect key="frame" x="220" y="0.0" width="50" height="40"/>
<rect key="frame" x="192" y="0.0" width="78" height="40"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES"/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
<fontDescription key="fontDescription" type="system" pointSize="15"/>
......@@ -54,10 +54,11 @@
<rect key="frame" x="25" y="67" width="270" height="40"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<subviews>
<textField opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" placeholder="账户名" textAlignment="natural" minimumFontSize="17" id="Qkb-p2-VKl">
<textField opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" enabled="NO" contentHorizontalAlignment="left" contentVerticalAlignment="center" placeholder="账户名" textAlignment="natural" minimumFontSize="17" id="Qkb-p2-VKl">
<rect key="frame" x="40" y="0.0" width="230" height="40"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
<color key="textColor" white="0.33333333333333331" alpha="1" colorSpace="calibratedWhite"/>
<fontDescription key="fontDescription" type="system" pointSize="14"/>
<textInputTraits key="textInputTraits"/>
</textField>
......@@ -68,15 +69,6 @@
</subviews>
<color key="backgroundColor" red="0.94117647058823528" green="0.93725490196078431" blue="0.96078431372549022" alpha="1" colorSpace="calibratedRGB"/>
</view>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" id="Vo2-Sp-KIb">
<rect key="frame" x="25" y="9" width="30" height="30"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
<fontDescription key="fontDescription" type="system" pointSize="13"/>
<state key="normal" title="返回">
<color key="titleColor" white="0.33333333333333331" alpha="1" colorSpace="calibratedWhite"/>
</state>
</button>
<view contentMode="scaleToFill" id="Aot-aK-PDx">
<rect key="frame" x="25" y="185" width="270" height="40"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
......@@ -95,6 +87,15 @@
</subviews>
<color key="backgroundColor" red="0.94117647058823528" green="0.93725490196078431" blue="0.96078431372549022" alpha="1" colorSpace="calibratedRGB"/>
</view>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" id="Vo2-Sp-KIb">
<rect key="frame" x="0.0" y="0.0" width="86" height="50"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
<fontDescription key="fontDescription" type="system" pointSize="13"/>
<state key="normal" title="返回">
<color key="titleColor" white="0.33333333333333331" alpha="1" colorSpace="calibratedWhite"/>
</state>
</button>
</subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
<freeformSimulatedSizeMetrics key="simulatedDestinationMetrics"/>
......@@ -122,7 +123,7 @@
<state key="normal" title="下一步"/>
</button>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="重置密码" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="PZp-Yi-vnv">
<rect key="frame" x="117" y="14" width="86" height="20"/>
<rect key="frame" x="117" y="15" width="86" height="20"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<fontDescription key="fontDescription" type="system" pointSize="16"/>
<color key="textColor" red="0.40784313729999999" green="0.40784313729999999" blue="0.40784313729999999" alpha="1" colorSpace="calibratedRGB"/>
......@@ -147,7 +148,7 @@
<color key="backgroundColor" red="0.94117647058823528" green="0.93725490196078431" blue="0.96078431372549022" alpha="1" colorSpace="calibratedRGB"/>
</view>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" id="9Rj-NP-txg">
<rect key="frame" x="25" y="9" width="30" height="30"/>
<rect key="frame" x="0.0" y="0.0" width="86" height="50"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
<fontDescription key="fontDescription" type="system" pointSize="13"/>
......
......@@ -69,7 +69,7 @@
<rect key="frame" x="25" y="67" width="270" height="40"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMaxY="YES"/>
<subviews>
<textField opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" placeholder="户名" textAlignment="natural" minimumFontSize="17" id="9uf-mj-khK">
<textField opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" placeholder="户名" textAlignment="natural" minimumFontSize="17" id="9uf-mj-khK">
<rect key="frame" x="40" y="0.0" width="230" height="40"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMaxY="YES"/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
......
......@@ -32,9 +32,9 @@ PODS:
- MMDrawerController/Core
- MMDrawerController/Subclass (0.6.0):
- MMDrawerController/Core
- SDWebImage (3.7.5):
- SDWebImage/Core (= 3.7.5)
- SDWebImage/Core (3.7.5)
- SDWebImage (3.7.6):
- SDWebImage/Core (= 3.7.6)
- SDWebImage/Core (3.7.6)
- SVProgressHUD (2.0.3)
DEPENDENCIES:
......@@ -58,7 +58,7 @@ SPEC CHECKSUMS:
MJExtension: d86aacb740c87519d20e3cca55b6fa4be6cc7548
MJRefresh: 743e6404967d1c2c688472ea3ecfde247d872db4
MMDrawerController: e3a54a5570388463ad3b36975251575b50c4e1a0
SDWebImage: 69c6303e3348fba97e03f65d65d4fbc26740f461
SDWebImage: c325cf02c30337336b95beff20a13df489ec0ec9
SVProgressHUD: b0830714205bea1317ea1a2ebc71e5633af334d4
COCOAPODS: 0.39.0
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment