Merge branch 'develop' of http://git.dev.yoho.cn/web/yohobuy into develop
Showing
2 changed files
with
16 additions
and
2 deletions
@@ -95,14 +95,19 @@ module.exports = function(data) { | @@ -95,14 +95,19 @@ module.exports = function(data) { | ||
95 | var load = new InfiniteLoad({ | 95 | var load = new InfiniteLoad({ |
96 | offset: { | 96 | offset: { |
97 | height: function() { | 97 | height: function() { |
98 | - return parseFloat($container.offset().top) + parseFloat($container.height()); | 98 | + return parseFloat($container.offset().top) + parseFloat($container.height()) - 200; |
99 | } | 99 | } |
100 | } | 100 | } |
101 | }); | 101 | }); |
102 | var options; | 102 | var options; |
103 | var url = data.url; | 103 | var url = data.url; |
104 | + var firstCount = data.firstCount; | ||
105 | + var pageCount = data.pageCount; | ||
104 | 106 | ||
105 | delete data.url; | 107 | delete data.url; |
108 | + delete data.firstCount; | ||
109 | + delete data.pageCount; | ||
110 | + | ||
106 | 111 | ||
107 | 112 | ||
108 | load.on('after', function(p) { | 113 | load.on('after', function(p) { |
@@ -111,6 +116,8 @@ module.exports = function(data) { | @@ -111,6 +116,8 @@ module.exports = function(data) { | ||
111 | pageIndex: p.index | 116 | pageIndex: p.index |
112 | }); | 117 | }); |
113 | 118 | ||
119 | + data.pageCount = (data.pageIndex === 1) ? firstCount : pageCount; | ||
120 | + | ||
114 | options = { | 121 | options = { |
115 | type: 'POST', | 122 | type: 'POST', |
116 | url: url, | 123 | url: url, |
@@ -24,7 +24,13 @@ if ($.inArray(homePage, ['boys','girls','kids','lifestyle']) > -1) { | @@ -24,7 +24,13 @@ if ($.inArray(homePage, ['boys','girls','kids','lifestyle']) > -1) { | ||
24 | require('../common/new-arrivls')({ | 24 | require('../common/new-arrivls')({ |
25 | type: homePage, | 25 | type: homePage, |
26 | url: '/common/getNewArrival', | 26 | url: '/common/getNewArrival', |
27 | - pageCount: homePage === 'boys' ? '15' : '20' | 27 | + firstCount: homePage === ('boys' || 'lifestyle') ? '25' : '20', |
28 | + pageCount: homePage === ('boys' || 'lifestyle') ? '15' : '12' | ||
29 | + }); | ||
30 | + window.setCookie('_Channel', homePage, { | ||
31 | + domain: '.yohobuy.com', | ||
32 | + path: '/', | ||
33 | + expires: 365 | ||
28 | }); | 34 | }); |
29 | } | 35 | } |
30 | 36 | ||
@@ -54,3 +60,4 @@ if (homePage === 'boys') { | @@ -54,3 +60,4 @@ if (homePage === 'boys') { | ||
54 | $('.img-slider-wrapper').slider2(); | 60 | $('.img-slider-wrapper').slider2(); |
55 | } | 61 | } |
56 | 62 | ||
63 | + |
-
Please register or login to post a comment