|
@@ -46,18 +46,12 @@ var debounceFn = debounce(function(cardNo, formModel) { |
|
@@ -46,18 +46,12 @@ var debounceFn = debounce(function(cardNo, formModel) { |
46
|
|
46
|
|
47
|
var checkCard = function(formModel) {
|
47
|
var checkCard = function(formModel) {
|
48
|
// 银行卡格式化
|
48
|
// 银行卡格式化
|
49
|
- $('#cardNo').keyup(function() {
|
49
|
+ $('#cardNo').on('input', function() {
|
50
|
var value = $(this).val();
|
50
|
var value = $(this).val();
|
51
|
var cardNo = $(this).val().replace(/\s/g, '');
|
51
|
var cardNo = $(this).val().replace(/\s/g, '');
|
52
|
|
52
|
|
53
|
$(this).val(value.replace(/[^\d]/g, '').replace(/(\d{4})(?=\d)/g, '$1 ')).trigger('change');
|
53
|
$(this).val(value.replace(/[^\d]/g, '').replace(/(\d{4})(?=\d)/g, '$1 ')).trigger('change');
|
54
|
|
54
|
|
55
|
- if (cardNo && cardNo.length < 16) {
|
|
|
56
|
- $('#bank-desc').hide();
|
|
|
57
|
- }
|
|
|
58
|
- }).blur(function() {
|
|
|
59
|
- var cardNo = $(this).val().replace(/\s/g, '');
|
|
|
60
|
-
|
|
|
61
|
if (cardNo && cardNo.length >= 16) {
|
55
|
if (cardNo && cardNo.length >= 16) {
|
62
|
debounceFn(cardNo, formModel);
|
56
|
debounceFn(cardNo, formModel);
|
63
|
} else {
|
57
|
} else {
|