...
|
...
|
@@ -14,7 +14,9 @@ const index = (req, res) => { |
|
|
let query = req.query.query || '';
|
|
|
let uid = req.user.uid || 3236556;
|
|
|
|
|
|
installmentModel.getStauts(uid).then((openStatus) => {
|
|
|
Promise.all([installmentModel.getStauts(uid), installmentModel.getSearchIntallment()]).then((result) => {
|
|
|
let openStatus = result[0];
|
|
|
|
|
|
if (openStatus === 0) {
|
|
|
return {
|
|
|
bannerTop: {
|
...
|
...
|
@@ -28,18 +30,24 @@ const index = (req, res) => { |
|
|
notOpen: true,
|
|
|
installmentOnly: {
|
|
|
title: '分期专享',
|
|
|
goods: [
|
|
|
{
|
|
|
|
|
|
}
|
|
|
]
|
|
|
goods: result[1]
|
|
|
}
|
|
|
};
|
|
|
} else if (openStatus === 2) {
|
|
|
if (query === 'usable') {
|
|
|
return installmentModel.getQueryCreditInfo(uid).then((data) => {
|
|
|
if (data.status === 2) {
|
|
|
data.replayStatus = '逾期';
|
|
|
} else if (data.status === 3) {
|
|
|
data.replayStatus = '不可用';
|
|
|
}
|
|
|
|
|
|
return _.assign({
|
|
|
isUnable: true
|
|
|
isUnable: true,
|
|
|
installmentOnly: {
|
|
|
title: '分期专享',
|
|
|
goods: result[1]
|
|
|
}
|
|
|
}, data);
|
|
|
});
|
|
|
} else {
|
...
|
...
|
@@ -49,17 +57,19 @@ const index = (req, res) => { |
|
|
}, data);
|
|
|
});
|
|
|
}
|
|
|
|
|
|
}
|
|
|
}).then((result) => {
|
|
|
result.pageHeader = _.assign({
|
|
|
installmentPage: true
|
|
|
}, headerModel.setNav({
|
|
|
navTitle: '有货分期',
|
|
|
navBtn: false
|
|
|
}));
|
|
|
|
|
|
res.render('installment/open-index', _.assign({
|
|
|
module: 'home',
|
|
|
page: 'installment',
|
|
|
title: '有货分期',
|
|
|
pageHeader: headerModel.setNav({
|
|
|
navTitle: '有货分期',
|
|
|
navBtn: false
|
|
|
})
|
|
|
title: '有货分期'
|
|
|
}, result));
|
|
|
});
|
|
|
};
|
...
|
...
|
@@ -70,33 +80,32 @@ const review = (req, res) => { |
|
|
|
|
|
installmentModel.getStauts(uid).then((status) => {
|
|
|
if (status === 1) {
|
|
|
params = {
|
|
|
return {
|
|
|
review: {
|
|
|
url: helpers.urlFormat('/?go=1')
|
|
|
url: helpers.urlFormat('//m.yohobuy.com/product/new')
|
|
|
}
|
|
|
};
|
|
|
} else if (status === 2) {
|
|
|
params = {
|
|
|
return installmentModel.getSearchIntallment().then((goods) => {
|
|
|
return {
|
|
|
success: {
|
|
|
price: '5000',
|
|
|
installmentOnly: {
|
|
|
title: '分期专享',
|
|
|
goods: [
|
|
|
{
|
|
|
|
|
|
}
|
|
|
]
|
|
|
goods: goods
|
|
|
}
|
|
|
}
|
|
|
};
|
|
|
} else {
|
|
|
params = {
|
|
|
});
|
|
|
|
|
|
} else if (status === 3) {
|
|
|
return {
|
|
|
error: {
|
|
|
url: helpers.urlFormat('/?go=1')
|
|
|
url: helpers.urlFormat('//m.yohobuy.com/product/new')
|
|
|
}
|
|
|
};
|
|
|
}
|
|
|
|
|
|
}).then((params) => {
|
|
|
res.render('installment/open-result', _.assign({
|
|
|
module: 'home',
|
|
|
page: 'installment',
|
...
|
...
|
|