list.html 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. <{include file="header.html"}>
  2. <link rel="stylesheet" type="text/css" href="<{$web_cfg.cdn}>/haili/css/index.css" />
  3. <style>
  4. .vogue_top_list img {
  5. background: #fff url("<{$web_cfg.cdn}>/public/static/img/m-load.gif") no-repeat scroll 50% center / 20px 20px;
  6. }
  7. </style>
  8. <{include file="common_header.html"}>
  9. <{if $eventsData}>
  10. <section class="cardlist">
  11. <{foreach from=$eventsData item=events}>
  12. <dl>
  13. <dt><a href="<{$events.url}>"><img src="<{$web_cfg.cdn}>/public/static/img/bg_alpha.png" data-ks-lazyload="<{$events.img_url}>"></a></dt>
  14. <dd><h5><{$events.events_name}></h5></dd>
  15. <dd><span class="time">
  16. <{if $events.rday>=1}>
  17. <em class="icon-time"></em>剩余<{$events.rday}>天</span>
  18. <{else}>
  19. 已结束
  20. <{/if}>
  21. <span>参与<{$events.user_total}>人</span>
  22. </dd>
  23. </dl>
  24. <{/foreach}>
  25. </section>
  26. <{/if}>
  27. <div class="clear"></div>
  28. <{if $totals}>
  29. <div class="loading">
  30. <img
  31. id="loadPage"
  32. data-ks-lazyload="<{$web_cfg.cdn}>/public/static/img/loading_new.gif"
  33. data-request-url="<{$web_cfg.domain}>/?c=cate&a=ajax&cate=<{$cate}>&plat_form_id=<{$plat_form_id}>&url=<{$url}>"
  34. data-page="2"
  35. data-totals="<{$totals}>"
  36. style="width:0px;"
  37. />
  38. <div class="loader-inner ball-pulse">
  39. <div></div><div></div><div></div><div></div><div></div><div></div>
  40. </div>
  41. </div>
  42. <{/if}>
  43. <script>
  44. KISSY.use('node, io, gallery/datalazyload/2.0/index', function (S, Node, IO, Datalazyload) {
  45. var $ = S.all;
  46. var lock = false;
  47. new Datalazyload({
  48. load: function(el){
  49. if (lock) return false;
  50. lock = true;
  51. var requesrUrl = $(el).attr('data-request-url');
  52. var page = Number($(el).attr('data-page'));
  53. var totals = Number($(el).attr('data-totals'));
  54. if (!requesrUrl) {
  55. lock = false;
  56. return false;
  57. }
  58. if (page > totals) {
  59. $('.loading').hide();
  60. return false;
  61. }
  62. IO.get(
  63. requesrUrl
  64. , {page: page}
  65. , function (data) {
  66. if (data.ok) {
  67. var next_page = page + 1;
  68. $('#loadPage').attr('data-page', next_page);
  69. var new_dl = $(data.msg);
  70. $(".cardlist").append(new_dl);
  71. new Datalazyload();
  72. lock = false;
  73. if (next_page > totals) {
  74. $('.loading').hide();
  75. }
  76. }
  77. }
  78. , 'json'
  79. );
  80. }
  81. });
  82. });
  83. //判断当前页图片加载完成loading消失
  84. /* $(".vogue_top_list").find("img").load(function(){
  85. $(this).parent().css("background","none");
  86. }); */
  87. </script>
  88. <{include file="bottom.html"}>
  89. <script type="text/javascript" src="<{$web_cfg.cdn}>/haili/js/list.js"></script>