...
|
...
|
@@ -59,33 +59,10 @@ const index = (req, res, next) => { |
|
|
|
|
|
logger.info(`installment index info: client_type=${req.query.client_type},req.user.uid=${req.user.uid},req.query.uid=${req.query.uid},cookies=${JSON.stringify(req.cookies)}`); // eslint-disable-line
|
|
|
Promise.all([
|
|
|
req.ctx(installmentModel).getStauts(uid),
|
|
|
req.ctx(installmentModel).getSearchIntallment({
|
|
|
uid: uid
|
|
|
})
|
|
|
req.ctx(installmentModel).getStauts(uid)
|
|
|
]).then((result) => {
|
|
|
|
|
|
if (req.yoho.isApp) {
|
|
|
_.forEach(result[1], goods => {
|
|
|
goods.url = yasProcess.addParamsToGoodsHref({
|
|
|
href: goods.url,
|
|
|
fromPageName: yasProcess.getPname(req),
|
|
|
fromPageParam: req.originalUrl
|
|
|
});
|
|
|
});
|
|
|
}
|
|
|
|
|
|
// openStatus:0 未申请 1审核中 2已开通 3 审核未通过
|
|
|
let openStatus = result[0];
|
|
|
let installmentOnly = {
|
|
|
title: {
|
|
|
title: '分期专享',
|
|
|
more_url: helpers.appUrlFormat(req.originalUrl, 'go.instalmentlist', {
|
|
|
title: '分期专享'
|
|
|
})
|
|
|
},
|
|
|
goods: result[1]
|
|
|
};
|
|
|
|
|
|
if (openStatus === '0') {
|
|
|
return Promise.all([
|
...
|
...
|
@@ -102,7 +79,7 @@ const index = (req, res, next) => { |
|
|
content: data[0],
|
|
|
notice: data[1],
|
|
|
notOpen: true,
|
|
|
installmentOnly: installmentOnly
|
|
|
goHomePath: req.yoho.isApp ? `yohobuy://yohobuy.com/goapp?openby:yohobuy={"action":"go.home","params":{"channel":"1"}}` : '//m.yohobuy.com/boys'
|
|
|
};
|
|
|
});
|
|
|
} else if (openStatus === '2') {
|
...
|
...
|
@@ -114,17 +91,10 @@ const index = (req, res, next) => { |
|
|
]).then((data) => {
|
|
|
let params = _.assign({
|
|
|
isOverdue: false,
|
|
|
installmentOnly: installmentOnly,
|
|
|
content: data[2],
|
|
|
notice: data[3]
|
|
|
}, data[0], data[1]);
|
|
|
|
|
|
if (installmentOnly.goods.length > 0) {
|
|
|
params.installmentOnly = _.assign({
|
|
|
showMore: true
|
|
|
}, installmentOnly);
|
|
|
}
|
|
|
|
|
|
// status: 1 正常 2 逾期 3 不可用 4 未开通
|
|
|
if (data[0].status === '2') {
|
|
|
params.replayStatus = '逾期';
|
...
|
...
|
|