Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
O
Opple-iOS
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
张杰
Opple-iOS
Commits
ba886b89
Commit
ba886b89
authored
May 17, 2016
by
polo2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化重置密码逻辑 by zcb
parent
479cc5c0
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
69 additions
and
30 deletions
+69
-30
LoginViewController.m
Lighting/Class/Login/LoginViewController.m
+53
-15
authenticateView.xib
Lighting/Class/Login/authenticateView.xib
+15
-14
Main.storyboard
Lighting/Lighting/Base.lproj/Main.storyboard
+1
-1
No files found.
Lighting/Class/Login/LoginViewController.m
View file @
ba886b89
...
...
@@ -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
=
@""
;
}
...
...
Lighting/Class/Login/authenticateView.xib
View file @
ba886b89
...
...
@@ -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=
"1
4
"
width=
"86"
height=
"20"
/>
<rect
key=
"frame"
x=
"117"
y=
"1
5
"
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=
"1
4
"
width=
"86"
height=
"20"
/>
<rect
key=
"frame"
x=
"117"
y=
"1
5
"
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=
"3
0"
/>
<rect
key=
"frame"
x=
"
0.0"
y=
"0.0"
width=
"86"
height=
"5
0"
/>
<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"
/>
...
...
Lighting/Lighting/Base.lproj/Main.storyboard
View file @
ba886b89
...
...
@@ -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"
/>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment