index.html 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139
  1. <extend name="Public:pinduoduobase" />
  2. <block name="content">
  3. <link rel="stylesheet" href="__PUBLIC__/pinduoduo/assets/css/super_spike.css">
  4. <section id="index-content">
  5. <div id="activity_list" class="main-view super-spike">
  6. <section class="al-main">
  7. <div class="al-activity-title">
  8. <img src="__PUBLIC__/pinduoduo/assets/css/superspike.png">
  9. <div class="al-activity-title-name">限时特卖</div>
  10. </div>
  11. <ul class="al-goods-list" id="tuan_list">
  12. <volist name="list" id="d">
  13. <li class="al-goods" onclick="location.href='{:U('/goods/'.$d['goods_id'])}'">
  14. <div class="al-item-img">
  15. <img class="al-item-logo" src="<?php $store = M('seller')->where( array('s_id' => $d['store_id']) )->find();echo resize($store['s_logo'], 100, 100); ?>">
  16. <img class="al-item-pic" src="__UPLOAD__/{$d.image}">
  17. <!--ms-if-->
  18. </div>
  19. <div class="al-item-name">
  20. <span>{$d.name}</span>
  21. </div>
  22. <div class="al-item-info">
  23. <div class="al-item-mk">
  24. <div class="al-item-discount">
  25. <div class="al-item-circle"></div>
  26. <?php echo round( ($d['pinprice']/$d['price']) * 10,1); ?>折
  27. </div>
  28. <div class="al-item-price">
  29. <span class="price-icon">¥</span>
  30. <span class="price">{$d.pinprice}</span>
  31. <del class="market-price">¥{$d.price}</del>
  32. <p class="al-item-sales">已团{$d.seller_count}件</p>
  33. </div>
  34. </div>
  35. <div class="al-item-sale">
  36. 马上抢
  37. <img src="__PUBLIC__/pinduoduo/assets/img/rightjian.png">
  38. </div>
  39. <!--ms-if-->
  40. </div>
  41. </li>
  42. </volist>
  43. </ul>
  44. </section>
  45. </div>
  46. </section>
  47. <div class="center" id="center_pullup" style="display:none;">
  48. <span><img class="img_rotate" src="__PUBLIC__/pinduoduo/assets/img/pull_loading_8eba142.png"/>
  49. </span><span class="orders_text"></span>
  50. </div>
  51. <style>
  52. .center {
  53. width: 170px;
  54. margin: 0 auto;
  55. text-align: center;
  56. }
  57. .img_rotate {
  58. width: 30px;
  59. height: 30px;
  60. margin-top: 7px;
  61. margin-right: 5px;
  62. -webkit-animation: loading 1s linear 0s infinite;
  63. }
  64. @-webkit-keyframes loading {
  65. 0% {
  66. -webkit-transform: rotate(0);
  67. }
  68. 100% {
  69. -webkit-transform: rotate(360deg);
  70. }
  71. }
  72. .orders_text {
  73. line-height: 45px;
  74. font-weight: 700;
  75. font-size: 15px;
  76. }
  77. </style>
  78. <script>
  79. var offset = 0;
  80. var _pa = 2;
  81. var is_can_next = 1;
  82. var cur_url = "{:U('SuperSpike/index')}";
  83. var req_step = 1;
  84. function loaddata()
  85. {
  86. var totalheight = parseFloat($(window).height()) + parseFloat($(window).scrollTop()); //浏览器的高度加上滚动条的高度
  87. if ($(document).height() <= totalheight+200) //当文档的高度小于或者等于总的高度的时候,开始动态加载数据
  88. {
  89. if(is_can_next == 1)//加载数据
  90. {
  91. is_can_next = 0;
  92. nextpage();
  93. }
  94. }
  95. }
  96. function nextpage()
  97. {
  98. $('#center_pullup').show();
  99. $.ajax(
  100. {
  101. url: cur_url,
  102. type:'post',
  103. data:{page:_pa},
  104. dataType: 'json',
  105. success: function(result){
  106. if(result.code == 1)
  107. {
  108. $('#tuan_list').append(result.html);
  109. $('#center_pullup').hide();
  110. _pa++;
  111. is_can_next = 1;
  112. } else if(result.code == 0) {
  113. $('#center_pullup').remove();
  114. }
  115. }
  116. }
  117. );
  118. }
  119. $(function(){
  120. $(window).scroll( function() {
  121. loaddata();
  122. });
  123. })
  124. </script>
  125. </block>