1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889 |
- {extend name='admin@main'}
- {block name="button"}
- <button data-modal='{:url("add")}?type=2' data-title="添加" class='layui-btn layui-btn-xs layui-btn-primary'>添加系列</button>
- {/block}
- {block name="content"}
- <div class="think-box-shadow">
- {include file='series_manage/index_search'}
- <table class="layui-table margin-top-20" lay-skin="line">
- <thead>
- <tr>
- <th class='text-left nowrap' >标题</th>
- <th class='text-left nowrap' >视频</th>
- <th class='text-left nowrap' >分类</th>
- <th class='text-left nowrap'>类型</th>
- <th class='text-left nowrap'>状态</th>
- <th class='text-left nowrap'>置顶</th>
- <th class="text-left nowrap">操作</th>
- </tr>
- </thead>
- <tbody>
- {foreach $list as $key=>$vo}
- <tr>
- <td class='text-left nowrap'>{$vo.title|default=''}</td>
- <td class='text-left nowrap'>
- <img class="video_player" alert="点击播放" src="{$vo.cover|default=''}" data-src="{$vo.video_url|default=''}" style="height: 50px;width: 75px" />
- </td>
- <td class='text-left nowrap'>{$video_cate[$vo.first_classify]['title']|default='--'}--{$video_cate[$vo.second_classify]['title']|default='--'}</td>
- <td class='text-left nowrap'>{$vo.type == 1 ?'单个' :'系列'}</td>
- <td class='text-left nowrap'>{$vo.status == 1 ?'已启用' :'已禁用'}</td>
- <td class='text-left nowrap'>{$vo.is_top == 1 ?'是' :'否'}</td>
- <td class='text-left nowrap' >
- <a data-title="编辑" class="layui-btn layui-btn-xs" data-modal='{:url("edit")}?id={$vo.id}&type={$vo.type}'>编 辑</a>
- {if $vo.status == 1}
- <span class="layui-btn layui-btn-xs layui-btn-warm" onclick="btn_confirm('禁用','forbidden','{$vo.id}');" >禁 用</span>
- {else}
- <span class="layui-btn layui-btn-xs layui-btn-xs" onclick="btn_confirm('启用','enable','{$vo.id}');">启 用</span>
- {/if}
- <span class="layui-btn layui-btn-xs layui-btn-danger" onclick="btn_confirm('删除','del','{$vo.id}');">删 除</span>
- <a data-title="视频管理" class="layui-btn layui-btn-xs" data-open='{:url("/nutrition/video_url/index")}?video_id={$vo.id}'>视频管理</a>
- </td>
- </tr>
- {/foreach}
- </tbody>
- </table>
- {empty name='list'}<span class="notdata">没有记录哦</span>{else}{$pagehtml|raw|default=''}{/empty}
- </div>
- <script>
- function btn_confirm(msg,fun,id) {
- layer.confirm('请确定是否'+msg, {btn: ['确定', '取消'], title: "提示"}, function () {
- var url = "/nutrition/series_manage/"+fun;
- layer.closeAll();
- $.ajax({
- type: "post",
- url: url,
- data: {id:id},
- dataType: "json",
- async: false,
- success: function (data) {
- layer.msg(data.info);
- setTimeout(function () {
- window.location.reload();
- },1000)
- }
- });
- });
- }
- $('.video_player').click(function () {
- vUrl = $(this).data('src'); //获取到播放的url
- var loadstr = '<video width="100%" height="100%" controls="controls" autobuffer="autobuffer" autoplay="autoplay" loop="loop">' +
- '<source src='+vUrl+' type="video/mp4"></source></video>';
- layer.open({
- type: 1,
- title: false,
- area: ['730px', '500px'],
- shade: [0.8, 'rgb(14, 16, 22)'],
- skin: 'demo-class',
- content: loadstr
- });
- });
- </script>
- {/block}
|