Authored by Aiden Xu

开通有货分期

... ... @@ -112,6 +112,8 @@ const review = (req, res) => {
const startingService = (req, res, next) => {
res.render('installment/starting-service', {
module: 'home',
page: 'installment.starting-service',
navTitle: '开通有货分期',
navBtn: false
});
... ...
<div class="installment-page">
<div class="installment-starting-service-page">
{{> resources/banner-top}}
<div class="exclamation">
基本信息的有效性决定您能否激活有货分期,以及最终可获得的额度!
... ...
... ... @@ -8,6 +8,7 @@ var winH = $(window).height(),
searching = false,
page = 0;
ellipsis.init();
function search() {
... ...
const $ = require('yoho-jquery');
const Timer = function() {
this.counter = 0;
this.countdownTimer = null;
};
/**
* 倒计时
*
* @param progress 进度回调
* @param complete 完成回调
*/
Timer.prototype.startCountdown = function(progress, complete) {
if (this.counter > 0 || this.countdownTimer) {
return;
} else {
this.counter = 59;
}
if (progress) {
progress.call(this, this.counter);
}
this.countdownTimer = setInterval(()=> {
this.counter--;
if (this.counter <= 0) {
if (complete) {
clearInterval(this.countdownTimer);
this.counter = 0;
this.countdownTimer = null;
complete.call(this);
}
}
if (progress && this.counter > 0) {
progress.call(this, this.counter);
}
}, 1000);
};
/**
* 点击发送短信事件
*/
$('#send-sms').click(function() {
new Timer().startCountdown(function(counter) {
$('#send-sms').text(counter + 's');
}, function() {
$('#send-sms').text('获取验证码');
});
return false;
});
$('#card-no').keydown(function() {
const value = $(this).val();
$(this).val(value.replace(/\s[^\d]/g, '').replace(/(\d{4})(?=\d)/g, '$1 '));
});
... ...
.installment-page {
.installment-starting-service-page {
.exclamation {
background-color: #ff7f7f;
color: white;
... ...