Authored by hf

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

@@ -7,7 +7,7 @@ var $ = require('yoho.zepto'); @@ -7,7 +7,7 @@ var $ = require('yoho.zepto');
7 7
8 var $phoneNum = $('#phone-num'), 8 var $phoneNum = $('#phone-num'),
9 $countrySelect = $('#country-select'), 9 $countrySelect = $('#country-select'),
10 - $countryCode = $('#country-code'), 10 + $areaCode = $('#area-code'),
11 $btnNext = $('#btn-next'); 11 $btnNext = $('#btn-next');
12 12
13 var api = require('../api'); 13 var api = require('../api');
@@ -29,23 +29,23 @@ $phoneNum.bind('input', function() { @@ -29,23 +29,23 @@ $phoneNum.bind('input', function() {
29 }); 29 });
30 30
31 $countrySelect.change(function() { 31 $countrySelect.change(function() {
32 - $countryCode.text($countrySelect.val()); 32 + $areaCode.text($countrySelect.val());
33 }); 33 });
34 34
35 $btnNext.on('touchstart', function() { 35 $btnNext.on('touchstart', function() {
36 var pn = trim($phoneNum.val()), 36 var pn = trim($phoneNum.val()),
37 - country = $countrySelect.val(); 37 + areaCode = $countrySelect.val();
38 38
39 if ($btnNext.hasClass('disable')) { 39 if ($btnNext.hasClass('disable')) {
40 return; 40 return;
41 } 41 }
42 42
43 - if (api.phoneRegx[country].test(pn)) { 43 + if (api.phoneRegx[areaCode].test(pn)) {
44 $.ajax({ 44 $.ajax({
45 url: '/passport/reg/verifymobile', 45 url: '/passport/reg/verifymobile',
46 type: 'POST', 46 type: 'POST',
47 data: { 47 data: {
48 - areaCode: country.split('+')[1], 48 + areaCode: areaCode.split('+')[1],
49 phoneNum: pn 49 phoneNum: pn
50 }, 50 },
51 success: function(data) { 51 success: function(data) {
@@ -4,7 +4,7 @@ @@ -4,7 +4,7 @@
4 <div class="content"> 4 <div class="content">
5 {{> passport/country_list}} 5 {{> passport/country_list}}
6 <div class="input-container phone-container row has-clear"> 6 <div class="input-container phone-container row has-clear">
7 - <span id="country-code" class="country-code">{{countryCode}}</span> 7 + <span id="area-code" class="area-code">{{areaCode}}</span>
8 <input id="phone-num" class="input phone-num" type="text" placeholder="手机号"> 8 <input id="phone-num" class="input phone-num" type="text" placeholder="手机号">
9 </div> 9 </div>
10 <span id="btn-next" class="btn btn-next disable row">下一步</span> 10 <span id="btn-next" class="btn btn-next disable row">下一步</span>