Authored by whb

Merge branch 'develop' of http://git.dev.yoho.cn/web/yohobuy.git into develop

@@ -6,6 +6,7 @@ @@ -6,6 +6,7 @@
6 var $ = require('yoho.jquery'); 6 var $ = require('yoho.jquery');
7 7
8 require('./footer'); 8 require('./footer');
  9 +require('./simple-header');
9 require('./header'); 10 require('./header');
10 11
11 function cookie(name) { 12 function cookie(name) {
@@ -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,
@@ -266,16 +266,16 @@ function fadeAnimate() { @@ -266,16 +266,16 @@ function fadeAnimate() {
266 if (window.globaltimeout) { 266 if (window.globaltimeout) {
267 window.clearTimeout(window.globaltimeout); 267 window.clearTimeout(window.globaltimeout);
268 } 268 }
269 - window.logotrans.fadeOut(window.loopdurationtime, function() { 269 + window.$logotrans.fadeOut(window.loopdurationtime, function() {
270 window.isen = false; 270 window.isen = false;
271 - window.logotrans.css('background-image', 'url(http://static.yohobuy.com/newheader/img/logo.png)');  
272 - window.logotrans.fadeIn(window.loopdurationtime, function() { 271 + window.$logotrans.css('background-image', 'url(http://static.yohobuy.com/newheader/img/logo.png)');
  272 + window.$logotrans.fadeIn(window.loopdurationtime, function() {
273 window.onetimeoout = window.setTimeout(function() { 273 window.onetimeoout = window.setTimeout(function() {
274 - window.logotrans.fadeOut(window.loopdurationtime, function() { 274 + window.$logotrans.fadeOut(window.loopdurationtime, function() {
275 window.clearTimeout(window.onetimeoout); 275 window.clearTimeout(window.onetimeoout);
276 window.isen = true; 276 window.isen = true;
277 - window.logotrans.css('background-image', 'url(http://static.yohobuy.com/newheader/img/logo_e.png)');  
278 - window.logotrans.fadeIn(window.loopdurationtime, function() { 277 + window.$logotrans.css('background-image', 'url(http://static.yohobuy.com/newheader/img/logo_e.png)');
  278 + window.$logotrans.fadeIn(window.loopdurationtime, function() {
279 window.globaltimeout = window.setTimeout(fadeAnimate, 1 * 60 * 1000); 279 window.globaltimeout = window.setTimeout(fadeAnimate, 1 * 60 * 1000);
280 }); 280 });
281 }); 281 });
@@ -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 +