failed.html 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. <style>
  2. .right-content{
  3. padding-top:54px!important; padding-left:0!important; width:970px!important;
  4. }
  5. </style>
  6. <div class="content">
  7. <% include ../leftBar.html %>
  8. <!-- right content start -->
  9. <div class="right-content myCover-underReview">
  10. <div class="pageInfo">My Cover</div>
  11. <% include topBar.html %>
  12. <div class="covers-photos">
  13. <%if(data.length){%>
  14. <ul>
  15. <%for(let val of data){%>
  16. <li class="covers" id="<%=val.id%>" style="width: 210px;">
  17. <img src="<%=val.img%>" alt=""/>
  18. <div>
  19. <ul class="edit">
  20. <li>
  21. <a class="coverDelete" href="javascript:;">
  22. <div><img src="<%=public_path%>/img/u155.png" alt=""/></div>
  23. <div>Delete</div>
  24. </a>
  25. </li>
  26. </ul>
  27. </div>
  28. </li>
  29. <%}%>
  30. </ul>
  31. <%}else{%>
  32. <div class="noData">No photos rejected.</div>
  33. <%}%>
  34. </div>
  35. <div id="page" class="pagenation"></div>
  36. </div>
  37. <!-- right content end -->
  38. </div>
  39. <script>
  40. $(function(){
  41. //显示修改和删除
  42. $('.covers').mouseenter(function(){
  43. $(this).find('ul.edit').stop();
  44. $(this).find('ul.edit').slideDown(300);
  45. })
  46. $('.covers').mouseleave(function(){
  47. $(this).find('ul.edit').stop();
  48. $(this).find('ul.edit').slideUp(300);
  49. })
  50. /**
  51. * 删除封面
  52. */
  53. $('.coverDelete').on('click', function () {
  54. let id = $(this).parents('li.covers').attr('id');
  55. parent.layer.confirm('Are you sure you wish to delete this photo?', {
  56. btn:['Cancel', 'Yes'],
  57. title:'',
  58. btnAlign:'c',
  59. closeBtn: 0,
  60. shadeClose:true,
  61. shade:0.01
  62. }, function(){
  63. parent.layer.msg('Cancel Delete');
  64. }, function(){
  65. $.post('/broadcast/cover/deleteCover',{id:id},function(data){
  66. if(data.errno == 0){
  67. window.location.reload();
  68. parent.layer.msg('deleted');
  69. }else{
  70. parent.layer.msg('Failed to delete');
  71. }
  72. })
  73. });
  74. })
  75. //分页
  76. var pages = Math.ceil('<%=count.total%>'/8);
  77. if(pages>1) {
  78. page('page', pages);
  79. }
  80. })
  81. </script>