index_bk.html 8.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268
  1. <extend name="Public:pinduoduobase" />
  2. <block name="content">
  3. <link rel="stylesheet" href="__PUBLIC__/pinduoduo/assets/css/spike_fa7d87b5cdf7fae91acff20eb96ae665.css">
  4. <div id="spike-list">
  5. <div class="base-list-wrapper" id="tuan_list">
  6. <volist name="list" id="d">
  7. <div class="spike-list-item-0" onclick="location.href='{:U('/goods/'.$d['goods_id'])}'">
  8. <div avalonctrl="spike-list-item-0">
  9. <?php
  10. $to_night = strtotime(date('Y-m-d')." 23:59:59");
  11. $tomo_night = $to_night + 86400;
  12. $aftmo_night = $to_night + 86400*2;
  13. ?>
  14. <?php if(empty($cur_btime) ){
  15. $cur_btime = $d['begin_time'];//首次进入
  16. ?>
  17. <?php if($d['begin_time'] <= time() && $d['end_time'] > time() ){
  18. $is_first = true;
  19. ?>
  20. <!-- 正在进行中,并且首次进入 -->
  21. <div class="time-line">
  22. <!--ms-if-->
  23. <span class="icon"><div class="time-icon time-icon-current"></div><span>
  24. <span class="time-show time-show-current"> <?php echo date('H').':00'; ?> 正在进行中</span>
  25. </span></span>
  26. </div>
  27. <?php } else if($d['begin_time'] < $to_night){ ?>
  28. <div class="time-line">
  29. <!--ms-if-->
  30. <span class="icon"><div class="time-icon"></div><span>
  31. <span class="time-show"> <?php echo date('H',$d['begin_time']).':00'; ?> </span>
  32. </span></span>
  33. </div>
  34. <?php }else if($d['begin_time'] > $to_night && $d['begin_time'] < $tomo_night){ ?>
  35. <!-- 明日 -->
  36. <div class="time-line">
  37. <!--ms-if-->
  38. <span class="icon"><div class="time-icon"></div><span>
  39. <span class="time-show">明日 <?php echo date('H',$d['begin_time']).':00'; ?> </span>
  40. </span></span>
  41. </div>
  42. <?php }else if($d['begin_time'] > $tomo_night && $d['begin_time'] < $aftmo_night){ ?>
  43. <!-- 后日 -->
  44. <div class="time-line">
  45. <!--ms-if-->
  46. <span class="icon"><div class="time-icon"></div><span>
  47. <span class="time-show">后天 <?php echo date('H',$d['begin_time']).':00'; ?> </span>
  48. </span></span>
  49. </div>
  50. <?php }else{ $is_first = false; ?>
  51. <!-- 很多天以后 -->
  52. <div class="time-line">
  53. <!--ms-if-->
  54. <span class="icon"><div class="time-icon"></div><span>
  55. <span class="time-show"> <?php echo date('Y-m-d H',$d['begin_time']).':00'; ?> </span>
  56. </span></span>
  57. </div>
  58. <?php } ?>
  59. <?php }else if($d['begin_time'] != $cur_btime){
  60. $cur_btime = $d['begin_time'];
  61. $is_first = false;
  62. ?>
  63. <?php if($d['begin_time'] < $to_night){ ?>
  64. <div class="time-line">
  65. <!--ms-if-->
  66. <span class="icon"><div class="time-icon"></div><span>
  67. <span class="time-show"> <?php echo date('H',$d['begin_time']).':00'; ?> </span>
  68. </span></span>
  69. </div>
  70. <?php }else if($d['begin_time'] > $to_night && $d['begin_time'] < $tomo_night){ ?>
  71. <!-- 明日 -->
  72. <div class="time-line">
  73. <!--ms-if-->
  74. <span class="icon"><div class="time-icon"></div><span>
  75. <span class="time-show">明日 <?php echo date('H',$d['begin_time']).':00'; ?> </span>
  76. </span></span>
  77. </div>
  78. <?php }else if($d['begin_time'] > $tomo_night && $d['begin_time'] < $aftmo_night){ ?>
  79. <!-- 后日 -->
  80. <div class="time-line">
  81. <!--ms-if-->
  82. <span class="icon"><div class="time-icon"></div><span>
  83. <span class="time-show">后天 <?php echo date('H',$d['begin_time']).':00'; ?> </span>
  84. </span></span>
  85. </div>
  86. <?php }else{ ?>
  87. <!-- 很多天以后 -->
  88. <div class="time-line">
  89. <!--ms-if-->
  90. <span class="icon"><div class="time-icon"></div><span>
  91. <span class="time-show"> <?php echo date('Y-m-d H',$d['begin_time']).':00'; ?> </span>
  92. </span></span>
  93. </div>
  94. <?php } ?>
  95. <?php }else {
  96. $cur_btime = $d['begin_time'];
  97. $is_first = false;
  98. ?>
  99. <?php } ?>
  100. <div class="spike-goods">
  101. <?php if($is_first){ ?>
  102. <div class="line line-current"></div>
  103. <?php }else { ?>
  104. <div class="line "></div>
  105. <?php } ?>
  106. <img class="spike-img" src="{$d.image}">
  107. <div class="spike-info">
  108. <div class="spike-goods-name">{$d.name}</div>
  109. <div class="spike-buy">
  110. <div class="all-price">
  111. <span class="sale-symbol">¥</span>
  112. <span class="sale-price">{$d.pinprice}</span>
  113. <span class="market-price">¥<span class="market">{$d.price}<span></span>
  114. </span></span></div>
  115. <?php if($d['quantity'] != 0 && $d['begin_time'] <= time() && $d['end_time'] > time()){ ?>
  116. <div class="left-time spike-button-on">
  117. <div class="quantity">
  118. <span class="head">剩余</span>
  119. <div class="quantity-detail">
  120. <span>{$d.quantity}件</span>
  121. </div>
  122. </div>
  123. <span class="btnClass">马上抢</span>
  124. </div>
  125. <?php } ?>
  126. <?php if($d['quantity'] == 0){ ?>
  127. <div class="left-time spike-button-off">
  128. <div class="quantity">
  129. <span class="head">剩余</span>
  130. <div class="quantity-detail">
  131. <span>{$d.quantity}件</span>
  132. </div>
  133. </div>
  134. <span class="btnClass">已售罄</span>
  135. </div>
  136. <?php } ?>
  137. <?php if($d['quantity'] != 0 && $d['begin_time'] > time()) { ?>
  138. <div class="left-time spike-button-coming">
  139. <div class="quantity">
  140. <span class="head">限量</span>
  141. <div class="quantity-detail">
  142. <span>{$d.quantity}件</span>
  143. </div>
  144. </div>
  145. <span class="btnClass">即将开抢</span>
  146. </div>
  147. <?php } ?>
  148. </div>
  149. </div>
  150. </div>
  151. <!--ms-if-->
  152. <?php if($is_first){ ?>
  153. <div class="view-more" id="more" style="display:none;">
  154. <span>查看之前时间段已售罄商品</span>
  155. </div>
  156. <?php } ?>
  157. <div class="final-icon"></div>
  158. <!--ms-if-->
  159. </div>
  160. </div>
  161. <?php $last_btime = $d['begin_time']; ?>
  162. </volist>
  163. </div>
  164. </div>
  165. <div class="center" id="center_pullup" style="display:none;">
  166. <span><img class="img_rotate" src="__PUBLIC__/pinduoduo/assets/img/pull_loading_8eba142.png"/>
  167. </span><span class="orders_text"></span>
  168. </div>
  169. <style>
  170. .center {
  171. width: 170px;
  172. margin: 0 auto;
  173. text-align: center;
  174. }
  175. .img_rotate {
  176. width: 30px;
  177. height: 30px;
  178. margin-top: 7px;
  179. margin-right: 5px;
  180. -webkit-animation: loading 1s linear 0s infinite;
  181. }
  182. @-webkit-keyframes loading {
  183. 0% {
  184. -webkit-transform: rotate(0);
  185. }
  186. 100% {
  187. -webkit-transform: rotate(360deg);
  188. }
  189. }
  190. .orders_text {
  191. line-height: 45px;
  192. font-weight: 700;
  193. font-size: 15px;
  194. }
  195. </style>
  196. <script>
  197. var offset = 0;
  198. var _pa = 2;
  199. var is_can_next = 1;
  200. var cur_url = "{:U('Spike/index')}";
  201. var last_btime = "{$last_btime}";
  202. var req_step = 1;
  203. function loaddata()
  204. {
  205. var totalheight = parseFloat($(window).height()) + parseFloat($(window).scrollTop()); //浏览器的高度加上滚动条的高度
  206. if ($(document).height() <= totalheight+200) //当文档的高度小于或者等于总的高度的时候,开始动态加载数据
  207. {
  208. if(is_can_next == 1)//加载数据
  209. {
  210. is_can_next = 0;
  211. nextpage();
  212. }
  213. }
  214. }
  215. function nextpage()
  216. {
  217. $('#center_pullup').show();
  218. $.ajax(
  219. {
  220. url: cur_url,
  221. type:'post',
  222. data:{page:_pa,last_btime:last_btime},
  223. dataType: 'json',
  224. success: function(result){
  225. if(result.code == 1)
  226. {
  227. $('#tuan_list').append(result.html);
  228. $('#center_pullup').hide();
  229. last_btime = result.fc_last_end_time;
  230. _pa++;
  231. is_can_next = 1;
  232. } else {
  233. $('#center_pullup').remove();
  234. }
  235. }
  236. }
  237. );
  238. }
  239. $(function(){
  240. $(window).scroll( function() {
  241. loaddata();
  242. });
  243. })
  244. </script>
  245. </block>