From a06aa3c488bf5b45146e0969a5b2c21d0af847e8 Mon Sep 17 00:00:00 2001 From: xiaoyong931011 <15274802129@163.com> Date: Fri, 17 Dec 2021 11:30:12 +0800 Subject: [PATCH] 20211216 --- src/main/resources/templates/febs/views/video/video/video-source-update.html | 38 ++++++++++++++++++++++++++++++++++++++ 1 files changed, 38 insertions(+), 0 deletions(-) diff --git a/src/main/resources/templates/febs/views/video/video/video-source-update.html b/src/main/resources/templates/febs/views/video/video/video-source-update.html index 232c770..f1fc924 100644 --- a/src/main/resources/templates/febs/views/video/video/video-source-update.html +++ b/src/main/resources/templates/febs/views/video/video/video-source-update.html @@ -27,6 +27,19 @@ </div> <div class="layui-form-item"> + <label class="layui-form-label">缩略图:</label> + <div class="layui-input-block"> + <div class="layui-upload"> + <button type="button" class="layui-btn" id="thumbUpload">上传图片</button> + <div class="layui-upload-list"> + <img class="layui-upload-img" id="thumb" th:src="${obj.thumb}" style="width: 150px;"/> + <input class="layui-input febs-hide" name="thumb" data-th-value="${obj.thumb}" autocomplete="off" /> + </div> + </div> + </div> + </div> + + <div class="layui-form-item"> <label class="layui-form-label"></label> <div class="layui-input-block"> <div class="layui-upload-drag" id="upload"> @@ -124,5 +137,30 @@ } } }); + + + upload.render({ + elem: '#thumbUpload' + ,url: 'common/upload' + ,before: function(obj){ + //预读本地文件示例,不支持ie8 + obj.preview(function(index, file, result){ + $('#thumb').attr('src', result); + }); + layer.msg('上传中', {icon: 16, time: 0}); + } + ,done: function(res){ + //如果上传失败 + if(res.code != 200){ + return layer.msg('上传失败'); + } + + $('#thumb').next().val(res.data[0]) + layer.msg('上传成功', {icon: 1}); + } + ,error: function(){ + layer.msg('上传失败'); + } + }); }); </script> \ No newline at end of file -- Gitblit v1.9.1