12345678910111213141516171819 |
- <?php /*a:1:{s:75:"D:\project\gyx\gaoyixia\application\nutrition\view\series_article\form.html";i:1699858976;}*/ ?>
- <link rel="stylesheet" href="/static/plugs/layui/css/layui.css" media="all"><script src="/static/plugs/layui/layui.all.js" charset="utf-8"></script><div class="think-box-shadow"><form class="layui-form layui-card" action="<?php echo 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='<?php echo htmlentities((isset($vo['title']) && ($vo['title'] !== '')?$vo['title']:"")); ?>' placeholder="请输入标题" class="layui-input"></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='<?php echo htmlentities((isset($vo['total_sequel']) && ($vo['total_sequel'] !== '')?$vo['total_sequel']:"1")); ?>' placeholder="请输入图文期数" class="layui-input"></div></div><div class="layui-form-item"><label class="layui-form-label ">封面</label><div class="layui-input-block"><input name="cover" type="hidden" class="layui-input" value="<?php echo htmlentities((isset($vo['cover']) && ($vo['cover'] !== '')?$vo['cover']:'')); ?>"></div></div><div class="layui-form-item"><label class="layui-form-label label-required">分类</label><div class="layui-input-inline"><select name="first_classify" lay-filter ="first_classify"><option value="0">请选择</option><?php if(!empty($cate_tree)): foreach($cate_tree as $ck=>$cv): if(isset($vo['first_classify']) && $vo['first_classify'] == $cv['id']): ?><option selected data-cl_key="<?php echo htmlentities($ck); ?>" value="<?php echo htmlentities($cv['id']); ?>"><?php echo htmlentities($cv['title']); ?></option><?php else: ?><option data-cl_key="<?php echo htmlentities($ck); ?>" value="<?php echo htmlentities($cv['id']); ?>"><?php echo htmlentities($cv['title']); ?></option><?php endif; ?><?php endforeach; ?><?php endif; ?></select></div><div class="layui-input-inline"><select name="second_classify" lay-filter ="second_classify"><option value="0">请选择</option><?php if(!empty($cate_tree)): foreach($cate_tree as $ck=>$cv): if(isset($vo['first_classify']) && $vo['first_classify'] == $cv['id']): if(isset($cv['children'])): foreach($cv['children'] as $cln): if(isset($vo['second_classify']) && $vo['second_classify'] == $cln['id']): ?><option selected value="<?php echo htmlentities($cln['id']); ?>"><?php echo htmlentities($cln['title']); ?></option><?php else: ?><option value="<?php echo htmlentities($cln['id']); ?>"><?php echo htmlentities($cln['title']); ?></option><?php endif; ?><?php endforeach; ?><?php endif; ?><?php endif; ?><?php endforeach; ?><?php endif; ?></select></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='<?php echo htmlentities((isset($vo['sort']) && ($vo['sort'] !== '')?$vo['sort']:"0")); ?>' placeholder="请输入排序号" class="layui-input"></div></div><input type="hidden" name="type" value="<?php echo htmlentities($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 <?php if(!empty($vo['is_vip']) && $vo['is_vip'] == 1): ?>selected<?php endif; ?> value="1">是</option></select></div></div><?php if(!(empty($vo['id']) || (($vo['id'] instanceof \think\Collection || $vo['id'] instanceof \think\Paginator ) && $vo['id']->isEmpty()))): ?><input type='hidden' value='<?php echo htmlentities($vo['id']); ?>' name='id'><?php endif; 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><?php endif; ?></div></form><script src="/static/plugs/layui/layui.all.js" charset="utf-8"></script><script> window.form.render();
- $('[name="cover"]').uploadOneImage();
- // 分类选择监听
- form.on('select(first_classify)', function(data){
- var cl_html = '<option value="0">请选择</option>';
- if(data.value == 0) {
- $("select[name='second_classify']").html(cl_html);
- }else{
- var cl_key = data.elem[data.elem.selectedIndex].dataset.cl_key;
- var goods_spec = <?php echo json_encode($cate_tree); ?>;
- $.each(goods_spec[cl_key]['children'],function (ck,cv) {
- cl_html +='<option value="'+cv.id+'">'+cv.title+'</option>';
- })
- $("select[name='second_classify']").html(cl_html);
- }
- window.form.render();
- })
- </script></div>
|