Authored by htoooth

调整样式名

1 -{{> layout/header}}  
2 -<div class="passport-page yoho-page clearfix">  
3 - {{# passport}}  
4 - {{> passport/cover}}  
5 - <div class="content">  
6 - {{> passport/register}}  
7 - </div>  
8 - {{/ passport}}  
9 -  
10 - <div class="page-tip clearfix">为了给您更好的购物体验, 建议您创建YOHO!Family账号</div>  
11 -  
12 -</div>  
13 -{{> layout/footer}}  
@@ -45,14 +45,16 @@ function disableSMSBtn() { @@ -45,14 +45,16 @@ function disableSMSBtn() {
45 second = 60; 45 second = 60;
46 $smsCaptchaCtrl.text('获取短信验证码'); 46 $smsCaptchaCtrl.text('获取短信验证码');
47 $smsCaptchaCtrl.removeClass('disable'); 47 $smsCaptchaCtrl.removeClass('disable');
  48 + $smsCaptchaCtrl.removeClass('second-progress');
48 } else { 49 } else {
  50 + $smsCaptchaCtrl.addClass('second-progress');
49 $smsCaptchaCtrl.text(second + '秒后可重新操作'); 51 $smsCaptchaCtrl.text(second + '秒后可重新操作');
50 window.setTimeout(disableSMSBtn, 1000); 52 window.setTimeout(disableSMSBtn, 1000);
51 } 53 }
52 } 54 }
53 55
54 $smsCaptchaCtrl.click(function() { 56 $smsCaptchaCtrl.click(function() {
55 - if ($smsCaptchaCtrl.hasClass('disable')) { 57 + if ($smsCaptchaCtrl.hasClass('disable') || $smsCaptchaCtrl.hasClass('second-progress')) {
56 return; 58 return;
57 } 59 }
58 60
@@ -48,8 +48,9 @@ function disableSMSBtn() { @@ -48,8 +48,9 @@ function disableSMSBtn() {
48 second = 60; 48 second = 60;
49 $smsCaptchaCtrl.text('获取短信验证码'); 49 $smsCaptchaCtrl.text('获取短信验证码');
50 $smsCaptchaCtrl.removeClass('disable'); 50 $smsCaptchaCtrl.removeClass('disable');
51 - $smsCaptchaCtrl.removeClass('progress'); 51 + $smsCaptchaCtrl.removeClass('second-progress');
52 } else { 52 } else {
  53 + $smsCaptchaCtrl.addClass('second-progress');
53 $smsCaptchaCtrl.text(second + '秒后可重新操作'); 54 $smsCaptchaCtrl.text(second + '秒后可重新操作');
54 window.setTimeout(disableSMSBtn, 1000); 55 window.setTimeout(disableSMSBtn, 1000);
55 } 56 }
@@ -113,7 +114,7 @@ $('#region').change(function() { @@ -113,7 +114,7 @@ $('#region').change(function() {
113 }); 114 });
114 115
115 ep.tail('phoneNum', 'img-captcha', function(phoneAuth, imgAuth) { 116 ep.tail('phoneNum', 'img-captcha', function(phoneAuth, imgAuth) {
116 - if (phoneAuth && imgAuth && !$smsCaptchaCtrl.hasClass('progress')) { 117 + if (phoneAuth && imgAuth && !$smsCaptchaCtrl.hasClass('second-progress')) {
117 $smsCaptchaCtrl.removeClass('disable'); 118 $smsCaptchaCtrl.removeClass('disable');
118 } else { 119 } else {
119 $smsCaptchaCtrl.addClass('disable'); 120 $smsCaptchaCtrl.addClass('disable');
@@ -210,12 +211,11 @@ $smsCaptchaInput.on('blur', function() { @@ -210,12 +211,11 @@ $smsCaptchaInput.on('blur', function() {
210 }); 211 });
211 212
212 $smsCaptchaCtrl.on('click', function() { 213 $smsCaptchaCtrl.on('click', function() {
213 - if ($smsCaptchaCtrl.hasClass('disable')) { 214 + if ($smsCaptchaCtrl.hasClass('disable') || $smsCaptchaCtrl.hasClass('second-progress')) {
214 return; 215 return;
215 } 216 }
216 217
217 $smsCaptchaCtrl.addClass('disable'); 218 $smsCaptchaCtrl.addClass('disable');
218 - $smsCaptchaCtrl.addClass('progress');  
219 219
220 disableSMSBtn(); 220 disableSMSBtn();
221 sendSMSCaptcha(); 221 sendSMSCaptcha();
@@ -423,9 +423,9 @@ function disableSMSBtn() { @@ -423,9 +423,9 @@ function disableSMSBtn() {
423 second = 60; 423 second = 60;
424 $smsCaptchaCtrl.text('获取短信验证码'); 424 $smsCaptchaCtrl.text('获取短信验证码');
425 $smsCaptchaCtrl.removeClass('disable'); 425 $smsCaptchaCtrl.removeClass('disable');
426 - $smsCaptchaCtrl.removeClass('progress'); 426 + $smsCaptchaCtrl.removeClass('second-progress');
427 } else { 427 } else {
428 - $smsCaptchaCtrl.add('progress'); 428 + $smsCaptchaCtrl.addClass('second-progress');
429 $smsCaptchaCtrl.text(second + '秒后可重新操作'); 429 $smsCaptchaCtrl.text(second + '秒后可重新操作');
430 window.setTimeout(disableSMSBtn, 1000); 430 window.setTimeout(disableSMSBtn, 1000);
431 } 431 }
@@ -459,7 +459,7 @@ exports.init = function() { @@ -459,7 +459,7 @@ exports.init = function() {
459 459
460 // 图形验证通过时,发送短信按钮可点击 460 // 图形验证通过时,发送短信按钮可点击
461 ep.tail('captcha-img', 'phone-num', function(captchaAuth, phoneAuth) { 461 ep.tail('captcha-img', 'phone-num', function(captchaAuth, phoneAuth) {
462 - if (captchaAuth && phoneAuth && !$smsCaptchaCtrl.hasClass('progress')) { 462 + if (captchaAuth && phoneAuth && !$smsCaptchaCtrl.hasClass('second-progress')) {
463 $smsCaptchaCtrl.removeClass('disable'); 463 $smsCaptchaCtrl.removeClass('disable');
464 } else { 464 } else {
465 $smsCaptchaCtrl.addClass('disable'); 465 $smsCaptchaCtrl.addClass('disable');
@@ -505,7 +505,7 @@ exports.init = function() { @@ -505,7 +505,7 @@ exports.init = function() {
505 505
506 // 点击发送验证码 506 // 点击发送验证码
507 $smsCaptchaCtrl.on('click', function() { 507 $smsCaptchaCtrl.on('click', function() {
508 - if ($(this).hasClass('disable')) { 508 + if ($smsCaptchaCtrl.hasClass('disable') || $smsCaptchaCtrl.hasClass('second-progress')) {
509 return; 509 return;
510 } 510 }
511 511
@@ -14,44 +14,34 @@ var jQuery = require('yoho-jquery'), @@ -14,44 +14,34 @@ var jQuery = require('yoho-jquery'),
14 14
15 var tplFn = Handlebars.compile(tpl); 15 var tplFn = Handlebars.compile(tpl);
16 16
17 - var _that = this;  
18 - var $tips = null;  
19 -  
20 var methods = { 17 var methods = {
21 show: function() { 18 show: function() {
22 - var topLeft = this.offset();  
23 -  
24 - if (_that.isInit) { 19 + var $parent = this.parent(),
  20 + topLeft = $parent.offset(),
25 $tips = this.find('.tips'); 21 $tips = this.find('.tips');
26 - this.find('.rectangle').text(arguments[0]); 22 +
  23 + if ($tips.length !== 0) {
  24 + $tips.find('.rectangle').text(arguments[0]).removeClass('hide');
27 } else { 25 } else {
28 - _that.isInit = true;  
29 - this.append(tplFn({content: arguments[0]}));  
30 - $tips = this.find('.tips').removeClass('hide'); 26 + $parent.append(tplFn({content: arguments[0]}));
  27 + $tips = $parent.find('.tips').removeClass('hide');
31 $tips.css({ 28 $tips.css({
32 - top: topLeft.top + this.height() - 2, 29 + top: $parent.height() - 2,
33 left: topLeft.left, 30 left: topLeft.left,
34 width: this.width() + 2, 31 width: this.width() + 2,
35 height: this.height 32 height: this.height
36 }); 33 });
37 } 34 }
38 35
39 - return this; 36 + return $tips;
40 }, 37 },
41 hide: function() { 38 hide: function() {
42 - if (_that.isInit) {  
43 - this.find('.tips').addClass('hide');  
44 - _that.isInit = false;  
45 - } 39 + var $parent = this.parent();
46 40
47 - return this;  
48 - },  
49 - status: function() {  
50 - return _that.isInit; 41 + return $parent.find('.tips').addClass('hide');
51 } 42 }
52 - };  
53 43
54 - _that.isInit = false; 44 + };
55 45
56 $.fn.tips = function(method) { 46 $.fn.tips = function(method) {
57 47