Authored by Rock Zhang

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

@@ -16,12 +16,13 @@ $resend.on('touchstart', function(e) { @@ -16,12 +16,13 @@ $resend.on('touchstart', function(e) {
16 16
17 $.ajax({ 17 $.ajax({
18 url: $resend.data('url'), 18 url: $resend.data('url'),
19 - type: 'GET'  
20 - }).then(function(data) { 19 + type: 'GET',
  20 + success: function(data) {
21 if (data.code === 200) { 21 if (data.code === 200) {
22 showErrTip(data.message); 22 showErrTip(data.message);
23 } else { 23 } else {
24 showErrTip(data.message); 24 showErrTip(data.message);
25 } 25 }
  26 + }
26 }); 27 });
27 }); 28 });
@@ -37,13 +37,14 @@ $btnSure.on('touchstart', function() { @@ -37,13 +37,14 @@ $btnSure.on('touchstart', function() {
37 type: 'POST', 37 type: 'POST',
38 data: { 38 data: {
39 email: email 39 email: email
40 - }  
41 - }).then(function(data) { 40 + },
  41 + success: function(data) {
42 if (data.code === 200) { 42 if (data.code === 200) {
43 location.href = data.data; 43 location.href = data.data;
44 } else { 44 } else {
45 showErrTip(data.message); 45 showErrTip(data.message);
46 } 46 }
  47 + }
47 }); 48 });
48 } else { 49 } else {
49 showErrTip('邮箱格式不正确,请重新输入'); 50 showErrTip('邮箱格式不正确,请重新输入');
@@ -45,13 +45,14 @@ $btnNext.on('touchstart', function() { @@ -45,13 +45,14 @@ $btnNext.on('touchstart', function() {
45 data: { 45 data: {
46 area: country.split('+')[1], 46 area: country.split('+')[1],
47 mobile: pn 47 mobile: pn
48 - }  
49 - }).then(function(data) { 48 + },
  49 + success: function(data) {
50 if (data.code === 200) { 50 if (data.code === 200) {
51 location.href = '/passport/back/code'; 51 location.href = '/passport/back/code';
52 } else { 52 } else {
53 showErrTip(data.message); 53 showErrTip(data.message);
54 } 54 }
  55 + }
55 }); 56 });
56 } else { 57 } else {
57 showErrTip('手机号格式不正确,请重新输入'); 58 showErrTip('手机号格式不正确,请重新输入');
@@ -37,8 +37,8 @@ $btnOk.on('touchstart', function() { @@ -37,8 +37,8 @@ $btnOk.on('touchstart', function() {
37 url: '/passport/back/update', 37 url: '/passport/back/update',
38 data: { 38 data: {
39 password: pwd 39 password: pwd
40 - }  
41 - }).then(function(data) { 40 + },
  41 + success: function(data) {
42 if (data.code === 200) { 42 if (data.code === 200) {
43 showErrTip('密码修改成功'); 43 showErrTip('密码修改成功');
44 44
@@ -49,6 +49,7 @@ $btnOk.on('touchstart', function() { @@ -49,6 +49,7 @@ $btnOk.on('touchstart', function() {
49 } else { 49 } else {
50 showErrTip(data.message); 50 showErrTip(data.message);
51 } 51 }
  52 + }
52 }); 53 });
53 } else { 54 } else {
54 showErrTip('密码6-20位,请重新输入'); 55 showErrTip('密码6-20位,请重新输入');
@@ -50,8 +50,8 @@ module.exports = function(useInRegister) { @@ -50,8 +50,8 @@ module.exports = function(useInRegister) {
50 50
51 $.ajax({ 51 $.ajax({
52 type: 'POST', 52 type: 'POST',
53 - url: '/passport/' + urlMid + '/sendPhone'  
54 - }).then(function (data) { 53 + url: '/passport/' + urlMid + '/sendPhone',
  54 + success: function(data) {
55 if (data.code === 200) { 55 if (data.code === 200) {
56 $captchaTip.text('重发验证码 (60秒)').addClass('disable'); 56 $captchaTip.text('重发验证码 (60秒)').addClass('disable');
57 countDown(); 57 countDown();
@@ -60,6 +60,7 @@ module.exports = function(useInRegister) { @@ -60,6 +60,7 @@ module.exports = function(useInRegister) {
60 //验证码不正确,显示提示 60 //验证码不正确,显示提示
61 showErrTip(data.message); 61 showErrTip(data.message);
62 } 62 }
  63 + }
63 }); 64 });
64 }); 65 });
65 66
@@ -73,8 +74,8 @@ module.exports = function(useInRegister) { @@ -73,8 +74,8 @@ module.exports = function(useInRegister) {
73 url: '/passport/' + urlMid + '/verifycode', 74 url: '/passport/' + urlMid + '/verifycode',
74 data: { 75 data: {
75 verifyCode: trim($captcha.val()) 76 verifyCode: trim($captcha.val())
76 - }  
77 - }).then(function (data) { 77 + },
  78 + success: function(data) {
78 if (data.code === 200) { 79 if (data.code === 200) {
79 location.href = data.data; 80 location.href = data.data;
80 } else { 81 } else {
@@ -82,6 +83,7 @@ module.exports = function(useInRegister) { @@ -82,6 +83,7 @@ module.exports = function(useInRegister) {
82 //验证码不正确,显示提示 83 //验证码不正确,显示提示
83 showErrTip(data.message); 84 showErrTip(data.message);
84 } 85 }
  86 + }
85 }); 87 });
86 }); 88 });
87 89
@@ -81,8 +81,8 @@ $loginBtn.on('touchstart', function() { @@ -81,8 +81,8 @@ $loginBtn.on('touchstart', function() {
81 area: country.split('+')[1], 81 area: country.split('+')[1],
82 account: pn, 82 account: pn,
83 pwd: pwd 83 pwd: pwd
84 - }  
85 - }).then(function(data) { 84 + },
  85 + success: function(data) {
86 if (data.code === 200) { 86 if (data.code === 200) {
87 showErrTip('登录成功'); 87 showErrTip('登录成功');
88 88
@@ -93,8 +93,10 @@ $loginBtn.on('touchstart', function() { @@ -93,8 +93,10 @@ $loginBtn.on('touchstart', function() {
93 } else { 93 } else {
94 showErrTip(data.message); 94 showErrTip(data.message);
95 } 95 }
96 - }, function() { 96 + },
  97 + error: function() {
97 showErrTip('网络断开连接啦~'); 98 showErrTip('网络断开连接啦~');
  99 + }
98 }); 100 });
99 } else { 101 } else {
100 showErrTip('账号或密码有错误,请重新输入'); 102 showErrTip('账号或密码有错误,请重新输入');
@@ -84,8 +84,8 @@ $loginBtn.on('touchstart', function() { @@ -84,8 +84,8 @@ $loginBtn.on('touchstart', function() {
84 data: { 84 data: {
85 account: acc, 85 account: acc,
86 pwd: pwd 86 pwd: pwd
87 - }  
88 - }).then(function(data) { 87 + },
  88 + success: function(data) {
89 if (data.code === 200) { 89 if (data.code === 200) {
90 showErrTip('登录成功'); 90 showErrTip('登录成功');
91 91
@@ -96,8 +96,10 @@ $loginBtn.on('touchstart', function() { @@ -96,8 +96,10 @@ $loginBtn.on('touchstart', function() {
96 } else { 96 } else {
97 showErrTip(data.message); 97 showErrTip(data.message);
98 } 98 }
99 - }, function() { 99 + },
  100 + error: function() {
100 showErrTip('网络断开连接啦~'); 101 showErrTip('网络断开连接啦~');
  102 + }
101 }); 103 });
102 } else { 104 } else {
103 showErrTip('账号或密码有错误,请重新输入'); 105 showErrTip('账号或密码有错误,请重新输入');
@@ -39,8 +39,8 @@ $btnSure.on('touchstart', function() { @@ -39,8 +39,8 @@ $btnSure.on('touchstart', function() {
39 url: '/passport/register/regmobile', 39 url: '/passport/register/regmobile',
40 data: { 40 data: {
41 password: pwd 41 password: pwd
42 - }  
43 - }).then(function(data) { 42 + },
  43 + success: function(data) {
44 if (data.code === 200) { 44 if (data.code === 200) {
45 showErrTip('注册成功'); 45 showErrTip('注册成功');
46 46
@@ -58,6 +58,7 @@ $btnSure.on('touchstart', function() { @@ -58,6 +58,7 @@ $btnSure.on('touchstart', function() {
58 }, 1000); 58 }, 1000);
59 } 59 }
60 } 60 }
  61 + }
61 }); 62 });
62 } 63 }
63 }); 64 });
@@ -45,13 +45,14 @@ $btnNext.on('touchstart', function() { @@ -45,13 +45,14 @@ $btnNext.on('touchstart', function() {
45 data: { 45 data: {
46 area: country.split('+')[1], 46 area: country.split('+')[1],
47 profile: pn 47 profile: pn
48 - }  
49 - }).then(function(data) { 48 + },
  49 + success: function(data) {
50 if (data.code === 200) { 50 if (data.code === 200) {
51 location.href = '/passport/register/code'; 51 location.href = '/passport/register/code';
52 } else { 52 } else {
53 showErrTip(data.message); 53 showErrTip(data.message);
54 } 54 }
  55 + }
55 }); 56 });
56 } else { 57 } else {
57 showErrTip('手机号格式不正确,请重新输入'); 58 showErrTip('手机号格式不正确,请重新输入');
@@ -4,50 +4,64 @@ @@ -4,50 +4,64 @@
4 <script> 4 <script>
5 seajs.use('js/guang/plus-star/list'); 5 seajs.use('js/guang/plus-star/list');
6 </script> 6 </script>
7 -{{else if psDetail}} 7 +{{/if}}
  8 +{{#if psDetail}}
8 <script> 9 <script>
9 seajs.use('js/guang/plus-star/detail'); 10 seajs.use('js/guang/plus-star/detail');
10 </script> 11 </script>
  12 +{{/if}}
  13 +
11 {{!-- 注册 --}} 14 {{!-- 注册 --}}
12 -{{else if regIndex}} 15 +{{#if regIndex}}
13 <script> 16 <script>
14 seajs.use('js/passport/register/register'); 17 seajs.use('js/passport/register/register');
15 </script> 18 </script>
16 -{{else if regCode}} 19 +{{/if}}
  20 +{{#if regCode}}
17 <script> 21 <script>
18 seajs.use('js/passport/register/code'); 22 seajs.use('js/passport/register/code');
19 </script> 23 </script>
20 -{{else if regPwd}} 24 +{{/if}}
  25 +{{#if regPwd}}
21 <script> 26 <script>
22 seajs.use('js/passport/register/password'); 27 seajs.use('js/passport/register/password');
23 </script> 28 </script>
  29 +{{/if}}
  30 +
24 {{!-- 登陆 --}} 31 {{!-- 登陆 --}}
25 -{{else if loginIndex}} 32 +{{#if loginIndex}}
26 <script> 33 <script>
27 seajs.use('js/passport/login/login'); 34 seajs.use('js/passport/login/login');
28 </script> 35 </script>
29 -{{else if loginInterational}} 36 +{{/if}}
  37 +{{#if loginInterational}}
30 <script> 38 <script>
31 seajs.use('js/passport/login/interational'); 39 seajs.use('js/passport/login/interational');
32 </script> 40 </script>
  41 +{{/if}}
  42 +
33 {{!-- 密码找回 --}} 43 {{!-- 密码找回 --}}
34 -{{else if backEmail}} 44 +{{#if backEmail}}
35 <script> 45 <script>
36 seajs.use('js/passport/back/email'); 46 seajs.use('js/passport/back/email');
37 </script> 47 </script>
38 -{{else if backEmailSuccess}} 48 +{{/if}}
  49 +{{#if backEmailSuccess}}
39 <script> 50 <script>
40 seajs.use('js/passport/back/email-success'); 51 seajs.use('js/passport/back/email-success');
41 </script> 52 </script>
42 -{{else if backMobile}} 53 +{{/if}}
  54 +{{#if backMobile}}
43 <script> 55 <script>
44 seajs.use('js/passport/back/mobile'); 56 seajs.use('js/passport/back/mobile');
45 </script> 57 </script>
46 -{{else if backCode}} 58 +{{/if}}
  59 +{{#if backCode}}
47 <script> 60 <script>
48 seajs.use('js/passport/back/code'); 61 seajs.use('js/passport/back/code');
49 </script> 62 </script>
50 -{{else if backNewPwd}} 63 +{{/if}}
  64 +{{#if backNewPwd}}
51 <script> 65 <script>
52 seajs.use('js/passport/back/new-password'); 66 seajs.use('js/passport/back/new-password');
53 </script> 67 </script>