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) {  
21 - if (data.code === 200) {  
22 - showErrTip(data.message);  
23 - } else {  
24 - showErrTip(data.message); 19 + type: 'GET',
  20 + success: function(data) {
  21 + if (data.code === 200) {
  22 + showErrTip(data.message);
  23 + } else {
  24 + showErrTip(data.message);
  25 + }
25 } 26 }
26 }); 27 });
27 }); 28 });
@@ -37,12 +37,13 @@ $btnSure.on('touchstart', function() { @@ -37,12 +37,13 @@ $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) {  
42 - if (data.code === 200) {  
43 - location.href = data.data;  
44 - } else {  
45 - showErrTip(data.message); 40 + },
  41 + success: function(data) {
  42 + if (data.code === 200) {
  43 + location.href = data.data;
  44 + } else {
  45 + showErrTip(data.message);
  46 + }
46 } 47 }
47 }); 48 });
48 } else { 49 } else {
@@ -45,12 +45,13 @@ $btnNext.on('touchstart', function() { @@ -45,12 +45,13 @@ $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) {  
50 - if (data.code === 200) {  
51 - location.href = '/passport/back/code';  
52 - } else {  
53 - showErrTip(data.message); 48 + },
  49 + success: function(data) {
  50 + if (data.code === 200) {
  51 + location.href = '/passport/back/code';
  52 + } else {
  53 + showErrTip(data.message);
  54 + }
54 } 55 }
55 }); 56 });
56 } else { 57 } else {
@@ -37,17 +37,18 @@ $btnOk.on('touchstart', function() { @@ -37,17 +37,18 @@ $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) {  
42 - if (data.code === 200) {  
43 - showErrTip('密码修改成功');  
44 -  
45 - //1000ms后跳转页面  
46 - setTimeout(function() {  
47 - location.href = '/';  
48 - }, 1000);  
49 - } else {  
50 - showErrTip(data.message); 40 + },
  41 + success: function(data) {
  42 + if (data.code === 200) {
  43 + showErrTip('密码修改成功');
  44 +
  45 + //1000ms后跳转页面
  46 + setTimeout(function() {
  47 + location.href = '/';
  48 + }, 1000);
  49 + } else {
  50 + showErrTip(data.message);
  51 + }
51 } 52 }
52 }); 53 });
53 } else { 54 } else {
@@ -50,15 +50,16 @@ module.exports = function(useInRegister) { @@ -50,15 +50,16 @@ 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) {  
55 - if (data.code === 200) {  
56 - $captchaTip.text('重发验证码 (60秒)').addClass('disable');  
57 - countDown();  
58 - } else { 53 + url: '/passport/' + urlMid + '/sendPhone',
  54 + success: function(data) {
  55 + if (data.code === 200) {
  56 + $captchaTip.text('重发验证码 (60秒)').addClass('disable');
  57 + countDown();
  58 + } else {
59 59
60 - //验证码不正确,显示提示  
61 - showErrTip(data.message); 60 + //验证码不正确,显示提示
  61 + showErrTip(data.message);
  62 + }
62 } 63 }
63 }); 64 });
64 }); 65 });
@@ -73,14 +74,15 @@ module.exports = function(useInRegister) { @@ -73,14 +74,15 @@ 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) {  
78 - if (data.code === 200) {  
79 - location.href = data.data;  
80 - } else { 77 + },
  78 + success: function(data) {
  79 + if (data.code === 200) {
  80 + location.href = data.data;
  81 + } else {
81 82
82 - //验证码不正确,显示提示  
83 - showErrTip(data.message); 83 + //验证码不正确,显示提示
  84 + showErrTip(data.message);
  85 + }
84 } 86 }
85 }); 87 });
86 }); 88 });
@@ -81,20 +81,22 @@ $loginBtn.on('touchstart', function() { @@ -81,20 +81,22 @@ $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 + success: function(data) {
  86 + if (data.code === 200) {
  87 + showErrTip('登录成功');
  88 +
  89 + //1000ms后跳转页面
  90 + setTimeout(function() {
  91 + location.href = data.data;
  92 + }, 1000);
  93 + } else {
  94 + showErrTip(data.message);
  95 + }
  96 + },
  97 + error: function() {
  98 + showErrTip('网络断开连接啦~');
84 } 99 }
85 - }).then(function(data) {  
86 - if (data.code === 200) {  
87 - showErrTip('登录成功');  
88 -  
89 - //1000ms后跳转页面  
90 - setTimeout(function() {  
91 - location.href = data.data;  
92 - }, 1000);  
93 - } else {  
94 - showErrTip(data.message);  
95 - }  
96 - }, function() {  
97 - showErrTip('网络断开连接啦~');  
98 }); 100 });
99 } else { 101 } else {
100 showErrTip('账号或密码有错误,请重新输入'); 102 showErrTip('账号或密码有错误,请重新输入');
@@ -84,20 +84,22 @@ $loginBtn.on('touchstart', function() { @@ -84,20 +84,22 @@ $loginBtn.on('touchstart', function() {
84 data: { 84 data: {
85 account: acc, 85 account: acc,
86 pwd: pwd 86 pwd: pwd
  87 + },
  88 + success: function(data) {
  89 + if (data.code === 200) {
  90 + showErrTip('登录成功');
  91 +
  92 + //1s后跳转页面
  93 + setTimeout(function() {
  94 + location.href = data.data;
  95 + }, 1000);
  96 + } else {
  97 + showErrTip(data.message);
  98 + }
  99 + },
  100 + error: function() {
  101 + showErrTip('网络断开连接啦~');
87 } 102 }
88 - }).then(function(data) {  
89 - if (data.code === 200) {  
90 - showErrTip('登录成功');  
91 -  
92 - //1s后跳转页面  
93 - setTimeout(function() {  
94 - location.href = data.data;  
95 - }, 1000);  
96 - } else {  
97 - showErrTip(data.message);  
98 - }  
99 - }, function() {  
100 - showErrTip('网络断开连接啦~');  
101 }); 103 });
102 } else { 104 } else {
103 showErrTip('账号或密码有错误,请重新输入'); 105 showErrTip('账号或密码有错误,请重新输入');
@@ -39,23 +39,24 @@ $btnSure.on('touchstart', function() { @@ -39,23 +39,24 @@ $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) {  
44 - if (data.code === 200) {  
45 - showErrTip('注册成功');  
46 -  
47 - //1000ms后跳转页面  
48 - setTimeout(function() {  
49 - location.href = data.data;  
50 - }, 1000);  
51 - } else {  
52 - if (data.code === 401 || data.code === 404 || data.code === 505) {  
53 - showErrTip(data.message);  
54 - } else {  
55 - showErrTip(data.message); 42 + },
  43 + success: function(data) {
  44 + if (data.code === 200) {
  45 + showErrTip('注册成功');
  46 +
  47 + //1000ms后跳转页面
56 setTimeout(function() { 48 setTimeout(function() {
57 location.href = data.data; 49 location.href = data.data;
58 }, 1000); 50 }, 1000);
  51 + } else {
  52 + if (data.code === 401 || data.code === 404 || data.code === 505) {
  53 + showErrTip(data.message);
  54 + } else {
  55 + showErrTip(data.message);
  56 + setTimeout(function() {
  57 + location.href = data.data;
  58 + }, 1000);
  59 + }
59 } 60 }
60 } 61 }
61 }); 62 });
@@ -45,12 +45,13 @@ $btnNext.on('touchstart', function() { @@ -45,12 +45,13 @@ $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) {  
50 - if (data.code === 200) {  
51 - location.href = '/passport/register/code';  
52 - } else {  
53 - showErrTip(data.message); 48 + },
  49 + success: function(data) {
  50 + if (data.code === 200) {
  51 + location.href = '/passport/register/code';
  52 + } else {
  53 + showErrTip(data.message);
  54 + }
54 } 55 }
55 }); 56 });
56 } else { 57 } else {
@@ -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>