Authored by htoooth

链式调用

... ... @@ -58,7 +58,7 @@ function validatePhoneNumAsync() {
type: 'POST',
url: '/passport/back/authcode',
data: {
phoneNum: $phoneNumInput.val(),
phoneNum: $.trim($phoneNumInput.val()),
area: $regionCodeText.text()
}
}).then(function(data) {
... ... @@ -281,11 +281,9 @@ exports.init = function() {
var name = $clickItem.data('value');
var $selectedItem = $clickItem.siblings('.selected');
$selectedItem.find('.iconfont').html('');
$selectedItem.removeClass('selected');
$selectedItem.find('.iconfont').html('').removeClass('selected');
$clickItem.find('.iconfont').html(selectedIcon);
$clickItem.addClass('selected');
$clickItem.find('.iconfont').html(selectedIcon).addClass('selected');
$regionSelectHeader.find('.name').html(name);
$regionCodeText.text(areaCode);
... ...
... ... @@ -36,11 +36,9 @@ $('input').placeholder();
ep.tail('pwd', 'repwd', function(pwd, repwd) {
if (pwd && repwd) {
$next.removeClass('disable');
$next.prop('disabled', false);
$next.removeClass('disable').prop('disabled', false);
} else {
$next.addClass('disable');
$next.prop('disabled', true);
$next.addClass('disable').prop('disabled', true);
}
});
... ...
... ... @@ -36,12 +36,9 @@ function disableSMSBtn() {
second -= 1;
if (second < 0) {
second = 60;
$smsCaptchaCtrl.text('获取短信验证码');
$smsCaptchaCtrl.removeClass('disable');
$smsCaptchaCtrl.removeClass('second-progress');
$smsCaptchaCtrl.text('获取短信验证码').removeClass('disable').removeClass('second-progress');
} else {
$smsCaptchaCtrl.addClass('second-progress');
$smsCaptchaCtrl.text(second + '秒后可重新操作');
$smsCaptchaCtrl.addClass('second-progress').text(second + '秒后可重新操作');
window.setTimeout(disableSMSBtn, 1000);
}
}
... ...
... ... @@ -52,12 +52,9 @@ function disableSMSBtn() {
second -= 1;
if (second < 0) {
second = 60;
$smsCaptchaCtrl.text('获取短信验证码');
$smsCaptchaCtrl.removeClass('disable');
$smsCaptchaCtrl.removeClass('second-progress');
$smsCaptchaCtrl.text('获取短信验证码').removeClass('disable').removeClass('second-progress');
} else {
$smsCaptchaCtrl.addClass('second-progress');
$smsCaptchaCtrl.text(second + '秒后可重新操作');
$smsCaptchaCtrl.addClass('second-progress').text(second + '秒后可重新操作');
window.setTimeout(disableSMSBtn, 1000);
}
}
... ... @@ -130,11 +127,9 @@ $regionSelectList.on('click', '.option', function() {
var name = $clickItem.data('value');
var $selectedItem = $clickItem.siblings('.selected');
$selectedItem.find('.iconfont').html('');
$selectedItem.removeClass('selected');
$selectedItem.find('.iconfont').html('').end().removeClass('selected');
$clickItem.find('.iconfont').html(selectedIcon);
$clickItem.addClass('selected');
$clickItem.find('.iconfont').html(selectedIcon).end().addClass('selected');
$regionSelectHeader.find('.name').html(name);
$regionCodeText.text(areaCode);
... ...
... ... @@ -283,11 +283,9 @@ $regionSelectList.on('click', '.option', function() {
var name = $clickItem.data('value');
var $selectedItem = $clickItem.siblings('.selected');
$selectedItem.find('.iconfont').html('');
$selectedItem.removeClass('selected');
$selectedItem.find('.iconfont').html('').removeClass('selected');
$clickItem.find('.iconfont').html(selectedIcon);
$clickItem.addClass('selected');
$clickItem.find('.iconfont').html(selectedIcon).addClass('selected');
$regionSelectHeader.find('.name').html(name);
$regionCodeText.text(areaCode);
... ...
var reg = require('./reg/reg');
reg.init('reg');
reg.init();
... ...
... ... @@ -190,8 +190,8 @@ function validateSMSCaptchaAsync() {
type: 'POST',
url: '/passport/reg/msgcaptcha',
data: {
code: $smsCaptchaInput.val(),
mobile: $phoneNumInput.val(),
code: $.trim($smsCaptchaInput.val()),
mobile: $.trim($phoneNumInput.val()),
area: $regionCodeText.text().split('+')[1]
}
}).then(function(data) {
... ... @@ -239,7 +239,7 @@ function validateSMSCaptcha() {
}
function validatePhoneNumLocal() {
var phoneNum = $phoneNumInput.val(),
var phoneNum = $.trim($phoneNumInput.val()),
length = phoneNum.length,
regionCode = $regionCodeText.text();
... ... @@ -365,7 +365,7 @@ function register() {
url: '/passport/reg/mobileregister',
data: {
area: $regionCodeText.text().split('+')[1],
mobile: $phoneNumInput.val(),
mobile: $.trim($phoneNumInput.val()),
verifyCode: $imgCaptchaInput.val(),
code: $smsCaptchaInput.val(),
password: $passwordInput.val()
... ... @@ -412,7 +412,7 @@ function sendSMSCaptcha() {
url: '/passport/reg/sendBindMsg',
data: {
area: $regionCodeText.text().split('+')[1],
mobile: $phoneNumInput.val(),
mobile: $.trim($phoneNumInput.val()),
verifyCode: $imgCaptchaInput.val()
}
});
... ... @@ -422,12 +422,9 @@ function disableSMSBtn() {
second -= 1;
if (second < 0) {
second = 60;
$smsCaptchaCtrl.text('获取短信验证码');
$smsCaptchaCtrl.removeClass('disable');
$smsCaptchaCtrl.removeClass('second-progress');
$smsCaptchaCtrl.text('获取短信验证码').removeClass('disable').removeClass('second-progress');
} else {
$smsCaptchaCtrl.addClass('second-progress');
$smsCaptchaCtrl.text(second + '秒后可重新操作');
$smsCaptchaCtrl.addClass('second-progress').text(second + '秒后可重新操作');
window.setTimeout(disableSMSBtn, 1000);
}
}
... ... @@ -524,11 +521,9 @@ exports.init = function() {
var name = $clickItem.data('value');
var $selectedItem = $clickItem.siblings('.selected');
$selectedItem.find('.iconfont').html('');
$selectedItem.removeClass('selected');
$selectedItem.find('.iconfont').html('').removeClass('selected');
$clickItem.find('.iconfont').html(selectedIcon);
$clickItem.addClass('selected');
$clickItem.find('.iconfont').html(selectedIcon).addClass('selected');
$regionSelectHeader.find('.name').html(name);
$regionCodeText.text(areaCode);
... ...