Merge branch 'develop' of git.dev.yoho.cn:web/yohobuy into feature/detailFix
Showing
13 changed files
with
156 additions
and
114 deletions
@@ -15,7 +15,11 @@ var $loading, | @@ -15,7 +15,11 @@ var $loading, | ||
15 | 15 | ||
16 | // 初始化 | 16 | // 初始化 |
17 | function init($container) { | 17 | function init($container) { |
18 | - var html = '<div class="loading-mask hide"><div class="loading"></div></div>'; | 18 | + var html = '<div class="loading-mask hide">' + |
19 | + '<div class="loading">' + | ||
20 | + '<div></div><div></div><div></div>' + | ||
21 | + '</div>' + | ||
22 | + '</div>'; | ||
19 | 23 | ||
20 | hasInit = true; | 24 | hasInit = true; |
21 | if ($container === undefined) { | 25 | if ($container === undefined) { |
static/js/product/extract-url.js
deleted
100644 → 0
1 | -/** | ||
2 | - * 提取URL中的参数 | ||
3 | - * @author: xuqi<qi.xu@yoho.cn> | ||
4 | - * @date: 2015/11/19 | ||
5 | - */ | ||
6 | - | ||
7 | -var opt = {}; | ||
8 | - | ||
9 | -var paramStr = window.location.search.split('?')[1]; | ||
10 | - | ||
11 | -var keyVal = paramStr ? paramStr.split('&') : []; | ||
12 | - | ||
13 | -var i, key, val; | ||
14 | - | ||
15 | -for (i = keyVal.length; i > 0; i--) { | ||
16 | - key = keyVal[i - 1].split('='); | ||
17 | - | ||
18 | - val = key[1]; | ||
19 | - key = key[0]; | ||
20 | - | ||
21 | - //初始化默认参数 | ||
22 | - opt[key] = val; | ||
23 | - | ||
24 | - //discount = p_d,同时需要两个参数 | ||
25 | - if (key === 'discount' || key === 'p_d') { | ||
26 | - opt.discount = val; | ||
27 | - opt.p_d = val; | ||
28 | - } | ||
29 | -} | ||
30 | - | ||
31 | -if (typeof opt.gender === 'undefined') { | ||
32 | - switch (window.cookie('_Channel')) { | ||
33 | - case 'boys': | ||
34 | - opt.gender = '1,3'; | ||
35 | - break; | ||
36 | - case 'girls': | ||
37 | - opt.gender = '2,3'; | ||
38 | - break; | ||
39 | - default: | ||
40 | - opt.gender = '1,2,3'; | ||
41 | - } | ||
42 | -} | ||
43 | - | ||
44 | -module.exports = opt; |
@@ -31,7 +31,7 @@ var $input = $('#search-input input'), | @@ -31,7 +31,7 @@ var $input = $('#search-input input'), | ||
31 | $clear = $('#search-input .clear-input'); | 31 | $clear = $('#search-input .clear-input'); |
32 | 32 | ||
33 | //默认筛选条件 | 33 | //默认筛选条件 |
34 | -var defaultOpt = require('./extract-url'); | 34 | +var defaultOpt = require('./query-param'); |
35 | 35 | ||
36 | var $listNav = $('#list-nav'), | 36 | var $listNav = $('#list-nav'), |
37 | 37 |
@@ -24,7 +24,7 @@ var winH = $(window).height(), | @@ -24,7 +24,7 @@ var winH = $(window).height(), | ||
24 | noResult = '<p class="no-result">未找到相关搜索结果</p>'; | 24 | noResult = '<p class="no-result">未找到相关搜索结果</p>'; |
25 | 25 | ||
26 | //默认筛选条件 | 26 | //默认筛选条件 |
27 | -var defaultOpt = require('../extract-url'); | 27 | +var defaultOpt = require('../query-param'); |
28 | 28 | ||
29 | var $listNav = $('#list-nav'), | 29 | var $listNav = $('#list-nav'), |
30 | 30 |
@@ -27,7 +27,7 @@ var winH = $(window).height(), | @@ -27,7 +27,7 @@ var winH = $(window).height(), | ||
27 | noResult = '<p class="no-result">未找到相关搜索结果</p>'; | 27 | noResult = '<p class="no-result">未找到相关搜索结果</p>'; |
28 | 28 | ||
29 | //默认筛选条件 | 29 | //默认筛选条件 |
30 | -var defaultOpt = require('../extract-url'); | 30 | +var defaultOpt = require('../query-param'); |
31 | 31 | ||
32 | var storeOpt = $.extend({}, defaultOpt); //存储默认筛选条件以便重置 | 32 | var storeOpt = $.extend({}, defaultOpt); //存储默认筛选条件以便重置 |
33 | 33 |
static/js/product/query-param.js
0 → 100644
@@ -6,15 +6,72 @@ | @@ -6,15 +6,72 @@ | ||
6 | right: 0; | 6 | right: 0; |
7 | left: 0; | 7 | left: 0; |
8 | 8 | ||
9 | + @-webkit-keyframes scale { | ||
10 | + 0% { | ||
11 | + -webkit-transform: scale(1); | ||
12 | + transform: scale(1); | ||
13 | + opacity: 1; | ||
14 | + } | ||
15 | + | ||
16 | + 45% { | ||
17 | + -webkit-transform: scale(0.1); | ||
18 | + transform: scale(0.1); | ||
19 | + opacity: 0.7; | ||
20 | + } | ||
21 | + | ||
22 | + 80% { | ||
23 | + -webkit-transform: scale(1); | ||
24 | + transform: scale(1); | ||
25 | + opacity: 1; | ||
26 | + } | ||
27 | + } | ||
28 | + | ||
29 | + @keyframes scale { | ||
30 | + 0% { | ||
31 | + -webkit-transform: scale(1); | ||
32 | + transform: scale(1); | ||
33 | + opacity: 1; | ||
34 | + } | ||
35 | + | ||
36 | + 45% { | ||
37 | + -webkit-transform: scale(0.1); | ||
38 | + transform: scale(0.1); | ||
39 | + opacity: 0.7; | ||
40 | + } | ||
41 | + | ||
42 | + 80% { | ||
43 | + -webkit-transform: scale(1); | ||
44 | + transform: scale(1); | ||
45 | + opacity: 1; | ||
46 | + } | ||
47 | + } | ||
48 | + | ||
9 | .loading { | 49 | .loading { |
10 | position: absolute; | 50 | position: absolute; |
11 | - width: 100rem / $pxConvertRem; | ||
12 | - height: 40rem / $pxConvertRem; | ||
13 | - background: image-url('loading.gif') no-repeat; | ||
14 | - background-size: 100% 100%; | 51 | + width: 60px; |
52 | + height: 20px; | ||
15 | top: 50%; | 53 | top: 50%; |
16 | left: 50%; | 54 | left: 50%; |
17 | - margin-left: -50rem / $pxConvertRem; | ||
18 | - margin-top: -20rem / $pxConvertRem; | 55 | + margin-top: -10px; |
56 | + margin-left: -30px; | ||
57 | + | ||
58 | + > div { | ||
59 | + display: inline-block; | ||
60 | + background: #fff; | ||
61 | + width: 15px; | ||
62 | + height: 15px; | ||
63 | + @include border-radius(100%); | ||
64 | + margin: 2px; | ||
65 | + | ||
66 | + $init: 0.12; | ||
67 | + @for $i from 1 through 3 { | ||
68 | + &:nth-child(#{$i}) { | ||
69 | + -webkit-animation: scale .75s #{$init}s infinite cubic-bezier(.2,.68,.18,1.08); | ||
70 | + animation: scale .75s #{$init}s infinite cubic-bezier(.2,.68,.18,1.08); | ||
71 | + } | ||
72 | + | ||
73 | + $init: ($i + 1) * 0.12; | ||
74 | + } | ||
75 | + } | ||
19 | } | 76 | } |
20 | } | 77 | } |
@@ -4,58 +4,6 @@ | @@ -4,58 +4,6 @@ | ||
4 | {{> product/banner-swipe-and-single}} | 4 | {{> product/banner-swipe-and-single}} |
5 | {{/ headerBanner}} | 5 | {{/ headerBanner}} |
6 | <div id="hotRank"></div> | 6 | <div id="hotRank"></div> |
7 | - {{#if brand}} | ||
8 | - <input id="brand" type="hidden" value={{brand}}> | ||
9 | - {{/if}} | ||
10 | - | ||
11 | - {{#if gender}} | ||
12 | - <input id="gender" type="hidden" value={{gender}}> | ||
13 | - {{/if}} | ||
14 | - | ||
15 | - {{#if sort}} | ||
16 | - <input id="sort" type="hidden" value={{sort}}> | ||
17 | - {{/if}} | ||
18 | - | ||
19 | - {{#if msort}} | ||
20 | - <input id="msort" type="hidden" value={{msort}}> | ||
21 | - {{/if}} | ||
22 | - | ||
23 | - {{#if misort}} | ||
24 | - <input id="misort" type="hidden" value={{misort}}> | ||
25 | - {{/if}} | ||
26 | - | ||
27 | - {{#if color}} | ||
28 | - <input id="color" type="hidden" value={{color}}> | ||
29 | - {{/if}} | ||
30 | - | ||
31 | - {{#if size}} | ||
32 | - <input id="size" type="hidden" value={{size}}> | ||
33 | - {{/if}} | ||
34 | - | ||
35 | - {{#if price}} | ||
36 | - <input id="price" type="hidden" value={{price}}> | ||
37 | - {{/if}} | ||
38 | - | ||
39 | - {{#if p_d}} | ||
40 | - <input id="p_d" type="hidden" value={{p_d}}> | ||
41 | - {{/if}} | ||
42 | - | ||
43 | - {{#if channel}} | ||
44 | - <input id="channel" type="hidden" value={{channel}}> | ||
45 | - {{/if}} | ||
46 | - | ||
47 | - {{#if limit}} | ||
48 | - <input id="limit" type="hidden" value={{limit}}> | ||
49 | - {{/if}} | ||
50 | - | ||
51 | - {{#if page}} | ||
52 | - <input id="page" type="hidden" value={{page}}> | ||
53 | - {{/if}} | ||
54 | - | ||
55 | - {{#if discount}} | ||
56 | - <input id="discount" type="hidden" value={{discount}}> | ||
57 | - {{/if}} | ||
58 | - | ||
59 | {{> product/suspend-cart}} | 7 | {{> product/suspend-cart}} |
60 | </div> | 8 | </div> |
61 | {{> layout/footer}} | 9 | {{> layout/footer}} |
@@ -37,6 +37,9 @@ | @@ -37,6 +37,9 @@ | ||
37 | <div class="container hide clearfix"></div> | 37 | <div class="container hide clearfix"></div> |
38 | {{> filter}} | 38 | {{> filter}} |
39 | </div> | 39 | </div> |
40 | + | ||
41 | + {{> product/query-param}} | ||
42 | + | ||
40 | {{> product/suspend-cart}} | 43 | {{> product/suspend-cart}} |
41 | </div> | 44 | </div> |
42 | {{> layout/footer}} | 45 | {{> layout/footer}} |
1 | +{{#if brand}} | ||
2 | + <input class="query-param" type="hidden" data-attr="brand" value="{{brand}}"> | ||
3 | +{{/if}} | ||
4 | + | ||
5 | +{{#if gender}} | ||
6 | + <input class="query-param" type="hidden" data-attr="gender" value="{{gender}}"> | ||
7 | +{{/if}} | ||
8 | + | ||
9 | +{{#if sort}} | ||
10 | + <input class="query-param" type="hidden" data-attr="sort" value="{{sort}}"> | ||
11 | +{{/if}} | ||
12 | + | ||
13 | +{{#if msort}} | ||
14 | + <input class="query-param" type="hidden" data-attr="msort" value="{{msort}}"> | ||
15 | +{{/if}} | ||
16 | + | ||
17 | +{{#if misort}} | ||
18 | + <input class="query-param" type="hidden" data-attr="misort" value="{{misort}}"> | ||
19 | +{{/if}} | ||
20 | + | ||
21 | +{{#if color}} | ||
22 | + <input class="query-param" type="hidden" data-attr="color" value="{{color}}"> | ||
23 | +{{/if}} | ||
24 | + | ||
25 | +{{#if size}} | ||
26 | + <input class="query-param" type="hidden" data-attr="size" value="{{size}}"> | ||
27 | +{{/if}} | ||
28 | + | ||
29 | +{{#if price}} | ||
30 | + <input class="query-param" type="hidden" data-attr="price" value="{{price}}"> | ||
31 | +{{/if}} | ||
32 | + | ||
33 | +{{#if discount}} | ||
34 | + <input class="query-param" type="hidden" data-attr="discount" value="{{discount}}"> | ||
35 | +{{/if}} | ||
36 | + | ||
37 | +{{#if query}} | ||
38 | + <input class="query-param" type="hidden" data-attr="query" value="{{query}}"> | ||
39 | +{{/if}} | ||
40 | + | ||
41 | +{{#if style}} | ||
42 | + <input class="query-param" type="hidden" data-attr="style" value="{{style}}"> | ||
43 | +{{/if}} | ||
44 | + | ||
45 | +{{#if p_d}} | ||
46 | + <input class="query-param" type="hidden" data-attr="p_d" value="{{p_d}}"> | ||
47 | +{{/if}} | ||
48 | + | ||
49 | +{{#if channel}} | ||
50 | + <input class="query-param" type="hidden" data-attr="channel" value="{{channel}}"> | ||
51 | +{{/if}} | ||
52 | + | ||
53 | +{{#if dayLimit}} | ||
54 | + <input class="query-param" type="hidden" data-attr="dayLimit" value="{{dayLimit}}"> | ||
55 | +{{/if}} | ||
56 | + | ||
57 | +{{#if limit}} | ||
58 | + <input class="query-param" type="hidden" data-attr="limit" value="{{limit}}"> | ||
59 | +{{/if}} |
-
Please register or login to post a comment