Merge branch 'develop' of http://git.dev.yoho.cn/web/yohobuy into fix/issue
Showing
7 changed files
with
76 additions
and
51 deletions
@@ -358,7 +358,7 @@ | @@ -358,7 +358,7 @@ | ||
358 | { | 358 | { |
359 | picLink: { | 359 | picLink: { |
360 | //图片导航 | 360 | //图片导航 |
361 | - title: 'AA', //图片导航标题 | 361 | + picTitle: 'AA', //图片导航标题 |
362 | list: [ | 362 | list: [ |
363 | { | 363 | { |
364 | href: '', | 364 | href: '', |
@@ -621,6 +621,20 @@ | @@ -621,6 +621,20 @@ | ||
621 | //路径导航 | 621 | //路径导航 |
622 | pathNav: [...], | 622 | pathNav: [...], |
623 | 623 | ||
624 | + //品牌入口 | ||
625 | + shopEntry: { | ||
626 | + home: '', | ||
627 | + logo: '', | ||
628 | + shopName: '', | ||
629 | + sort: [ | ||
630 | + { | ||
631 | + href: '', | ||
632 | + name: '上衣' | ||
633 | + }, | ||
634 | + ... | ||
635 | + ] | ||
636 | + }, | ||
637 | + | ||
624 | ..//标准页面内容,见上 | 638 | ..//标准页面内容,见上 |
625 | } | 639 | } |
626 | } | 640 | } |
@@ -641,20 +655,6 @@ | @@ -641,20 +655,6 @@ | ||
641 | brandAbout: '', //品牌介绍页传HTML文本,非品牌介绍页则不传 | 655 | brandAbout: '', //品牌介绍页传HTML文本,非品牌介绍页则不传 |
642 | leftContent: [], //... | 656 | leftContent: [], //... |
643 | 657 | ||
644 | - //品牌入口 | ||
645 | - shopEntry: { | ||
646 | - home: '', | ||
647 | - logo: '', | ||
648 | - shopName: '', | ||
649 | - sort: [ | ||
650 | - { | ||
651 | - href: '', | ||
652 | - name: '上衣' | ||
653 | - }, | ||
654 | - ... | ||
655 | - ] | ||
656 | - }, | ||
657 | - | ||
658 | //分类介绍 | 658 | //分类介绍 |
659 | sortIntro: { | 659 | sortIntro: { |
660 | name: '', | 660 | name: '', |
@@ -3,7 +3,6 @@ | @@ -3,7 +3,6 @@ | ||
3 | {{# passport}} | 3 | {{# passport}} |
4 | {{> passport/cover}} | 4 | {{> passport/cover}} |
5 | <div class="content"> | 5 | <div class="content"> |
6 | - <form id="login-form" method="POST" action="/passport/login/login"> | ||
7 | <ul class="login-ul"> | 6 | <ul class="login-ul"> |
8 | <li class="relative clearfix"> | 7 | <li class="relative clearfix"> |
9 | <h2 class="title">会员登录</h2> | 8 | <h2 class="title">会员登录</h2> |
@@ -26,7 +25,7 @@ | @@ -26,7 +25,7 @@ | ||
26 | </span> | 25 | </span> |
27 | </li> | 26 | </li> |
28 | <li class="relative"> | 27 | <li class="relative"> |
29 | - <input id="password" class="password input va" name="password" type="text" placeholder="密码" autocomplete="off" maxlength="20"> | 28 | + <input id="password" class="password input va" name="password" type="password" placeholder="密码" autocomplete="off" maxlength="20"> |
30 | <span id="caps-lock" class="caps-lock hide">大写状态开启</span> | 29 | <span id="caps-lock" class="caps-lock hide">大写状态开启</span> |
31 | <span class="err-tip hide"> | 30 | <span class="err-tip hide"> |
32 | <i></i> | 31 | <i></i> |
@@ -69,7 +68,6 @@ | @@ -69,7 +68,6 @@ | ||
69 | </li> | 68 | </li> |
70 | </ul> | 69 | </ul> |
71 | <input id="country-code-hide" name="countryCode" type="hidden" value="{{countryCode}}"> | 70 | <input id="country-code-hide" name="countryCode" type="hidden" value="{{countryCode}}"> |
72 | - </form> | ||
73 | </div> | 71 | </div> |
74 | {{/ passport}} | 72 | {{/ passport}} |
75 | </div> | 73 | </div> |
@@ -34,32 +34,6 @@ | @@ -34,32 +34,6 @@ | ||
34 | {{> product/left-content}} | 34 | {{> product/left-content}} |
35 | </div> | 35 | </div> |
36 | <div class="list-right pull-right"> | 36 | <div class="list-right pull-right"> |
37 | - {{# shopEntry}} | ||
38 | - <div class="shop-entry clearfix"> | ||
39 | - <a class="pull-left" href="{{home}}"> | ||
40 | - <img class="logo" src="{{logo}}"> | ||
41 | - </a> | ||
42 | - | ||
43 | - <div class="name pull-left"> | ||
44 | - <a class="shop-name" href="{{home}}">{{shopName}}</a> | ||
45 | - <p class="sorts"> | ||
46 | - {{#each sort}} | ||
47 | - <a href="{{href}}">{{name}}</a> | ||
48 | - | ||
49 | - {{#unless @last}} | ||
50 | - / | ||
51 | - {{/unless}} | ||
52 | - {{/each}} | ||
53 | - </p> | ||
54 | - </div> | ||
55 | - | ||
56 | - <a class="entry-btn pull-right" href="{{home}}"> | ||
57 | - 进入品牌店铺 | ||
58 | - <span class="iconfont"></span> | ||
59 | - </a> | ||
60 | - </div> | ||
61 | - {{/ shopEntry}} | ||
62 | - | ||
63 | {{> product/standard-content}} | 37 | {{> product/standard-content}} |
64 | 38 | ||
65 | {{> product/latest-walk}} | 39 | {{> product/latest-walk}} |
@@ -3,6 +3,32 @@ | @@ -3,6 +3,32 @@ | ||
3 | {{# search}} | 3 | {{# search}} |
4 | {{> layout/path-nav}} | 4 | {{> layout/path-nav}} |
5 | 5 | ||
6 | + {{# shopEntry}} | ||
7 | + <div class="shop-entry clearfix"> | ||
8 | + <a class="pull-left" href="{{home}}"> | ||
9 | + <img class="logo" src="{{logo}}"> | ||
10 | + </a> | ||
11 | + | ||
12 | + <div class="name pull-left"> | ||
13 | + <a class="shop-name" href="{{home}}">{{shopName}}</a> | ||
14 | + <p class="sorts"> | ||
15 | + {{#each sort}} | ||
16 | + <a href="{{href}}">{{name}}</a> | ||
17 | + | ||
18 | + {{#unless @last}} | ||
19 | + / | ||
20 | + {{/unless}} | ||
21 | + {{/each}} | ||
22 | + </p> | ||
23 | + </div> | ||
24 | + | ||
25 | + <a class="entry-btn pull-right" href="{{home}}"> | ||
26 | + 进入品牌店铺 | ||
27 | + <span class="iconfont"></span> | ||
28 | + </a> | ||
29 | + </div> | ||
30 | + {{/ shopEntry}} | ||
31 | + | ||
6 | {{> product/standard-content}} | 32 | {{> product/standard-content}} |
7 | 33 | ||
8 | {{> product/latest-walk}} | 34 | {{> product/latest-walk}} |
1 | -<p class="path-nav"> | 1 | +{{#if pathNav}} |
2 | + <p class="path-nav"> | ||
2 | {{#each pathNav}} | 3 | {{#each pathNav}} |
3 | {{#if href}} | 4 | {{#if href}} |
4 | <a href="{{href}}"> | 5 | <a href="{{href}}"> |
@@ -18,4 +19,5 @@ | @@ -18,4 +19,5 @@ | ||
18 | </span> | 19 | </span> |
19 | {{/if}} | 20 | {{/if}} |
20 | {{/each}} | 21 | {{/each}} |
21 | -</p> | ||
22 | + </p> | ||
23 | +{{/if}} |
@@ -67,8 +67,8 @@ | @@ -67,8 +67,8 @@ | ||
67 | 67 | ||
68 | {{!-- 图片链接 --}} | 68 | {{!-- 图片链接 --}} |
69 | {{# picLink}} | 69 | {{# picLink}} |
70 | - {{#if title}} | ||
71 | - <h2 class="nav-pic-title">{{title}}</h2> | 70 | + {{#if picTitle}} |
71 | + <h2 class="nav-pic-title">{{picTitle}}</h2> | ||
72 | {{/if}} | 72 | {{/if}} |
73 | <ul class="pic-nav"> | 73 | <ul class="pic-nav"> |
74 | {{#each list}} | 74 | {{#each list}} |
@@ -31,6 +31,8 @@ var checkbox = { | @@ -31,6 +31,8 @@ var checkbox = { | ||
31 | unchecked: '' | 31 | unchecked: '' |
32 | }; | 32 | }; |
33 | 33 | ||
34 | +var authing = false; | ||
35 | + | ||
34 | var emailAcTime; | 36 | var emailAcTime; |
35 | 37 | ||
36 | require('yoho.placeholder'); | 38 | require('yoho.placeholder'); |
@@ -46,7 +48,7 @@ function validateAccount() { | @@ -46,7 +48,7 @@ function validateAccount() { | ||
46 | if (/^[0-9]+$/.test(account)) { | 48 | if (/^[0-9]+$/.test(account)) { |
47 | 49 | ||
48 | //如果是纯数字,则作为手机号码处理 | 50 | //如果是纯数字,则作为手机号码处理 |
49 | - if (mailPhoneRegx.phoneRegx['+' + $countryCodeHide.val()].test(account)) { | 51 | + if (mailPhoneRegx.phoneRegx[$countryCodeHide.val()].test(account)) { |
50 | pass = true; | 52 | pass = true; |
51 | } else { | 53 | } else { |
52 | pass = false; | 54 | pass = false; |
@@ -97,6 +99,7 @@ function validatePassword() { | @@ -97,6 +99,7 @@ function validatePassword() { | ||
97 | $passwordTip.removeClass('hide').children('em').text(err); | 99 | $passwordTip.removeClass('hide').children('em').text(err); |
98 | $password.addClass('error'); | 100 | $password.addClass('error'); |
99 | } | 101 | } |
102 | + return pass; | ||
100 | } | 103 | } |
101 | 104 | ||
102 | //验证 | 105 | //验证 |
@@ -254,7 +257,29 @@ $('.va').on('focus', function() { | @@ -254,7 +257,29 @@ $('.va').on('focus', function() { | ||
254 | $('#login-btn').on('click', function() { | 257 | $('#login-btn').on('click', function() { |
255 | var pass = validate(); | 258 | var pass = validate(); |
256 | 259 | ||
257 | - if (pass) { | ||
258 | - $('#login-form').submit(); | 260 | + if (pass && authing === false) { |
261 | + authing = true; | ||
262 | + | ||
263 | + $.ajax({ | ||
264 | + url: '/passport/login/auth', | ||
265 | + type: 'POST', | ||
266 | + data: { | ||
267 | + areaCode: $countryCodeHide.val().replace('+', ''), | ||
268 | + account: $.trim($account.val()), | ||
269 | + password: $.trim($password.val()) | ||
270 | + }, | ||
271 | + success: function(data) { | ||
272 | + if (data.code === 400) { | ||
273 | + $passwordTip.removeClass('hide').children('em').text(data.message); | ||
274 | + $password.addClass('error'); | ||
275 | + return; | ||
276 | + } else { | ||
277 | + location.href = data.data.href; | ||
278 | + } | ||
279 | + }, | ||
280 | + complete: function() { | ||
281 | + authing = false; | ||
282 | + } | ||
283 | + }); | ||
259 | } | 284 | } |
260 | }); | 285 | }); |
-
Please register or login to post a comment