...
|
...
|
@@ -3,17 +3,25 @@ |
|
|
* @author: wsl<shuiling.wang@yoho.cn>
|
|
|
* @date: 2016/08/01
|
|
|
*/
|
|
|
'use strict';
|
|
|
|
|
|
const headerModel = require('../../../doraemon/models/header');
|
|
|
const installmentModel = require('../models/installment');
|
|
|
const _ = require('lodash');
|
|
|
const helpers = global.yoho.helpers;
|
|
|
|
|
|
const index = (req, res) => {
|
|
|
res.render('installment/open-index', {
|
|
|
module: 'home',
|
|
|
page: 'installment',
|
|
|
title: '有货分期',
|
|
|
pageHeader: headerModel.setNav({
|
|
|
navTitle: '有货分期',
|
|
|
navBtn: false
|
|
|
}),
|
|
|
let uid = req.user.uid || 3236556;
|
|
|
let params = {};
|
|
|
let notOpen = false;
|
|
|
let isRepay = false;
|
|
|
|
|
|
// installmentModel.getStauts(uid).then((openStatus) => {
|
|
|
|
|
|
// });
|
|
|
|
|
|
if (notOpen) {
|
|
|
params = {
|
|
|
bannerTop: {
|
|
|
data: [
|
|
|
{
|
...
|
...
|
@@ -22,6 +30,7 @@ const index = (req, res) => { |
|
|
}
|
|
|
]
|
|
|
},
|
|
|
notOpen: notOpen,
|
|
|
installmentOnly: {
|
|
|
title: '分期专享',
|
|
|
goods: [
|
...
|
...
|
@@ -29,21 +38,89 @@ const index = (req, res) => { |
|
|
|
|
|
}
|
|
|
]
|
|
|
},
|
|
|
pageFooter: true
|
|
|
});
|
|
|
}
|
|
|
};
|
|
|
} else {
|
|
|
if (isRepay) {
|
|
|
params = {
|
|
|
repay: true,
|
|
|
price: '455',
|
|
|
day: '3',
|
|
|
monthPrice: '500',
|
|
|
sumPrice: '799',
|
|
|
isRepay: true
|
|
|
};
|
|
|
} else {
|
|
|
params = {
|
|
|
replayStatus: '逾期',
|
|
|
price: '500',
|
|
|
sumPrice: '1000',
|
|
|
isUnable: true,
|
|
|
installmentOnly: {
|
|
|
title: '分期专享',
|
|
|
goods: [
|
|
|
{
|
|
|
|
|
|
}
|
|
|
]
|
|
|
}
|
|
|
};
|
|
|
}
|
|
|
}
|
|
|
|
|
|
res.render('installment/open-index', _.assign({
|
|
|
module: 'home',
|
|
|
page: 'installment',
|
|
|
title: '有货分期',
|
|
|
pageHeader: headerModel.setNav({
|
|
|
navTitle: '有货分期',
|
|
|
navBtn: false
|
|
|
})
|
|
|
}, params));
|
|
|
};
|
|
|
|
|
|
const review = (req, res) => {
|
|
|
res.render('installment/result', {
|
|
|
let uid = req.user.uid || 20000032;
|
|
|
let params = {};
|
|
|
|
|
|
installmentModel.getStauts(uid).then((status) => {
|
|
|
if (status === 1) {
|
|
|
params = {
|
|
|
review: {
|
|
|
url: helpers.urlFormat('/?go=1')
|
|
|
}
|
|
|
};
|
|
|
} else if (status === 2) {
|
|
|
params = {
|
|
|
success: {
|
|
|
price: '5000',
|
|
|
installmentOnly: {
|
|
|
title: '分期专享',
|
|
|
goods: [
|
|
|
{
|
|
|
|
|
|
}
|
|
|
]
|
|
|
}
|
|
|
}
|
|
|
};
|
|
|
} else {
|
|
|
params = {
|
|
|
error: {
|
|
|
url: helpers.urlFormat('/?go=1')
|
|
|
}
|
|
|
};
|
|
|
}
|
|
|
|
|
|
res.render('installment/open-result', _.assign({
|
|
|
module: 'home',
|
|
|
page: 'installment',
|
|
|
title: '有货分期',
|
|
|
pageHeader: headerModel.setNav({
|
|
|
navTitle: '有货分期',
|
|
|
navBtn: false
|
|
|
}),
|
|
|
pageFooter: true
|
|
|
})
|
|
|
}, params));
|
|
|
});
|
|
|
};
|
|
|
|
...
|
...
|
|