home.cmp.php 3.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. <style>
  2. #component-anim .layui-card-body{padding: 15px;}
  3. #component-anim .component-anim-demo{font-size: 0;}
  4. #component-anim .component-anim-demo li{display: inline-block; vertical-align: middle; width: 127px; line-height: 25px; padding: 20px 0; font-size: 14px; text-align: center; color: #666; transition: all .3s; -webkit-transition: all .3s;}
  5. #component-anim .component-anim-demo li .layui-icon{display: inline-block; font-size: 36px;}
  6. #component-anim .component-anim-demo li .fontclass{display: none;}
  7. #component-anim .component-anim-demo li .name{color: #c2c2c2;}
  8. #component-anim .component-anim-demo li:hover{background-color: #f2f2f2; color: #000;}
  9. #component-anim .component-anim-demo li{width: 168px;}
  10. #component-anim .component-anim-demo .layui-anim{cursor: pointer;}
  11. #component-anim .component-anim-demo .layui-anim{width:150px;height:100px;}
  12. #component-anim .component-anim-demo .code{height:25px;}
  13. #component-anim .component-anim-demo .layui-anim-yes
  14. {
  15. border:1px solid #0000ff;
  16. }
  17. #component-anim .component-anim-demo .layui-anim-no
  18. {
  19. border: 1px solid #e2e2e2;
  20. }
  21. </style>
  22. <div class="layui-card" id="component-anim">
  23. <div class="layui-card-header">
  24. <input type="hidden" class="file_key" value="<?php echo $config['id'] ?>">
  25. <input type="hidden" class="file_pg" value="<?php echo $search_pg ?>">
  26. <input type="hidden" class="file_cur" value="<?php echo $cur ?>">
  27. <div class="layui-inline"><div class="layui-input-inline"><input type="text" style="width: 100%;" class="layui-input file_filename" value="<?php echo $search_name ?>" autocomplete="new-password" placeholder="文件名"></div></div>
  28. <div class="layui-inline" style="display: none;"><div class="layui-input-inline"><input type="text" style="width: 100%;" class="layui-input file_tag" value="<?php echo $search_tag ?>" autocomplete="new-password" placeholder="标签"></div></div>
  29. <div class="layui-inline"><div class="layui-input-inline"><select lay-ignore="" class="layui-input file_cate" style="width: 100%;"><option parent="" value="-1" selected="">选择分类</option>
  30. <?php if(isset($cate) && is_array($cate)): foreach($cate as $k => $v): ?>
  31. <option parent="" value="<?php echo $v['id'] ?>" <?php if($v['id'] == $search_cate): ?>selected<?php endif ?>><?php echo $v['name'] ?></option>
  32. <?php endforeach;endif; ?>
  33. </select></div></div>
  34. <div class="layui-inline" class="file-search" onclick="showUploadFilesSearch($(this))"><div class="layui-input-inline"><button type="button" class="layui-btn"><i class="fa fa-save"></i> 搜索</button></div></div>
  35. </div>
  36. <div class="layui-card-body">
  37. <ul class="component-anim-demo">
  38. <?php if(isset($file) && is_array($file)): foreach($file as $k1 => $v1): ?>
  39. <li class="<?php if(strstr($cur, $v1['url'])): ?>layui-anim-yes<?php else: ?>layui-anim-no<?php endif ?>">
  40. <div class="layui-anim" data-anim="layui-anim-up" onclick="showUploadFilesSet($(this), '<?php echo $v1['name'] ?>','<?php echo $v1['url'] ?>')"><img src="<?php echo $v1['pic'] ?>" style="max-width: 150px;max-height: 100px;margin-left: 10px;"/></div>
  41. <div class="code"><?php echo $v1['source_name'] ?></div>
  42. </li>
  43. <?php endforeach;endif; ?>
  44. </ul>
  45. <div id="file-page"></div>
  46. </div>
  47. <script>
  48. layui.use('laypage', function(){
  49. var laypage = layui.laypage;
  50. //执行一个laypage实例
  51. laypage.render({
  52. elem: 'file-page' //注意,这里的 test1 是 ID,不用加 # 号
  53. ,count: <?php echo $total ?> //数据总数,从服务端得到
  54. ,limit:12
  55. ,curr:<?php echo $search_pg ?>
  56. ,jump: function(obj, first){
  57. //首次不执行
  58. if(!first){
  59. $('.file_pg').val(obj.curr);
  60. showUploadFilesSearch($('.file_pg'));
  61. }
  62. }
  63. });
  64. });
  65. </script>
  66. </div>