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
f38200111436f334ca5e0c2ec6be96bc0821d249
1 parent
021865a3
countDown
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
3 deletions
public/js/passport/register/register-new.js
public/js/passport/smslogin/sms-login-new.js
public/js/passport/register/register-new.js
View file @
f382001
...
...
@@ -74,14 +74,14 @@ class RegisterNew {
itime
=
setInterval
(()
=>
{
if
(
count
===
0
)
{
this
.
view
.
getVerifyCodeBtn
.
text
(
'重新发送'
).
removeClass
(
'disabl
e'
);
this
.
view
.
getVerifyCodeBtn
.
text
(
'重新发送'
).
addClass
(
'activ
e'
);
clearInterval
(
itime
);
}
else
{
this
.
view
.
getVerifyCodeBtn
.
text
(
'重新发送 ('
+
count
--
+
'秒)'
);
window
.
setCookie
(
'count'
,
count
);
if
(
during
&&
parseInt
(
during
,
10
)
!==
0
)
{
this
.
view
.
getVerifyCodeBtn
.
addClass
(
'disabl
e'
);
this
.
view
.
getVerifyCodeBtn
.
removeClass
(
'activ
e'
);
}
}
},
1000
);
...
...
public/js/passport/smslogin/sms-login-new.js
View file @
f382001
...
...
@@ -46,6 +46,30 @@ class SmsLoginNew extends Page {
}
/**
* 获取验证码倒计时
*/
countDown
(
during
)
{
let
count
=
during
||
59
;
let
itime
;
this
.
selector
.
getVerifyCodeBtn
.
removeClass
(
'active'
);
itime
=
setInterval
(()
=>
{
if
(
count
===
0
)
{
this
.
selector
.
getVerifyCodeBtn
.
text
(
'重新发送'
).
addClass
(
'active'
);
clearInterval
(
itime
);
}
else
{
this
.
selector
.
getVerifyCodeBtn
.
text
(
'重新发送 ('
+
count
--
+
'秒)'
);
window
.
setCookie
(
'count'
,
count
);
if
(
during
&&
parseInt
(
during
,
10
)
!==
0
)
{
this
.
selector
.
getVerifyCodeBtn
.
removeClass
(
'active'
);
}
}
},
1000
);
}
/**
* 输入监听,改变按钮状态
*/
changeBtnStatus
()
{
...
...
@@ -122,7 +146,7 @@ class SmsLoginNew extends Page {
validate
.
type
===
2
&&
validate
.
refresh
();
if
(
data
.
code
===
200
)
{
checkPoint
(
'YB_MOBILE_NEXT_C'
);
// 埋点
console
.
log
(
data
);
this
.
countDown
(
);
}
else
{
(
data
.
changeCaptcha
&&
validate
.
type
!==
2
)
&&
validate
.
refresh
();
tip
.
show
(
data
.
message
);
...
...
Please
register
or
login
to post a comment