Showing
1 changed file
with
7 additions
and
0 deletions
@@ -71,6 +71,7 @@ $usernameInput.bind('input propertychange', function() { | @@ -71,6 +71,7 @@ $usernameInput.bind('input propertychange', function() { | ||
71 | // 提交表单请求 | 71 | // 提交表单请求 |
72 | $addressForm.on('submit', function() { | 72 | $addressForm.on('submit', function() { |
73 | let username = $usernameInput.val().replace(/(^\s+)|(\s+$)/g, ''); | 73 | let username = $usernameInput.val().replace(/(^\s+)|(\s+$)/g, ''); |
74 | + let phone = $(this).find('[name="mobile"]').val(); | ||
74 | 75 | ||
75 | if (isSubmiting) { | 76 | if (isSubmiting) { |
76 | return false; | 77 | return false; |
@@ -95,6 +96,12 @@ $addressForm.on('submit', function() { | @@ -95,6 +96,12 @@ $addressForm.on('submit', function() { | ||
95 | tip.show('手机号不能为空'); | 96 | tip.show('手机号不能为空'); |
96 | return false; | 97 | return false; |
97 | } | 98 | } |
99 | + | ||
100 | + if (!(/^1[34578]\d{9}$/.test(phone))) { | ||
101 | + tip.show('请填写正确的手机号'); | ||
102 | + return false; | ||
103 | + } | ||
104 | + | ||
98 | if (!$(this).find('[name="area_code"]').val() || !$(this).find('[name="area"]').val() || | 105 | if (!$(this).find('[name="area_code"]').val() || !$(this).find('[name="area"]').val() || |
99 | $(this).find('[name="area_code"]').val().length < 6) { | 106 | $(this).find('[name="area_code"]').val().length < 6) { |
100 | tip.show('省市区不能为空'); | 107 | tip.show('省市区不能为空'); |
-
Please register or login to post a comment