Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
万
万科
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
张杰
万科
Commits
88b0f4dc
Commit
88b0f4dc
authored
Nov 15, 2015
by
Achilles
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refactor login page
parent
dcf57dbf
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
57 additions
and
3 deletions
+57
-3
VankeLoginBoard_iPhone.m
vanke/view_iPhone/templates/login/VankeLoginBoard_iPhone.m
+48
-0
VankeLoginBoard_iPhone.xml
vanke/view_iPhone/templates/login/VankeLoginBoard_iPhone.xml
+9
-3
No files found.
vanke/view_iPhone/templates/login/VankeLoginBoard_iPhone.m
View file @
88b0f4dc
...
@@ -12,6 +12,7 @@
...
@@ -12,6 +12,7 @@
#import "AppDelegate.h"
#import "AppDelegate.h"
#import "GEToast.h"
#import "GEToast.h"
#import "VankeUtil.h"
#import "VankeUtil.h"
#import "VankeCommonModel.h"
#define PWD_MASK @" "
#define PWD_MASK @" "
...
@@ -92,6 +93,20 @@ ON_DID_DISAPPEAR( signal )
...
@@ -92,6 +93,20 @@ ON_DID_DISAPPEAR( signal )
[
NSObject
cancelPreviousPerformRequestsWithTarget
:
self
];
[
NSObject
cancelPreviousPerformRequestsWithTarget
:
self
];
}
}
ON_LOAD_DATAS
(
signal
)
{
// admin/thoradmin
VankeCommonModel
*
userModel
=
[
VankeCommonModel
sharedInstance
];
User
*
user
=
[
userModel
currentUser
];
if
(
nil
!=
user
)
{
$
(
self
.
txtUserName
).
DATA
(
user
.
code
);
$
(
self
.
txtPwd
).
DATA
([
userModel
currentUserPassword
]);
}
else
{
[
self
.
txtUserName
becomeFirstResponder
];
}
[
self
refreshLoginButtonStyle
];
}
ON_SIGNAL3
(
VankeLoginBoard_iPhone
,
btnLogin
,
signal
)
ON_SIGNAL3
(
VankeLoginBoard_iPhone
,
btnLogin
,
signal
)
{
{
if
(
!
[
self
checkToLogin
])
{
if
(
!
[
self
checkToLogin
])
{
...
@@ -103,6 +118,39 @@ ON_SIGNAL3( VankeLoginBoard_iPhone, btnLogin, signal )
...
@@ -103,6 +118,39 @@ ON_SIGNAL3( VankeLoginBoard_iPhone, btnLogin, signal )
[
_model
login
:[
self
getUserName
]
password
:[
self
getPassword
]];
[
_model
login
:[
self
getUserName
]
password
:[
self
getPassword
]];
}
}
ON_SIGNAL3
(
VankeLoginBoard_iPhone
,
txtUserName
,
signal
)
{
if
([
signal
is
:
BeeUITextField
.
CLEAR
])
{
[
self
setLoginButtonEnabled
:
NO
];
}
else
{
[
self
refreshLoginButtonStyle
];
}
}
ON_SIGNAL3
(
VankeLoginBoard_iPhone
,
txtPwd
,
signal
)
{
if
([
signal
is
:
BeeUITextField
.
CLEAR
])
{
[
self
setLoginButtonEnabled
:
NO
];
}
else
{
[
self
refreshLoginButtonStyle
];
}
}
-
(
void
)
refreshLoginButtonStyle
{
BOOL
disabled
=
[
VankeUtil
isBlankString
:
_txtPwd
.
text
]
||
[
VankeUtil
isBlankString
:
_txtUserName
.
text
];
[
self
setLoginButtonEnabled
:
!
disabled
];
}
-
(
void
)
setLoginButtonEnabled
:
(
BOOL
)
enabled
{
if
(
!
enabled
)
{
$
(
self
.
btnLogin
).
ADD_CLASS
(
@"disabled-btn"
);
[
self
.
btnLogin
setUserInteractionEnabled
:
NO
];
}
else
{
$
(
self
.
btnLogin
).
REMOVE_CLASS
(
@"disabled-btn"
);
[
self
.
btnLogin
setUserInteractionEnabled
:
YES
];
}
}
ON_SIGNAL3
(
VankeUserModel
,
RELOADING
,
signal
)
{
ON_SIGNAL3
(
VankeUserModel
,
RELOADING
,
signal
)
{
}
}
...
...
vanke/view_iPhone/templates/login/VankeLoginBoard_iPhone.xml
View file @
88b0f4dc
...
@@ -10,9 +10,9 @@
...
@@ -10,9 +10,9 @@
</linear>
</linear>
<linear
orientation=
"v"
class=
"form-wrapper"
>
<linear
orientation=
"v"
class=
"form-wrapper"
>
<input
id=
"txtUserName"
class=
"input-field"
placeholder=
"请输入用户名"
>
admin
</input>
<input
id=
"txtUserName"
class=
"input-field"
placeholder=
"请输入用户名"
></input>
<input
id=
"txtPwd"
class=
"input-field pwd"
placeholder=
"请输入密码"
>
thoradmin
</input>
<input
id=
"txtPwd"
class=
"input-field pwd"
placeholder=
"请输入密码"
></input>
<button
id=
"btnLogin"
class=
"login-btn"
>
登 录
</button>
<button
id=
"btnLogin"
class=
"login-btn
disabled-btn
"
>
登 录
</button>
</linear>
</linear>
<linear
orientation=
"h"
class=
"bottom"
>
<linear
orientation=
"h"
class=
"bottom"
>
...
@@ -105,6 +105,12 @@
...
@@ -105,6 +105,12 @@
background-color: #ed1b23;
background-color: #ed1b23;
border-radius: 5px;
border-radius: 5px;
margin-top: 10px;
margin-top: 10px;
color: white;
}
.disabled-btn {
background-color: #cbcbcb !important;
color: gray;
}
}
.disable {
.disable {
...
...
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