...
|
...
|
@@ -8,6 +8,8 @@ var phoneRegx = require('../common/mail-phone-regx').phoneRegx; |
|
|
var EventProxy = require('yoho-eventproxy');
|
|
|
|
|
|
var $regionCodeText = $('#region-code'),
|
|
|
$regionSelectList = $('#country-select-list'),
|
|
|
$regionSelectHeader = $('#country-select-header'),
|
|
|
$phoneNumInput = $('#phone-num'),
|
|
|
$imgCaptchaInput = $('#verifyCode'),
|
|
|
$imgCaptchaCtrl = $('.img-captcha-refresh'),
|
...
|
...
|
@@ -27,6 +29,13 @@ var $refer = $('#refer'); |
|
|
var second = 60,
|
|
|
ep = new EventProxy();
|
|
|
|
|
|
var upDown = {
|
|
|
up: '',
|
|
|
down: ''
|
|
|
};
|
|
|
|
|
|
var selectedIcon = '';
|
|
|
|
|
|
function errTip(ele, msg) {
|
|
|
var $errTip = ele.next('.tips');
|
|
|
var $errMsg = $errTip.find('.content');
|
...
|
...
|
@@ -104,10 +113,40 @@ ep.tail('phoneNum', 'img-captcha', 'sms-captcha', function(phoneAuth, imgAuth, s |
|
|
|
|
|
});
|
|
|
|
|
|
$('#region').change(function() {
|
|
|
var $this = $(this);
|
|
|
function changeHeader() {
|
|
|
var $indicator = $regionSelectHeader.find('.iconfont');
|
|
|
|
|
|
if ($regionSelectList.hasClass('hide')) {
|
|
|
$indicator.html(upDown.up);
|
|
|
} else {
|
|
|
$indicator.html(upDown.down);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
// 选择国家列表
|
|
|
$regionSelectList.on('click', '.option', function() {
|
|
|
var $clickItem = $(this);
|
|
|
var areaCode = $clickItem.data('code');
|
|
|
var name = $clickItem.data('value');
|
|
|
var $selectedItem = $clickItem.siblings('.selected');
|
|
|
|
|
|
$selectedItem.find('.iconfont').html('');
|
|
|
$selectedItem.removeClass('selected');
|
|
|
|
|
|
$clickItem.find('.iconfont').html(selectedIcon);
|
|
|
$clickItem.addClass('selected');
|
|
|
|
|
|
$regionSelectHeader.find('.name').html(name);
|
|
|
$regionCodeText.text(areaCode);
|
|
|
|
|
|
$regionSelectList.addClass('hide');
|
|
|
changeHeader();
|
|
|
});
|
|
|
|
|
|
$regionCodeText.text($this.val());
|
|
|
// 选择国家头
|
|
|
$regionSelectHeader.on('click', function() {
|
|
|
$regionSelectList.toggleClass('hide');
|
|
|
changeHeader();
|
|
|
});
|
|
|
|
|
|
ep.tail('phoneNum', 'img-captcha', function(phoneAuth, imgAuth) {
|
...
|
...
|
|