|
@@ -7,7 +7,7 @@ var $ = require('yoho.zepto'); |
|
@@ -7,7 +7,7 @@ var $ = require('yoho.zepto'); |
7
|
|
7
|
|
8
|
var $phoneNum = $('#phone-num'),
|
8
|
var $phoneNum = $('#phone-num'),
|
9
|
$countrySelect = $('#country-select'),
|
9
|
$countrySelect = $('#country-select'),
|
10
|
- $countryCode = $('#country-code'),
|
10
|
+ $areaCode = $('#area-code'),
|
11
|
$btnNext = $('#btn-next');
|
11
|
$btnNext = $('#btn-next');
|
12
|
|
12
|
|
13
|
var api = require('../api');
|
13
|
var api = require('../api');
|
|
@@ -29,23 +29,23 @@ $phoneNum.bind('input', function() { |
|
@@ -29,23 +29,23 @@ $phoneNum.bind('input', function() { |
29
|
});
|
29
|
});
|
30
|
|
30
|
|
31
|
$countrySelect.change(function() {
|
31
|
$countrySelect.change(function() {
|
32
|
- $countryCode.text($countrySelect.val());
|
32
|
+ $areaCode.text($countrySelect.val());
|
33
|
});
|
33
|
});
|
34
|
|
34
|
|
35
|
$btnNext.on('touchstart', function() {
|
35
|
$btnNext.on('touchstart', function() {
|
36
|
var pn = trim($phoneNum.val()),
|
36
|
var pn = trim($phoneNum.val()),
|
37
|
- country = $countrySelect.val();
|
37
|
+ areaCode = $countrySelect.val();
|
38
|
|
38
|
|
39
|
if ($btnNext.hasClass('disable')) {
|
39
|
if ($btnNext.hasClass('disable')) {
|
40
|
return;
|
40
|
return;
|
41
|
}
|
41
|
}
|
42
|
|
42
|
|
43
|
- if (api.phoneRegx[country].test(pn)) {
|
43
|
+ if (api.phoneRegx[areaCode].test(pn)) {
|
44
|
$.ajax({
|
44
|
$.ajax({
|
45
|
url: '/passport/reg/verifymobile',
|
45
|
url: '/passport/reg/verifymobile',
|
46
|
type: 'POST',
|
46
|
type: 'POST',
|
47
|
data: {
|
47
|
data: {
|
48
|
- areaCode: country.split('+')[1],
|
48
|
+ areaCode: areaCode.split('+')[1],
|
49
|
phoneNum: pn
|
49
|
phoneNum: pn
|
50
|
},
|
50
|
},
|
51
|
success: function(data) {
|
51
|
success: function(data) {
|