exchange_log.html 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. <!doctype html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8">
  5. <meta name="viewport" content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no"/>
  6. <title>兑换记录</title>
  7. <link rel="stylesheet" href="__STATIC__/box/css/_flexible.css?v={:config('js_version')}">
  8. <link rel="stylesheet" href="__STATIC__/box/css/log.css?v={:config('js_version')}">
  9. <script src="__STATIC__/box/js/flexible375.js?v={:config('js_version')}"></script>
  10. </head>
  11. <body>
  12. <div class="tab">
  13. <a class="tab_cell active" href="{:url('exchange/log/'.$wx_app_id)}?v={:config('js_version')}">兑换记录</a>
  14. <a class="tab_cell" href="{:url('lottery/log/'.$wx_app_id)}?v={:config('js_version')}">抽奖记录</a>
  15. </div>
  16. <div class="exchangeList">
  17. <ul class="js-template">
  18. <foreach name="list" item="vo">
  19. <li class="exchangeList_item">
  20. <div class="info">
  21. <h1 class="title">{$vo.title}</h1>
  22. <p class="time">{$vo.time}</p>
  23. </div>
  24. <div class="money">-{$vo.integral}金币</div>
  25. </li>
  26. </foreach>
  27. </ul>
  28. </div>
  29. <script src="__STATIC__/box/js/jquery.js"></script>
  30. <script>
  31. $(function () {
  32. var params = {
  33. format : 'json',
  34. page : 1,
  35. offset : 10
  36. };
  37. var get = 0
  38. $(window).bind('scroll', function () {
  39. var h = $(document.body).height()
  40. var c = $(window).scrollTop()
  41. var wh = $(window).height()
  42. if (Math.ceil(wh + c) >= h - 10) {
  43. getLog()
  44. }
  45. });
  46. function getLog() {
  47. if (get) return false
  48. get = 1
  49. params.page = ++ params.page
  50. $.ajax({
  51. url : '/exchange/log/{$wx_app_id}',
  52. data : params,
  53. type : 'post',
  54. success: function (res) {
  55. var _html = ''
  56. for (var i = 0; i < res.data.list.length; i ++) {
  57. _html += '<li class="exchangeList_item">\n' +
  58. ' <div class="info">\n' +
  59. ' <h1 class="title">' + res.data.list[i].title + '</h1>\n' +
  60. ' <p class="time">' + res.data.list[i].time + '</p>\n' +
  61. ' </div>\n' +
  62. ' <div class="money">-' + res.data.list[i].integral + '金币</div>\n' +
  63. ' </li>';
  64. }
  65. $('.js-template').append(_html)
  66. if ($('.js-template .content_item').length >= res.data.count) {
  67. $(window).unbind('scroll')
  68. }
  69. get = 0
  70. },
  71. error: function () {
  72. get = 0
  73. }
  74. })
  75. }
  76. })
  77. </script>
  78. </body>
  79. </html>