mycomment.html 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. {include file=comm/head.html}
  2. {include file=comm/top.html}
  3. <div class="container pages">
  4. {include file=comm/position.html}
  5. <div class="row mb-5">
  6. {include file=member/left.html}
  7. <div class="col-12 col-md-10 mt-3">
  8. <table class="table">
  9. <thead>
  10. <th>序号</th>
  11. <th>文章</th>
  12. <th>评论</th>
  13. <th>状态</th>
  14. <th>时间</th>
  15. <th>操作</th>
  16. </thead>
  17. <tbody>
  18. {pboot:mycomment num=10}
  19. <tr>
  20. <td>[mycomment:i]</td>
  21. <td>[mycomment:title]</td>
  22. <td>[mycomment:comment]</td>
  23. <td>{pboot:if([mycomment:status]==1)}已审核{else}<span style="color:red">待审核</span>{/pboot:if}</td>
  24. <td>[mycomment:date]</td>
  25. <td><span class="del" data-url="[mycomment:delaction]" style="cursor:pointer" >删除</span></td>
  26. </tr>
  27. {/pboot:mycomment}
  28. </tbody>
  29. </table>
  30. {include file=comm/page.html}
  31. </div>
  32. </div>
  33. </div>
  34. <script>
  35. $(".del").on("click",function(){
  36. if(!confirm("您确定要删除么?")){
  37. return;
  38. }
  39. var url=$(this).data('url');
  40. var el=$(this).parents("tr");
  41. $.ajax({
  42. type: 'GET',
  43. url: url,
  44. dataType: 'json',
  45. success: function (response, status) {
  46. if(response.code==0){
  47. alert(response.data);
  48. }else{
  49. el.remove();
  50. }
  51. },
  52. error:function(xhr,status,error){
  53. alert('返回数据异常!');
  54. }
  55. });
  56. });
  57. </script>
  58. {include file=comm/foot.html}