Merge branch 'feature/installment2a' into release/4.9.2
Showing
5 changed files
with
14 additions
and
14 deletions
@@ -463,6 +463,7 @@ const checkVerifyCode = (uid, mobile, code) => { | @@ -463,6 +463,7 @@ const checkVerifyCode = (uid, mobile, code) => { | ||
463 | method: method, | 463 | method: method, |
464 | mobile: mobile, | 464 | mobile: mobile, |
465 | snsCheckCode: code, | 465 | snsCheckCode: code, |
466 | + codeType: 1, // 授信 | ||
466 | debug: 'XYZ' | 467 | debug: 'XYZ' |
467 | }, { | 468 | }, { |
468 | timeout: API_TIMEOUT | 469 | timeout: API_TIMEOUT |
@@ -43,18 +43,12 @@ var debounceFn = debounce(function(cardNo, formModel) { | @@ -43,18 +43,12 @@ var debounceFn = debounce(function(cardNo, formModel) { | ||
43 | 43 | ||
44 | var checkCard = function(formModel) { | 44 | var checkCard = function(formModel) { |
45 | // 银行卡格式化 | 45 | // 银行卡格式化 |
46 | - $('#cardNo').keyup(function() { | 46 | + $('#cardNo').on('input', function() { |
47 | var value = $(this).val(); | 47 | var value = $(this).val(); |
48 | var cardNo = $(this).val().replace(/\s/g, ''); | 48 | var cardNo = $(this).val().replace(/\s/g, ''); |
49 | 49 | ||
50 | $(this).val(value.replace(/[^\d]/g, '').replace(/(\d{4})(?=\d)/g, '$1 ')).trigger('change'); | 50 | $(this).val(value.replace(/[^\d]/g, '').replace(/(\d{4})(?=\d)/g, '$1 ')).trigger('change'); |
51 | 51 | ||
52 | - if (cardNo && cardNo.length < 16) { | ||
53 | - $('#bank-desc').hide(); | ||
54 | - } | ||
55 | - }).blur(function() { | ||
56 | - var cardNo = $(this).val().replace(/\s/g, ''); | ||
57 | - | ||
58 | if (cardNo && cardNo.length >= 16) { | 52 | if (cardNo && cardNo.length >= 16) { |
59 | debounceFn(cardNo, formModel); | 53 | debounceFn(cardNo, formModel); |
60 | } else { | 54 | } else { |
@@ -35,14 +35,15 @@ var validateForm = function() { | @@ -35,14 +35,15 @@ var validateForm = function() { | ||
35 | 35 | ||
36 | checkCard(formData); | 36 | checkCard(formData); |
37 | 37 | ||
38 | -// 输入框改变时同时更新模型 | ||
39 | -$('input').on('input', function() { | ||
40 | - var name = $(this).attr('name'); | ||
41 | - | ||
42 | - formData[name] = $(this).val(); | 38 | +// 定时更新模型,解决各种浏览器奇葩问题终极办法 |
39 | +setInterval(function() { | ||
40 | + $('input').each(function() { | ||
41 | + var name = $(this).attr('name'); | ||
43 | 42 | ||
43 | + formData[name] = $(this).val(); | ||
44 | + }); | ||
44 | validateForm(); | 45 | validateForm(); |
45 | -}); | 46 | +}, 500); |
46 | 47 | ||
47 | applyButton.on('click', function() { | 48 | applyButton.on('click', function() { |
48 | var self = this; | 49 | var self = this; |
@@ -139,6 +139,8 @@ $('#send-sms').click(function() { | @@ -139,6 +139,8 @@ $('#send-sms').click(function() { | ||
139 | return false; | 139 | return false; |
140 | } | 140 | } |
141 | 141 | ||
142 | + $(self).data('running', true); | ||
143 | + | ||
142 | $.get('/home/installment/starting-service/verify-code', { | 144 | $.get('/home/installment/starting-service/verify-code', { |
143 | mobile: formModel.mobile | 145 | mobile: formModel.mobile |
144 | }).then(function(result) { | 146 | }).then(function(result) { |
@@ -158,6 +160,8 @@ $('#send-sms').click(function() { | @@ -158,6 +160,8 @@ $('#send-sms').click(function() { | ||
158 | tip.show(result.message); | 160 | tip.show(result.message); |
159 | $(self).data('running', false); | 161 | $(self).data('running', false); |
160 | } | 162 | } |
163 | + }).done(function() { | ||
164 | + $(self).data('running', false); | ||
161 | }); | 165 | }); |
162 | 166 | ||
163 | return false; | 167 | return false; |
@@ -73,7 +73,7 @@ a { | @@ -73,7 +73,7 @@ a { | ||
73 | display: none; | 73 | display: none; |
74 | text-align: center; | 74 | text-align: center; |
75 | width: 70%; | 75 | width: 70%; |
76 | - padding: 34PX 0; | 76 | + padding: 18PX 55PX; |
77 | top: 50%; | 77 | top: 50%; |
78 | left: 50%; | 78 | left: 50%; |
79 | margin-left: -35%; | 79 | margin-left: -35%; |
-
Please register or login to post a comment