myvoucherlist.html 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163
  1. <extend name="Public:pinduoduobase" />
  2. <block name="content">
  3. <div class="container coupon-container no-footer" id="index-content">
  4. <ul class="coupon-tabbar">
  5. <li class="coupon-tab" onclick="location.href='{:U('User/myvoucherlist', array('type' => 1))}'">
  6. <span <?php if($type == 1){ ?>class="selected"<?php } ?>>未使用</span>
  7. </li>
  8. <li class="coupon-tab" onclick="location.href='{:U('User/myvoucherlist', array('type' => 2))}'">
  9. <span <?php if($type == 2){ ?>class="selected"<?php } ?>>已使用/已过期</span>
  10. </li>
  11. </ul>
  12. <ul class="coupon-list">
  13. <?php if($type == 1){ ?>
  14. <li class="available-coupon-list" id="available-coupon-list">
  15. <?php } ?>
  16. <?php if($type == 2){ ?>
  17. <li class="out-coupon-list" id="out-coupon-list">
  18. <?php } ?>
  19. <div class="base-list-wrapper" id="tuan_list">
  20. <volist name="list" id="d">
  21. <div >
  22. <div class="coupon-list-item">
  23. <div class="detail" style="<?php if($type == 1){ ?>color: rgb(255, 171, 51);<?php } ?><?php if($type == 2){ ?>color: rgb(150, 150, 150);<?php } ?>">
  24. <?php if($type == 1){ ?>
  25. <img class="" src="__PUBLIC__/pinduoduo/assets/img/mall_available_bg.png">
  26. <?php } ?>
  27. <?php if($type == 2){ ?>
  28. <img class="" src="__PUBLIC__/pinduoduo/assets/img/mall_expired_bg.png">
  29. <?php } ?>
  30. <p class="coupon-type"><?php if($d['type'] == 0){ ?>店铺券<?php }else{ ?>全网通用<?php } ?></p>
  31. <div class="discount">
  32. <div class="discount-value">
  33. <b>¥</b><?php echo round($d['credit']); ?>
  34. </div>
  35. </div>
  36. <div class="info">
  37. <div class="more-info">
  38. <p class="batch-name">
  39. <?php if($d['limit_money'] >0) { ?>
  40. 满<?php echo round($d['limit_money']); ?>减<?php echo round($d['credit']); ?>
  41. <?php } ?>
  42. </p>
  43. <p class="scope scope-available">
  44. <?php if($d['type'] == 0){ ?>
  45. 仅限{$d.store_name}
  46. <?php } ?>
  47. </p>
  48. <p class="duration">
  49. <?php echo date('Y.m.d',$d['begin_time']); ?>
  50. -
  51. <?php echo date('Y.m.d',$d['end_time']); ?>
  52. </p>
  53. </div>
  54. </div>
  55. <!--ms-if-->
  56. </div>
  57. </div>
  58. </div>
  59. </volist>
  60. </div>
  61. </li>
  62. </ul>
  63. </div>
  64. <div class="center" id="center_pullup" style="display:none;">
  65. <span><img class="img_rotate" src="__PUBLIC__/pinduoduo/assets/img/pull_loading_8eba142.png"/>
  66. </span><span class="orders_text"></span>
  67. </div>
  68. <style>
  69. .coupon-tabbar .coupon-tab {
  70. width:49%;
  71. }
  72. .center {
  73. width: 170px;
  74. margin: 0 auto;
  75. text-align: center;
  76. }
  77. .img_rotate {
  78. width: 30px;
  79. height: 30px;
  80. margin-top: 7px;
  81. margin-right: 5px;
  82. -webkit-animation: loading 1s linear 0s infinite;
  83. }
  84. @-webkit-keyframes loading {
  85. 0% {
  86. -webkit-transform: rotate(0);
  87. }
  88. 100% {
  89. -webkit-transform: rotate(360deg);
  90. }
  91. }
  92. .orders_text {
  93. line-height: 45px;
  94. font-weight: 700;
  95. font-size: 15px;
  96. }
  97. </style>
  98. <script>
  99. var offset = 0;
  100. var _pa = 2;
  101. var is_can_next = 1;
  102. var cur_url = "{:U('User/myvoucherlist',array('type' => $type))}";
  103. var req_step = 1;
  104. function loaddata()
  105. {
  106. var totalheight = parseFloat($(window).height()) + parseFloat($(window).scrollTop()); //浏览器的高度加上滚动条的高度
  107. if ($(document).height() <= totalheight+200) //当文档的高度小于或者等于总的高度的时候,开始动态加载数据
  108. {
  109. if(is_can_next == 1)//加载数据
  110. {
  111. is_can_next = 0;
  112. nextpage();
  113. }
  114. }
  115. }
  116. function nextpage()
  117. {
  118. $('#center_pullup').show();
  119. $.ajax(
  120. {
  121. url: cur_url,
  122. type:'post',
  123. data:{page:_pa},
  124. dataType: 'json',
  125. success: function(result){
  126. if(result.code == 1)
  127. {
  128. $('#tuan_list').append(result.html);
  129. $('#center_pullup').hide();
  130. _pa++;
  131. is_can_next = 1;
  132. } else if(result.code == 0) {
  133. $('#center_pullup').remove();
  134. }
  135. }
  136. }
  137. );
  138. }
  139. $(function(){
  140. $(window).scroll( function() {
  141. loaddata();
  142. });
  143. })
  144. </script>
  145. </block>