Authored by zzzzzzz

Merge branch 'release/4.9.2' of git.yoho.cn:fe/yohobuywap-node into release/4.9.2

... ... @@ -476,7 +476,9 @@ const postAccount = (params) => {
return api.get('', _.assign({
method: 'user.instalment.bindingCards',
debug: 'XYZ'
}, params));
}, params), {
timeout: 6000
});
};
module.exports = {
... ...
<div class="installment-page add-account-page">
<div class="installment-page add-account-page yoho-page">
{{#bindCard}}
<ul class="add-form">
<li>
... ...
... ... @@ -13,7 +13,7 @@
<input id="list-{{key}}" type="checkbox" class="installment-check-btn" {{#if isChecked}}checked{{/if}}/>
<label for="list-{{key}}">
<div class="cont">
<p>¥{{currNoFeeAmt}}</p>
<p>¥{{currAmt}}</p>
<p>【全{{stage}}期】{{billInfo}}</p>
</div>
</label>
... ...
... ... @@ -9,6 +9,7 @@ const AuthHelper = require('../models/auth-helper');
// constrant
const CODE_REQUIRED = '请输入校验码';
const PASSWORD_REQUIRED = '请输入密码';
const PASSWORD_LENGTH_ERROR = '密码6-20位,请重新输入';
const BAD_PASSWORD = '密码格式不正确';
const TOO_MANY = '请求太频繁';
const LOGIN_SUCCSS = '登录成功';
... ... @@ -28,6 +29,7 @@ const _step1 = (req, res, next) => {
let viewData = {
module: 'passport',
page: 'sms-login',
backUrl: '/passport/login',
isPassportPage: true,
headerText: '手机号码快捷登录',
areaCode: '+86', // 默认的区号
... ... @@ -270,6 +272,11 @@ exports.password = (req, res, next) => {
return res.json(data);
}
if (password.length < 6 || password.length > 20) {
data.message = PASSWORD_LENGTH_ERROR;
return res.json(data);
}
if (!helpers.verifyPassword(password)) {
return res.json(data);
}
... ...
<div class="sms-login passport-page yoho-page">
<div class="sms-login sms-login-check passport-page yoho-page">
{{> passport/header}}
<div class="content">
<p class="sms-login-msg">验证码已发至&nbsp;<span class="tel">+{{area}} {{mobile}}</span></p>
<div class="input-container input-group sms-input row">
<input id="sms-code" class="input" type="text" placeholder="验证码">
<span class="input-addon">
<div class="input-addon">
<button type="button" id="resend-sms">重发验证码</button>
</span>
</div>
<button class="clear-input" type="button"></button>
</div>
<button id="btn-next" class="btn btn-next disable row" type="button">登录</button>
</div>
... ...
... ... @@ -3,8 +3,8 @@
<div class="content">
<p class="sms-login-msg small">你以后还可以使用手机号码 + 密码的形式登录有货哦!</p>
<div class="input-container row has-eye">
<input id="pwd" class="pwd input" type="password" placeholder="密码">
<div class="eye close" id="eye"></div>
<input id="pwd" class="pwd input" type="text" placeholder="密码">
<div class="eye" id="eye"></div>
</div>
<span id="btn-next" class="btn btn-next disable row">确定</span>
</div>
... ...
... ... @@ -46,6 +46,7 @@ $('input').on('input', function() {
applyButton.on('click', function() {
var self = this;
var ret = false;
if (!flag || $(this).hasClass('disabled') || !validateForm()) {
return false;
... ... @@ -74,17 +75,24 @@ applyButton.on('click', function() {
if (data.code === 200) {
params.params.status = 1;
ret = true;
} else if (data.code === 500) {
tip.show('连接超时');
flag = true;
} else {
params.params.message = data.message;
ret = true;
}
url += encodeURIComponent(JSON.stringify(params));
$(self).attr('href', url);
return true;
},
error: function() {
tip.show('网络断开连接了~');
flag = true;
return false;
}
});
return ret;
});
... ...
... ... @@ -227,7 +227,11 @@ $('#apply-button').click(function() {
var params;
if (!result) {
return;
// return;
result = {
code: 500
};
}
params = {
... ...
... ... @@ -19,7 +19,7 @@ var repayment = new Repayment({
index: li.index(),
orderCode: li.data('billNo'),
termNo: li.data('currterm'),
amount: parseFloat(li.data('currnofeeamt')),
amount: parseFloat(li.data('curramt')),
fee: parseFloat(li.data('currfee')) + 0
};
... ... @@ -49,10 +49,10 @@ $(CHECKBOX_SELECTOR + ':checkbox').click(function() {
billNo = $(self).parent().data('billNo'),
li = $('li[data-bill-no=' + billNo + ']'),
selection = li.find('input:checked'),
lastIndex = li.eq(0).index();
lastIndex = li.eq(0).data('currterm');
selection.parent().each(function(index, sel) {
var key = $(sel).index();
var key = $(sel).data('currterm');
if ((key + 1) - lastIndex > 1) {
isSkipped = true;
... ...
... ... @@ -3,6 +3,7 @@ var tip = require('plugin/tip');
var $resendBtn,
$nextBtn,
$smsCode,
$resetBtn,
mobile, area;
var page = {
... ... @@ -23,6 +24,7 @@ var page = {
domInit: function() {
$resendBtn = $('#resend-sms');
$nextBtn = $('#btn-next');
$resetBtn = $('.clear-input');
$smsCode = $('#sms-code');
mobile = $('#mobile').val();
area = $('#area').val();
... ... @@ -40,11 +42,18 @@ var page = {
var hasVal = Boolean($.trim(this.value));
$nextBtn.toggleClass('disable', !hasVal);
$nextBtn.prop('disabled', !hasVal);
$resetBtn.toggle(hasVal);
});
$nextBtn.on('click', function() {
!self.disableAjax && self.submit();
});
$resetBtn.on('click', function() {
$smsCode.val('');
$resetBtn.hide();
});
},
... ... @@ -67,7 +76,7 @@ var page = {
self.timerId = null;
$resendBtn.prop('disable', false);
} else {
txt = second + 's';
txt = '重新发送(' + second + '秒)';
}
$resendBtn.text(txt);
... ... @@ -104,13 +113,14 @@ var page = {
var self = this;
var code = $.trim($smsCode.val());
this.disableAjax = true;
$nextBtn.prop('disabled', this.disableAjax = true);
$.get('/passport/sms_login/check.json', {
code: code
})
.done(function(res) {
if (res.code === 200) {
location.href = res.redirect;
self.disableAjax = true; // 成功后 disabled, 执行跳转
return;
}
... ... @@ -118,9 +128,10 @@ var page = {
})
.fail(function() {
tip.show('出错了, 请重试');
self.disableAjax = false; // 失败后 允许再次 请求
})
.always(function() {
self.disableAjax = false;
$nextBtn.prop('disabled', self.disableAjax);
});
}
};
... ...
... ... @@ -10,4 +10,9 @@
display: table-cell;
vertical-align: middle;
}
.input-addon {
width: 1%;
overflow: hidden;
}
}
... ...
... ... @@ -138,7 +138,7 @@ body.passport-body {
background-color: #36a74c;
border-radius: 5PX;
color: #fff;
&.disable {
&.disable, &[disabled] {
background-color: #a2a2a2;
}
}
... ...
... ... @@ -4,14 +4,13 @@
}
#resend-sms {
display: block;
background-color: transparent;
width: 190px;
margin-right: 15px;
border: 1px solid #36a74c;
border-radius: 26px;
font-size: 20px;
line-height: 30px;
width: 148PX;
margin: 0 15PX 0 28PX;
border: 1PX solid #36a74c;
padding: 5PX 0;
border-radius: 20PX;
font-size: 16PX;
color: #36a74c;
}
... ... @@ -20,6 +19,12 @@
}
}
.sms-login-check {
.clear-input {
right: 175PX;
}
}
.sms-login-msg {
font-size: 28px;
color: #fff;
... ...