index.html 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. <article class="cl pd-20" style="min-width: 900px;">
  2. <div class="cl pd-5 bg-1 bk-gray mt-20">
  3. <span class="l">
  4. <a href="javascript:;" onclick="del_all()" class="btn btn-danger radius">
  5. <i class="Hui-iconfont">&#xe6e2;</i> 批量删除</a>
  6. </span>
  7. <span class="r">共有数据:<strong id="total">{notempty name="list"}{$list->total()}{else/}0{/notempty}</strong>
  8. 条</span>
  9. </div>
  10. <div id="edatalist">
  11. <table class="table table-border table-bordered table-bg">
  12. <thead>
  13. <tr class="text-c">
  14. <th width="25">
  15. <input type="checkbox" value="" name="allcheck">
  16. </th>
  17. <th style="width: 40px;">ID</th>
  18. <th style="width: 80px;">名称</th>
  19. <th style="width: 100px;">电话</th>
  20. <th>留言内容</th>
  21. <th>主页</th>
  22. <th style="width: 120px;">时间</th>
  23. <th style="width: 60px;">标记</th>
  24. <th style="width: 200px;">备注</th>
  25. <th style="width: 60px;">操作</th>
  26. </tr>
  27. </thead>
  28. <tbody>
  29. {foreach $list as $val}
  30. <tr class="text-c va-m">
  31. <td>
  32. <input type="checkbox" value="{$val.id}" name="checkbox[]">
  33. </td>
  34. <td>{$val.id}</td>
  35. <td>{$val.name}</td>
  36. <td>{$val.contact}</td>
  37. <td class="text-l">{$val.content}</td>
  38. <td class="text-l">{$val.url}</td>
  39. <td>{$val.time|date="Y-m-d H:i:s"}</td>
  40. <td class="td-status">
  41. <div class="switch size-S" data-on-label="是" data-off-label="否" data-id="{$val.id}">
  42. <input type="checkbox" {if $val.mark==1}checked{/if}>
  43. </div>
  44. </td>
  45. <td><input type="text" class="input-text input-remark text-l" value="{$val.remark}"
  46. data-id="{$val.id}"></td>
  47. <td class="td-manage">
  48. <a href="javascript:;" title="删除" style="text-decoration:none" class="btn btn-danger radius"
  49. onClick="del(this,'{$val.id}')">
  50. <i class="Hui-iconfont">&#xe6e2;</i>
  51. </a>
  52. </td>
  53. </tr>
  54. {/foreach}
  55. </tbody>
  56. </table>
  57. </div>
  58. <div class="cl pd-5 bg-1 bk-gray mt-20 ">
  59. <span class="r">{notempty name="list"}{$list->render()}{/notempty}</span>
  60. </div>
  61. </article>
  62. <script>
  63. // 改变状态
  64. function mark(obj, id) {
  65. $.post('mark', {
  66. 'id': id
  67. }, function (res) {
  68. if (res.code == 0) {
  69. layer.msg(res.msg, {
  70. icon: 1,
  71. time: 1000
  72. });
  73. if (res.mark == 1) {
  74. var img_str = '<a href="javascript:;" onclick="mark(this,' + id + ')" style="text-decoration: none;" title="重点"><span class="f-20 c-primary"><i class="Hui-iconfont">&#xe601;</i></span></a>';
  75. } else {
  76. var img_str = '<a href="javascript:;" onclick="mark(this,' + id + ')" style="text-decoration: none;" title=""><span class="f-20 c-primary"><i class="Hui-iconfont">&#xe677;</i></span></a>';
  77. }
  78. $(obj).parents('td.td-status').append(img_str);
  79. $(obj).remove();
  80. } else {
  81. layer.msg(res.msg, {
  82. icon: 5,
  83. time: 1000
  84. });
  85. return false;
  86. }
  87. }, 'json');
  88. }
  89. // 备注
  90. $(".input-remark").change(function () {
  91. var remark = $(this).val();
  92. var id = $(this).data('id');
  93. console.log(id);
  94. $.post('remark', {
  95. 'id': id,
  96. 'remark': remark
  97. }, function (res) {
  98. if (res.code == 0) {
  99. layer.msg(res.msg, {
  100. icon: 1,
  101. time: 1000
  102. });
  103. } else {
  104. layer.msg(res.msg, {
  105. icon: 5,
  106. time: 1000
  107. });
  108. return false;
  109. }
  110. }, 'json');
  111. });
  112. </script>