|  |  | 
 |  |  |                     <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> | 
 |  |  | 
 |  |  |                 <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> | 
 |  |  | 
 |  |  |     {{#  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> | 
 |  |  | 
 |  |  |                 {{#  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> | 
 |  |  | 
 |  |  |                     return layer.msg('上传失败'); | 
 |  |  |                 } | 
 |  |  |  | 
 |  |  |                 $('#thumb').next().val(res.data[0]) | 
 |  |  |                 layer.msg('上传成功', {icon: 1}); | 
 |  |  |             } | 
 |  |  |             ,error: function(){ | 
 |  |  | 
 |  |  |                 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', | 
 |  |  | 
 |  |  |                 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; |