Authored by hf

Merge branch 'develop' of http://git.dev.yoho.cn/web/yohobuy into develop

... ... @@ -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) {
... ...
... ... @@ -4,7 +4,7 @@
<div class="content">
{{> passport/country_list}}
<div class="input-container phone-container row has-clear">
<span id="country-code" class="country-code">{{countryCode}}</span>
<span id="area-code" class="area-code">{{areaCode}}</span>
<input id="phone-num" class="input phone-num" type="text" placeholder="手机号">
</div>
<span id="btn-next" class="btn btn-next disable row">下一步</span>
... ...