myfavgoods.html 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153
  1. <extend name="Public:pinduoduobase" />
  2. <block name="content">
  3. <link rel="stylesheet" href="__PUBLIC__/pinduoduo/assets/css/likes_d0bf6c65ee1a3c99ec3fcea913d20f11.css">
  4. <div class="container no-footer" id="likes">
  5. <section id="like-list">
  6. <div class="base-list-wrapper" id="tuan_list">
  7. <volist name="list" id="d">
  8. <div class="like-list-item-0" >
  9. <div class="like-item">
  10. <div class="like-item-goods-img" onclick="location.href='{:U('/goods/'.$d['goods_id'])}'">
  11. <?php if(!empty($d['fan_image'])){ ?>
  12. <img src="/Uploads/image/{$d.fan_image}" />
  13. <?php } else { ?>
  14. <img src="{$d.image}" />
  15. <?php } ?>
  16. </div>
  17. <div class="like-item-goods-text" onclick="location.href='{:U('/goods/'.$d['goods_id'])}'">
  18. <div class="like-item-goods-name">{$d.name}</div>
  19. <div class="like-item-goods-count">已卖<?php echo $d['seller_count']+$d['virtual_count']; ?>件</span></div>
  20. </div>
  21. <div class="like-item-goods-bottom">
  22. <div class="like-item-goods-line"></div>
  23. <div class="like-item-goods-price">¥{$d.danprice}</div>
  24. <div class="like-item-goods-start" onclick="location.href='{:U('/goods/'.$d['goods_id'])}'">立即购买</div>
  25. <div class="like-item-goods-cancel" onclick="del_fav(this,{$d.goods_id})">取消收藏</div>
  26. </div>
  27. </div>
  28. </div>
  29. </volist>
  30. </div>
  31. </section>
  32. </div>
  33. <include file="Widget:pin_notify" />
  34. <div class="center" id="center_pullup" style="display:none;">
  35. <span><img class="img_rotate" src="__PUBLIC__/pinduoduo/assets/img/pull_loading_8eba142.png"/>
  36. </span><span class="orders_text"></span>
  37. </div>
  38. <div style="height:50px;"></div>
  39. <include file="Public:foot_pinduoduo" />
  40. <style>
  41. .like-item-goods-start{
  42. border:1px solid #ff6699;
  43. background-color: #ff6699;
  44. }
  45. .like-item-goods-price{
  46. color:#ff6699;
  47. }
  48. .container{background-color:#fff;}
  49. .coupon-tabbar .coupon-tab {
  50. width:49%;
  51. }
  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('User/myfavgoods')}";
  83. var req_step = 1;
  84. function del_fav(obj,goods_id)
  85. {
  86. $.ajax({
  87. url:"index.php?s=/User/fav_toggle",
  88. type:'get',
  89. data:{goods_id:goods_id},
  90. dataType:'json',
  91. success:function(ret){
  92. $(obj).parent().parent().parent().remove();
  93. }
  94. })
  95. return false;
  96. }
  97. function loaddata()
  98. {
  99. var totalheight = parseFloat($(window).height()) + parseFloat($(window).scrollTop()); //浏览器的高度加上滚动条的高度
  100. if ($(document).height() <= totalheight+200) //当文档的高度小于或者等于总的高度的时候,开始动态加载数据
  101. {
  102. if(is_can_next == 1)//加载数据
  103. {
  104. is_can_next = 0;
  105. nextpage();
  106. }
  107. }
  108. }
  109. function nextpage()
  110. {
  111. $('#center_pullup').show();
  112. $.ajax(
  113. {
  114. url: cur_url,
  115. type:'post',
  116. data:{page:_pa},
  117. dataType: 'json',
  118. success: function(result){
  119. if(result.code == 1)
  120. {
  121. $('#tuan_list').append(result.html);
  122. $('#center_pullup').hide();
  123. _pa++;
  124. is_can_next = 1;
  125. } else if(result.code == 0) {
  126. $('#center_pullup').remove();
  127. }
  128. }
  129. }
  130. );
  131. }
  132. $(function(){
  133. $(window).scroll( function() {
  134. loaddata();
  135. });
  136. })
  137. </script>
  138. </block>