...
|
...
|
@@ -7,7 +7,7 @@ var $ = require('yoho.zepto'); |
|
|
|
|
|
var $phoneNum = $('#phone-num'),
|
|
|
$countrySelect = $('#country-select'),
|
|
|
$countryCode = $('#country-code'),
|
|
|
$areaCode = $('#area-code'),
|
|
|
$btnNext = $('#btn-next');
|
|
|
|
|
|
var api = require('../api');
|
...
|
...
|
@@ -29,23 +29,23 @@ $phoneNum.bind('input', function() { |
|
|
});
|
|
|
|
|
|
$countrySelect.change(function() {
|
|
|
$countryCode.text($countrySelect.val());
|
|
|
$areaCode.text($countrySelect.val());
|
|
|
});
|
|
|
|
|
|
$btnNext.on('touchstart', function() {
|
|
|
var pn = trim($phoneNum.val()),
|
|
|
country = $countrySelect.val();
|
|
|
areaCode = $countrySelect.val();
|
|
|
|
|
|
if ($btnNext.hasClass('disable')) {
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
if (api.phoneRegx[country].test(pn)) {
|
|
|
if (api.phoneRegx[areaCode].test(pn)) {
|
|
|
$.ajax({
|
|
|
url: '/passport/reg/verifymobile',
|
|
|
type: 'POST',
|
|
|
data: {
|
|
|
areaCode: country.split('+')[1],
|
|
|
areaCode: areaCode.split('+')[1],
|
|
|
phoneNum: pn
|
|
|
},
|
|
|
success: function(data) {
|
...
|
...
|
|