Authored by xuqi

back js bugs

... ... @@ -6,7 +6,7 @@
var $ = require('yoho.zepto');
var $phoneNum = $('#phone-num'),
$countrySelector = $('#country-selector'),
$countrySelect = $('#country-select'),
$countryCode = $('#country-code'),
$btnNext = $('#btn-next');
... ... @@ -16,6 +16,8 @@ var tip = require('../../plugin/tip');
var trim = $.trim;
var showErrTip = tip.show;
api.selectCssHack($('#country-select'));
api.bindClearEvt();
$phoneNum.bind('input', function() {
... ... @@ -26,19 +28,19 @@ $phoneNum.bind('input', function() {
}
});
$countrySelector.change(function() {
$countryCode.text($countrySelector.val());
$countrySelect.change(function() {
$countryCode.text($countrySelect.val());
});
$btnNext.on('touchstart', function() {
var pn = trim($phoneNum.val()),
country = $countrySelector.val();
country = $countrySelect.val();
if ($btnNext.hasClass('disable')) {
return;
}
if (api.phoneRegx.test(pn)) {
if (api.phoneRegx[country].test(pn)) {
$.ajax({
url: '/passport/back/sendcode',
type: 'POST',
... ...
... ... @@ -64,7 +64,7 @@ $btnOk.on('touchstart', function() {
if (api.pwdValidate(pwd)) {
$.ajax({
type: 'POST',
url: '/passport/back/update',
url: url,
data: setting,
success: function(data) {
if (data.code === 200) {
... ...