Authored by 陈轩

fix

... ... @@ -29,6 +29,7 @@ const _step1 = (req, res, next) => {
let viewData = {
module: 'passport',
page: 'sms-login',
title: '手机短信登录',
backUrl: '/passport/login',
isPassportPage: true,
headerText: '手机号码快捷登录',
... ... @@ -49,6 +50,7 @@ const _step2 = (req, res, next) => {
const viewData = {
module: 'passport',
page: 'sms-check',
title: '手机短信登录',
backUrl: '/passport/sms_login?step=1',
isPassportPage: true,
headerText: '手机号码快捷登录',
... ... @@ -66,6 +68,7 @@ const _step3 = (req, res, next) => {
const viewData = {
module: 'passport',
page: 'sms-password',
title: '设置密码',
backUrl: '/passport/sms_login?step=2',
isPassportPage: true,
headerText: '设置密码'
... ...
... ... @@ -5,6 +5,7 @@
<div class="input-container phone-container row has-clear">
<span id="area-code" class="area-code">{{areaCode}}</span>
<input id="phone-num" class="input phone-num" type="text" placeholder="手机号">
<button class="clear-input" type="button"></button>
</div>
<span id="btn-next" class="btn btn-next disable row">获取短信验证码</span>
</div>
... ...
... ... @@ -41,8 +41,7 @@ var page = {
$smsCode.on('input', function() {
var hasVal = Boolean($.trim(this.value));
$nextBtn.toggleClass('disable', !hasVal);
$nextBtn.prop('disabled', !hasVal);
$nextBtn.trigger('toggleDisable', !hasVal);
$resetBtn.toggle(hasVal);
});
... ... @@ -53,9 +52,18 @@ var page = {
$resetBtn.on('click', function() {
$smsCode.val('');
$resetBtn.hide();
$nextBtn.trigger('toggleDisable');
});
},
$nextBtn.on('toggleDisable', function(event, bool) {
if (bool === void 0) {
bool = true;
}
$nextBtn.toggleClass('disable', bool);
$nextBtn.prop('disable', bool);
});
},
countDown: function() {
var self = this;
... ...
... ... @@ -6,6 +6,7 @@ var api = require('./api');
var $countrySelect,
$areaCode,
$nextBtn,
$resetBtn,
$phoneNum;
var page = {
... ... @@ -13,14 +14,13 @@ var page = {
init: function() {
this.domInit();
this.bindEvent();
this.toggleNextBtn();
},
domInit: function() {
$countrySelect = $('#country-select');
$areaCode = $('#area-code');
$nextBtn = $('#btn-next');
$phoneNum = $('#phone-num');
$resetBtn = $('.clear-input');
},
bindEvent: function() {
var self = this;
... ... @@ -35,6 +35,14 @@ var page = {
$nextBtn.on('click', function() {
!self.disableAjax && self.goNext();
});
$resetBtn.on('click', function() {
$phoneNum.val('');
$nextBtn
.prop('disable', true)
.toggleClass('disable', true);
$resetBtn.hide();
});
},
// 切换$nextBtn disable状态
... ... @@ -44,6 +52,8 @@ var page = {
$nextBtn
.toggleClass('disable', !bool)
.prop('disable', !bool);
$resetBtn.toggle(bool);
},
// 提交按钮
... ...
... ... @@ -154,6 +154,8 @@ body.passport-body {
height: 16PX;
background: resolve('passport/clear-input.png') no-repeat;
background-size: 100% 100%;
outline: none;
border: none;
}
.eye {
position: absolute;
... ...
... ... @@ -12,6 +12,11 @@
border-radius: 20PX;
font-size: 16PX;
color: #36a74c;
&:disabled {
color: #a2a2a2;
border-color: #a2a2a2;
}
}
button {
... ...