Merge branch 'develop' of git.dev.yoho.cn:web/yohobuy into develop
Showing
4 changed files
with
9 additions
and
11 deletions
@@ -112,7 +112,7 @@ class NewsaleData | @@ -112,7 +112,7 @@ class NewsaleData | ||
112 | 112 | ||
113 | $param['client_secret'] = Sign::getSign($param); | 113 | $param['client_secret'] = Sign::getSign($param); |
114 | 114 | ||
115 | - return Yohobuy::get(Yohobuy::API_URL, $param, 600); // 缓存10分钟 | 115 | + return Yohobuy::get(Yohobuy::API_URL, $param, 1800); // 缓存30分钟 |
116 | } | 116 | } |
117 | 117 | ||
118 | /** | 118 | /** |
@@ -15,8 +15,7 @@ var $loadMoreInfo = $('#load-more-info'); | @@ -15,8 +15,7 @@ var $loadMoreInfo = $('#load-more-info'); | ||
15 | var $loading = $(''), | 15 | var $loading = $(''), |
16 | $noMore = $(''); | 16 | $noMore = $(''); |
17 | 17 | ||
18 | -var winH = $(window).height(), | ||
19 | - loadMoreH = $loadMoreInfo.height(); | 18 | +var winH = $(window).height(); |
20 | 19 | ||
21 | var $infoList = $('#info-list'), | 20 | var $infoList = $('#info-list'), |
22 | $infos = $infoList.children('.info-list'), | 21 | $infos = $infoList.children('.info-list'), |
@@ -107,7 +106,9 @@ navHammer.on('tap', function(e) { | @@ -107,7 +106,9 @@ navHammer.on('tap', function(e) { | ||
107 | }); | 106 | }); |
108 | 107 | ||
109 | $(document).scroll(function() { | 108 | $(document).scroll(function() { |
110 | - if ($(window).scrollTop() + winH >= $(document).height() - loadMoreH - 50) { | ||
111 | - loadMore($infos.not('.hide'), state[curType]); | 109 | + var $c = $infos.not('.hide'); |
110 | + | ||
111 | + if ($(window).scrollTop() + winH >= $(document).height() - 0.25 * $c.height()) { | ||
112 | + loadMore($c, state[curType]); | ||
112 | } | 113 | } |
113 | }); | 114 | }); |
@@ -9,8 +9,7 @@ var $ = require('jquery'); | @@ -9,8 +9,7 @@ var $ = require('jquery'); | ||
9 | var info = require('./info'), | 9 | var info = require('./info'), |
10 | loadMore = info.loadMore; | 10 | loadMore = info.loadMore; |
11 | 11 | ||
12 | -var winH = $(window).height(), | ||
13 | - loadMoreH = $('#load-more').height(); | 12 | +var winH = $(window).height(); |
14 | 13 | ||
15 | var $author = $('#author-infos'); | 14 | var $author = $('#author-infos'); |
16 | var $tag = $('#tag'); | 15 | var $tag = $('#tag'); |
@@ -41,9 +40,7 @@ if ($tag.length > 0) { | @@ -41,9 +40,7 @@ if ($tag.length > 0) { | ||
41 | } | 40 | } |
42 | 41 | ||
43 | $(document).scroll(function() { | 42 | $(document).scroll(function() { |
44 | - | ||
45 | - //设置50px阈值 | ||
46 | - if ($(window).scrollTop() + winH >= $(document).height() - loadMoreH - 50) { | 43 | + if ($(window).scrollTop() + winH >= $(document).height() - 0.25 * $infos.height()) { |
47 | loadMore($infos, setting); | 44 | loadMore($infos, setting); |
48 | } | 45 | } |
49 | }); | 46 | }); |
@@ -55,7 +55,7 @@ class SearchModel | @@ -55,7 +55,7 @@ class SearchModel | ||
55 | } | 55 | } |
56 | // 接口调用正常,数据封装完成, 则设置一级(master)和二级(slave)数据缓存 | 56 | // 接口调用正常,数据封装完成, 则设置一级(master)和二级(slave)数据缓存 |
57 | else { | 57 | else { |
58 | - Cache::set($key, $result, 600); // 缓存10分钟 | 58 | + Cache::set($key, $result, 1800); // 缓存30分钟 |
59 | } | 59 | } |
60 | } | 60 | } |
61 | 61 |
-
Please register or login to post a comment