54530d37d30568818a5f9b4949cfe7d1.php 6.4 KB

1234567891011121314151617181920212223242526
  1. <?php /*a:1:{s:71:"D:\project\gyx\gaoyixia\application\nutrition\view\user_video\form.html";i:1709255771;}*/ ?>
  2. <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-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="label" class="layui-input" value="<?php echo htmlentities((isset($vo['label']) && ($vo['label'] !== '')?$vo['label']:'')); ?>"></div></div><div class="layui-form-item"><label class="layui-form-label label-required">封面</label><div class="layui-input-block"><input name="cover" type="hidden" value="<?php echo htmlentities((isset($vo['cover']) && ($vo['cover'] !== '')?$vo['cover']:'')); ?>"></div></div><div class="layui-form-item video"><label class="layui-form-label label-required">视频</label><div class="layui-input-block"><input name="video_url" type="hidden" value="<?php echo htmlentities((isset($vo['video_url']) && ($vo['video_url'] !== '')?$vo['video_url']:'')); ?>"></div></div><div class="layui-form-item video"><label class="layui-form-label label-required">简介</label><div class="layui-input-block"><textarea placeholder="请输入标签" class="layui-textarea" name="label"><?php echo htmlentities((isset($vo['desc']) && ($vo['desc'] !== '')?$vo['desc']:'')); ?></textarea></div></div><div class="layui-form-item"><label class="layui-form-label label-required">审核</label><div class="layui-input-inline"><select name="status" lay-filter ="status"><?php foreach(['暂不审核','审核通过','审核拒绝'] as $ck=>$cv): ?><option <?php if($vo['status'] == $ck): ?> selected <?php endif; ?> value="<?php echo htmlentities($ck); ?>"><?php echo htmlentities($cv); ?></option><?php endforeach; ?></select></div></div><div class="layui-form-item"><label class="layui-form-label label-required">审核备注</label><div class="layui-input-block"><input name="remark" maxlength="60" value='<?php echo htmlentities((isset($vo['remark']) && ($vo['remark'] !== '')?$vo['remark']:"")); ?>' 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="is_top" lay-filter ="is_top"><?php foreach(['不置顶','置顶'] as $ck=>$cv): if(!empty($vo['is_top']) && $vo['is_top'] == $ck): ?><option selected data-cl_key="<?php echo htmlentities($ck); ?>" value="<?php echo htmlentities($ck); ?>"><?php echo htmlentities($cv); ?></option><?php else: ?><option data-cl_key="<?php echo htmlentities($ck); ?>" value="<?php echo htmlentities($ck); ?>"><?php echo htmlentities($cv); ?></option><?php endif; ?><?php endforeach; ?></select></div></div><div class="layui-form-item"><label class="layui-form-label label-required">排序</label><div class="layui-input-block"><input type="number" name="sort" value='<?php echo htmlentities((isset($vo['sort']) && ($vo['sort'] !== '')?$vo['sort']:"")); ?>' placeholder="请输入排序号" class="layui-input"></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; ?><input name="user_id" type="hidden" value='<?php echo htmlentities((isset($vo['user_id']) && ($vo['user_id'] !== '')?$vo['user_id']:"0")); ?>'><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></div></form><script> window.form.render();
  3. require(['ckeditor', 'angular'], function () {
  4. window.createEditor('[name="detail"]', {height: 500,width:1000});
  5. })
  6. $('[name="cover"]').uploadOneImage();
  7. $('[name="video_url"]').uploadOneVideo()
  8. // 分类选择监听
  9. form.on('select(first_classify)', function(data){
  10. var cl_html = '<option value="0">请选择</option>';
  11. if(data.value == 0) {
  12. $("select[name='second_classify']").html(cl_html);
  13. }else{
  14. var cl_key = data.elem[data.elem.selectedIndex].dataset.cl_key;
  15. var goods_spec = <?php echo json_encode($cate_tree); ?>;
  16. $.each(goods_spec[cl_key]['children'],function (ck,cv) {
  17. cl_html +='<option value="'+cv.id+'">'+cv.title+'</option>';
  18. })
  19. $("select[name='second_classify']").html(cl_html);
  20. }
  21. window.form.render();
  22. })
  23. </script></div>