...
|
...
|
@@ -6,6 +6,7 @@ var api = require('./api'); |
|
|
var $countrySelect,
|
|
|
$areaCode,
|
|
|
$nextBtn,
|
|
|
$resetBtn,
|
|
|
$phoneNum;
|
|
|
|
|
|
var page = {
|
...
|
...
|
@@ -13,14 +14,13 @@ var page = { |
|
|
init: function() {
|
|
|
this.domInit();
|
|
|
this.bindEvent();
|
|
|
|
|
|
this.toggleNextBtn();
|
|
|
},
|
|
|
domInit: function() {
|
|
|
$countrySelect = $('#country-select');
|
|
|
$areaCode = $('#area-code');
|
|
|
$nextBtn = $('#btn-next');
|
|
|
$phoneNum = $('#phone-num');
|
|
|
$resetBtn = $('.clear-input');
|
|
|
},
|
|
|
bindEvent: function() {
|
|
|
var self = this;
|
...
|
...
|
@@ -35,6 +35,14 @@ var page = { |
|
|
$nextBtn.on('click', function() {
|
|
|
!self.disableAjax && self.goNext();
|
|
|
});
|
|
|
|
|
|
$resetBtn.on('click', function() {
|
|
|
$phoneNum.val('');
|
|
|
$nextBtn
|
|
|
.prop('disable', true)
|
|
|
.toggleClass('disable', true);
|
|
|
$resetBtn.hide();
|
|
|
});
|
|
|
},
|
|
|
|
|
|
// 切换$nextBtn disable状态
|
...
|
...
|
@@ -44,6 +52,8 @@ var page = { |
|
|
$nextBtn
|
|
|
.toggleClass('disable', !bool)
|
|
|
.prop('disable', !bool);
|
|
|
|
|
|
$resetBtn.toggle(bool);
|
|
|
},
|
|
|
|
|
|
// 提交按钮
|
...
|
...
|
|