1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495 |
- {extend name='admin@main'}
- {block name="button"}
- <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>
- <a href="javascript:history.go(-1);" data-title="返 回" class='layui-btn layui-btn-sm layui-btn-primary'>返 回</a>
- <button data-open='{:url("add")}?video_id={$video_id}' data-title="添加" class='layui-btn layui-btn-sm layui-btn-primary'>添加</button>
- {/block}
- {block name="content"}
- <div class="think-box-shadow">
- <table class="layui-table margin-top-20" lay-skin="line">
- <thead>
- <tr>
- <th class='list-table-check-td think-checkbox'><input data-auto-none data-check-target='.list-check-box' type='checkbox'></th>
- <th class='list-table-sort-td'>
- <button type="button" data-reload class="layui-btn layui-btn-xs">刷 新</button>
- </th>
- <th class='text-left nowrap'>ID</th>
- <th class='text-left nowrap'>标题</th>
- <th class='text-left nowrap'>视频</th>
- <th class='text-left nowrap'>绑定用户</th>
- <th class='text-left nowrap'>是否VIP</th>
- <th class="text-left" style="width: 20%">操作</th>
- </tr>
- </thead>
- <tbody>
- {foreach $list as $key=>$vo}
- <tr>
- <td class='list-table-check-td think-checkbox'><input class="list-check-box" value='{$vo.id}' type='checkbox'></td>
- <td class='list-table-sort-td'>
- <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">
- </td>
- <td class='text-left nowrap'>{$vo.id|default=''}</td>
- <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.url|default=''}" style="height: 50px;width: 75px" />
- </td>
- <td class='text-left nowrap'>{$vo.phone|default='--'}</td>
- <td class='text-left nowrap'>{$vo.is_vip ? '是':'否'}</td>
- <td class='text-left' style="width: 20%">
- <a data-title="编辑" class="layui-btn layui-btn-xs" data-open='{:url("edit")}?id={$vo.id}&video_id={$vo.video_id}'>编 辑</a>
- <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>
- {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>
- </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/video_url/"+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)
- }
- });
- });
- }
- $(document).on("click",'.video_player',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
- });
- form.render();
- });
- </script>
- {/block}
|