index.html 4.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. {extend name='admin@main'}
  2. {block name="button"}
  3. <button data-action='{:url("remove")}' data-confirm="确定要删除吗?" data-csrf="{:systoken('remove')}" 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. <button data-open='{:url("add")}?video_id={$video_id}' data-title="添加" class='layui-btn layui-btn-sm layui-btn-primary'>添加</button>
  6. {/block}
  7. {block name="content"}
  8. <div class="think-box-shadow">
  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='list-table-sort-td'>
  14. <button type="button" data-reload class="layui-btn layui-btn-xs">刷 新</button>
  15. </th>
  16. <th class='text-left nowrap'>ID</th>
  17. <th class='text-left nowrap'>标题</th>
  18. <th class='text-left nowrap'>视频</th>
  19. <th class='text-left nowrap'>绑定用户</th>
  20. <th class='text-left nowrap'>是否VIP</th>
  21. <th class="text-left" style="width: 20%">操作</th>
  22. </tr>
  23. </thead>
  24. <tbody>
  25. {foreach $list as $key=>$vo}
  26. <tr>
  27. <td class='list-table-check-td think-checkbox'><input class="list-check-box" value='{$vo.id}' type='checkbox'></td>
  28. <td class='list-table-sort-td'>
  29. <input data-action-blur="{:request()->url()}" data-value="id#{$vo.id};action#sort;sort#{value}" data-loading="false" value="{$vo.sort}" class="list-sort-input">
  30. </td>
  31. <td class='text-left nowrap'>{$vo.id|default=''}</td>
  32. <td class='text-left nowrap'>{$vo.title|default=''}</td>
  33. <td class='text-left nowrap'>
  34. <img class="video_player" alert="点击播放" src="{$vo.cover|default=''}" data-src="{$vo.url|default=''}" style="height: 50px;width: 75px" />
  35. </td>
  36. <td class='text-left nowrap'>{$vo.phone|default='--'}</td>
  37. <td class='text-left nowrap'>{$vo.is_vip ? '是':'否'}</td>
  38. <td class='text-left' style="width: 20%">
  39. <a data-title="编辑" class="layui-btn layui-btn-xs" data-open='{:url("edit")}?id={$vo.id}&video_id={$vo.video_id}'>编 辑</a>
  40. <a data-title="评论" class="layui-btn layui-btn-xs" data-open='{:url("/nutrition/video_comment/index")}?url_id={$vo.id}&video_id={$vo.video_id}'>评 论</a>
  41. {if $vo.status == 1}
  42. <span class="layui-btn layui-btn-xs layui-btn-warm" onclick="btn_confirm('禁用','forbidden','{$vo.id}');" >禁 用</span>
  43. {else}
  44. <span class="layui-btn layui-btn-xs layui-btn-xs" onclick="btn_confirm('启用','enable','{$vo.id}');">启 用</span>
  45. {/if}
  46. <span class="layui-btn layui-btn-xs 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/video_url/"+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. $(document).on("click",'.video_player',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. form.render();
  87. });
  88. </script>
  89. {/block}