Showing
4 changed files
with
19 additions
and
10 deletions
@@ -219,7 +219,7 @@ const category = (req, res, next) => { | @@ -219,7 +219,7 @@ const category = (req, res, next) => { | ||
219 | type: 'default', | 219 | type: 'default', |
220 | order: '0', | 220 | order: '0', |
221 | page: 1, | 221 | page: 1, |
222 | - limit: 6, | 222 | + limit: 12, |
223 | }, params); | 223 | }, params); |
224 | 224 | ||
225 | searchModel.getSearchData(initialData).then((firstScreenGoodsList) => { | 225 | searchModel.getSearchData(initialData).then((firstScreenGoodsList) => { |
@@ -39,7 +39,7 @@ const list = (req, res, next) => { | @@ -39,7 +39,7 @@ const list = (req, res, next) => { | ||
39 | type: 'default', | 39 | type: 'default', |
40 | order: '0', | 40 | order: '0', |
41 | page: 1, | 41 | page: 1, |
42 | - limit: 6 | 42 | + limit: 12 |
43 | }, params); | 43 | }, params); |
44 | 44 | ||
45 | if (query) { | 45 | if (query) { |
@@ -179,6 +179,7 @@ const search = (req, res, next) => { | @@ -179,6 +179,7 @@ const search = (req, res, next) => { | ||
179 | let params = Object.assign({}, req.query); | 179 | let params = Object.assign({}, req.query); |
180 | 180 | ||
181 | params.isApp = req.yoho.isApp; | 181 | params.isApp = req.yoho.isApp; |
182 | + params.limit = 24; | ||
182 | searchModel.getSearchData(params).then((result) => { | 183 | searchModel.getSearchData(params).then((result) => { |
183 | 184 | ||
184 | if (result && result.list && parseInt(params.page) === 1 && parseInt(params.start) > 0) { | 185 | if (result && result.list && parseInt(params.page) === 1 && parseInt(params.start) > 0) { |
@@ -31,7 +31,10 @@ | @@ -31,7 +31,10 @@ | ||
31 | {{#if @root._noLazy}} | 31 | {{#if @root._noLazy}} |
32 | <img src="{{image default_images 235 314}}"/> | 32 | <img src="{{image default_images 235 314}}"/> |
33 | {{else}} | 33 | {{else}} |
34 | + {{!-- | ||
34 | <img class="lazy" data-original="{{image default_images 235 314}}"/> | 35 | <img class="lazy" data-original="{{image default_images 235 314}}"/> |
36 | + --}} | ||
37 | + <img src="{{image default_images 235 314}}"/> | ||
35 | {{/if}} | 38 | {{/if}} |
36 | </a> | 39 | </a> |
37 | {{# is_soon_sold_out}} | 40 | {{# is_soon_sold_out}} |
@@ -454,8 +454,8 @@ function search(opt) { | @@ -454,8 +454,8 @@ function search(opt) { | ||
454 | } | 454 | } |
455 | 455 | ||
456 | if (firstScreen) { | 456 | if (firstScreen) { |
457 | - // 如果首屏加载了,则去掉6条记录 | ||
458 | - params.start = 6; | 457 | + // 如果首屏加载了,则去掉12条记录 |
458 | + params.start = 12; | ||
459 | } | 459 | } |
460 | 460 | ||
461 | $.extend(setting, defaultOpt, params); | 461 | $.extend(setting, defaultOpt, params); |
@@ -988,9 +988,9 @@ $listNav.on('touchend touchcancel', function(e) { | @@ -988,9 +988,9 @@ $listNav.on('touchend touchcancel', function(e) { | ||
988 | 988 | ||
989 | function scrollHandler() { | 989 | function scrollHandler() { |
990 | 990 | ||
991 | - // 当scroll到1/4$goodsContainer高度后继续请求下一页数据 | 991 | + // 当scroll到1/2$goodsContainer高度后继续请求下一页数据 |
992 | if ($(window).scrollTop() + winH > | 992 | if ($(window).scrollTop() + winH > |
993 | - $(document).height() - 0.25 * $goodsContainer.height()) { | 993 | + $(document).height() - 0.5 * $goodsContainer.height()) { |
994 | search(); | 994 | search(); |
995 | } | 995 | } |
996 | } | 996 | } |
@@ -1073,10 +1073,15 @@ if ($brandHeader.length > 0) { | @@ -1073,10 +1073,15 @@ if ($brandHeader.length > 0) { | ||
1073 | }); | 1073 | }); |
1074 | } | 1074 | } |
1075 | 1075 | ||
1076 | -// 初始请求最新第一页数据 | ||
1077 | -setTimeout(function() { | ||
1078 | - search(); | ||
1079 | -}, 500); | 1076 | +var initialData = false; |
1077 | + | ||
1078 | +$(window).one('scroll', function() { | ||
1079 | + // 初始请求最新第一页数据 | ||
1080 | + if (!initialData) { | ||
1081 | + search(); | ||
1082 | + initialData = true; | ||
1083 | + } | ||
1084 | +}); | ||
1080 | 1085 | ||
1081 | $listNav.on('touchstart', 'li', function() { | 1086 | $listNav.on('touchstart', 'li', function() { |
1082 | $listNav.find('li').removeClass('bytouch'); | 1087 | $listNav.find('li').removeClass('bytouch'); |
-
Please register or login to post a comment