Authored by Aiden Xu

开通有货分期

... ... @@ -253,7 +253,8 @@ const activateService = (req, res, next) => {
const getBankInfo = (req, res, next) => {
installmentModel.getBankInfo({
cardNo: req.query.cardNo
cardNo: req.query.cardNo,
uid: req.user.uid || 0 // TODO: fix uid
}).then((result)=> {
res.json(result);
}).catch(next);
... ...
... ... @@ -125,20 +125,27 @@ const _processBankCards = (list) => {
list = list || [];
_.forEach(list, (data) => {
let newCardNo = data.cardNo.split('');
let cardNo = newCardNo.length;
data.cardNo = '';
for (let i = 1; i < cardNo; i++) {
if (i < (cardNo - 4)) {
data.cardNo += '*';
} else {
data.cardNo += newCardNo[i - 1];
}
}
// let newCardNo = data.cardNo.split('');
// let cardNo = newCardNo.length;
// data.cardNo = '';
//
//
// for (let i = 1; i < cardNo; i++) {
// if (i < (cardNo - 4)) {
// data.cardNo += '*';
// } else {
// data.cardNo += newCardNo[i - 1];
// }
// }
// 正则替换卡号,保留后4位
data.cardNo = data.cardNo.replace(/(\d+)(\d{4})$/, function(a, b, c) {
return b.replace(/\d/g, '*') + c;
});
});
return list;
};
... ... @@ -478,12 +485,14 @@ const activateService = (params) => {
* 获取银行信息
*
* @param cardNo
* @param uid
* @returns {*}
*/
const getBankInfo = (cardNo) => {
const getBankInfo = (cardNo, uid) => {
return api.get('', {
method: 'user.instalment.getBankInfoByCardNo',
cardNo: cardNo
cardNo: cardNo,
uid: uid
});
};
... ...
... ... @@ -232,6 +232,15 @@
"desc":"已还款",
"curr_date":"【1/3期】",
"sort_id":"1"
},
{
"curr_amt": "¥599.00",
"curr_principal_amt": "¥590.00",
"curr_fee_amt": "¥5.00",
"curr_dealy_fee_amt": "¥4.00",
"desc":"逾期2天",
"curr_date":"【1/3期】",
"sort_id":"1"
}
]
},
... ...
... ... @@ -19,10 +19,13 @@ router.get('/installment/starting-service', installment.startingService); // 分
router.get('/installment/starting-service/verify-code', installment.verifyCode);
router.get('/installment/overdue', installment.overdueList); // 逾期未还款列表
router.get('/installment/7daylist', installment.sevenDayList); // 7日待还款列表
// TODO: Use dashed-lower-case only!
router.get('/installment/monthRepayList', installment.monthRepayList); // 本月待还款列表
router.get('/installment/totalRepayList', installment.totalRepayList); // 待还总金额列表
router.get('/installment/repayRecord', installment.repayRecordPage); // 还款记录
router.get('/installment/getRepayRecord', installment.getRepayRecord); // ajax请求还款记录
router.get('/installment/account', installment.account); // 账户管理
router.get('/installment/bank-info', installment.getBankInfo);
router.post('/installment/activate-service', installment.activateService);
... ...
... ... @@ -31,7 +31,7 @@
<span class="on is-repay">待还款金额</span>
<span class="is-usable">可用额度</span>
</div>
<div class="repay installment-cont">
<div class="repay installment-cont">
<div class="repay-area detail-bg">
<p class="detail-txt1">近7日代还款</p>
<p class="detail-txt1">¥<span class="detail-txt2">{{round dayAmt}}</span></p>
... ... @@ -44,7 +44,7 @@
<li><a href="/home/installment/monthRepayList">本月待还金额:<div class="list-right"><span class="list-r-txt">¥{{monthAmt}}</span><span class="iconfont"> &#xe604;</span></div></a></li>
<li><a href="/home/installment/totalRepayList">待还总金额:<div class="list-right"><span class="list-r-txt">¥{{totalAmt}}</span><span class="iconfont"> &#xe604;</span></div></a></li>
<li><a href="/home/installment/repayRecord">还款记录:<div class="list-right iconfont">&#xe604;</div></a></li>
<li><a href="">分期订单:<div class="list-right iconfont">&#xe604;</div></a></li>
<li><a href="/home/installment/order">分期订单:<div class="list-right iconfont">&#xe604;</div></a></li>
</ul>
<ul class="group-list">
... ...
... ... @@ -54,6 +54,7 @@
</div>
<div class="status">
{{desc}}
<span class="iconfont notice">&#xe639;</span>
</div>
<div class="clearfix"></div>
</li>
... ...
... ... @@ -2,9 +2,13 @@
* 订单状态样式
*/
$('.status').each(function() {
const text = $(this).text();
const text = $(this).text().trim();
const fade = text.match(/已还款|已退款/) || [];
const expire = text.match(/逾期/) || [];
if (text.indexOf(/已还款|已退款/)) {
if (fade.length > 0) {
$(this).addClass('faded');
} else if (expire.length > 0) {
$(this).addClass('expired');
}
});
... ...
... ... @@ -137,4 +137,5 @@ $('#apply-form').submit(function() {
$.post('/home/installment/activate-service', formModel).then((result)=> {
console.log(result);
});
return false;
});
... ...
... ... @@ -156,8 +156,16 @@
position: absolute;
right: 30px;
.faded {
&.faded {
color: #b0b0b0;
.iconfont {
display: none;
}
}
&.expired {
color: #d0021b;
}
}
}
... ...