Authored by 王水玲

有货分期

... ... @@ -10,7 +10,7 @@ const _ = require('lodash');
const helpers = global.yoho.helpers;
// 判断是否已经获取到了开通的状态值
const _reviewStatus = (uid, status) => {
const _reviewStatus = (uid, status, next) => {
if (status === '1') {
return {
review: {
... ... @@ -28,7 +28,7 @@ const _reviewStatus = (uid, status) => {
}
}
};
});
}).catch(next);
} else if (status === '3') {
return {
... ... @@ -125,19 +125,26 @@ const review = (req, res, next) => {
let data = {
module: 'home',
page: 'installment',
title: '有货分期',
isInstallmentPage: true
title: '有货分期'
};
if (openStatus) {
res.render('installment/open-result', _.assign(data, _reviewStatus(uid, +openStatus)));
if (openStatus !== '2') {
res.render('installment/open-result', _.assign(data, _reviewStatus(uid, openStatus)));
} else {
installmentModel.getStauts(uid).then((status) => {
return _reviewStatus(uid, status);
}).then((params) => {
_reviewStatus(uid, openStatus, next).then((params) => {
res.render('installment/open-result', _.assign(data, params));
}).catch(next);
});
}
// if (openStatus) {
// res.render('installment/open-result', _.assign(data, _reviewStatus(uid, +openStatus)));
// } else {
// installmentModel.getStauts(uid).then((status) => {
// return _reviewStatus(uid, status);
// }).then((params) => {
// res.render('installment/open-result', _.assign(data, params));
// }).catch(next);
// }
};
// 逾期未还款列表
... ...
<div class="installment-page">
<div class="installment-page installment-result-page">
{{# review}}
<i class="review-icon"></i>
<p class="font-b">审核中</p>
<p class="font-p">审核结果会在5分钟内短信通知您</p>
<a href="{{url}}" class="open-btn">先去逛逛</a>
{{/review}}
{{#success}}
{{/ review}}
{{# success}}
<div class="success">
<i class="success-icon"></i>
<p class="font-b">可用额度</p>
<p class="installment-price">¥<span>{{round price}}</span></p>
<div class="open-btn">去逛逛</div>
<div class="success-bg">
<i class="success-icon"></i>
<p class="font-b">可用额度</p>
<p class="installment-price">¥<span>{{round price}}</span></p>
<div class="open-btn">去逛逛</div>
</div>
</div>
{{# installmentOnly}}
{{> installment/installment-only}}
{{/ installmentOnly}}
{{/success}}
{{#error}}
{{/ success}}
{{# error}}
<div class="error">
<i class="success-icon"></i>
<p class="error-txt1">审核未通过,暂时无法授信</p>
<p class="error-txt2">在有货更多的消费,增加信用度,<br>会大大提升审核通过率噢</p>
<a href="{{url}}" class="open-btn">去逛逛</a>
</div>
{{/error}}
{{/ error}}
</div>
... ...
... ... @@ -59,7 +59,7 @@
数据智能加密,保障您的用卡安全
</div>
<a href="/home/installment/starting-service?openby:yohobuy=%7B%22action%22%3A%22go.instalmentActivated%22%7D" id="apply-button" class="apply-button">下一步</a>
<a href="" id="apply-button" class="apply-button">下一步</a>
<div class="provider-mark">
Yoho!Buy信而富联合提供
</div>
... ...
... ... @@ -194,30 +194,46 @@ setInterval(function() {
*/
$('#apply-button').click(function() {
var ret = false;
var that = $(this);
if ($(this).hasClass('disabled') || !validateForm()) {
return false;
}
// $.ajax({
// method: 'post',
// url: '/home/installment/activate-service',
// data: formModel,
// async: false
// }).then(function(result) {
// if (result.code === 200) {
// if (result.data.result === 'success') {
// // 调用成功
// ret = true;
// } else {
// // 调用失败
// if (result.data.resultMsgType === '1') {
// tip.show(result.data.resultMsg);
// }
// clearVerifyCode();
// }
// } else {
// tip.show(result.message);
// clearVerifyCode();
// }
// });
$.ajax({
method: 'post',
url: '/home/installment/activate-service',
data: formModel,
async: false
}).then(function(result) {
if (result.code === 200) {
if (result.data.result === 'success') {
// 调用成功
ret = true;
} else {
// 调用失败
if (result.data.resultMsgType === '1') {
tip.show(result.data.resultMsg);
}
clearVerifyCode();
}
if (result.code === 200 && result.data) {
that.attr('href', '/home/installment/review?status=' + result.data.status);
ret = true;
} else {
tip.show(result.message);
clearVerifyCode();
... ...
... ... @@ -118,10 +118,14 @@
}
.success {
padding-bottom: 30px;
background: #efefef;
}
.success-bg {
background: #fff;
padding-bottom: 70px;
border-bottom: 1px solid #dedee0;
margin-bottom: 30px;
background: #fff;
}
.error {
... ... @@ -278,3 +282,7 @@
.installment-body {
background: #efefef;
}
.installment-result-page .installment-only {
margin-top: 0;
}
... ...