...
|
...
|
@@ -7,7 +7,7 @@ var $ = require('yoho.zepto'); |
|
|
|
|
|
var $phoneNum = $('#phone-num'),
|
|
|
$countrySelect = $('#country-select'),
|
|
|
$countryCode = $('#country-code'),
|
|
|
$areaCode = $('#area-code'),
|
|
|
$pwd = $('#pwd'),
|
|
|
$loginBtn = $('#btn-login'),
|
|
|
|
...
|
...
|
@@ -61,25 +61,25 @@ $pwd.bind('input', function() { |
|
|
});
|
|
|
|
|
|
$countrySelect.change(function() {
|
|
|
$countryCode.text($countrySelect.val());
|
|
|
$areaCode.text($countrySelect.val());
|
|
|
});
|
|
|
|
|
|
$loginBtn.on('touchstart', function() {
|
|
|
var pn = trim($phoneNum.val()),
|
|
|
country = $countrySelect.val(),
|
|
|
areaCode = $countrySelect.val(),
|
|
|
pwd = trim($pwd.val());
|
|
|
|
|
|
if ($loginBtn.hasClass('disable')) {
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
if (api.phoneRegx[country].test(pn) && api.pwdValidate(pwd)) {
|
|
|
if (api.phoneRegx[areaCode].test(pn) && api.pwdValidate(pwd)) {
|
|
|
$.ajax({
|
|
|
type: 'POST',
|
|
|
url: '/passport/signin/auth',
|
|
|
url: '/passport/login/auth',
|
|
|
data: {
|
|
|
areaCode: country.split('+')[1],
|
|
|
phoneNum: pn,
|
|
|
areaCode: areaCode.replace('+', ''),
|
|
|
account: pn,
|
|
|
password: pwd
|
|
|
},
|
|
|
success: function(data) {
|
...
|
...
|
|