Toggle navigation
Toggle navigation
This project
Loading...
Sign in
fe
/
yoho-blk
·
Commits
Go to a project
GitLab
Go to group
Project
Activity
Files
Commits
Pipelines
0
Builds
0
Graphs
Milestones
Issues
0
Merge Requests
1
Members
Labels
Wiki
Forks
Network
Create a new issue
Download as
Email Patches
Plain Diff
Browse Files
Authored by
htoooth
9 years ago
Commit
c1a94a50fdd1bfad733e6aa482c8b56a6a5c3e9f
1 parent
dafb8a64
tips调整,登录页
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
51 additions
and
28 deletions
apps/passport/views/action/login/index.hbs
public/js/passport/login/index.js
public/scss/passport/_login.css
apps/passport/views/action/login/index.hbs
View file @
c1a94a5
...
...
@@ -17,19 +17,39 @@
<input
id=
"account"
class=
"account input phone-num va"
name=
"account"
value=
"
{{
bindMobile
}}
"
type=
"text"
placeholder=
"Phone Number"
autocomplete=
"off"
>
<div
class=
"tips phone-num-tips hide"
>
<div
class=
"triangle"
></div>
<div
class=
"rectangle"
></div>
</div>
</div>
</li>
<li
class=
"clearfix"
>
<input
id=
"password"
class=
"input password va needTip"
name=
"password"
type=
"password"
placeholder=
"Password"
autocomplete=
"off"
maxlength=
"20"
>
<div
class=
"pwd-wrapper"
>
<input
id=
"password"
class=
"input password va needTip"
name=
"password"
type=
"password"
placeholder=
"Password"
autocomplete=
"off"
maxlength=
"20"
>
<div
class=
"tips pwd-tips hide"
>
<div
class=
"triangle"
></div>
<div
class=
"rectangle"
></div>
</div>
</div>
</li>
<li
class=
"clearfix captcha-wrap hide"
>
<div
class=
"img-captcha-wrapper"
>
<input
id=
"captcha"
class=
"input va captcha needTip"
type=
"text"
name=
"captcha"
placeholder=
"图形验证码"
autocomplete=
"off"
maxlength=
"4"
>
<input
id=
"captcha"
class=
"input va captcha needTip"
type=
"text"
name=
"captcha"
placeholder=
"图形验证码"
autocomplete=
"off"
maxlength=
"4"
>
<div
class=
"tips img-captcha-tips hide"
>
<div
class=
"triangle"
></div>
<div
class=
"rectangle"
></div>
</div>
</div>
<div
class=
"left captcha-component"
>
<img
id=
"captcha-img"
class=
"left captcha-img"
alt=
""
>
...
...
@@ -82,12 +102,6 @@
<a
class=
"blue"
href=
"
{{
fastReg
}}
"
>
快速注册
</a>
</span>
</li>
<div
class=
"tips hide"
>
<div
class=
"triangle"
></div>
<div
class=
"rectangle"
></div>
</div>
</ul>
<input
id=
"country-code-hide"
name=
"countryCode"
type=
"hidden"
value=
"
{{
countryCode
}}
"
>
{{/
passport
}}
...
...
public/js/passport/login/index.js
View file @
c1a94a5
...
...
@@ -37,21 +37,18 @@ var checkbox = {
unchecked
:
''
};
var
$errTip
=
$
(
'.tips'
);
var
$errMsg
=
$errTip
.
find
(
'.rectangle'
);
require
(
'yoho-jquery-placeholder'
);
function
errTip
(
ele
,
msg
)
{
var
topLeft
=
ele
.
offset
();
var
$errTip
=
ele
.
next
(
'.tips'
);
var
$errMsg
=
$errTip
.
find
(
'.rectangle'
);
$errMsg
.
text
(
msg
);
return
$errTip
.
css
({
top
:
topLeft
.
top
+
ele
.
height
()
-
2
,
left
:
topLeft
.
left
,
width
:
ele
.
width
()
+
2
,
height
:
ele
.
height
}).
removeClass
(
'hide'
);
return
$errTip
.
removeClass
(
'hide'
);
}
function
hideTip
(
ele
)
{
return
ele
.
next
(
'.tips'
).
addClass
(
'hide'
);
}
// 验证账户名
...
...
@@ -67,7 +64,7 @@ function validateAccountLocal() {
if
(
phoneNum
.
length
===
11
&&
mailPhoneRegx
.
phoneRegx
[
'+86'
].
test
(
phoneNum
))
{
return
true
;
}
else
{
errTip
(
$phone
,
'手机号码不正确,请重新输入'
);
errTip
(
$phone
NumInput
,
'手机号码不正确,请重新输入'
);
return
false
;
}
}
...
...
@@ -79,13 +76,13 @@ function validateAccountLocal() {
if
(
mailPhoneRegx
.
emailRegx
.
test
(
phoneNum
))
{
return
true
;
}
else
{
errTip
(
$phone
,
'邮箱格式不正确,请重新输入'
);
errTip
(
$phone
NumInput
,
'邮箱格式不正确,请重新输入'
);
return
false
;
}
}
}
else
{
errTip
(
$phone
,
'请输入账号'
);
errTip
(
$phone
NumInput
,
'请输入账号'
);
return
false
;
}
}
...
...
@@ -102,7 +99,7 @@ function validateAccountAsync() {
if
(
data
.
code
&&
data
.
code
===
200
)
{
return
true
;
}
else
{
errTip
(
$phone
,
'账号不存在'
);
errTip
(
$phone
NumInput
,
'账号不存在'
);
return
false
;
}
});
...
...
@@ -128,6 +125,7 @@ function validateAccount() {
}
return
validate
().
then
(
function
()
{
hideTip
(
$phoneNumInput
);
ep
.
emit
(
'phone'
,
true
);
}).
fail
(
function
()
{
ep
.
emit
(
'phone'
,
false
);
...
...
@@ -252,6 +250,7 @@ mailAc($phoneNumInput, function() {
});
$phoneNumInput
.
on
(
'focus'
,
function
()
{
hideTip
(
$phoneNumInput
);
$phone
.
addClass
(
'focus'
);
}).
on
(
'blur'
,
function
()
{
$phone
.
removeClass
(
'focus'
);
...
...
@@ -272,6 +271,8 @@ $passwordInput.on('blur', function() {
validatePasswordLocal
();
}).
on
(
'focus'
,
function
()
{
$passwordInput
.
addClass
(
'focus'
);
hideTip
(
$passwordInput
);
});
// 验证码
...
...
@@ -322,19 +323,19 @@ ep.tail('phone', 'password', 'captcha', function(phoneAuth, passwordAuth, captch
ep
.
on
(
'phone'
,
function
(
auth
)
{
if
(
auth
)
{
$errTip
.
addClass
(
'hide'
);
hideTip
(
$phoneNumInput
);
}
});
ep
.
on
(
'password'
,
function
(
auth
)
{
if
(
auth
)
{
$errTip
.
addClass
(
'hide'
);
hideTip
(
$passwordInput
);
}
});
ep
.
on
(
'captcha'
,
function
(
auth
)
{
if
(
auth
&&
!
$captchaWrap
.
hasClass
(
'hide'
))
{
$errTip
.
addClass
(
'hide'
);
hideTip
(
$imgCaptchaInput
);
}
});
...
...
public/scss/passport/_login.css
View file @
c1a94a5
...
...
@@ -109,4 +109,12 @@
text-align
:
center
;
}
}
.pwd-wrapper
{
width
:
100%
;
}
.img-captcha-wrapper
{
width
:
$
captcha
;
}
}
...
...
Please
register
or
login
to post a comment