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
shijian
8 years ago
Commit
b61b2f43a966fc8465bf4740706ad1fa7e4fe40b
1 parent
a33c8069
遍历问题
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
35 additions
and
25 deletions
apps/passport/router.js
public/js/passport/back/back.js
public/js/passport/reg/reg.js
apps/passport/router.js
View file @
b61b2f4
...
...
@@ -73,7 +73,8 @@ router.post('/autouserinfo/relateMobile', bind.relateMobile);
* 注册页面路由
*/
router
.
get
(
'/reg'
,
reg
.
index
);
router
.
post
(
'/reg/checkmobile'
,
reg
.
checkMobile
);
// router.post('/reg/checkmobile', reg.checkMobile);
router
.
post
(
'/reg/piccaptcha'
,
reg
.
checkCode
,
reg
.
picCaptcha
);
router
.
post
(
'/reg/msgcaptcha'
,
reg
.
msgCaptcha
);
router
.
post
(
'/reg/sendBindMsg'
,
reg
.
checkCode
,
reg
.
sendBindMsg
);
...
...
@@ -87,9 +88,9 @@ router.get('/reg/success', reg.success);
router
.
get
(
'/back/index'
,
back
.
indexPage
);
// 实时验证输入是否正确
router
.
post
(
'/back/authcode'
,
back
.
validateInputAPI
,
back
.
getUserInfoAPI
);
// router.post('/back/authcode',
// back.validateInputAPI,
// back.getUserInfoAPI);
// 提交按钮邮件API
router
.
post
(
'/back/email'
,
...
...
public/js/passport/back/back.js
View file @
b61b2f4
...
...
@@ -8,7 +8,7 @@ var $ = require('yoho-jquery'),
regx
=
require
(
'../common/mail-phone-regx'
),
EventProxy
=
require
(
'yoho-eventproxy'
);
var
emailAc
=
require
(
'../common/ac-email'
);
// 邮箱自动完成
//
var emailAc = require('../common/ac-email'); // 邮箱自动完成
var
$regionCodeText
=
$
(
'#country-code'
),
$phoneNumInput
=
$
(
'.phone-num'
),
...
...
@@ -125,7 +125,7 @@ function validatePhoneNumLocal() {
/**
* 整合本地和异步验证
*/
function
validatePhoneNum
()
{
function
validatePhoneNum
()
{
//eslint-disable-line
function
validate
()
{
var
defer
=
$
.
Deferred
();
//eslint-disable-line
...
...
@@ -227,9 +227,9 @@ function validateImgCaptcha() {
/**
* 邮箱自动补全
*/
emailAc
(
$phoneNumInput
,
function
()
{
validatePhoneNum
();
});
// emailAc($phoneNumInput, function() {
// validatePhoneNum();
// });
$imgCaptchaInput
.
attr
(
'maxlength'
,
4
);
...
...
@@ -237,6 +237,7 @@ $imgCaptchaInput.attr('maxlength', 4);
$
(
'input'
).
placeholder
();
exports
.
init
=
function
()
{
$nextBtn
.
removeClass
(
'disable'
);
// 监听事件 phone-num 和 captcha-img
ep
.
tail
(
'phone-num'
,
'captcha-img'
,
function
(
phoneAuth
,
imgAuth
)
{
...
...
@@ -271,13 +272,13 @@ exports.init = function() {
$imgCaptchaInput
.
addClass
(
'focus'
);
});
$phoneNumInput
.
on
(
'focus'
,
function
()
{
hideTip
(
$phoneNumInput
);
$
(
'.phone'
).
addClass
(
'focus'
);
}).
on
(
'blur'
,
function
()
{
$phoneNumInput
.
removeClass
(
'focus'
);
$
(
'.phone'
).
removeClass
(
'focus'
);
});
// $phoneNumInput.on('focus', function() {
// hideTip($phoneNumInput);
// $('.phone').addClass('focus');
// }).on('blur', function() {
// $phoneNumInput.removeClass('focus');
// $('.phone').removeClass('focus');
// });
$nextBtn
.
on
(
'click'
,
function
()
{
var
urlPhone
=
'/passport/back/mobile'
,
...
...
public/js/passport/reg/reg.js
View file @
b61b2f4
...
...
@@ -261,7 +261,9 @@ function validatePhoneNumLocal() {
}
function
validatePhoneNum
()
{
return
(
function
()
{
return
$
.
Deferred
().
resolve
(
true
);
// eslint-disable-line
return
(
function
()
{
// eslint-disable-line
var
defer
=
$
.
Deferred
();
// eslint-disable-line
if
(
validatePhoneNumLocal
())
{
...
...
@@ -464,14 +466,16 @@ function disableSMSBtn() {
}
exports
.
init
=
function
()
{
$smsCaptchaCtrl
.
removeClass
(
'disable'
);
// 验证手机输入
$phoneNumInput
.
on
(
'blur'
,
function
()
{
validatePhoneNum
();
$
(
'#phone'
).
removeClass
(
'focus'
);
}).
on
(
'focus'
,
function
()
{
hideTip
(
$phoneNumInput
);
$
(
'#phone'
).
addClass
(
'focus'
);
});
// $phoneNumInput.on('blur', function() {
// validatePhoneNum();
// $('#phone').removeClass('focus');
// }).on('focus', function() {
// hideTip($phoneNumInput);
// $('#phone').addClass('focus');
// });
// 验证图形输入
$imgCaptchaInput
.
on
(
'blur'
,
function
()
{
...
...
@@ -573,7 +577,11 @@ exports.init = function() {
$smsCaptchaCtrl
.
addClass
(
'disable'
);
disableSMSBtn
();
sendSMSCaptcha
();
sendSMSCaptcha
().
then
((
data
)
=>
{
if
(
data
.
code
!==
200
)
{
errTip
(
$smsCaptchaInput
,
data
.
message
);
}
});
});
// 点击注册提交
...
...
Please
register
or
login
to post a comment