index.html 3.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. {extend name='admin@main'}
  2. {block name="button"}
  3. <button data-action='{:url("del")}' data-confirm="确定要删除吗?" data-csrf="{:systoken('del')}" data-rule="id#{key}" class='layui-btn layui-btn-sm layui-btn-primary'>批量删除</button>
  4. <a href="javascript:history.go(-1);" data-title="返 回" class='layui-btn layui-btn-sm layui-btn-primary'>返 回</a>
  5. {/block}
  6. {block name="content"}
  7. <div class="think-box-shadow">
  8. {include file='user_datum/index_search'}
  9. <table class="layui-table margin-top-20" lay-skin="line">
  10. <thead>
  11. <tr>
  12. <th class='list-table-check-td think-checkbox'><input data-auto-none data-check-target='.list-check-box' type='checkbox'></th>
  13. <th class='text-left nowrap' >ID</th>
  14. <th class='text-left nowrap' >用户</th>
  15. <th class='text-left ' style="max-width: 20%">标题</th>
  16. <th class='text-left nowrap' >文件</th>
  17. <th class='text-left nowrap'>状态</th>
  18. <th class="text-left nowrap">操作</th>
  19. </tr>
  20. </thead>
  21. <tbody>
  22. {foreach $list as $key=>$vo}
  23. <tr>
  24. <td class='list-table-check-td think-checkbox'><input class="list-check-box" value='{$vo.id}' type='checkbox'></td>
  25. <td class='text-left'>{$vo.id|default=''}</td>
  26. <td class='text-left nowrap'>
  27. <img data-tips-image style="width:50px;height:50px" src="{$vo.headimg|default=''}" class="margin-right-5 text-top">
  28. <div class="inline-block">
  29. 用户ID:{$vo.user_id|default='--'}<br>
  30. 手机号:{$vo.phone|default='--'}<br>
  31. 用户昵称:{$vo.user_name|default='--'}
  32. </div>
  33. </td>
  34. <td class='text-left'>{$vo.title|default=''}</td>
  35. <td class='text-left nowrap'>{$vo.datum_url|default=''}</td>
  36. <td class='text-left nowrap'>{$vo.status == 0 ?'待审核' : ($vo.status == 1?'审核通过':'审核拒绝')}</td>
  37. <td class='text-left nowrap' >
  38. {if $vo.status == 0}
  39. <a data-title="审核" class="layui-btn layui-btn-sm layui-btn-warm" data-modal='{:url("edit")}?id={$vo.id}'>审 核</a>
  40. {else}
  41. <a data-title="查看" class="layui-btn layui-btn-sm" data-modal='{:url("edit")}?id={$vo.id}'>查 看</a>
  42. {eq name='vo.status' value='1'}
  43. <!-- <a data-title="加入系列" class="layui-btn layui-btn-sm layui-btn-warm" data-modal='{:url("series")}?id={$vo.id}'>加入系列</a>-->
  44. <!-- <span class="layui-btn layui-btn-sm layui-btn-warm" onclick="btn_confirm('新建资料','new_datum','{$vo.id}');">新建资料</span>-->
  45. {/eq}
  46. {/if}
  47. <span class="layui-btn layui-btn-sm layui-btn-danger" onclick="btn_confirm('删除','del','{$vo.id}');">删 除</span>
  48. </td>
  49. </tr>
  50. {/foreach}
  51. </tbody>
  52. </table>
  53. {empty name='list'}<span class="notdata">没有记录哦</span>{else}{$pagehtml|raw|default=''}{/empty}
  54. </div>
  55. <script>
  56. function btn_confirm(msg,fun,id) {
  57. layer.confirm('请确定是否'+msg, {btn: ['确定', '取消'], title: "提示"}, function () {
  58. var url = "/nutrition/user_datum/"+fun;
  59. layer.closeAll();
  60. $.ajax({
  61. type: "post",
  62. url: url,
  63. data: {id:id},
  64. dataType: "json",
  65. async: false,
  66. success: function (data) {
  67. layer.msg(data.info);
  68. setTimeout(function () {
  69. window.location.reload();
  70. },1000)
  71. }
  72. });
  73. });
  74. }
  75. </script>
  76. {/block}