niyuan_index.html 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148
  1. <extend name="Public:pinduoduobase" />
  2. <block name="content">
  3. <link rel="stylesheet" href="__PUBLIC__/pinduoduo/assets/css/subject.css">
  4. <div id="main">
  5. <?php if(!empty($subject['banner'])){ ?>
  6. <div class="subject-banner" >
  7. <img src="/Uploads/image/{$subject.banner}" width="100%" />
  8. </div>
  9. <?php } ?>
  10. <section id="index-content">
  11. <?php if($fromindex == 1) { ?>
  12. <ul class="subject-roll-message">
  13. <?php if(!empty($niyuansubjects)) { ?>
  14. <?php $i =1; foreach($niyuansubjects as $niyuan){ ?>
  15. <li <?php if($i<3){ ?>style="color: rgb(102, 102, 102);"<?php }else{ ?>style="color: rgb(255, 0, 0);" <?php } ?> onclick="location='{:U('Subject/index',array('id' => $niyuan['id']))}'">
  16. <p><?php echo $niyuan['name']; ?></p>
  17. </li>
  18. <?php $i++; } ?>
  19. <?php } ?>
  20. </ul>
  21. <?php }else { ?>
  22. <div class="subject-banner" style="display:none;">
  23. </div>
  24. <?php } ?>
  25. <div id="subject-goods-list" class="main-view tuan subject-double-goods">
  26. <div class="base-list-wrapper" id="tuan_list">
  27. <volist name="list" id="d">
  28. <div class="subject-goods-list-item-1 double-grid-one">
  29. <div class="double-grid-item gap-right" onclick="location.href='{:U('/goods/'.$d['goods_id'])}'">
  30. <img src="{$fan_ly_image}" class="scrollLoading" data-echo="__UPLOAD__/{$d.image}" />
  31. <p class="goods-name">{$d.name}</p>
  32. <div class="detail">
  33. <b class="price-icon">¥</b>
  34. <b class="price">{$d.pinprice}</b>
  35. <div class="info">
  36. <span>{$d.pin_count}人团</span>
  37. <span> · </span>
  38. <span>已团{$d.seller_count}件</span>
  39. <!--ms-if-->
  40. </div>
  41. </div>
  42. </div>
  43. </div>
  44. </volist>
  45. </div>
  46. </div>
  47. </section>
  48. </div>
  49. <div class="center" id="center_pullup" style="display:none;">
  50. <span><img class="img_rotate" src="__PUBLIC__/pinduoduo/assets/img/pull_loading_8eba142.png"/>
  51. </span><span class="orders_text"></span>
  52. </div>
  53. <include file="Widget:pin_notify" />
  54. <include file="Public:foot_lazy" />
  55. <style>
  56. .center {
  57. width: 170px;
  58. margin: 0 auto;
  59. text-align: center;
  60. }
  61. .img_rotate {
  62. width: 30px;
  63. height: 30px;
  64. margin-top: 7px;
  65. margin-right: 5px;
  66. -webkit-animation: loading 1s linear 0s infinite;
  67. }
  68. @-webkit-keyframes loading {
  69. 0% {
  70. -webkit-transform: rotate(0);
  71. }
  72. 100% {
  73. -webkit-transform: rotate(360deg);
  74. }
  75. }
  76. .orders_text {
  77. line-height: 45px;
  78. font-weight: 700;
  79. font-size: 15px;
  80. }
  81. </style>
  82. <script>
  83. var offset = 0;
  84. var _pa = 2;
  85. var is_can_next = 1;
  86. var cur_url = "{:U('Subject/index',array('id' => $subject_id))}";
  87. var req_step = 1;
  88. function loaddata()
  89. {
  90. var totalheight = parseFloat($(window).height()) + parseFloat($(window).scrollTop()); //浏览器的高度加上滚动条的高度
  91. if ($(document).height() <= totalheight+200) //当文档的高度小于或者等于总的高度的时候,开始动态加载数据
  92. {
  93. if(is_can_next == 1)//加载数据
  94. {
  95. is_can_next = 0;
  96. nextpage();
  97. }
  98. }
  99. }
  100. function nextpage()
  101. {
  102. $('#center_pullup').show();
  103. $.ajax(
  104. {
  105. url: cur_url,
  106. type:'post',
  107. data:{page:_pa},
  108. dataType: 'json',
  109. success: function(result){
  110. if(result.code == 1)
  111. {
  112. $('#tuan_list').append(result.html);
  113. $('#center_pullup').hide();
  114. _pa++;
  115. is_can_next = 1;
  116. bindImgEvent();
  117. } else if(result.code == 0) {
  118. $('#center_pullup').remove();
  119. }
  120. }
  121. }
  122. );
  123. }
  124. $(function(){
  125. $(window).scroll( function() {
  126. loaddata();
  127. });
  128. })
  129. </script>
  130. </block>