index_ajax_goods_list.html 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227
  1. <section class="main-view tuan-index" id="goods_list">
  2. <div class="base-list-wrapper" id="tuan_list">
  3. <volist name="list" id="d">
  4. <div class="single-list-item" onclick="location.href='{:U('/goods/'.$d['goods_id'])}'">
  5. <div class="goods-image">
  6. <img src="{$index_ly_image}" data-echo="__UPLOAD__/{$d.image}" class="scrollLoading" data-url="__UPLOAD__/{$d.image}" width="100%">
  7. </div>
  8. <p class="goods-name" data-log="" data-reactid="89">
  9. {$d.name}
  10. </p>
  11. <div class="detail" style="height: .5rem;">
  12. <div class="local-groups">
  13. <span></span>
  14. <?php foreach($d['avatar_list'] as $avatar){ ?>
  15. <div class="avatar">
  16. <img src="<?php echo $avatar['avatar']; ?>">
  17. </div>
  18. <?php } ?>
  19. </div>
  20. </div>
  21. <div class="detail" data-reactid="90">
  22. <img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACIAAAAiCAMAAAANmfvwAAAABGdBTUEAALGPC/xhBQAAAAFzUkdCAK7OHOkAAAEIUExURUxpcZSUlJCQkJaWlpmZmZWVlZmZmZSUlJSUlJSUlJSUlJOTk5WVlZSUlJSUlJSUlJSUlJWVlZaWlpSUlJWVlZWVlZSUlJSUlJSUlJSUlJWVlZSUlJWVlZWVlX9/f5SUlJWVlZWVlZ+fn5aWlpSUlJSUlJKSkpWVlZmZmZWVlZOTk5WVlZWVlZWVlZaWlpSUlJSUlJWVlZWVlaqqqpSUlJmZmZWVlZOTk5SUlJWVlZSUlJOTk////5WVlZOTk5WVlZWVlZOTk5WVlZWVlZSUlJWVlZaWlpSUlJWVlZycnJSUlJKSkpaWlpSUlJWVlZSUlJWVlZSUlJWVlZOTk5SUlJSUlJSUlJWVlZnIn4UAAABXdFJOUwD3FxYKdgWL+lRlQNDODOvwsD2xmDqN/jxxRm77lgJ68aIIM93VIYAZgy10Y/0s/Hx7xAOlHoxY0eDMZAHvOT9oMqzs7Z9mocgNyTsnMLyg6p5XJrtWJJVjJAMAAAFFSURBVDjL3ZHVloNAEEQbEogQiLu7u7usu2///5/sSCA5yWHfd+ulq5o7Q9MA/GH5/B70+H2/ENEwUoWjpkQEdUXMEK+BeM2QjIFkTIgcHpQzYewGYT97FkxLeVKKBlIkKS+lgwYRoN0ygM1AbABlWgN7IsbbNSjpb7KXoMZdjCMhnuqHa8glde5CHEny1AWwFpgrWAG6vJnkSJwnB7GOE4dxjogCDW5yFCqsXyHO6qZOEPfzdmiaU1dlSJXaOXUd/aPlKeJsAdq4tx+3N9ZgMUOcyjrSn+Bytd4JRz9A2K1XS5z0OWBpuBA3Ep5K2iC6GhZC2Ni+tuoZom7ZFsmOEix/vZwhb++sJACyzHx+uE+I1+9nVq8AUs77JnGj4aB9BLQHwxEpzdvrFBtYe3xQWjKIzhvXBelfqlmnBeSWojzdwb/UDwOrhGgcYFPiAAAAAElFTkSuQmCC">
  23. <a class="group-desc" data-reactid="92">
  24. {$d.pin_count}人团
  25. </a>
  26. <a class="sale-price" data-reactid="95">
  27. <i data-reactid="96">¥</i>
  28. {$d.pinprice}
  29. </a>
  30. <a class="normal-price" >
  31. 已团{$d.seller_count}
  32. </a>
  33. </div>
  34. <div class="core" data-log="" data-reactid="101">
  35. <span data-reactid="102">去开团</span>
  36. <img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAASBAMAAACdhyI/AAAABGdBTUEAALGPC/xhBQAAAAFzUkdCAK7OHOkAAAAnUExURf///0xpcf///////////////////////////////////////////+nkmRIAAAAMdFJOUx0AA9zdqt4eH6mPHIvMvyYAAABaSURBVAjXYxCsFgQCBvFkRhBVdsYARK05cxjIZVA9A+IyCMWAuAyCYC6DIJjLIAjmAinNM2ccgIJzzhxhBCtxAGs4wgjW7gA27AjIsDYQR5BBIgVskWADyFoA69EgN3WDDasAAAAASUVORK5CYII=" data-reactid="103">
  37. </div>
  38. </div>
  39. </volist>
  40. <?php if(!empty($sublist_list)){ ?>
  41. <volist name="sublist_list" id="sd">
  42. <div class="tuan_recommend" style="height: 355.6px;">
  43. <div class="tuan_recommend_head">
  44. {$sd.name}
  45. </div>
  46. <div class="tuan_read_more" onclick="location.href='{:U('Subject/index',array('id' => $sd['id']) )}'; ">
  47. <span>查看更多</span>
  48. <i class="arrow"></i>
  49. </div>
  50. <ul class="subject-scroll-goods_list_item-24 tuan_bd">
  51. <?php foreach($sd['goods_list'] as $sdcv){ ?>
  52. <li onclick="location.href='{:U('/goods/'.$sdcv['goods']['goods_id'])}'">
  53. <img src="{$fan_ly_image}" data-echo="<?php echo $sdcv['goods']['image']; ?>" class="scrollLoading tuan_recommand_forward" style="width: 220px;height:220px;" >
  54. <div class="tuan_recommend_title" style="width: 220px;">
  55. <?php echo $sdcv['goods']['name']; ?>
  56. </div>
  57. <div class="tuan_recommend_price">
  58. <span><?php echo $sdcv['goods']['pinprice']; ?></span>
  59. </div>
  60. </li>
  61. <?php } ?>
  62. </ul>
  63. <div class="fugai"></div>
  64. </div>
  65. </volist>
  66. <?php } ?>
  67. </div>
  68. </section>
  69. <div class="center" id="center_pullup" style="display:none;">
  70. <span><img class="img_rotate" src="__PUBLIC__/pinduoduo/assets/img/pull_loading_8eba142.png"/>
  71. </span><span class="orders_text"></span>
  72. </div>
  73. <style>
  74. .single-list-item .detail{margin-right: 0.2rem;}
  75. .local-groups {
  76. height: .24rem;
  77. -webkit-box-orient: horizontal;
  78. -webkit-box-direction: reverse;
  79. -ms-flex-direction: row-reverse;
  80. flex-direction: row-reverse;
  81. -webkit-flex-direction: row-reverse;
  82. display: -webkit-box;
  83. display: -ms-flexbox;
  84. display: flex;
  85. display: -webkit-flex;
  86. -webkit-box-pack: start;
  87. -ms-flex-pack: start;
  88. justify-content: flex-start;
  89. -webkit-justify-content: flex-start;
  90. -webkit-box-align: center;
  91. -ms-flex-align: center;
  92. align-items: center;
  93. -webkit-align-items: center;
  94. }
  95. .local-groups .avatar, .local-groups .local-groups-bubble {
  96. float: right;
  97. background-repeat: no-repeat;
  98. background-size: contain;
  99. }
  100. .local-groups .avatar {
  101. width: .25rem;
  102. height: .25rem;
  103. background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACwAAAAsCAMAAAApWqozAAAAXVBMV…fRwbg/co8Nc+QRXxMP4THEFtBwYLX9c2niOr7fbvfQOv4Co6SCa8C40ooAAAAASUVORK5CYII=);
  104. border-radius: 50%;
  105. border: 1px solid #e0e0e0;
  106. }
  107. .local-groups .avatar {
  108. width: .32rem;
  109. height: .32rem;
  110. }
  111. .local-groups .avatar:nth-child(n+1) {
  112. margin-left: -.09rem;
  113. }
  114. .local-groups .avatar img {
  115. width: 100%;
  116. height: 100%;
  117. border-radius: 50%;
  118. margin:0px;
  119. }
  120. .center {
  121. width: 170px;
  122. margin: 0 auto;
  123. text-align: center;
  124. }
  125. .img_rotate {
  126. width: 30px;
  127. height: 30px;
  128. margin-top: 7px;
  129. margin-right: 5px;
  130. -webkit-animation: loading 1s linear 0s infinite;
  131. }
  132. @-webkit-keyframes loading {
  133. 0% {
  134. -webkit-transform: rotate(0);
  135. }
  136. 100% {
  137. -webkit-transform: rotate(360deg);
  138. }
  139. }
  140. .orders_text {
  141. line-height: 45px;
  142. font-weight: 700;
  143. font-size: 15px;
  144. }
  145. </style>
  146. <script>
  147. var offset = 0;
  148. var _pa = 2;
  149. var is_can_next = 1;
  150. var cur_url = "{:U('Index/index')}";
  151. function loaddata()
  152. {
  153. var totalheight = parseFloat($(window).height()) + parseFloat($(window).scrollTop()); //浏览器的高度加上滚动条的高度
  154. if ($(document).height() <= totalheight+200) //当文档的高度小于或者等于总的高度的时候,开始动态加载数据
  155. {
  156. if(is_can_next == 1)//加载数据
  157. {
  158. is_can_next = 0;
  159. nextpage();
  160. }
  161. }
  162. }
  163. function nextpage()
  164. {
  165. var best_url = cur_url+'&page='+_pa;
  166. $('#center_pullup').show();
  167. $.ajax(
  168. {
  169. url: cur_url,
  170. type:'get',
  171. data:{page:_pa},
  172. dataType: 'json',
  173. success: function(result){
  174. if(result.code == 1)
  175. {
  176. $('#tuan_list').append(result.html);
  177. $('#center_pullup').hide();
  178. _pa++;
  179. is_can_next = 1;
  180. bindImgEvent();
  181. } else if(result.code == 0) {
  182. $('#center_pullup').hide();
  183. }
  184. }
  185. }
  186. );
  187. }
  188. $(function(){
  189. $(window).scroll( function() {
  190. loaddata();
  191. });
  192. })
  193. </script>