3a2fc529b781103baceb9d9b660602e9.php 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. <?php /*a:1:{s:70:"D:\project\gyx\gaoyixia\application\nutrition\view\video_url\form.html";i:1711348156;}*/ ?>
  2. <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"><fieldset class="layui-elem-field layui-field-title" style="margin-top: 30px;"><legend>视频编辑</legend></fieldset><div class="layui-card-body layui-tab-content"><div class="layui-form-item"><label class="layui-form-label label-required">系列</label><div class="layui-input-block"><input name="video_id" type="hidden" value='<?php echo htmlentities((isset($video_info['id']) && ($video_info['id'] !== '')?$video_info['id']:"")); ?>' class="layui-input"><input readonly maxlength="60" value='<?php echo htmlentities((isset($video_info['title']) && ($video_info['title'] !== '')?$video_info['title']:"")); ?>' class="layui-input"></div></div><div class="layui-form-item"><label class="layui-form-label label-required">标题</label><div class="layui-input-block"><input name="title" value='<?php echo htmlentities((isset($vo['title']) && ($vo['title'] !== '')?$vo['title']:"")); ?>' class="layui-input"></div></div><div class="layui-form-item"><label class="layui-form-label label-required">简介</label><div class="layui-input-block"><textarea placeholder="请输入简介" maxlength="500" class="layui-textarea" name="desc"><?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-block"><textarea placeholder="请输入标签" maxlength="100" class="layui-textarea" name="label"><?php echo htmlentities((isset($vo['label']) && ($vo['label'] !== '')?$vo['label']:'')); ?></textarea><span >多个用逗号隔开(半角)</span></div></div><div class="layui-form-item"><label class="layui-form-label label-required">关联文章</label><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 class="layui-form-item" ><label class="layui-form-label ">关联资料</label><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 class="layui-form-item" ><label class="layui-form-label ">关联商品</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"><label class="layui-form-label label-required">评论开关</label><div class="layui-input-inline"><select name="comment_switch" lay-filter ="comment_switch"><option selected value="1">开启</option><option <?php if(isset($vo['comment_switch']) && $vo['comment_switch'] == 0): ?>selected <?php endif; ?> value="0">关闭</option></select></div></div><div class="layui-form-item"><label class="layui-form-label ">会员账号</label><div class="layui-input-block"><input name="phone" value='<?php echo htmlentities((isset($vo['phone']) && ($vo['phone'] !== '')?$vo['phone']:"")); ?>' placeholder="请输入会员会员账号" class="layui-input"></div></div><div class="layui-form-item"><label class="layui-form-label ">上架时间</label><div class="layui-input-block"><input name="release_time" value='<?php echo htmlentities((isset($vo['release_time']) && ($vo['release_time'] !== '')?$vo['release_time']:"")); ?>' class="layui-input"></div></div><div class="layui-form-item"><label class="layui-form-label ">播放量</label><div class="layui-input-block"><input name="read_num" value='<?php echo htmlentities((isset($vo['read_num']) && ($vo['read_num'] !== '')?$vo['read_num']:"")); ?>' placeholder="请输入播放量" class="layui-input"></div></div><div class="layui-form-item"><label class="layui-form-label ">热搜阅读量</label><div class="layui-input-block"><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"></div></div><div class="layui-form-item"><label class="layui-form-label ">PDF</label><label class="layui-col-xs10 relative"><label class="layui-col-xs9 think-form-group-left"><input name="ppt" value='<?php echo htmlentities((isset($vo['ppt']) && ($vo['ppt'] !== '')?$vo['ppt']:"")); ?>' placeholder="请上传" class="layui-input"></label><button type="button" class="layui-btn" id="test3"><i class="layui-icon"></i>上传PPT</button></label></div><div class="layui-form-item pdf"><label class="layui-form-label ">PDF原文件</label><label class="layui-col-xs10 relative"><label class="layui-col-xs9 think-form-group-left"><input name="pdf_clear" value='<?php echo htmlentities((isset($vo['pdf_clear']) && ($vo['pdf_clear'] !== '')?$vo['pdf_clear']:"")); ?>' readonly class="layui-input layui-bg-gray"></label></label></div><div class="layui-form-item"><label class="layui-form-label label-required">视频封面</label><div class="layui-input-block"><input class="cover" 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" style="display: none"><label class="layui-form-label label-required">上传类型</label><div class="layui-input-inline"><select name="up_type" lay-filter ="up_type"><?php foreach([2=>'路径'] as $ck=>$cv): if(!empty($vo['up_type']) && $vo['up_type'] == $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><!--
  3. <div class="layui-form-item up_video"><label class="layui-form-label label-required">视频上传</label><div class="layui-input-block"><input class="up_url layui-input" name="up_url" type="hidden" value="<?php echo htmlentities((isset($vo['url']) && ($vo['url'] !== '')?$vo['url']:'')); ?>"></div></div>--><!-- <div class="layui-form-item path" ><label class="layui-form-label label-required">视频路径</label><div class="layui-input-block"><input name="path" class="layui-input" value="<?php echo htmlentities((isset($vo['url']) && ($vo['url'] !== '')?$vo['url']:'')); ?>" /></div></div>--><div class="layui-form-item" ><label class="layui-form-label label-required">云点播ID</label><div class="layui-input-block"><input name="ali_vid" class="layui-input" value="<?php echo htmlentities((isset($vo['ali_vid']) && ($vo['ali_vid'] !== '')?$vo['ali_vid']:'')); ?>" /></div></div><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><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"><label class="layui-form-label label-required">排序</label><div class="layui-input-block"><input name="sort" maxlength="60" value='<?php echo htmlentities((isset($vo['sort']) && ($vo['sort'] !== '')?$vo['sort']:"")); ?>' 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; ?><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></form><script src="/static/plugs/layui/layui.all.js" charset="utf-8"></script><script> window.form.render();
  4. laydate.render({type: 'datetime', elem: '[name="release_time"]'})
  5. laydate.render({type: 'datetime', elem: '[name="regular_hot_end_time"]'})
  6. $('[name="cover"]').uploadOneImage()
  7. $('[name="up_url"]').uploadOneVideo()
  8. $(document).on("click",'.video_player',function () {
  9. vUrl = $(".item_url").val(); //获取到播放的url
  10. var loadstr = '<video width="100%" height="100%" controls="controls" autobuffer="autobuffer" autoplay="autoplay" loop="loop">' +
  11. '<source src='+vUrl+' type="video/mp4"></source></video>';
  12. layer.open({
  13. type: 1,
  14. title: false,
  15. area: ['730px', '500px'],
  16. shade: [0.8, 'rgb(14, 16, 22)'],
  17. skin: 'demo-class',
  18. content: loadstr
  19. });
  20. form.render();
  21. });
  22. // 文章监听
  23. form.on('select(article_id)', function(data){
  24. var cl_html = '<option value="0">请选择</option>';
  25. if(data.value == 0) {
  26. $("select[name='article_item']").html(cl_html);
  27. }else{
  28. var vl_key = data.elem[data.elem.selectedIndex].dataset.vl_key;
  29. var article_list = <?php echo json_encode($article_list); ?>;
  30. $.each(article_list[vl_key]['item_children'],function (ck,cv) {
  31. cl_html +='<option value="'+cv.id+'">'+cv.title+'</option>';
  32. })
  33. $("select[name='article_item']").html(cl_html);
  34. }
  35. window.form.render();
  36. });
  37. // 关联资料监听
  38. form.on('select(datum_id)', function(data){
  39. var cl_html = '<option value="0">请选择</option>';
  40. if(data.value == 0) {
  41. $("select[name='datum_item']").html(cl_html);
  42. }else{
  43. var dl_key = data.elem[data.elem.selectedIndex].dataset.dl_key;
  44. var datum_list = <?php echo json_encode($datum_list); ?>;
  45. $.each(datum_list[dl_key]['url_arr'],function (ck,cv) {
  46. cl_html +='<option value="'+cv.id+'">'+cv.title+'</option>';
  47. })
  48. $("select[name='datum_item']").html(cl_html);
  49. }
  50. window.form.render();
  51. });
  52. form.on('select(up_type)', function(data){
  53. check_type()
  54. window.form.render();
  55. })
  56. // 关联供应商商品监听
  57. form.on('select(supplier_id)', function(data){
  58. var cl_html = '<option value="0">请选择</option>';
  59. if(data.value == 0) {
  60. $("select[name='goods_id']").html(cl_html);
  61. }else{
  62. var dl_key = data.elem[data.elem.selectedIndex].dataset.dl_key;
  63. console.log(dl_key);
  64. var supplier = <?php echo json_encode($supplier); ?>;
  65. $.each(supplier[dl_key]['goods_list'],function (ck,cv) {
  66. cl_html +='<option value="'+cv.id+'">'+cv.name+'</option>';
  67. })
  68. $("select[name='goods_id']").html(cl_html);
  69. }
  70. window.form.render();
  71. });
  72. function check_type() {
  73. if( $("select[name='up_type']").val() == 1) {
  74. $(".up_video").show();
  75. $(".path").hide();
  76. }else{
  77. $(".up_video").hide();
  78. $(".path").show();
  79. }
  80. window.form.render();
  81. }
  82. check_type()
  83. layui.use(['upload', 'element', 'layer'], function(){
  84. var $ = layui.jquery
  85. ,upload = layui.upload
  86. ,element = layui.element
  87. ,layer = layui.layer;
  88. upload.render({
  89. elem: '#test3',
  90. url: '/api/upload/pdfUpload', //此处用的是第三方的 http 请求演示,实际使用时改成您自己的上传接口即可。,accept: 'file', //普通文件,
  91. accept: 'file', //普通文件,
  92. done: function(res){
  93. if(res.code == 1){
  94. $("input[name='ppt']").val(res.data.cipher_path);
  95. $("input[name='pdf_clear']").val(res.data.plaintext_path);
  96. }
  97. layer.msg(res.msg);
  98. }
  99. });
  100. });
  101. </script></div>