Authored by shijian

遍历问题

... ... @@ -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',
... ...
... ... @@ -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',
... ...
... ... @@ -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);
}
});
});
// 点击注册提交
... ...