Authored by 李靖

完成

... ... @@ -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 === '0';
// 正则替换卡号,保留后4位
data.cardNo = data.cardNo.replace(/(\d+)(\d{4})$/, function(a, b, c) {
... ...
<div class="bank-card-page">
{{#if noBank}}
<div class="card-tips">
<div class="left">
<p>您设置的银行卡所属银行已暂停服务,</p>
<p>为了不影响您的还款,请更换银行卡</p>
</div>
<div class="right">
<a class="iconfont" href="m.yohobuy.com/home/installment/bind-card">去更换&nbsp;&#xe604;</a>
<a class="iconfont" href="//m.yohobuy.com/home/installment/bind-card">去更换&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>
{{#if validStatus}}
<div class="out-of-service">暂停服务</div>
{{/if}}
</a>
{{/accountList}}
</div>
... ...