journal.cmp.php 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. <?php $data['journal/lib/manage.journalContent']=Dever::load('journal/lib/manage.journalContent') ?>
  2. <style>
  3. .layui-col-md2
  4. {
  5. height: 450px;
  6. }
  7. </style>
  8. <div class="layui-fluid layadmin-cmdlist-fluid" test="公告">
  9. <ul class="layui-row layui-col-space30" id="sortable">
  10. <?php if(isset($data['journal/lib/manage.journalContent']) && is_array($data['journal/lib/manage.journalContent'])): ?><?php $t=count($data['journal/lib/manage.journalContent'])-1 ?><?php $i=0 ?><?php foreach($data['journal/lib/manage.journalContent'] as $k => $v): ?><li class="layui-col-md2 layui-col-sm4" id="data-<?php echo $v['id'] ?>">
  11. <div class="cmdlist-container">
  12. <div href="javascript:;" style="height:auto;text-align: center;">
  13. <img src="<?php echo $v['pic'] ?>" width="150">
  14. </div>
  15. <a href="javascript:;">
  16. <div class="cmdlist-text">
  17. <p class="info"><?php echo $v['name'] ?></p>
  18. <div class="price">
  19. <b></b>
  20. </div>
  21. <div class="text"><?php echo $v['text'] ?></div>
  22. <div style="margin-top:10px;text-align:center;">
  23. <div class="layui-table-cell"><a href="javascript:;" class="edit" onclick="<?php echo $v['edit'] ?>"><button type="button" class="btn btn-info btn-rounded waves-effect waves-light m-b-5 layui-btn layui-btn-xs">编辑</button></a>&nbsp;&nbsp;<a href="<?php echo $v['delete'] ?>" class="oper_delete"><button type="button" class="btn btn-info btn-rounded waves-effect waves-light m-b-5 layui-btn layui-btn-danger layui-btn-xs"><span class="am-icon-trash-o"></span>删除</button></a>&nbsp;&nbsp;</div>
  24. </div>
  25. </div>
  26. </a>
  27. </div>
  28. </li><?php $i=$i+1 ?><?php endforeach; ?><?php else: ?><?php echo $data['journal/lib/manage.journalContent'] ?><?php endif; ?>
  29. </ul>
  30. </div>
  31. <script id="url">var url="<?php echo Dever::url("journal/lib/manage.updateJournalContent") ?>"</script>
  32. <script>
  33. $( function() {
  34. var sort = $( "#sortable" ).sortable({
  35. opacity: 0.7,
  36. stop:function(){
  37. var arr = $( "#sortable" ).sortable('toArray');
  38. arr = arr.join(',');
  39. $.post(url, {data:arr}, function()
  40. {
  41. })
  42. }
  43. });
  44. $( "#sortable" ).disableSelection();
  45. } );
  46. </script>