From 43fa0ec4dc02c2bb1a2ac5e9eea81cae4d2cb11d Mon Sep 17 00:00:00 2001
From: Helius <wangdoubleone@gmail.com>
Date: Fri, 17 Dec 2021 16:08:18 +0800
Subject: [PATCH] Merge branch 'master' of http://120.27.238.55:7000/r/xc-video

---
 src/main/resources/templates/febs/views/video/video/video-list.html |   45 +++++++++++++++++++++++++++++++++++++--------
 1 files changed, 37 insertions(+), 8 deletions(-)

diff --git a/src/main/resources/templates/febs/views/video/video/video-list.html b/src/main/resources/templates/febs/views/video/video/video-list.html
index 86edba5..1e72d99 100644
--- a/src/main/resources/templates/febs/views/video/video/video-list.html
+++ b/src/main/resources/templates/febs/views/video/video/video-list.html
@@ -56,6 +56,14 @@
         </div>
     </div>
 </div>
+<style>
+    .layui-table-cell {
+        height: 100%;
+    }
+</style>
+<script type="text/html" id="thumbFormat">
+    <img src="{{d.thumb}}" />
+</script>
 <script type="text/html" id="is-up-format">
     {{#
     var status = {
@@ -78,6 +86,11 @@
     <span shiro:lacksPermission="video:view,video:update,video:delete">
         <span class="layui-badge-dot febs-bg-orange"></span> 无权限
     </span>
+    {{# if(d.isUp == 1) { }}
+    <button lay-event="isUp" type="button" class="layui-btn layui-btn-xs layui-btn-danger isUp">下架</button>
+    {{# } else { }}
+    <button lay-event="isUp" type="button" class="layui-btn layui-btn-xs layui-btn-normal isUp">上架</button>
+    {{# } }}
     <a lay-event="edit" shiro:hasPermission="video:update"><i
             class="layui-icon febs-edit-area febs-blue">&#xe7a4;</i></a>
     <a lay-event="del" shiro:hasPermission="video:delete"><i class="layui-icon febs-edit-area febs-red">&#xe7f9;</i></a>
@@ -155,16 +168,29 @@
                 });
             }
             if (layEvent === 'edit') {
-                febs.modal.open('修改视频', 'video/update/' + data.name, {
-                    area: $(window).width() <= 750 ? '90%' : '50%',
-                    offset: '30px',
+                febs.modal.open('修改视频', 'video/update/' + data.id, {
+                    area: ['100%', '100%'],
                     btn: ['提交', '取消'],
                     yes: function (index, layero) {
-                        $('#user-update').find('#submit').trigger('click');
+                        $('#video-update').find('#submit').trigger('click');
                     },
                     btn2: function () {
                         layer.closeAll();
                     }
+                });
+            }
+            if (layEvent === 'isUp') {
+                var text;
+                if (data.isUp == 1) {
+                    text = "下架";
+                } else {
+                    text = "上架";
+                }
+                febs.modal.confirm('是否' + text + "该视频", '确定' + text + '该视频?', function () {
+                    febs.post(ctx + 'video/video/changeIsUp/' + data.id, null, function () {
+                        febs.alert.success(text + '视频成功');
+                        $query.click();
+                    });
                 });
             }
         });
@@ -197,15 +223,18 @@
             tableIns = febs.table.init({
                 elem: $view.find('table'),
                 id: 'videoTable',
-                url: ctx + 'video/list',
+                url: ctx + 'video/video/list',
                 cols: [[
                     {type: 'checkbox'},
                     {field: 'title', title: '视频名', minWidth: 100},
-                    {field: 'thumb', title: '缩略图'},
+                    {templet: '#thumbFormat', title: '缩略图'},
                     {title: '是否上架', templet: '#is-up-format'},
                     {title: '会员', templet: '#is-free-format'},
-                    {field: 'createdTime', title: '创建时间', minWidth: 180, sort: true},
-                    {title: '操作', toolbar: '#user-option', minWidth: 140}
+                    {field: 'playCnt', title: '播放量'},
+                    {field: 'collectCnt', title: '收藏量'},
+                    {field: 'starCnt', title: '点赞量'},
+                    {field: 'createdTime', title: '创建时间', minWidth: 180},
+                    {title: '操作', toolbar: '#user-option'}
                 ]]
             });
         }

--
Gitblit v1.9.1