From 9f14a435039c4159cdc015bb567adc6a3f84306f Mon Sep 17 00:00:00 2001
From: xiaoyong931011 <15274802129@163.com>
Date: Wed, 22 Dec 2021 15:35:29 +0800
Subject: [PATCH] 20211216
---
src/main/resources/templates/febs/views/video/video/video-add.html | 73 ++++++++++--------------------------
1 files changed, 21 insertions(+), 52 deletions(-)
diff --git a/src/main/resources/templates/febs/views/video/video/video-add.html b/src/main/resources/templates/febs/views/video/video/video-add.html
index fd8ad51..a0051eb 100644
--- a/src/main/resources/templates/febs/views/video/video/video-add.html
+++ b/src/main/resources/templates/febs/views/video/video/video-add.html
@@ -47,6 +47,7 @@
<button type="button" class="layui-btn" id="thumbUpload">上传图片</button>
<div class="layui-upload-list">
<img class="layui-upload-img" id="thumb" style="width: 150px;"/>
+ <input class="layui-input febs-hide" name="thumb" autocomplete="off" />
</div>
</div>
</div>
@@ -64,52 +65,13 @@
<table class="layui-table">
<thead>
<tr>
- <th>排序</th>
- <th>视频标题</th>
- <th>视频缩略图</th>
+ <th>章节标题</th>
+ <th>缩略图</th>
<th>资源名称</th>
<th>操作</th>
</tr>
</thead>
<tbody id="itemList">
-<!-- <tr>-->
-<!-- <th>-->
-<!-- 1-->
-<!-- </th>-->
-<!-- <th>-->
-<!-- <input type="text" class="layui-input" placeholder="" />-->
-<!-- </th>-->
-<!-- <th>-->
-<!-- <div class="upload">-->
-<!-- <img class="layui-upload-img item-img febs-hide" style="width: 150px;"/>-->
-<!-- <button class="layui-btn layui-btn-xs" type="button">点击上传</button>-->
-<!-- <input type="text" class="febs-hide" name="itemThumb" />-->
-<!-- </div>-->
-<!-- </th>-->
-<!-- <th>123</th>-->
-<!-- <th>-->
-<!-- <button class="layui-btn layui-btn-xs layui-btn-danger demo-delete">删除</button>-->
-<!-- </th>-->
-<!-- </tr>-->
-<!-- <tr>-->
-<!-- <th>-->
-<!-- 2-->
-<!-- </th>-->
-<!-- <th>-->
-<!-- <input type="text" class="layui-input" placeholder="" />-->
-<!-- </th>-->
-<!-- <th>-->
-<!-- <div class="upload">-->
-<!-- <img class="layui-upload-img item-img" src="https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fimg.jj20.com%2Fup%2Fallimg%2Ftp05%2F19100120461512E-0-lp.jpg&refer=http%3A%2F%2Fimg.jj20.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=jpeg" style="width: 150px;"/>-->
-<!-- <button class="layui-btn layui-btn-xs febs-hide" type="button">点击上传</button>-->
-<!-- <input type="text" class="febs-hide" name="itemThumb" />-->
-<!-- </div>-->
-<!-- </th>-->
-<!-- <th>123</th>-->
-<!-- <th>-->
-<!-- <button class="layui-btn layui-btn-xs layui-btn-danger demo-delete">删除</button>-->
-<!-- </th>-->
-<!-- </tr>-->
</tbody>
</table>
</div>
@@ -140,10 +102,7 @@
{{# layui.each(d, function(index, item){ }}
<tr>
<th>
- {{item.seq}}
<input type="text" class="febs-hide" name="sourceId" value="{{item.id}}"/>
- </th>
- <th>
<input type="text" class="layui-input" name="name" placeholder="" value=""/>
</th>
<th>
@@ -151,11 +110,11 @@
{{# if(!item.thumb || item.thumb == ''){ }}
<img class="layui-upload-img item-img febs-hide" src="" style="width: 150px;"/>
<button class="layui-btn layui-btn-xs" type="button">点击上传</button>
- <input type="text" class="febs-hide" name="itemThumb" />
+ <input type="text" class="febs-hide" autocomplete="off" name="itemThumb" />
{{# } else { }}
- <img class="layui-upload-img item-img" src="" style="width: 150px;"/>
+ <img class="layui-upload-img item-img" src="{{item.thumb}}" style="width: 150px;"/>
<button class="layui-btn layui-btn-xs febs-hide" type="button">点击上传</button>
- <input type="text" class="febs-hide" name="itemThumb" />
+ <input type="text" class="febs-hide" autocomplete="off" name="itemThumb" />
{{# } }}
</div>
</th>
@@ -269,6 +228,7 @@
return layer.msg('上传失败');
}
+ $('#thumb').next().val(res.data[0])
layer.msg('上传成功', {icon: 1});
}
,error: function(){
@@ -350,17 +310,19 @@
itemData.push(data);
});
+ if (!data.field.thumb) {
+ febs.alert.warn('未上传缩略图');
+ return;
+ }
var field = {};
field.items = itemData;
field.title = data.field.title;
field.cateIds = cateIds.join(",");
field.thumb = data.field.thumb;
+ field.isFree = data.field.isFree;
+ field.intro = data.field.intro;
console.log(field);
-
- // febs.post(ctx + 'video/video/add', data.field, function () {
- // layer.closeAll();
- // });
$.ajax({
url : ctx + 'video/video/add',
@@ -370,9 +332,16 @@
data : JSON.stringify(field),
success : function(res) {
console.log(res)
+ if (res.code != 200) {
+ febs.alert.warn(res.message);
+ return;
+ }
+ febs.alert.success('新增成功');
+ $('#febs-video').find('#query').click();
+ layer.closeAll();
},
error : function(err) {
-
+ layer.msg("请求错误");
}
})
return false;
--
Gitblit v1.9.1