1be237e4f24b1edd1b79f38d10cd3991.php 14 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. <?php /*a:2:{s:64:"D:\project\gyx\gaoyixia\application\operate\view\press\form.html";i:1711349914;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-xs3 relative"><span class="color-green">热搜定时时间</span><input name="regular_hot_end_time" value='<?php echo htmlentities((isset($vo['regular_hot_end_time']) && ($vo['regular_hot_end_time'] !== '')?$vo['regular_hot_end_time']:"")); ?>' class="layui-input"></label><label class="layui-col-xs3 relative"><span class="color-green">目标热搜阅读量</span><input name="hot_target_num" value='<?php echo htmlentities((isset($vo['hot_target_num']) && ($vo['hot_target_num'] !== '')?$vo['hot_target_num']:"")); ?>' placeholder="请输入目标热搜阅读量" class="layui-input"></label></div><!-- <div class="layui-form-item">--><!-- <label class="layui-form-label ">热搜定时时间</label>--><!-- <div class="layui-input-block">--><!-- <input name="regular_hot_end_time" value='<?php echo htmlentities((isset($vo['regular_hot_end_time']) && ($vo['regular_hot_end_time'] !== '')?$vo['regular_hot_end_time']:"")); ?>' class="layui-input">--><!-- </div>--><!-- </div>--><!-- <div class="layui-form-item">--><!-- <label class="layui-form-label ">目标热搜阅读量</label>--><!-- <div class="layui-input-block">--><!-- <input name="hot_target_num" value='<?php echo htmlentities((isset($vo['hot_target_num']) && ($vo['hot_target_num'] !== '')?$vo['hot_target_num']:"")); ?>' placeholder="请输入目标热搜阅读量" class="layui-input">--><!-- </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"><div class="layui-input-inline"><select name="datum_id" lay-filter ="datum_id" lay-search><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" lay-search><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" lay-search><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" lay-search><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" lay-search><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" lay-search><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" ><label class="layui-col-xs12 relative"><span class="color-green">产品</span></label><div class="layui-input-inline" ><select name="supplier_id" lay-filter ="supplier_id" lay-search><option value="0">请选择</option><?php foreach($supplier as $dk=>$dv): ?><option <?php if(isset($vo['supplier_id']) && $vo['supplier_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="goods_id" lay-filter ="goods_id" lay-search><option value="0">请选择</option><?php foreach($supplier as $vk=>$vv): if(isset($vo['supplier_id']) && $vo['supplier_id'] == $vv['id']): foreach($vv['goods_list'] as $cln): ?><option <?php if(isset($vo['goods_id']) && $vo['goods_id'] == $cln['id']): ?> selected <?php endif; ?> value="<?php echo htmlentities($cln['id']); ?>"><?php echo htmlentities($cln['name']); ?></option><?php endforeach; ?><?php endif; ?><?php endforeach; ?></select></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. laydate.render({type: 'datetime', elem: '[name="regular_hot_end_time"]'})
  4. $('[name="cover"]').uploadOneImage();
  5. $('[name="images"]').uploadMultipleImage();
  6. require(['ckeditor', 'angular'], function () {
  7. window.createEditor('[name="content"]', {
  8. height: 500,
  9. });
  10. })
  11. laydate.render({
  12. elem: '#release_time'
  13. ,type: 'datetime'
  14. });
  15. // 文章监听
  16. form.on('select(article_id)', function(data){
  17. var cl_html = '<option value="0">请选择</option>';
  18. if(data.value == 0) {
  19. $("select[name='article_item']").html(cl_html);
  20. }else{
  21. var vl_key = data.elem[data.elem.selectedIndex].dataset.vl_key;
  22. var article_list = <?php echo json_encode($article_list); ?>;
  23. $.each(article_list[vl_key]['item_children'],function (ck,cv) {
  24. cl_html +='<option value="'+cv.id+'">'+cv.title+'</option>';
  25. })
  26. $("select[name='article_item']").html(cl_html);
  27. }
  28. window.form.render();
  29. });
  30. // 关联视频监听
  31. form.on('select(video_id)', function(data){
  32. var cl_html = '<option value="0">请选择</option>';
  33. if(data.value == 0) {
  34. $("select[name='video_item']").html(cl_html);
  35. }else{
  36. var vl_key = data.elem[data.elem.selectedIndex].dataset.vl_key;
  37. var video_list = <?php echo json_encode($video_list); ?>;
  38. $.each(video_list[vl_key]['video_arr'],function (ck,cv) {
  39. cl_html +='<option value="'+cv.id+'">'+cv.title+'</option>';
  40. })
  41. $("select[name='video_item']").html(cl_html);
  42. }
  43. window.form.render();
  44. });
  45. // 关联资料监听
  46. form.on('select(datum_id)', function(data){
  47. var cl_html = '<option value="0">请选择</option>';
  48. if(data.value == 0) {
  49. $("select[name='datum_item']").html(cl_html);
  50. }else{
  51. var dl_key = data.elem[data.elem.selectedIndex].dataset.dl_key;
  52. var datum_list = <?php echo json_encode($datum_list); ?>;
  53. $.each(datum_list[dl_key]['url_arr'],function (ck,cv) {
  54. cl_html +='<option value="'+cv.id+'">'+cv.title+'</option>';
  55. })
  56. $("select[name='datum_item']").html(cl_html);
  57. }
  58. window.form.render();
  59. });
  60. // 关联供应商商品监听
  61. form.on('select(supplier_id)', function(data){
  62. var cl_html = '<option value="0">请选择</option>';
  63. if(data.value == 0) {
  64. $("select[name='goods_id']").html(cl_html);
  65. }else{
  66. var dl_key = data.elem[data.elem.selectedIndex].dataset.dl_key;
  67. console.log(dl_key);
  68. var supplier = <?php echo json_encode($supplier); ?>;
  69. $.each(supplier[dl_key]['goods_list'],function (ck,cv) {
  70. cl_html +='<option value="'+cv.id+'">'+cv.name+'</option>';
  71. })
  72. $("select[name='goods_id']").html(cl_html);
  73. }
  74. window.form.render();
  75. });
  76. </script></div>