list.html 2.7 KB

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