123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129 |
- <div class="think-box-shadow">
- <form class="layui-form layui-card" action="{:request()->url()}" data-auto="true" method="post" autocomplete="off">
- <div class="layui-card-body">
- <div class="layui-form-item">
- <label class="layui-form-label label-required">标题</label>
- <div class="layui-input-block">
- <input name="title" maxlength="60" value='{$vo.title|default=""}' placeholder="请输入标题" class="layui-input">
- </div>
- </div>
- <div class="layui-form-item">
- <label class="layui-form-label label-required">目录</label>
- <div class="layui-input-inline">
- <select name="datum_cate" lay-filter ="datum_cate" lay-search>
- {foreach $datum_cate as $ck=>$cv}
- {if !empty($vo.datum_cate) && $vo.datum_cate == $ck}
- <option selected value="{$ck}">{$cv.title}</option>
- {else}
- <option value="{$ck}">{$cv.title}</option>
- {/if}
- {/foreach}
- </select>
- </div>
- </div>
- <div class="layui-form-item">
- <label class="layui-form-label">资料章数</label>
- <div class="layui-input-block">
- <input name="total_sequel" type="number" value='{$vo.total_sequel|default="1"}' placeholder="请输入资料章数" class="layui-input">
- </div>
- </div>
- <div class="layui-form-item">
- <label class="layui-form-label label-required">关联视频</label>
- <div class="layui-input-inline">
- <select name="video_id" lay-filter ="video_id" lay-search>
- <option value="0">请选择</option>
- {foreach $video_list as $vk=>$vv}
- <option {if isset($vo.video_id) && $vo.video_id == $vv['id'] }selected{/if} data-vl_key="{$vk}" value="{$vv['id']}">{$vv['title']}</option>
- {/foreach}
- </select>
- </div>
- <div class="layui-input-inline">
- <select name="video_item" lay-filter ="video_item" lay-search>
- <option value="0">请选择</option>
- {foreach $video_list as $vk=>$vv}
- {if isset($vo.video_id) && $vo.video_id == $vv['id'] }
- {foreach $vv['video_arr'] as $cln}
- <option {if isset($vo.video_item) && $vo.video_item == $cln['id']} selected {/if} value="{$cln['id']}">{$cln['title']}</option>
- {/foreach}
- {/if}
- {/foreach}
- </select>
- </div>
- </div>
- <div class="layui-form-item" >
- <label class="layui-form-label ">关联产品</label>
- <div class="layui-input-inline" style="width: 300px">
- <select name="goods_id" lay-filter ="goods_id" lay-search="">
- <option value="0">请选择</option>
- {foreach $supplier_goods as $gk=>$gv}
- <option {if isset($vo.goods_id) && $vo.goods_id == $gv['id'] }selected{/if} value="{$gv['id']}">{$gv['name']}------{$gv['title']}</option>
- {/foreach}
- </select>
- </div>
- </div>
- <div class="layui-form-item">
- <label class="layui-form-label label-required">标签</label>
- <div class="layui-input-block">
- <textarea placeholder="请输入标签" maxlength="100" class="layui-textarea" name="label">{$vo.label|default=''}</textarea>
- <span >多个用逗号隔开(半角)</span>
- </div>
- </div>
- <div class="layui-form-item">
- <label class="layui-form-label label-required">排序</label>
- <div class="layui-input-block">
- <input name="sort" type="number" value='{$vo.sort|default="0"}' placeholder="请输入排序号" class="layui-input">
- </div>
- </div>
- <input type="hidden" name="type" value="{$type}">
- <div class="layui-form-item">
- <label class="layui-form-label label-required">是否VIP</label>
- <div class="layui-input-block">
- <select class="layui-select" name="is_vip">
- <option value="0">否</option>
- <option {if !empty($vo.is_vip) && $vo.is_vip == 1 }selected{/if} value="1">是</option>
- </select>
- </div>
- </div>
- {notempty name='vo.id'}<input type='hidden' value='{$vo.id}' name='id'>{/notempty}
- {if !$r}
- <div class="layui-form-item text-center">
- <button class="layui-btn" type='submit'>保 存</button>
- <button class="layui-btn layui-btn-danger" type='button' data-close>取消编辑</button>
- </div>
- {/if}
- </div>
- </form>
- <script src="/static/plugs/layui/layui.all.js" charset="utf-8"></script>
- <script>
- window.form.render();
- $('[name="cover"]').uploadOneImage();
- // 关联视频监听
- form.on('select(video_id)', function(data){
- var cl_html = '<option value="0">请选择</option>';
- if(data.value == 0) {
- $("select[name='video_item']").html(cl_html);
- }else{
- var vl_key = data.elem[data.elem.selectedIndex].dataset.vl_key;
- var video_list = {:json_encode($video_list)};
- $.each(video_list[vl_key]['video_arr'],function (ck,cv) {
- cl_html +='<option value="'+cv.id+'">'+cv.title+'</option>';
- })
- $("select[name='video_item']").html(cl_html);
- }
- window.form.render();
- });
- </script>
- </div>
|