...
|
...
|
@@ -11,13 +11,13 @@ const helpers = global.yoho.helpers; |
|
|
|
|
|
// 判断是否已经获取到了开通的状态值
|
|
|
const _reviewStatus = (uid, status) => {
|
|
|
if (status === 1) {
|
|
|
if (status === '1') {
|
|
|
return {
|
|
|
review: {
|
|
|
url: helpers.urlFormat('/product/new')
|
|
|
}
|
|
|
};
|
|
|
} else if (status === 2) {
|
|
|
} else if (status === '2') {
|
|
|
return Promise.all([installmentModel.getSearchIntallment(), installmentModel.getQueryCreditInfo(uid)]).then((result) => { //eslint-disable-line
|
|
|
return {
|
|
|
success: {
|
...
|
...
|
@@ -30,7 +30,7 @@ const _reviewStatus = (uid, status) => { |
|
|
};
|
|
|
});
|
|
|
|
|
|
} else if (status === 3) {
|
|
|
} else if (status === '3') {
|
|
|
return {
|
|
|
error: {
|
|
|
url: helpers.urlFormat('/product/new')
|
...
|
...
|
@@ -49,6 +49,7 @@ const _repaymentList = (req, res, next, title, params) => { |
|
|
res.render('installment/repayment-list', {
|
|
|
module: 'home',
|
|
|
page: 'repayment-list',
|
|
|
isInstallmentPage: true,
|
|
|
title: title,
|
|
|
data: result
|
|
|
});
|
...
|
...
|
@@ -57,14 +58,14 @@ const _repaymentList = (req, res, next, title, params) => { |
|
|
|
|
|
// 开通分期首页
|
|
|
const index = (req, res, next) => {
|
|
|
let uid = req.user.uid || 3236556;
|
|
|
let uid = req.user.uid || 512579468;
|
|
|
|
|
|
Promise.all([installmentModel.getStauts(uid), installmentModel.getSearchIntallment()]).then((result) => {
|
|
|
|
|
|
// status:0 未申请 1审核中 2已开通 3 审核未通过
|
|
|
let openStatus = result[0];
|
|
|
|
|
|
if (openStatus === 0) {
|
|
|
if (openStatus === '0') {
|
|
|
return installmentModel.getResources().then(data => {
|
|
|
return {
|
|
|
bannerTop: data,
|
...
|
...
|
@@ -75,7 +76,7 @@ const index = (req, res, next) => { |
|
|
}
|
|
|
};
|
|
|
});
|
|
|
} else if (openStatus === 2) {
|
|
|
} else if (openStatus === '2') {
|
|
|
return Promise.all([installmentModel.getQueryCreditInfo(uid), installmentModel.getQueryAmtInfo(uid)]).then((data) => { //eslint-disable-line
|
|
|
let params = _.assign({
|
|
|
isOverdue: false,
|
...
|
...
|
@@ -111,6 +112,7 @@ const index = (req, res, next) => { |
|
|
res.render('installment/open-index', _.assign({
|
|
|
module: 'home',
|
|
|
page: 'installment',
|
|
|
isInstallmentPage: true,
|
|
|
title: '有货分期'
|
|
|
}, result));
|
|
|
}).catch(next);
|
...
|
...
|
@@ -119,11 +121,12 @@ const index = (req, res, next) => { |
|
|
// 开通结果显示
|
|
|
const review = (req, res, next) => {
|
|
|
let openStatus = req.query.status || false;
|
|
|
let uid = req.user.uid || 20000032;
|
|
|
let uid = req.user.uid || 512579468;
|
|
|
let data = {
|
|
|
module: 'home',
|
|
|
page: 'installment',
|
|
|
title: '有货分期'
|
|
|
title: '有货分期',
|
|
|
isInstallmentPage: true
|
|
|
};
|
|
|
|
|
|
if (openStatus) {
|
...
|
...
|
@@ -170,6 +173,7 @@ const repayRecordPage = (req, res) => { |
|
|
res.render('installment/repay-record', {
|
|
|
module: 'home',
|
|
|
page: 'repay-record',
|
|
|
isInstallmentPage: true,
|
|
|
title: '还款记录'
|
|
|
});
|
|
|
};
|
...
|
...
|
@@ -201,6 +205,7 @@ const account = (req, res, next) => { |
|
|
res.render('installment/account', {
|
|
|
accountList: result,
|
|
|
title: '账号管理',
|
|
|
isInstallmentPage: true,
|
|
|
repaymentList: result
|
|
|
});
|
|
|
}).catch(next);
|
...
|
...
|
@@ -232,7 +237,7 @@ const activateService = (req, res, next) => { |
|
|
const getBankInfo = (req, res, next) => {
|
|
|
installmentModel.getBankInfo({
|
|
|
cardNo: req.query.cardNo,
|
|
|
uid: req.user.uid || 3096590 // TODO: fix uid
|
|
|
uid: req.user.uid || 512579468 // TODO: fix uid
|
|
|
}).then((result)=> {
|
|
|
res.json(result);
|
|
|
}).catch(next);
|
...
|
...
|
@@ -255,7 +260,7 @@ const orderIndex = (req, res) => { |
|
|
|
|
|
const orderList = (req, res) => {
|
|
|
const params = {
|
|
|
uid: req.user.uid || 8041876, // TODO: fix me
|
|
|
uid: req.user.uid || 512579468, // TODO: fix me
|
|
|
type: req.query.type || 1,
|
|
|
page: req.query.page || 1,
|
|
|
limit: req.query.limit || 10
|
...
|
...
|
@@ -271,7 +276,7 @@ const orderList = (req, res) => { |
|
|
|
|
|
const orderDetail = (req, res) => {
|
|
|
const params = {
|
|
|
uid: req.user.id || 8041876, // TODO: fix me
|
|
|
uid: req.user.id || 512579468, // TODO: fix me
|
|
|
orderCode: req.params.id
|
|
|
};
|
|
|
|
...
|
...
|
@@ -287,8 +292,20 @@ const orderDetail = (req, res) => { |
|
|
};
|
|
|
|
|
|
// 还款详情
|
|
|
const repayDetail = (req, res) => {
|
|
|
res.render('installment/repay-detail');
|
|
|
const repayDetail = (req, res, next) => {
|
|
|
let params = {
|
|
|
uid: req.user.id || 512579468,
|
|
|
rePayNo: req.query.id || '',
|
|
|
pageNo: 1
|
|
|
};
|
|
|
|
|
|
installmentModel.getQueryRePayList(params).then((result) => {
|
|
|
res.render('installment/repay-detail', _.assign({
|
|
|
title: '还款详情',
|
|
|
isInstallmentPage: true,
|
|
|
isOne: true
|
|
|
}, result[0]));
|
|
|
}).catch(next);
|
|
|
};
|
|
|
|
|
|
module.exports = {
|
...
|
...
|
|