Merge branch 'develop' of http://git.dev.yoho.cn/web/yohobuy into fix/issue
Showing
7 changed files
with
215 additions
and
190 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,73 +3,71 @@ | @@ -3,73 +3,71 @@ | ||
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"> | ||
8 | - <li class="relative clearfix"> | ||
9 | - <h2 class="title">会员登录</h2> | ||
10 | - <span id="country-code" class="country-code right"> | ||
11 | - <em>{{countryName}} {{countryCode}}</em> | ||
12 | - <i class="iconfont"></i> | ||
13 | - <ul id="country-list" class="country-list"> | ||
14 | - {{#each countryList}} | ||
15 | - <li data-cc="{{areaCode}}">{{name}} {{areaCode}}</li> | ||
16 | - {{/each}} | ||
17 | - </ul> | ||
18 | - </span> | ||
19 | - </li> | ||
20 | - <li class="relative"> | ||
21 | - <input id="account" class="account input va" name="account" type="text" placeholder="邮箱/手机号码" autocomplete="off"> | ||
22 | - <ul id="email-autocomplete" class="email-autocomplete hide"></ul> | ||
23 | - <span class="err-tip hide"> | ||
24 | - <i></i> | ||
25 | - <em></em> | ||
26 | - </span> | ||
27 | - </li> | ||
28 | - <li class="relative"> | ||
29 | - <input id="password" class="password input va" name="password" type="text" placeholder="密码" autocomplete="off" maxlength="20"> | ||
30 | - <span id="caps-lock" class="caps-lock hide">大写状态开启</span> | ||
31 | - <span class="err-tip hide"> | ||
32 | - <i></i> | ||
33 | - <em>请输入密码</em> | ||
34 | - </span> | ||
35 | - </li> | ||
36 | - <li> | ||
37 | - <span id="login-btn" class="login-btn btn">登录</span> | ||
38 | - </li> | ||
39 | - <li class="other-opts"> | ||
40 | - <span class="remeber-me"> | ||
41 | - <i class="iconfont"></i> | ||
42 | - 记住登录状态 | ||
43 | - </span> | ||
44 | - <span class="right"> | ||
45 | - <a class="forget-password" href="{{forgetPwd}}">忘记密码?</a> | ||
46 | - | | ||
47 | - <a class="fast-reg" href="{{fastReg}}">快速注册</a> | ||
48 | - </span> | ||
49 | - </li> | ||
50 | - <li class="third-party-login"> | ||
51 | - <a href="{{weixinLogin}}"> | ||
52 | - <span class="icon weixin"></span> | ||
53 | - </a> | ||
54 | - <a href="{{qqLogin}}"> | ||
55 | - <span class="icon qq"></span> | ||
56 | - </a> | ||
57 | - <a href="{{weiboLogin}}"> | ||
58 | - <span class="icon weibo"></span> | ||
59 | - </a> | ||
60 | - <a href="{{alipayLogin}}"> | ||
61 | - <span class="icon alipay"></span> | ||
62 | - </a> | ||
63 | - <a href="{{doubanLogin}}"> | ||
64 | - <span class="icon douban"></span> | ||
65 | - </a> | ||
66 | - <a href="{{renrenLogin}}"> | ||
67 | - <span class="icon renren"></span> | ||
68 | - </a> | ||
69 | - </li> | ||
70 | - </ul> | ||
71 | - <input id="country-code-hide" name="countryCode" type="hidden" value="{{countryCode}}"> | ||
72 | - </form> | 6 | + <ul class="login-ul"> |
7 | + <li class="relative clearfix"> | ||
8 | + <h2 class="title">会员登录</h2> | ||
9 | + <span id="country-code" class="country-code right"> | ||
10 | + <em>{{countryName}} {{countryCode}}</em> | ||
11 | + <i class="iconfont"></i> | ||
12 | + <ul id="country-list" class="country-list"> | ||
13 | + {{#each countryList}} | ||
14 | + <li data-cc="{{areaCode}}">{{name}} {{areaCode}}</li> | ||
15 | + {{/each}} | ||
16 | + </ul> | ||
17 | + </span> | ||
18 | + </li> | ||
19 | + <li class="relative"> | ||
20 | + <input id="account" class="account input va" name="account" type="text" placeholder="邮箱/手机号码" autocomplete="off"> | ||
21 | + <ul id="email-autocomplete" class="email-autocomplete hide"></ul> | ||
22 | + <span class="err-tip hide"> | ||
23 | + <i></i> | ||
24 | + <em></em> | ||
25 | + </span> | ||
26 | + </li> | ||
27 | + <li class="relative"> | ||
28 | + <input id="password" class="password input va" name="password" type="password" placeholder="密码" autocomplete="off" maxlength="20"> | ||
29 | + <span id="caps-lock" class="caps-lock hide">大写状态开启</span> | ||
30 | + <span class="err-tip hide"> | ||
31 | + <i></i> | ||
32 | + <em>请输入密码</em> | ||
33 | + </span> | ||
34 | + </li> | ||
35 | + <li> | ||
36 | + <span id="login-btn" class="login-btn btn">登录</span> | ||
37 | + </li> | ||
38 | + <li class="other-opts"> | ||
39 | + <span class="remeber-me"> | ||
40 | + <i class="iconfont"></i> | ||
41 | + 记住登录状态 | ||
42 | + </span> | ||
43 | + <span class="right"> | ||
44 | + <a class="forget-password" href="{{forgetPwd}}">忘记密码?</a> | ||
45 | + | | ||
46 | + <a class="fast-reg" href="{{fastReg}}">快速注册</a> | ||
47 | + </span> | ||
48 | + </li> | ||
49 | + <li class="third-party-login"> | ||
50 | + <a href="{{weixinLogin}}"> | ||
51 | + <span class="icon weixin"></span> | ||
52 | + </a> | ||
53 | + <a href="{{qqLogin}}"> | ||
54 | + <span class="icon qq"></span> | ||
55 | + </a> | ||
56 | + <a href="{{weiboLogin}}"> | ||
57 | + <span class="icon weibo"></span> | ||
58 | + </a> | ||
59 | + <a href="{{alipayLogin}}"> | ||
60 | + <span class="icon alipay"></span> | ||
61 | + </a> | ||
62 | + <a href="{{doubanLogin}}"> | ||
63 | + <span class="icon douban"></span> | ||
64 | + </a> | ||
65 | + <a href="{{renrenLogin}}"> | ||
66 | + <span class="icon renren"></span> | ||
67 | + </a> | ||
68 | + </li> | ||
69 | + </ul> | ||
70 | + <input id="country-code-hide" name="countryCode" type="hidden" value="{{countryCode}}"> | ||
73 | </div> | 71 | </div> |
74 | {{/ passport}} | 72 | {{/ passport}} |
75 | </div> | 73 | </div> |
1 | {{> layout/header}} | 1 | {{> layout/header}} |
2 | <div class="product-list-page product-page yoho-page"> | 2 | <div class="product-list-page product-page yoho-page"> |
3 | {{# list}} | 3 | {{# list}} |
4 | - {{# brandBanner}} | ||
5 | - <div class="brand-banner"> | ||
6 | - <div class="banner-img" style="height: {{bannerHeight}}px;background: url({{banner}})"></div> | ||
7 | - <div class="opt-wrap"> | ||
8 | - <p class="opt center-content"> | ||
9 | - <a href="{{brandHome}}"> | ||
10 | - <i class="iconfont"></i> | ||
11 | - 品牌首页 | ||
12 | - </a> | ||
13 | - <a href="{{brandIntro}}"> | ||
14 | - <i class="iconfont"></i> | ||
15 | - 品牌介绍 | ||
16 | - </a> | 4 | + {{# brandBanner}} |
5 | + <div class="brand-banner"> | ||
6 | + <div class="banner-img" style="height: {{bannerHeight}}px;background: url({{banner}})"></div> | ||
7 | + <div class="opt-wrap"> | ||
8 | + <p class="opt center-content"> | ||
9 | + <a href="{{brandHome}}"> | ||
10 | + <i class="iconfont"></i> | ||
11 | + 品牌首页 | ||
12 | + </a> | ||
13 | + <a href="{{brandIntro}}"> | ||
14 | + <i class="iconfont"></i> | ||
15 | + 品牌介绍 | ||
16 | + </a> | ||
17 | <span id="brand-favor" class="brand-favor"> | 17 | <span id="brand-favor" class="brand-favor"> |
18 | <i class="iconfont{{#if coled}} coled{{/if}}"></i> | 18 | <i class="iconfont{{#if coled}} coled{{/if}}"></i> |
19 | </span> | 19 | </span> |
20 | - </p> | ||
21 | - </div> | ||
22 | - </div> | ||
23 | - {{/ brandBanner}} | ||
24 | - | ||
25 | - <div class="center-content clearfix"> | ||
26 | - {{> layout/path-nav}} | ||
27 | - | ||
28 | - {{# brandAbout}} | ||
29 | - <div class="brand-about"> | ||
30 | - {{{brandIntro}}} | ||
31 | - </div> | ||
32 | - {{^}} | ||
33 | - <div class="list-left pull-left"> | ||
34 | - {{> product/left-content}} | ||
35 | - </div> | ||
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> | 20 | </p> |
54 | </div> | 21 | </div> |
55 | - | ||
56 | - <a class="entry-btn pull-right" href="{{home}}"> | ||
57 | - 进入品牌店铺 | ||
58 | - <span class="iconfont"></span> | ||
59 | - </a> | ||
60 | </div> | 22 | </div> |
61 | - {{/ shopEntry}} | 23 | + {{/ brandBanner}} |
24 | + | ||
25 | + <div class="center-content clearfix"> | ||
26 | + {{> layout/path-nav}} | ||
62 | 27 | ||
63 | - {{> product/standard-content}} | 28 | + {{# brandAbout}} |
29 | + <div class="brand-about"> | ||
30 | + {{{brandIntro}}} | ||
31 | + </div> | ||
32 | + {{^}} | ||
33 | + <div class="list-left pull-left"> | ||
34 | + {{> product/left-content}} | ||
35 | + </div> | ||
36 | + <div class="list-right pull-right"> | ||
37 | + {{> product/standard-content}} | ||
64 | 38 | ||
65 | - {{> product/latest-walk}} | 39 | + {{> product/latest-walk}} |
40 | + </div> | ||
41 | + {{/ brandAbout}} | ||
66 | </div> | 42 | </div> |
67 | - {{/ brandAbout}} | ||
68 | - </div> | ||
69 | {{/ list}} | 43 | {{/ list}} |
70 | </div> | 44 | </div> |
71 | {{> layout/footer}} | 45 | {{> layout/footer}} |
1 | {{> layout/header}} | 1 | {{> layout/header}} |
2 | <div class="product-search-page product-page yoho-page center-content"> | 2 | <div class="product-search-page product-page yoho-page center-content"> |
3 | {{# search}} | 3 | {{# search}} |
4 | - {{> layout/path-nav}} | 4 | + {{> layout/path-nav}} |
5 | 5 | ||
6 | - {{> product/standard-content}} | 6 | + {{# shopEntry}} |
7 | + <div class="shop-entry clearfix"> | ||
8 | + <a class="pull-left" href="{{home}}"> | ||
9 | + <img class="logo" src="{{logo}}"> | ||
10 | + </a> | ||
7 | 11 | ||
8 | - {{> product/latest-walk}} | 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 | + | ||
32 | + {{> product/standard-content}} | ||
33 | + | ||
34 | + {{> product/latest-walk}} | ||
9 | {{/ search}} | 35 | {{/ search}} |
10 | </div> | 36 | </div> |
11 | {{> layout/footer}} | 37 | {{> layout/footer}} |
1 | -<p class="path-nav"> | ||
2 | - {{#each pathNav}} | ||
3 | - {{#if href}} | ||
4 | - <a href="{{href}}"> | ||
5 | - {{name}} | 1 | +{{#if pathNav}} |
2 | + <p class="path-nav"> | ||
3 | + {{#each pathNav}} | ||
4 | + {{#if href}} | ||
5 | + <a href="{{href}}"> | ||
6 | + {{name}} | ||
6 | 7 | ||
7 | - {{#unless @last}} | ||
8 | - <span class="iconfont"></span> | ||
9 | - {{/unless}} | ||
10 | - </a> | ||
11 | - {{^}} | ||
12 | - <span> | ||
13 | - {{name}} | 8 | + {{#unless @last}} |
9 | + <span class="iconfont"></span> | ||
10 | + {{/unless}} | ||
11 | + </a> | ||
12 | + {{^}} | ||
13 | + <span> | ||
14 | + {{name}} | ||
14 | 15 | ||
15 | - {{#unless @last}} | ||
16 | - <i class="iconfont"></i> | ||
17 | - {{/unless}} | ||
18 | - </span> | ||
19 | - {{/if}} | ||
20 | - {{/each}} | ||
21 | -</p> | ||
16 | + {{#unless @last}} | ||
17 | + <i class="iconfont"></i> | ||
18 | + {{/unless}} | ||
19 | + </span> | ||
20 | + {{/if}} | ||
21 | + {{/each}} | ||
22 | + </p> | ||
23 | +{{/if}} |
@@ -38,37 +38,37 @@ | @@ -38,37 +38,37 @@ | ||
38 | 38 | ||
39 | {{!-- 全部品类--}} | 39 | {{!-- 全部品类--}} |
40 | {{# allSort}} | 40 | {{# allSort}} |
41 | - <div class="sort-container"> | ||
42 | - <h2> | ||
43 | - 全部品类 | ||
44 | - <span>{{updateNum}}</span> | ||
45 | - </h2> | ||
46 | - <ul> | ||
47 | - {{#each list}} | ||
48 | - <li class="product-list-nav {{#if active}}active{{/if}}"> | ||
49 | - <h3> | ||
50 | - <span class="icon-triangle"></span> | ||
51 | - {{name}} | ||
52 | - <span>{{num}}</span> | ||
53 | - </h3> | ||
54 | - <ul class="sort-child-list"> | ||
55 | - {{#each childList}} | ||
56 | - <li class="{{#if childActive}}active{{/if}}"> | ||
57 | - <a href="{{href}}">{{name}}</a> | ||
58 | - <span>{{num}}</span> | ||
59 | - </li> | ||
60 | - {{/each}} | ||
61 | - </ul> | ||
62 | - </li> | ||
63 | - {{/each}} | ||
64 | - </ul> | ||
65 | - </div> | 41 | + <div class="sort-container"> |
42 | + <h2> | ||
43 | + 全部品类 | ||
44 | + <span>{{updateNum}}</span> | ||
45 | + </h2> | ||
46 | + <ul> | ||
47 | + {{#each list}} | ||
48 | + <li class="product-list-nav {{#if active}}active{{/if}}"> | ||
49 | + <h3> | ||
50 | + <span class="icon-triangle"></span> | ||
51 | + {{name}} | ||
52 | + <span>{{num}}</span> | ||
53 | + </h3> | ||
54 | + <ul class="sort-child-list"> | ||
55 | + {{#each childList}} | ||
56 | + <li class="{{#if childActive}}active{{/if}}"> | ||
57 | + <a href="{{href}}">{{name}}</a> | ||
58 | + <span>{{num}}</span> | ||
59 | + </li> | ||
60 | + {{/each}} | ||
61 | + </ul> | ||
62 | + </li> | ||
63 | + {{/each}} | ||
64 | + </ul> | ||
65 | + </div> | ||
66 | {{/ allSort}} | 66 | {{/ allSort}} |
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