Authored by ccbikai

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

@@ -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 });
@@ -27,16 +27,4 @@ @@ -27,16 +27,4 @@
27 var s = document.getElementsByTagName("script")[0]; 27 var s = document.getElementsByTagName("script")[0];
28 s.parentNode.insertBefore(hm, s); 28 s.parentNode.insertBefore(hm, s);
29 })(); 29 })();
30 -</script>  
31 -  
32 -<script type="text/javascript">  
33 - (function(w,d,s,j,f){  
34 - w['YohoAcquisitionObject']=f;  
35 - w[f]=function(){w[f].p=arguments;};  
36 - var a=d.createElement(s);  
37 - var m=d.getElementsByTagName(s)[0];  
38 - a.async=1;  
39 - a.src=j;  
40 - m.parentNode.insertBefore(a,m);  
41 - })(window,document,'script','http://cdn.yoho.cn/yas-jssdk/1.0.8/yas.js','_yas');  
42 </script> 30 </script>
@@ -20,7 +20,20 @@ @@ -20,7 +20,20 @@
20 <script>seajs.config({base: 'http://localhost:8000/'});</script> 20 <script>seajs.config({base: 'http://localhost:8000/'});</script>
21 {{/if}} 21 {{/if}}
22 22
23 -{{> layout/analysis}} 23 +<script type="text/javascript">
  24 + (function(w,d,s,j,f){
  25 + w['YohoAcquisitionObject']=f;
  26 + w[f]=function(){w[f].p=arguments;};
  27 + var a=d.createElement(s);
  28 + var m=d.getElementsByTagName(s)[0];
  29 + a.async=1;
  30 + a.src=j;
  31 + m.parentNode.insertBefore(a,m);
  32 + })(window,document,'script','http://cdn.yoho.cn/yas-jssdk/1.0.8/yas.js','_yas');
  33 +</script>
  34 +
24 {{> layout/use}} 35 {{> layout/use}}
  36 +
  37 +{{> layout/analysis}}
25 </body> 38 </body>
26 </html> 39 </html>
@@ -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