1be237e4f24b1edd1b79f38d10cd3991.php 11 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. <?php /*a:2:{s:64:"D:\project\gyx\gaoyixia\application\operate\view\press\form.html";i:1699858976;s:56:"D:\project\gyx\gaoyixia\application\admin\view\main.html";i:1699858976;}*/ ?>
  2. <div class="layui-card layui-bg-gray"><?php if(!(empty($title) || (($title instanceof \think\Collection || $title instanceof \think\Paginator ) && $title->isEmpty()))): ?><div class="layui-card-header layui-anim layui-anim-fadein notselect"><span class="layui-icon layui-icon-next font-s10 color-desc margin-right-5"></span><?php echo htmlentities((isset($title) && ($title !== '')?$title:'')); ?><div class="pull-right"></div></div><?php endif; ?><div class="layui-card-body layui-anim layui-anim-upbit"><form class="layui-form layui-card" action="<?php echo request()->url(); ?>" data-auto="true" method="post" autocomplete="off"><div class="layui-card-body think-box-shadow padding-left-40"><div class="layui-tab"><ul class="layui-tab-title"><li class="layui-this">基础设置</li></ul><div class="layui-tab-content"><div class="layui-tab-item layui-show"><div class="layui-form-item layui-row layui-col-space15"><label class="layui-col-xs9 relative"><span class="color-green">新闻标题</span><input name="title" class="layui-input" placeholder="请输入新闻标题" value="<?php echo htmlentities((isset($vo['title']) && ($vo['title'] !== '')?$vo['title']:'')); ?>"></label></div><div class="layui-form-item layui-row layui-col-space15"><label class="layui-col-xs9 relative"><span class="color-green">新闻标签</span><textarea placeholder="请输入新闻标签" class="layui-textarea" name="label"><?php echo htmlentities((isset($vo['label']) && ($vo['label'] !== '')?$vo['label']:"")); ?></textarea></label></div><div class="layui-form-item layui-row layui-col-space15"><label class="layui-col-xs9 relative"><span class="color-green">新闻描述</span><textarea placeholder="请输入新闻描述" class="layui-textarea" name="desc"><?php echo htmlentities((isset($vo['desc']) && ($vo['desc'] !== '')?$vo['desc']:"")); ?></textarea></label></div><div class="layui-form-item"><span class="color-green label-required-prev">新闻封面</span><table class="layui-table"><thead><tr><td width="auto" class="text-left"><input name="images" type="hidden" value="<?php echo htmlentities((isset($vo['images']) && ($vo['images'] !== '')?$vo['images']:'')); ?>"></td></tr></thead></table></div><div class="layui-form-item layui-row layui-col-space15"><label class="layui-col-xs3 relative"><span class="color-green">会员账号</span><input name="phone" class="layui-input" placeholder="请输入会员账号" value="<?php echo htmlentities((isset($vo['phone']) && ($vo['phone'] !== '')?$vo['phone']:'')); ?>"></label><label class="layui-col-xs3 relative"><span class="color-green">阅读量</span><input name="read_num" class="layui-input" placeholder="" value="<?php echo htmlentities((isset($vo['read_num']) && ($vo['read_num'] !== '')?$vo['read_num']:'')); ?>"></label><label class="layui-col-xs3 relative"><span class="color-green">评论开关</span><select class="layui-select" name="comment_switch" id="comment_switch" lay-filter="comment_switch" lay-search><option <?php if(isset($vo['comment_switch']) && $vo['comment_switch'] == 1): ?>selected<?php endif; ?> value="1">开启</option><option <?php if(isset($vo['comment_switch']) && $vo['comment_switch'] == 0): ?>selected<?php endif; ?> value="0">关闭</option></select></label></div><div class="layui-form-item layui-row layui-col-space15"><label class="layui-col-xs3 relative"><span class="color-green">热搜阅读量</span><input name="hot_num" value='<?php echo htmlentities((isset($vo['hot_num']) && ($vo['hot_num'] !== '')?$vo['hot_num']:"")); ?>' placeholder="请输入热搜阅读量" class="layui-input"><input name="hot_num_old" type="hidden" value='<?php echo htmlentities((isset($vo['hot_num']) && ($vo['hot_num'] !== '')?$vo['hot_num']:"")); ?>' class="layui-input"></label><label class="layui-col-xs3 relative"><span class="color-green">上架时间</span><input name="release_time" id="release_time" class="layui-input" placeholder="" value="<?php echo htmlentities((isset($vo['release_time']) && ($vo['release_time'] !== '')?$vo['release_time']:'')); ?>"></label></div><div class="layui-form-item layui-row layui-col-space15"><label class="layui-col-xs12 relative"><span class="color-green">关联资料</span></label><div class="layui-inline" style="top: -15px;margin-bottom: -25px"><div class="layui-input-inline"><select name="datum_id" lay-filter ="datum_id"><option value="0">请选择</option><?php foreach($datum_list as $dk=>$dv): ?><option <?php if(isset($vo['datum_id']) && $vo['datum_id'] == $dv['id']): ?>selected<?php endif; ?> data-dl_key="<?php echo htmlentities($dk); ?>" value="<?php echo htmlentities($dv['id']); ?>"><?php echo htmlentities($dv['title']); ?></option><?php endforeach; ?></select></div><div class="layui-input-inline"><select name="datum_item" lay-filter ="datum_item"><option value="0">请选择</option><?php foreach($datum_list as $vk=>$vv): if(isset($vo['datum_id']) && $vo['datum_id'] == $vv['id']): foreach($vv['url_arr'] as $cln): ?><option <?php if(isset($vo['datum_item']) && $vo['datum_item'] == $cln['id']): ?> selected <?php endif; ?> value="<?php echo htmlentities($cln['id']); ?>"><?php echo htmlentities($cln['title']); ?></option><?php endforeach; ?><?php endif; ?><?php endforeach; ?></select></div></div></div><div class="layui-form-item layui-row layui-col-space15"><label class="layui-col-xs12 relative"><span class="color-green">视频</span></label><div class="layui-inline" style="top: -15px;margin-bottom: -25px;margin-right: 20px;"><div class="layui-input-inline"><select name="video_id" lay-filter ="video_id"><option value="0">请选择</option><?php foreach($video_list as $vk=>$vv): ?><option <?php if(isset($vo['video_id']) && $vo['video_id'] == $vv['id']): ?>selected<?php endif; ?> data-vl_key="<?php echo htmlentities($vk); ?>" value="<?php echo htmlentities($vv['id']); ?>"><?php echo htmlentities($vv['title']); ?></option><?php endforeach; ?></select></div><div class="layui-input-inline"><select name="video_item" lay-filter ="video_item"><option value="0">请选择</option><?php foreach($video_list as $vk=>$vv): if(isset($vo['video_id']) && $vo['video_id'] == $vv['id']): foreach($vv['video_arr'] as $cln): ?><option <?php if(isset($vo['video_item']) && $vo['video_item'] == $cln['id']): ?> selected <?php endif; ?> value="<?php echo htmlentities($cln['id']); ?>"><?php echo htmlentities($cln['title']); ?></option><?php endforeach; ?><?php endif; ?><?php endforeach; ?></select></div></div></div><div class="layui-form-item layui-row layui-col-space15"><label class="layui-col-xs12 relative"><span class="color-green">图文</span></label><div class="layui-inline" style="top: -15px;margin-bottom: -25px;margin-right: 20px;"><div class="layui-input-inline"><select name="article_id" lay-filter ="article_id"><option value="0">请选择</option><?php foreach($article_list as $vk=>$vv): ?><option <?php if(isset($vo['article_id']) && $vo['article_id'] == $vv['id']): ?>selected<?php endif; ?> data-vl_key="<?php echo htmlentities($vk); ?>" value="<?php echo htmlentities($vv['id']); ?>"><?php echo htmlentities($vv['title']); ?></option><?php endforeach; ?></select></div><div class="layui-input-inline"><select name="article_item" lay-filter ="article_item"><option value="0">请选择</option><?php foreach($article_list as $vk=>$vv): if(isset($vo['article_id']) && $vo['article_id'] == $vv['id']): foreach($vv['item_children'] as $cln): ?><option <?php if(isset($vo['article_item']) && $vo['article_item'] == $cln['id']): ?> selected <?php endif; ?> value="<?php echo htmlentities($cln['id']); ?>"><?php echo htmlentities($cln['title']); ?></option><?php endforeach; ?><?php endif; ?><?php endforeach; ?></select></div></div></div><div class="layui-form-item layui-row layui-col-space15"><label class="layui-col-xs12 relative"><span class="color-green">产品</span></label><div class="layui-inline" style="top: -15px;margin-bottom: -25px;margin-right: 20px;"><div class="layui-input-inline"><select name="goods_id" lay-filter ="goods_id"><option value="0">请选择</option><?php foreach($supplier_goods as $gk=>$gv): ?><option <?php if(isset($vo['goods_id']) && $vo['goods_id'] == $gv['id']): ?>selected<?php endif; ?> value="<?php echo htmlentities($gv['id']); ?>"><?php echo htmlentities($gv['name']); ?>------<?php echo htmlentities($gv['title']); ?></option><?php endforeach; ?></select></div></div></div><div class="layui-form-item layui-row layui-col-space9"><label class="layui-col-xs15 relative"><span class="color-green">详情</span><textarea name="content"><?php echo htmlentities((isset($vo['content']) && ($vo['content'] !== '')?$vo['content']:"")); ?></textarea></label></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; ?><div class="layui-form-item text-center"><button class="layui-btn" type='submit'>保 存</button><button class="layui-btn layui-btn-danger" type='button' onclick="history.go(-1)" data-close>返回</button></div></div></div></div></div></form></div><script> window.form.render();
  3. $('[name="cover"]').uploadOneImage();
  4. $('[name="images"]').uploadMultipleImage();
  5. require(['ckeditor', 'angular'], function () {
  6. window.createEditor('[name="content"]', {
  7. height: 500,
  8. });
  9. })
  10. laydate.render({
  11. elem: '#release_time'
  12. ,type: 'datetime'
  13. });
  14. // 文章监听
  15. form.on('select(article_id)', function(data){
  16. var cl_html = '<option value="0">请选择</option>';
  17. if(data.value == 0) {
  18. $("select[name='article_item']").html(cl_html);
  19. }else{
  20. var vl_key = data.elem[data.elem.selectedIndex].dataset.vl_key;
  21. var article_list = <?php echo json_encode($article_list); ?>;
  22. $.each(article_list[vl_key]['item_children'],function (ck,cv) {
  23. cl_html +='<option value="'+cv.id+'">'+cv.title+'</option>';
  24. })
  25. $("select[name='article_item']").html(cl_html);
  26. }
  27. window.form.render();
  28. });
  29. // 关联视频监听
  30. form.on('select(video_id)', function(data){
  31. var cl_html = '<option value="0">请选择</option>';
  32. if(data.value == 0) {
  33. $("select[name='video_item']").html(cl_html);
  34. }else{
  35. var vl_key = data.elem[data.elem.selectedIndex].dataset.vl_key;
  36. var video_list = <?php echo json_encode($video_list); ?>;
  37. $.each(video_list[vl_key]['video_arr'],function (ck,cv) {
  38. cl_html +='<option value="'+cv.id+'">'+cv.title+'</option>';
  39. })
  40. $("select[name='video_item']").html(cl_html);
  41. }
  42. window.form.render();
  43. });
  44. // 关联资料监听
  45. form.on('select(datum_id)', function(data){
  46. var cl_html = '<option value="0">请选择</option>';
  47. if(data.value == 0) {
  48. $("select[name='datum_item']").html(cl_html);
  49. }else{
  50. var dl_key = data.elem[data.elem.selectedIndex].dataset.dl_key;
  51. var datum_list = <?php echo json_encode($datum_list); ?>;
  52. $.each(datum_list[dl_key]['url_arr'],function (ck,cv) {
  53. cl_html +='<option value="'+cv.id+'">'+cv.title+'</option>';
  54. })
  55. $("select[name='datum_item']").html(cl_html);
  56. }
  57. window.form.render();
  58. });
  59. </script></div>