Authored by 徐炜

Merge remote-tracking branch 'origin/feature/installment2a' into feature/installment2a

# Conflicts:
#	public/js/home/installment.starting-service.page.js
Showing 40 changed files with 417 additions and 168 deletions
... ... @@ -10,11 +10,9 @@ const _ = require('lodash');
const helpers = global.yoho.helpers;
// 服务器报错页面
const _serverCrash = (res, url) => {
res.render('installment/server-crash', {
url: url
});
const _serverCrash = (res, params) => {
params.title = params.title || '有货分期';
res.render('installment/server-crash', params);
};
// 判断是否已经获取到了开通的状态值
... ... @@ -35,21 +33,27 @@ const _reviewStatus = (res, req, uid, status) => {
success: {
price: result[1].currCreditLimit,
installmentOnly: {
title: '分期专享',
title: {
title: '分期专享',
moreUrl: helpers.appUrlFormat(req.originalUrl, 'go.instalmentlist', {
title: '分期专享'
})
},
goods: result[0]
},
url: jumpUrl
}
};
}).catch(() => {
_serverCrash(res, req.originalUrl);
_serverCrash(res, {
url: req.originalUrl,
title: '分期专享'
});
});
} else if (status === '3') {
return {
error: {
url: jumpUrl
}
error: true
};
} else if (status === '4') {
return {
... ... @@ -75,7 +79,10 @@ const _repaymentList = (req, res, title, params) => {
data: result
});
}).catch(() => {
_serverCrash(res, req.originalUrl);
_serverCrash(res, {
url: req.originalUrl,
title: title
});
});
};
... ... @@ -90,7 +97,12 @@ const index = (req, res) => {
// status:0 未申请 1审核中 2已开通 3 审核未通过
let openStatus = result[0];
let installmentOnly = {
title: '分期专享',
title: {
title: '分期专享',
moreUrl: helpers.appUrlFormat(req.originalUrl, 'go.instalmentlist', {
title: '分期专享'
})
},
goods: result[1]
};
... ... @@ -134,7 +146,9 @@ const index = (req, res) => {
title: '有货分期'
}, result));
}).catch(() => {
_serverCrash(res, req.originalUrl);
_serverCrash(res, {
url: req.originalUrl
});
});
};
... ... @@ -152,7 +166,9 @@ const getInstallmentGoods = (req, res) => {
res.json();
}
}).catch(() => {
_serverCrash(res, req.originalUrl);
_serverCrash(res, {
url: req.originalUrl
});
});
};
... ... @@ -230,7 +246,10 @@ const getRepayRecord = (req, res) => {
res.json();
}
}).catch(() => {
_serverCrash(res, req.originalUrl);
_serverCrash(res, {
url: req.originalUrl,
title: '还款记录'
});
});
};
... ... @@ -264,7 +283,10 @@ const postAccount = (req, res) => {
installmentModel.postAccount(params).then((result) => {
res.json(result);
}).catch(() => {
_serverCrash(res, req.originalUrl);
_serverCrash(res, {
url: req.originalUrl,
title: '使用新卡还款'
});
});
};
... ... @@ -308,7 +330,10 @@ const activateService = (req, res) => {
}).then((result)=> {
res.json(result);
}).catch(() => {
_serverCrash(res, req.originalUrl);
_serverCrash(res, {
url: req.originalUrl,
title: '开通有货分期'
});
});
};
... ... @@ -319,7 +344,9 @@ const getBankInfo = (req, res) => {
}).then((result)=> {
res.json(result);
}).catch(() => {
_serverCrash(res, req.originalUrl);
_serverCrash(res, {
url: req.originalUrl
});
});
};
... ... @@ -327,7 +354,9 @@ const verifyCode = (req, res) => {
installmentModel.sendVerifyCode(req.cookies.installmentUid || 1, req.query.mobile).then((result)=> {
res.json(result);
}).catch(() => {
_serverCrash(res, req.originalUrl);
_serverCrash(res, {
url: req.originalUrl
});
});
};
... ... @@ -370,7 +399,10 @@ const orderList = (req, res) => {
isInstallmentPage: true
});
}).catch(() => {
_serverCrash(res, req.originalUrl);
_serverCrash(res, {
url: req.originalUrl,
title: '我的分期订单'
});
});
};
... ... @@ -458,7 +490,10 @@ const orderDetail = (req, res) => {
}
});
}).catch(() => {
_serverCrash(res, req.originalUrl);
_serverCrash(res, {
url: req.originalUrl,
title: '分期详情'
});
});
};
... ... @@ -477,7 +512,10 @@ const repayDetail = (req, res) => {
isOne: true
}, result[0]));
}).catch(() => {
_serverCrash(res, req.originalUrl);
_serverCrash(res, {
url: req.originalUrl,
title: '还款详情'
});
});
};
... ... @@ -500,7 +538,9 @@ const totalAmount = (req, res) => {
installmentModel.totalAmount(req.query.prices).then((result) => {
res.json(result);
}).catch(() => {
_serverCrash(res, req.originalUrl);
_serverCrash(res, {
url: req.originalUrl
});
});
};
... ... @@ -509,7 +549,9 @@ const checkVerifyCode = (req, res) => {
installmentModel.checkVerifyCode(req.cookies.installmentUid, req.query.mobile, req.query.code).then((result) => {
res.json(result);
}).catch(() => {
_serverCrash(res, req.originalUrl);
_serverCrash(res, {
url: req.originalUrl
});
});
};
... ... @@ -529,7 +571,10 @@ const bankCard = (req, res) => {
accountList: result
});
}).catch(() => {
_serverCrash(res, req.originalUrl);
_serverCrash(res, {
url: req.originalUrl,
title: '我的银行卡'
});
});
};
... ...
... ... @@ -107,7 +107,6 @@ const _processAmtList = (listData, queryDays) => {
// 处理还款记录数据
const _processRepayList = (list) => {
if (list !== 'NULL') {
_.forEach(list.rePayList, (data) => {
if (data.status === 1) {
... ... @@ -472,6 +471,14 @@ const checkVerifyCode = (uid, mobile, code) => {
});
};
// 添加银行卡请求
const postAccount = (params) => {
return api.get('', _.assign({
method: 'user.instalment.bindingCards',
debug: 'XYZ'
}, params));
};
module.exports = {
getStauts,
getQueryCreditInfo,
... ... @@ -487,5 +494,6 @@ module.exports = {
getInstallmentOrders,
getInstallmentOrderDetail,
totalAmount,
checkVerifyCode
checkVerifyCode,
postAccount
};
... ...
... ... @@ -13,7 +13,7 @@ const installment = require(cRoot + '/installment');
const router = express.Router(); // eslint-disable-line
// 分期付款
router.get('/installment/index', installment.index);// 开通分期首页
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);
... ... @@ -39,7 +39,7 @@ router.get('/installment/order/:id', installment.orderDetail);
router.get('/installment/total-amount.json', installment.totalAmount);
router.get('/installment/help', installment.help);// 帮助静态页面
router.get('/installment/agreement', installment.agreement);// 服务协议\服务条款静态页面
router.get('/installment/agreement', installment.agreement);// 服务协议静态页面
router.get('/installment/server-crash', installment.serverCrash); // 服务器崩溃
router.get('/installment/bank-card', installment.bankCard); // 银行卡列表
... ...
This diff could not be displayed because it is too large.
<div class="bank-card-page">
<ul class="bank-card-list">
{{#accountList}}
<li class="card-bg"><span>{{cardNo}}</span></li>
<li class="card-bg-{{lowerCase bankCode}}"><span>{{cardNo}}</span></li>
{{/accountList}}
</ul>
</div>
... ...
<div class="installment-page add-account-page">
{{#bindCard}}
<ul class="add-form">
<li>
<label>持卡人</label>
<div class="username">{{userName}}</div>
</li>
<li>
<label>银行卡</label>
<input id="cardNo" name="cardNo" type="tel" placeholder="请输入本人银行卡号" size="26" maxlength="23">
</li>
<li id="bank-desc" style="display: none;">
<div class="bank-info">
<img id="bank-icon" src="" alt="">
<span id="bank-name"></span>
</div>
</li>
<li>
<label>手机号</label>
<input type="number" placeholder="请输入银行预留手机号" id="mobile" name="mobile" pattern="\d*" maxlength="11">
</li>
</ul>
<a href="" class="open-btn disabled">下一步</a>
<a href="" class="jumpResult">&nbsp;</a>
{{/bindCard}}
<div class="success">
<i class="success-icon"></i>
<p class="success-txt">恭喜您,新增还款银行卡成功!</p>
<a href="" class="open-btn">确认</a>
</div>
<div class="error">
<i class="error-icon"></i>
<p class="error-txt1">对不起,绑定银行卡失败</p>
<p class="error-txt2">失败的原因可能是:银行卡户名、<br/>银行卡、预留手机号不一致</p>
<a href="{{url}}" class="open-btn">重新绑定银行卡</a>
<p class="contact-cs">如有疑问,请联系客服</p>
</div>
</div>
... ...
... ... @@ -143,5 +143,4 @@
如您在使用有货分期过程中遇到还款及资金安全方面问题您可联系信而富客服为,您进行相关处理和解答,联系电话:400-688-8692(工作日9:00-18:00),如您无法联系信而富客服您可联系有货客服,我们将在3个工作日内给您回复,感谢您的理解与支持!
</p>
</div>
</div>
... ...
... ... @@ -35,7 +35,7 @@
<p class="detail-txt1">近7日待还款</p>
<p class="detail-txt1">¥<span class="detail-txt2">{{dayAmt}}</span></p>
{{#if isOverdue}}
<p class="detail-txt3">您有¥{{overAmt}}已逾期,点击<a href="/home/installment/repay/overdue">查看详情</a></p>
<p class="detail-txt3">您有¥{{overAmt}}已逾期,点击<a href="/home/installment/repay/overdue">查看详情</a></p>
{{/if}}
<a href="/home/installment/repay/7daylist" class="see-btn">明细</a>
</div>
... ...
... ... @@ -20,10 +20,10 @@
{{/ 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>
<i class="error-icon"></i>
<p class="error-txt1">审核未通过暂时无法授信</p>
<p class="error-txt2">可能原因:姓名、身份证、银行卡不匹配</p>
<a href="/home/installment/starting-service" class="open-btn">重新申请</a>
</div>
{{/ error}}
{{#cancel}}
... ...
... ... @@ -90,5 +90,4 @@
{{#isRepaymentAllCompleted order.status}}
<div class="all-completed">已还清</div>
{{/isRepaymentAllCompleted}}
</div>
</div>
\ No newline at end of file
... ...
... ... @@ -21,4 +21,3 @@
</li>
{{/each}}
{{/if}}
... ...
... ... @@ -32,5 +32,5 @@
</ul>
{{> installment/repayment-bottom}}
{{/if}}
{{/data}}
{{/data}}
</div>
... ...
... ... @@ -53,7 +53,7 @@
</div>
<div class="agreements">
<input id="accept-agreements" name="agreements" type="checkbox" class="installment-check-btn"/>
<input id="accept-agreements" name="agreements" type="checkbox" class="installment-check-btn" checked/>
<label for="accept-agreements">
<div class="text-label">免费开通,详情请见
<a id="agreements" href="" data-href="/home/installment/agreement">《有货分期-信而富用户服务协议&借款服务协议》</a>
... ...
<div class="installment-only">
<h2>{{title}}</h2>
{{!--<h2>{{title}}</h2>--}}
{{> common/floor-header-more}}
<div id="goods-list" class="goods-list clearfix">
{{# goods}}
{{> common/goods}}
... ...
... ... @@ -19,6 +19,8 @@ module.exports = {
// service: 'http://192.168.102.14:8080/gateway/'
api: 'http://api-test3.yohops.com:9999/',
// api: 'http://172.16.6.179:8080/gateway',
service: 'http://service-test3.yohops.com:9999/'
// api: 'http://172.16.6.179:8080/gateway/',
... ...

5.13 KB | W: | H:

1.65 MB | W: | H:

  • 2-up
  • Swipe
  • Onion skin
... ... @@ -45,10 +45,14 @@ var checkCard = function(formModel) {
// 银行卡格式化
$('#cardNo').keyup(function() {
var value = $(this).val();
var cardNo = $(this).val().replace(/\s/g, '');
$(this).val(value.replace(/[^\d]/g, '').replace(/(\d{4})(?=\d)/g, '$1 ')).trigger('change');
}).change(function() {
if (cardNo && cardNo.length < 16) {
$('#bank-desc').hide();
}
}).blur(function() {
var cardNo = $(this).val().replace(/\s/g, '');
if (cardNo && cardNo.length >= 16) {
... ...
... ... @@ -20,7 +20,7 @@ var validateForm = function() {
var ret = false;
if (formData.cardNo &&
formData.mobile &&
formData.mobile.length === 11 &&
formData.bankName &&
formData.bankCode) {
applyButton.removeClass('disabled');
... ... @@ -36,7 +36,7 @@ var validateForm = function() {
checkCard(formData);
// 输入框改变时同时更新模型
$('input').on('change', function() {
$('input').on('input', function() {
var name = $(this).attr('name');
formData[name] = $(this).val();
... ... @@ -88,4 +88,3 @@ applyButton.on('click', function() {
}
});
});
... ...
... ... @@ -15,7 +15,7 @@ var FormModel = function() {
bankCode: '',
mobile: '',
snsCheckCode: '',
agreements: ''
agreements: 'on'
});
};
... ... @@ -59,6 +59,7 @@ const clearVerifyCode = function() {
$('#sns-check-code').val('');
};
checkCard(formModel);
/**
... ... @@ -159,7 +160,7 @@ $('#send-sms').click(function() {
return false;
});
// 输入框改变时同时更新模型
/*
$('input').on('change', function() {
var name = $(this).attr('name');
... ... @@ -202,31 +203,6 @@ $('#apply-button').click(function() {
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: 'get',
async: false,
... ...
... ... @@ -44,22 +44,26 @@ var repayment = new Repayment({
require('./overdue-notice');
$(CHECKBOX_SELECTOR + ':checkbox').click(function() {
var selection = repayment.getSelection();
var isSkipped = false;
var lastIndex = 0;
var self = this;
var isSkipped = false,
self = this,
billNo = $(self).parent().data('billNo'),
li = $('li[data-bill-no=' + billNo + ']'),
selection = li.find('input:checked'),
lastIndex = li.eq(0).index();
selection.forEach(function(sel) {
if ((sel.index + 1) - lastIndex > 1) {
selection.parent().each(function(index, sel) {
var key = $(sel).index();
if ((key + 1) - lastIndex > 1) {
isSkipped = true;
} else {
lastIndex = sel.index + 1;
lastIndex = key + 1;
}
});
if (isSkipped) {
setTimeout(function() {
tip.show($(self).is(':checked') ? '请按时间顺序取消选择,不可以跨期' : '请按时间顺序添加还款,不可以跨期');
tip.show('同一个分期订单不能跨期还款,请按时间顺序还款');
}, 0);
return false;
}
... ...
.add-account-page {
.add-form {
margin: 30px 0 80px;
background: #fff;
border-top: 1px solid #e0e0e0;
border-bottom: 1px solid #e0e0e0;
overflow: hidden;
box-sizing: border-box;
li {
width: 100%;
height: 86px;
border-top: 1px solid #e0e0e0;
margin-left: 30px;
box-sizing: border-box;
}
li:first-child {
border-top: none;
}
label {
color: #444;
font-size: 34px;
float: left;
line-height: 86px;
}
input {
font-size: 28px;
height: 40px;
line-height: 40px;
color: #444;
float: left;
border: none;
background: transparent;
margin: 23px 0 0 60px;
width: 410px;
font-family: helvetica, Arial, "黑体";
}
.username {
color: #b0b0b0;
float: left;
font-size: 28px;
width: 410px;
height: 40px;
margin: 23px 0 0 60px;
line-height: 40px;
}
.bank-info {
padding-left: 165px;
margin-top: 26px;
img {
width: 32px;
height: 32px;
display: inline-block;
}
span {
line-height: 32px;
position: absolute;
margin-left: 10px;
margin-top: 1px;
}
}
}
.disabled {
opacity: 0.5;
}
.success {
display: none;
.success-icon {
margin-top: 208px;
}
.success-txt {
text-align: center;
font-size: 24px;
color: #444;
margin-bottom: 90px;
}
}
.error {
display: none;
.error-txt1 {
color: #444;
font-size: 24px;
}
.error-txt2 {
color: #b0b0b0;
font-size: 22px;
line-height: 36px;
margin: 10px 0 105px;
}
.contact-cs {
width: 100%;
position: fixed;
bottom: 45px;
text-align: center;
color: #444;
font-size: 28px;
}
}
}
... ...
... ... @@ -20,4 +20,49 @@
font-size: 40px;
}
}
.card-bg-abc {
background: resolve("home/bank-icons/bank-ABC.png") no-repeat;
background-size: contain;
}
.card-bg-boc {
background: resolve("home/bank-icons/bank-BOC.png") no-repeat;
background-size: contain;
}
.card-bg-ccb {
background: resolve("home/bank-icons/bank-CCB.png") no-repeat;
background-size: contain;
}
.card-bg-ceb {
background: resolve("home/bank-icons/bank-CEB.png") no-repeat;
background-size: contain;
}
.card-bg-cib {
background: resolve("home/bank-icons/bank-CIB.png") no-repeat;
background-size: contain;
}
.card-bg-citic {
background: resolve("home/bank-icons/bank-CITIC.png") no-repeat;
background-size: contain;
}
.card-bg-cmbc {
background: resolve("home/bank-icons/bank-CMBC.png") no-repeat;
background-size: contain;
}
.card-bg-guangda {
background: resolve("home/bank-icons/bank-guangda.png") no-repeat;
background-size: contain;
}
.card-bg-icbc {
background: resolve("home/bank-icons/bank-ICBC.png") no-repeat;
background-size: contain;
}
.card-bg-payh {
background: resolve("home/bank-icons/bank-PAYH.png") no-repeat;
background-size: contain;
}
.card-bg-psbc {
background: resolve("home/bank-icons/bank-PSBC.png") no-repeat;
background-size: contain;
}
}
... ...
.installment-help {
padding: 30px;
margin: 0;
background-color: #fff;
font-family: "微软雅黑";
color: #444;
font-weight: 300;
.help-title {
text-align: center;
font-size: 28px;
margin-top: 10px;
font-weight: bold;
}
.help-group {
text-align: left;
margin: 0 5px 45px;
h2 {
font-size: 26px;
font-weight: bold;
}
p {
font-size: 26px;
line-height: 40px;
margin-top: 10px;
}
.remind {
color: #f00;
}
.underline {
text-decoration: underline;
}
.bold {
font-weight: bold;
}
ul {
list-style: disc;
list-style-position: inside;
margin-left: 22px;
}
table {
width: 92%;
text-align: center;
margin: 0 4%;
border: 1px solid #000;
font-size: 22px;
td {
text-align: center;
border-right: 1px solid #000;
}
tr:last-child {
border-top: 1px solid #000;
}
}
}
}
.installment-agreement {
p {
text-indent: 2em;
}
ul {
list-style-type: none;
li {
display: inline-block;
}
}
.indent2 {
text-indent: 2em;
display: inline-block;
}
}
.installment-help {
padding: 30px;
margin: 0;
background-color: #fff;
font-family: "微软雅黑";
color: #444;
font-weight: 300;
.help-title {
text-align: center;
font-size: 28px;
margin-top: 10px;
font-weight: bold;
}
.help-group {
text-align: left;
margin: 0 5px 45px;
h2 {
font-size: 26px;
font-weight: bold;
}
p {
font-size: 26px;
line-height: 40px;
margin-top: 10px;
}
.remind {
color: #f00;
}
.underline {
text-decoration: underline;
}
.bold {
font-weight: bold;
}
ul {
list-style: disc;
list-style-position: inside;
margin-left: 22px;
}
table {
width: 92%;
text-align: center;
margin: 0 4%;
border: 1px solid #000;
font-size: 22px;
td {
text-align: center;
border-right: 1px solid #000;
}
tr:last-child {
border-top: 1px solid #000;
}
}
}
}
.installment-agreement {
p {
text-indent: 2em;
}
ul {
list-style-type: none;
li {
display: inline-block;
}
}
.indent2 {
text-indent: 2em;
display: inline-block;
}
}
... ...
... ... @@ -2,6 +2,7 @@
@import "starting-service";
@import "repayment-list";
@import "order";
@import "add-account";
@import "help";
@import "bank-card";
... ...
... ... @@ -64,6 +64,7 @@
border-radius: 6px;
margin: 0 auto;
display: block;
font-size: 28px;
}
.installment-only {
... ... @@ -71,6 +72,13 @@
margin-top: 30px;
border-top: 1px solid #dedee0;
.floor-header-more {
height: 85px;
line-height: 85px;
margin: 0;
border-top: none;
}
h2 {
height: 85px;
line-height: 85px;
... ... @@ -93,7 +101,7 @@
margin: 214px auto 50px;
}
.success-icon {
.error-icon {
background: resolve("home/review-img-2.png") no-repeat;
background-size: contain;
width: 208px;
... ...
... ... @@ -360,6 +360,10 @@
float: right;
color: #b1b1b1;
}
a {
display: block;
}
}
}
}
... ...