index.html 3.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. {extend name='admin@main'}
  2. {block name="button"}
  3. <button data-modal='{:url("add")}?type=2' data-title="添加" class='layui-btn layui-btn-xs layui-btn-primary'>添加系列</button>
  4. {/block}
  5. {block name="content"}
  6. <div class="think-box-shadow">
  7. {include file='series_manage/index_search'}
  8. <table class="layui-table margin-top-20" lay-skin="line">
  9. <thead>
  10. <tr>
  11. <th class='text-left nowrap' >标题</th>
  12. <th class='text-left nowrap' >视频</th>
  13. <th class='text-left nowrap' >分类</th>
  14. <th class='text-left nowrap'>类型</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='text-left nowrap'>{$vo.title|default=''}</td>
  24. <td class='text-left nowrap'>
  25. <img class="video_player" alert="点击播放" src="{$vo.cover|default=''}" data-src="{$vo.video_url|default=''}" style="height: 50px;width: 75px" />
  26. </td>
  27. <td class='text-left nowrap'>{$video_cate[$vo.first_classify]['title']|default='--'}--{$video_cate[$vo.second_classify]['title']|default='--'}</td>
  28. <td class='text-left nowrap'>{$vo.type == 1 ?'单个' :'系列'}</td>
  29. <td class='text-left nowrap'>{$vo.status == 1 ?'已启用' :'已禁用'}</td>
  30. <td class='text-left nowrap'>{$vo.is_top == 1 ?'是' :'否'}</td>
  31. <td class='text-left nowrap' >
  32. <a data-title="编辑" class="layui-btn layui-btn-xs" data-modal='{:url("edit")}?id={$vo.id}&type={$vo.type}'>编 辑</a>
  33. {if $vo.status == 1}
  34. <span class="layui-btn layui-btn-xs layui-btn-warm" onclick="btn_confirm('禁用','forbidden','{$vo.id}');" >禁 用</span>
  35. {else}
  36. <span class="layui-btn layui-btn-xs layui-btn-xs" onclick="btn_confirm('启用','enable','{$vo.id}');">启 用</span>
  37. {/if}
  38. <span class="layui-btn layui-btn-xs layui-btn-danger" onclick="btn_confirm('删除','del','{$vo.id}');">删 除</span>
  39. <a data-title="视频管理" class="layui-btn layui-btn-xs" data-open='{:url("/nutrition/video_url/index")}?video_id={$vo.id}'>视频管理</a>
  40. </td>
  41. </tr>
  42. {/foreach}
  43. </tbody>
  44. </table>
  45. {empty name='list'}<span class="notdata">没有记录哦</span>{else}{$pagehtml|raw|default=''}{/empty}
  46. </div>
  47. <script>
  48. function btn_confirm(msg,fun,id) {
  49. layer.confirm('请确定是否'+msg, {btn: ['确定', '取消'], title: "提示"}, function () {
  50. var url = "/nutrition/series_manage/"+fun;
  51. layer.closeAll();
  52. $.ajax({
  53. type: "post",
  54. url: url,
  55. data: {id:id},
  56. dataType: "json",
  57. async: false,
  58. success: function (data) {
  59. layer.msg(data.info);
  60. setTimeout(function () {
  61. window.location.reload();
  62. },1000)
  63. }
  64. });
  65. });
  66. }
  67. $('.video_player').click(function () {
  68. vUrl = $(this).data('src'); //获取到播放的url
  69. var loadstr = '<video width="100%" height="100%" controls="controls" autobuffer="autobuffer" autoplay="autoplay" loop="loop">' +
  70. '<source src='+vUrl+' type="video/mp4"></source></video>';
  71. layer.open({
  72. type: 1,
  73. title: false,
  74. area: ['730px', '500px'],
  75. shade: [0.8, 'rgb(14, 16, 22)'],
  76. skin: 'demo-class',
  77. content: loadstr
  78. });
  79. });
  80. </script>
  81. {/block}