Authored by Aiden Xu

开通有货分期

... ... @@ -127,6 +127,27 @@ const startingService = (req, res) => {
});
};
const activateService = (req, res, next) => {
installmentModel.activateService({
uid: req.user.uid,
userName: req.body.userName,
identityCardNo: req.body.identityCardNo,
cardNo: req.body.cardNo,
mobile: req.body.mobile,
snsCheckCode: req.body.snsCheckCode
}).then((result)=> {
res.json(result);
}).catch(next);
};
const getBankInfo = (req, res, next) => {
installmentModel.getBankInfo({
cardNo: req.query.cardNo
}).then((result)=> {
res.json(result);
}).catch(next);
};
const verifyCode = (req, res, next) => {
installmentModel.sendVerifyCode(req.user.uid, req.body.mobile).then((result)=> {
res.json(result);
... ... @@ -137,5 +158,7 @@ module.exports = {
index,
review,
startingService,
verifyCode
activateService,
verifyCode,
getBankInfo
};
... ...
... ... @@ -137,11 +137,24 @@ const activateService = (params) => {
}, params);
};
/**
* 获取银行信息
*
* @param cardNo
* @returns {*}
*/
const getBankInfo = (cardNo) => {
return api.get('', {
method: 'user.instalment.getBankInfoByCardNo'
}, cardNo);
};
module.exports = {
getStauts,
getQueryCreditInfo,
getQueryAmtInfo,
getSearchIntallment,
sendVerifyCode,
activateService
activateService,
getBankInfo
};
... ...
... ... @@ -17,4 +17,6 @@ router.get('/installment/index', installment.index);// 开通分期首页
router.get('/installment/review', installment.review); // 开通分期首页
router.get('/installment/starting-service', installment.startingService); // 分期付款开通
router.get('/installment/starting-service/verify-code', installment.verifyCode);
router.get('/installment/bank-info', installment.getBankInfo);
router.post('/installment/activate-service', installment.activateService);
module.exports = router;
... ...
... ... @@ -15,8 +15,12 @@ module.exports = {
port: 6001,
siteUrl: '//m.yohobuy.com',
domains: {
api: 'http://devapi.yoho.cn:58078/',
service: 'http://devservice.yoho.cn:58077/'
// api: 'http://devapi.yoho.cn:58078/',
// service: 'http://devservice.yoho.cn:58077/'
// api: 'http://testapi.yoho.cn:28078/',
// 'http://testservice.yoho.cn:28077/'
api: 'http://dev-api.yohops.com:9999/',
service: 'http://dev-service.yohops.com:9999/'
},
subDomains: {
host: '.m.yohobuy.com',
... ...
... ... @@ -121,5 +121,7 @@ $('input').on('change', function() {
* 表单提交
*/
$('#apply-form').submit(function() {
console.log(formModel);
$.post('/home/installment/activate-service', formModel).then((result)=> {
console.log(result);
});
});
... ...