index.html 4.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  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. {/block}
  5. {block name="content"}
  6. <div class="think-box-shadow">
  7. {include file='user_video/index_search'}
  8. <table class="layui-table margin-top-20" lay-skin="line">
  9. <thead>
  10. <tr>
  11. <th class='list-table-check-td think-checkbox'><input data-auto-none data-check-target='.list-check-box' type='checkbox'></th>
  12. <th class='text-left nowrap' >ID</th>
  13. <th class='text-left nowrap' >用户</th>
  14. <th class='text-left ' style="max-width: 20%">标题</th>
  15. <th class='text-left nowrap' >标签</th>
  16. <th class='text-left nowrap'>状态</th>
  17. <th class="text-left nowrap">操作</th>
  18. </tr>
  19. </thead>
  20. <tbody>
  21. {foreach $list as $key=>$vo}
  22. <tr>
  23. <td class='list-table-check-td think-checkbox'><input class="list-check-box" value='{$vo.id}' type='checkbox'></td>
  24. <td class='text-left'>{$vo.id|default=''}</td>
  25. <td class='text-left nowrap'>
  26. <img data-tips-image style="width:50px;height:50px" src="{$vo.headimg|default=''}" class="margin-right-5 text-top">
  27. <div class="inline-block">
  28. 用户ID:{$vo.user_id|default='--'}<br>
  29. 手机号:{$vo.phone|default='--'}<br>
  30. 用户昵称:{$vo.user_name|default='--'}
  31. </div>
  32. </td>
  33. <td class='text-left'>{$vo.title|default=''}</td>
  34. <td class='text-left nowrap'>{$vo.label|default=''}</td>
  35. <td class='text-left nowrap'>{$vo.status == 0 ?'待审核' : ($vo.status == 1?'审核通过':'审核拒绝')}</td>
  36. <td class='text-left nowrap' >
  37. {if $vo.status == 0}
  38. <a data-title="审核" class="layui-btn layui-btn-sm layui-btn-warm" data-modal='{:url("edit")}?id={$vo.id}'>审 核</a>
  39. {else}
  40. <a data-title="查看" class="layui-btn layui-btn-sm" data-modal='{:url("edit")}?id={$vo.id}'>查 看</a>
  41. {eq name='vo.status' value='1'}
  42. <!-- <a data-title="加入系列" class="layui-btn layui-btn-sm layui-btn-warm" data-modal='{:url("series")}?id={$vo.id}'>加入系列</a>-->
  43. <!-- <a data-title="新建图文" class="layui-btn layui-btn-sm layui-btn-warm" data-modal='{:url("new_article")}?id={$vo.id}'>新建图文</a>-->
  44. {/eq}
  45. {/if}
  46. <span class="layui-btn layui-btn-sm layui-btn-danger" onclick="btn_confirm('删除','del','{$vo.id}');">删 除</span>
  47. </td>
  48. </tr>
  49. {/foreach}
  50. </tbody>
  51. </table>
  52. {empty name='list'}<span class="notdata">没有记录哦</span>{else}{$pagehtml|raw|default=''}{/empty}
  53. </div>
  54. <script>
  55. function btn_confirm(msg,fun,id) {
  56. layer.confirm('请确定是否'+msg, {btn: ['确定', '取消'], title: "提示"}, function () {
  57. var url = "/nutrition/user_article/"+fun;
  58. layer.closeAll();
  59. $.ajax({
  60. type: "post",
  61. url: url,
  62. data: {id:id},
  63. dataType: "json",
  64. async: false,
  65. success: function (data) {
  66. layer.msg(data.info);
  67. setTimeout(function () {
  68. window.location.reload();
  69. },1000)
  70. }
  71. });
  72. });
  73. }
  74. $('.video_player').click(function () {
  75. vUrl = $(this).data('src'); //获取到播放的url
  76. var loadstr = '<video width="100%" height="100%" controls="controls" autobuffer="autobuffer" autoplay="autoplay" loop="loop">' +
  77. '<source src='+vUrl+' type="video/mp4"></source></video>';
  78. layer.open({
  79. type: 1,
  80. title: false,
  81. area: ['730px', '500px'],
  82. shade: [0.8, 'rgb(14, 16, 22)'],
  83. skin: 'demo-class',
  84. content: loadstr
  85. });
  86. });
  87. </script>
  88. {/block}