Toggle navigation
Toggle navigation
This project
Loading...
Sign in
fe
/
yohobuywap-node
·
Commits
Go to a project
GitLab
Go to group
Project
Activity
Files
Commits
Pipelines
0
Builds
0
Graphs
Milestones
Issues
0
Merge Requests
0
Members
Labels
Wiki
Forks
Network
Create a new issue
Download as
Email Patches
Plain Diff
Browse Files
Authored by
郭成尧
8 years ago
Commit
3c1de4f42243bcd2652ccff4faf87ac7b35b96c3
1 parent
2a3fe714
login-ok
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
40 additions
and
6 deletions
public/js/passport/smslogin/sms-login-new.js
public/scss/passport/sms-login-new.page.css
public/js/passport/smslogin/sms-login-new.js
View file @
3c1de4f
...
...
@@ -20,6 +20,7 @@ class SmsLoginNew extends Page {
countryCodeSelector
:
$
(
'#countryCodeSelector'
),
mobileInput
:
$
(
'input[name=mobile]'
),
getVerifyCodeBtn
:
$
(
'#getVerifyCodeBtn'
),
verifyCode
:
$
(
'input[name=verifyCode]'
),
smsLoginBtn
:
$
(
'#smsLoginBtn'
)
};
...
...
@@ -40,6 +41,7 @@ class SmsLoginNew extends Page {
this
.
selector
.
clearMobile
.
on
(
'click'
,
this
.
clearMobile
.
bind
(
this
));
this
.
selector
.
mobileInput
.
bind
(
'input'
,
this
.
changeBtnStatus
.
bind
(
this
));
this
.
selector
.
getVerifyCodeBtn
.
on
(
'click'
,
this
.
getVerifyCode
.
bind
(
this
));
this
.
selector
.
verifyCode
.
bind
(
'input'
,
this
.
changeBtnStatus
.
bind
(
this
));
this
.
selector
.
smsLoginBtn
.
on
(
'click'
,
this
.
login
.
bind
(
this
));
}
...
...
@@ -53,13 +55,45 @@ class SmsLoginNew extends Page {
}
else
{
this
.
selector
.
getVerifyCodeBtn
.
removeClass
(
'active'
);
}
// 登录按钮
if
(
this
.
selector
.
mobileInput
.
val
()
&&
this
.
selector
.
verifyCode
.
val
())
{
this
.
selector
.
smsLoginBtn
.
addClass
(
'active'
);
}
else
{
this
.
selector
.
smsLoginBtn
.
removeClass
(
'active'
);
}
}
/**
* 登录
*/
login
()
{
if
(
!
this
.
selector
.
smsLoginBtn
.
hasClass
(
'active'
))
{
return
;
}
let
code
=
this
.
selector
.
verifyCode
.
val
();
this
.
ajax
({
url
:
'/passport/sms_login/check.json'
,
data
:
{
code
:
code
}
}).
then
(
res
=>
{
if
(
res
.
code
===
200
)
{
checkPoint
(
'YB_MOBILE_LOGIN_C'
);
// 埋点
if
(
res
.
newer
)
{
res
.
redirect
=
res
.
redirect
+
'®isterCode='
+
res
.
registerCode
;
}
location
.
href
=
res
.
redirect
;
return
;
}
tip
.
show
(
res
.
message
);
}).
catch
(()
=>
{
tip
.
show
(
'出错了!'
);
});
}
/**
...
...
@@ -88,7 +122,7 @@ class SmsLoginNew extends Page {
validate
.
type
===
2
&&
validate
.
refresh
();
if
(
data
.
code
===
200
)
{
checkPoint
(
'YB_MOBILE_NEXT_C'
);
// 埋点
location
.
href
=
data
.
redirect
;
console
.
log
(
data
)
;
}
else
{
(
data
.
changeCaptcha
&&
validate
.
type
!==
2
)
&&
validate
.
refresh
();
tip
.
show
(
data
.
message
);
...
...
public/scss/passport/sms-login-new.page.css
View file @
3c1de4f
...
...
@@ -8,6 +8,10 @@ $top-bar-font-color: #444;
.sms-login-new-page
{
@extend
padding-75;
.active
{
background-color
:
#444
!important
;
}
.iconfont
{
color
:
#444
;
}
...
...
@@ -114,17 +118,13 @@ $top-bar-font-color: #444;
float
:
right
;
margin-top
:
-8px
;
}
>
.active
{
background-color
:
#444
;
}
}
.sms-login-btn
{
width
:
600px
;
height
:
70px
;
border-radius
:
4px
;
background-color
:
#
444
;
background-color
:
#
e0e0e0
;
margin-top
:
100px
;
font-size
:
32px
;
color
:
#fff
;
...
...
Please
register
or
login
to post a comment