Authored by 郭成尧

Merge branch 'feature/installment' into 'hotfix/uidhandle'

Feature/installment



See merge request !1136
... ... @@ -21,7 +21,7 @@ const _serverCrash = (res, params, err, next) => {
};
const _banksInit = () => {
const banks = ['农业银行', '中国银行', '工商银行', '建设银行', '光大银行', '兴业银行', '邮储银行', '民生银行', '中信银行', '广发银行'];
const banks = ['农业银行', '中国银行', '工商银行', '建设银行', '光大银行', '兴业银行', '邮储银行', '中信银行', '广发银行'];
if (new Date() >= new Date('2016-10-18 00:00:00')) {
// 2016年10月12日至17日 平安银行业务暂停(平安银行期间不支持服务)
... ... @@ -676,12 +676,21 @@ const bankCard = (req, res, next) => {
let uid = req.user.uid;
installmentModel.getBankCards(uid).then((result) => {
let noBank = true;
_.forEach(result, (val) => {
if (val.validStatus === false) {
noBank = false;
}
});
res.render('installment/bank-card', {
module: 'home',
page: 'bank-card',
title: '我的银行卡',
isInstallmentPage: true,
accountList: result,
noBank: noBank,
userName: _.get(result, '[0].userName')
});
}).catch((err) => {
... ...
... ... @@ -153,6 +153,7 @@ const _processBankCards = (list) => {
_.forEach(list, (data) => {
data.url = '/home/installment/card-detail?cardIdNo=' + data.cardIdNo;
data.validStatus = data.validStatus === '2';
// 正则替换卡号,保留后4位
data.cardNo = data.cardNo.replace(/(\d+)(\d{4})$/, function(a, b, c) {
... ...
<div class="bank-card-page">
{{#if accountList}}
{{#if noBank}}
<div class="card-tips">
<div class="left">
<p>您设置的银行卡所属银行已暂停服务,为了不影响您的还款,请添加新银行卡</p>
</div>
<div class="right hide">
<a class="iconfont" href="//m.yohobuy.com/home/installment/bind-card?name={{userName}}">去更换&nbsp;&#xe604;</a>
</div>
</div>
{{/if}}
<div class="bank-card-list" data-user="{{userName}}">
{{#accountList}}
<a class="card-bg-{{lowerCase bankCode}} card-nav" href="{{url}}"><span>{{cardNo}}</span></a>
<a class="card-bg-{{lowerCase bankCode}} card-nav" href="{{url}}">
<span>{{cardNo}}</span>
{{#if validStatus}}
<div class="out-of-service">暂停服务</div>
{{/if}}
</a>
{{/accountList}}
</div>
{{/if}}
</div>
... ...
... ... @@ -3,6 +3,35 @@
padding: 30px 30px 0;
}
.card-tips {
width: 100%;
height: 88px;
background-color: #ff8080;
font-size: 24px;
padding: 10px 25px;
.left {
float: left;
height: 68px;
line-height: 34px;
font-size: 24px;
color: #fff;
}
.right {
float: right;
width: 170px;
height: 68px;
line-height: 68px;
text-align: right;
.iconfont {
color: #fff;
font-size: 20px;
}
}
}
.card-nav {
width: 100%;
height: 200px;
... ... @@ -20,6 +49,20 @@
color: #fff;
font-size: 40px;
}
.out-of-service {
width: 120px;
height: 40px;
border-radius: 6px;
background-color: #fff;
font-size: 24px;
color: #ff575c;
line-height: 40px;
text-align: center;
position: absolute;
top: 20px;
right: 20px;
}
}
.card-bg-abc {
... ...