sugar_tccd_photo_list.html 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. {% load staticfiles %}
  2. {% for i in img %}
  3. <div class="col-xs-4 col-sm-4 col-md-3">
  4. <div class="imgParent">
  5. <div class="imgBorder">
  6. <img src="{{ i.addr }}" data-original="{{ i.addr }}" alt="" width="300px" height="300px">
  7. <!-- {% if role == "superuser" or role == "staff" %}
  8. <span>{{ i.upl_time }}</span>
  9. {% endif %} -->
  10. </div>
  11. <span class="imgBorderTime">{{ i.upl_time }}</span>
  12. <div class="imgInfo">
  13. <p>{{ i.real_time }}</p>
  14. <!-- <div>
  15. <a href="">测试</a>
  16. <a href="">测试</a>
  17. <a href="">测试</a>
  18. </div> -->
  19. </div>
  20. {% if role == "superuser" or role == "staff" %}
  21. <span class="delBtn" onclick="del($(this))"></span>
  22. {% endif %}
  23. </div>
  24. </div>
  25. {% empty %}
  26. <div class="col-xs-12 ">
  27. <div style="text-align: center;line-height: 200px;">
  28. 暂无数据
  29. </div>
  30. </div>
  31. {% endfor %}
  32. <input type="hidden" id="totalPage" value={{ nums }}>
  33. <script>
  34. // 时间段查询
  35. function img_filter() {
  36. var totalPage = $('#totalPage').val();
  37. var begin = $('#begin').val();
  38. var end = $('#end').val();
  39. if (!begin || !end) {
  40. layui.use('laypage', function () {
  41. var layer = layui.layer;
  42. layer.msg('请输入时间段!')
  43. })
  44. return false;
  45. }
  46. $.ajax({
  47. url: 'tccb_photo_list',
  48. type: 'get',
  49. data: {
  50. id: id,
  51. page: 1,
  52. begin: begin,
  53. end: end
  54. },
  55. success: function (data) {
  56. $('#picturesGather').html('');
  57. $('#picturesGather').html(data);
  58. viewer.destroy();
  59. viewer = new Viewer(document.getElementById('picturesGather'))
  60. var datas = {
  61. id: id,
  62. page: 1,
  63. begin: begin,
  64. end: end
  65. }
  66. if ($('#totalPage').val() > 0) {
  67. initSearchPage($('#totalPage').val(), 'sex_photo_list', datas);
  68. } else {
  69. $('#page').empty();
  70. }
  71. if ($('.content').height() > 750) {
  72. $('#iframe-main', parent.document).css('height', $('.content').height() + 20)
  73. } else {
  74. $('#iframe-main', parent.document).css('height', '750px')
  75. }
  76. }
  77. })
  78. }
  79. //用户搜索分页
  80. function initSearchPage(totalPage, url, datas) {
  81. layui.use('laypage', function () {
  82. var laypage = layui.laypage;
  83. laypage.render({
  84. elem: 'page' //注意,这里的 test1 是 ID,不用加 # 号
  85. // , count: 30
  86. , count: totalPage
  87. , theme: '#428BCA'
  88. , limit: 8
  89. , layout: ['prev', 'page', 'next', 'skip']
  90. , jump: function (obj, first) {
  91. datas.page = obj.curr;
  92. if (!first) {
  93. $.ajax({
  94. url: url,
  95. type: 'get',
  96. data: datas,
  97. success: function (data) {
  98. $('#picturesGather').html('');
  99. $('#picturesGather').append(data);
  100. viewer.destroy();
  101. viewer = new Viewer(document.getElementById('picturesGather'))
  102. if ($('.content').height() > 750) {
  103. $('#iframe-main', parent.document).css('height', $('.content').height() + 20)
  104. } else {
  105. $('#iframe-main', parent.document).css('height', '750px')
  106. }
  107. }
  108. })
  109. }
  110. }
  111. });
  112. });
  113. scrollBar()
  114. }
  115. </script>