123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272 |
- <?php /*a:3:{s:73:"D:\project\gyx\gaoyixia\application\operate\view\supplier_goods\form.html";i:1711355489;s:56:"D:\project\gyx\gaoyixia\application\admin\view\main.html";i:1699858976;s:73:"D:\project\gyx\gaoyixia\application\mall\view\store_goods\form_style.html";i:1699858976;}*/ ?>
- <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"><style> .inner-input {
- width: 80px;
- height: 14px;
- padding: 1px 5px;
- line-height: 12px;
- }
- .goods-spec-box {
- position: relative;
- margin: 0 10px 10px 0;
- vertical-align: middle;
- }
- .goods-spec-title {
- z-index: 2;
- width: 40px;
- color: #fff;
- height: 28px;
- position: absolute;
- background: #999;
- line-height: 28px;
- }
- .goods-spec-close {
- right: 8px;
- z-index: 2;
- line-height: 28px;
- position: absolute;
- display: inline-block
- }
- .goods-spec-btn {
- height: 28px;
- margin-left: 5px !important;
- line-height: 26px !important;
- }
- .goods-spec-box input {
- z-index: 1;
- width: 120px;
- position: relative;
- border: 1px solid #999;
- padding: 5px 0 5px 45px;
- display: inline-block !important;
- }
- .goods-spec-box input[type=checkbox] {
- z-index: 2;
- width: 40px;
- height: 28px;
- border: none;
- cursor: pointer;
- appearance: none;
- position: absolute;
- -webkit-appearance: none;
- }
- .goods-spec-box input[type=checkbox]:before {
- top: 1px;
- left: 1px;
- width: 40px;
- height: 26px;
- content: ' ';
- position: absolute;
- background: #c9c9c9;
- }
- .goods-spec-box input[type=checkbox]:after {
- top: 1px;
- left: 1px;
- color: #999;
- width: 40px;
- height: 26px;
- content: '\e63f';
- font-size: 16px;
- line-height: 26px;
- position: absolute;
- text-align: center;
- font-family: 'layui-icon';
- }
- .goods-spec-box input[type=checkbox]:checked:after {
- color: #333;
- content: '\e605';
- }
- </style><style> .layui-form-radio{
- margin: 0 !important;
- padding-right:0 !important;
- }
- .layui-form-select{
- margin-right: 10px !important;
- }
- .layui-col-xs9{
- width: 90%;
- }
- </style><form onsubmit="return false;" id="GoodsForm" data-auto="true" method="post" class='layui-form layui-card' 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"><!--基础设置start--><div class="layui-form-item layui-row layui-col-space15"><label class="layui-col-xs9 relative"><span class="color-green">名称</span><input name="name" required class="layui-input" placeholder="请输入产品名称" value="<?php echo htmlentities((isset($vo['name']) && ($vo['name'] !== '')?$vo['name']:'')); ?>"></label></div><div class="layui-form-item layui-row layui-col-space15"><label class="layui-col-xs9 relative"><span class="color-green">标签</span><span class="margin-left-10 color-gray">多个半角逗号(,)隔开</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 layui-row layui-col-space15"><label class="layui-col-xs9 relative" style="width: 100%;"><span class="color-green">产品分类</span></label><div style="width: 100%"><div style="width: 15%;float: left;"><select class="layui-select" id="first_classify" name="first_classify" lay-filter="first_classify" lay-search><option selected data-first_key="-1" selected value="0">请选择</option><?php if(!empty($goods_cate)): foreach($goods_cate as $ck=>$cv): if(isset_full_check($vo,'first_classify',$cv['id'])): ?><option selected data-first_key="<?php echo htmlentities($ck); ?>" value="<?php echo htmlentities($cv['id']); ?>"><?php echo htmlentities($cv['title']); ?></option><?php else: ?><option data-first_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 style="width: 15%;float: left"><select class="layui-select" id="second_classify" name="second_classify" lay-filter="second_classify" lay-search></select></div><div style="width: 15%;float: left"><select class="layui-select" id="third_classify" name="third_classify" lay-filter="third_classify" lay-search></select></div><input type="hidden" id="first" value="<?php echo htmlentities((isset($vo['first_classify']) && ($vo['first_classify'] !== '')?$vo['first_classify']:'-1')); ?>"/><input type="hidden" id="second" value="<?php echo htmlentities((isset($vo['second_classify']) && ($vo['second_classify'] !== '')?$vo['second_classify']:'-1')); ?>"/><input type="hidden" id="third" value="<?php echo htmlentities((isset($vo['third_classify']) && ($vo['third_classify'] !== '')?$vo['third_classify']:'-1')); ?>"/></div></div><div class="layui-form-item layui-row layui-col-space15" ><label class="layui-col-xs3 relative"><span class="color-green">供应商</span><select name="supplier_id" lay-filter ="supplier_id" lay-search><option value="0">请选择</option><?php foreach($supplier_list as $dk=>$dv): ?><option <?php if(isset($vo['supplier_id']) && $vo['supplier_id'] == $dv['id']): ?>selected<?php endif; ?> value="<?php echo htmlentities($dv['id']); ?>"><?php echo htmlentities($dv['title']); ?></option><?php endforeach; ?></select></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-xs9 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-xs9 relative"><span class="color-green">关联视频</span></label><div class="layui-inline" style="top: -15px;margin-bottom: -25px"><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-xs9 relative"><span class="color-green">关联文章</span></label><div class="layui-inline" style="top: -15px;margin-bottom: -25px"><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 layui-row layui-col-space15"><label class="layui-col-xs9 relative"><span class="color-green">会员账号</span><input name="phone" value='<?php echo htmlentities((isset($vo['phone']) && ($vo['phone'] !== '')?$vo['phone']:"")); ?>' placeholder="请输入会员会员账号" class="layui-input"></label></div><div class="layui-form-item layui-row layui-col-space15"><label class="layui-col-xs9 relative"><span class="color-green">上架时间</span><input name="release_time" value='<?php echo htmlentities((isset($vo['release_time']) && ($vo['release_time'] !== '')?$vo['release_time']:"")); ?>' class="layui-input"></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="cover" type="hidden" value="<?php echo htmlentities((isset($vo['cover']) && ($vo['cover'] !== '')?$vo['cover']:'')); ?>"></td></tr></thead></table><script>$('[name="cover"]').uploadMultipleImage()</script></div><div class="layui-form-item layui-row layui-col-space15"><label class="layui-col-xs2 relative"><span class="color-green">排序</span><input name="sort" required class="layui-input" placeholder="请输入排序号" value="<?php echo htmlentities((isset($vo['sort']) && ($vo['sort'] !== '')?$vo['sort']:'0')); ?>"></label><label class="layui-col-xs2 relative"><span class="color-green">阅读量</span><input name="read_num" required class="layui-input" placeholder="请输入阅读量" value="<?php echo htmlentities((isset($vo['read_num']) && ($vo['read_num'] !== '')?$vo['read_num']:'0')); ?>"></label><label class="layui-col-xs2 relative"><span class="color-green">转发量</span><input name="transmit_num" required class="layui-input" placeholder="请输入转发量" value="<?php echo htmlentities((isset($vo['transmit_num']) && ($vo['transmit_num'] !== '')?$vo['transmit_num']:'0')); ?>"></label><label class="layui-col-xs2 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></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 layui-row layui-col-space15"><label class="layui-col-xs9 relative"><span class="color-green">产品详情</span><textarea name="content"><?php echo htmlentities((isset($vo['content']) && ($vo['content'] !== '')?$vo['content']:"")); ?></textarea></label></div><div class="layui-form-item text-center"><?php if(!(empty($vo['id']) || (($vo['id'] instanceof \think\Collection || $vo['id'] instanceof \think\Paginator ) && $vo['id']->isEmpty()))): ?><input type="hidden" name="id" value="<?php echo htmlentities($vo['id']); ?>"><?php endif; ?><!-- <input type='hidden' value='<?php echo htmlentities((isset($supplier_id) && ($supplier_id !== '')?$supplier_id:"0")); ?>' name='supplier_id'><input type='hidden' value='<?php echo htmlentities((isset($company_id) && ($company_id !== '')?$company_id:"0")); ?>' name='company_id'>--><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();
- laydate.render({type: 'datetime', elem: '[name="release_time"]'})
- laydate.render({type: 'datetime', elem: '[name="regular_hot_end_time"]'})
- layui.use('element', function(){
- var $ = layui.jquery
- ,element = layui.element;
- var active = {
- tabAdd: function(){
- element.tabAdd('demo', {
- title: '新选项'+ (Math.random()*1000|0)
- ,content: '内容'+ (Math.random()*1000|0)
- ,id: new Date().getTime()
- })
- }
- ,tabDelete: function(othis){
- element.tabDelete('demo', '44');
- othis.addClass('layui-btn-disabled');
- }
- ,tabChange: function(){
- element.tabChange('demo', '22');
- }
- };
- $('.site-demo-active').on('click', function(){
- var othis = $(this), type = othis.data('type');
- active[type] ? active[type].call(this, othis) : '';
- });
- //Hash地址的定位
- var layid = location.hash.replace(/^#test=/, '');
- element.tabChange('test', layid);
- element.on('tab(test)', function(elem){
- location.hash = 'test='+ $(this).attr('lay-id');
- });
- });
- require(['ckeditor', 'angular'], function () {
- window.createEditor('[name="content"]', {
- height: 500,
- });
- })
- // 关联视频监听
- form.on('select(video_id)', function(data){
- var cl_html = '<option value="0">请选择</option>';
- if(data.value == 0) {
- $("select[name='video_item']").html(cl_html);
- }else{
- var vl_key = data.elem[data.elem.selectedIndex].dataset.vl_key;
- var video_list = <?php echo json_encode($video_list); ?>;
- $.each(video_list[vl_key]['video_arr'],function (ck,cv) {
- cl_html +='<option value="'+cv.id+'">'+cv.title+'</option>';
- })
- $("select[name='video_item']").html(cl_html);
- }
- window.form.render();
- });
- // 关联资料监听
- form.on('select(datum_id)', function(data){
- var cl_html = '<option value="0">请选择</option>';
- if(data.value == 0) {
- $("select[name='datum_item']").html(cl_html);
- }else{
- var dl_key = data.elem[data.elem.selectedIndex].dataset.dl_key;
- var datum_list = <?php echo json_encode($datum_list); ?>;
- $.each(datum_list[dl_key]['url_arr'],function (ck,cv) {
- cl_html +='<option value="'+cv.id+'">'+cv.title+'</option>';
- })
- $("select[name='datum_item']").html(cl_html);
- }
- window.form.render();
- });
- // 文章监听
- form.on('select(article_id)', function(data){
- var cl_html = '<option value="0">请选择</option>';
- if(data.value == 0) {
- $("select[name='article_item']").html(cl_html);
- }else{
- var vl_key = data.elem[data.elem.selectedIndex].dataset.vl_key;
- var article_list = <?php echo json_encode($article_list); ?>;
- $.each(article_list[vl_key]['item_children'],function (ck,cv) {
- cl_html +='<option value="'+cv.id+'">'+cv.title+'</option>';
- })
- $("select[name='article_item']").html(cl_html);
- }
- window.form.render();
- });
- // 三级分类联动 start
- var sel_second = <?php echo isset($vo['second_classify']) ? $vo['second_classify']:0; ?>;
- var sel_third = <?php echo isset($vo['third_classify']) ? $vo['third_classify']:0; ?>;
- var goods_spec = <?php echo json_encode($goods_cate); ?>;
- first(1);
- function first(source){
- // 将其他选择框置空
- var first_key = $("select[name='first_classify']").find("option:selected").data("first_key")
- $("#first").val(first_key);
- $("select[name='second_classify']").html('');
- $("select[name='third_classify']").html('');
- $("select[name='fourth_classify']").html('');
- // 没有下级不继续
- if(first_key == -1 || !("children" in goods_spec[first_key])){
- $("#second").val(-1);
- $("#third").val(-1);
- window.form.render();
- return true;
- }else{
- var second_html = '<option data-second_key="-1" selected value="0">请选择分类</option>';
- var to_each = goods_spec[first_key]['children'];
- $.each(to_each,function (ck,cv) {
- if(source == 1 && sel_second == cv.id){
- second_html +='<option selected data-second_key="'+ck+'" value="'+cv.id+'">'+cv.title+'</option>';
- $("#second").val(ck);
- }else{
- second_html +='<option data-second_key="'+ck+'" value="'+cv.id+'">'+cv.title+'</option>';
- }
- })
- $("select[name='second_classify']").html(second_html);
- window.form.render();
- second(source);
- }
- }
- function second(source){
- var first_key = $("select[name='first_classify']").find("option:selected").data("first_key");
- var second_key = $("select[name='second_classify']").find("option:selected").data("second_key");
- // 将其他选择框置空
- $("#second").val(second_key);
- $("select[name='third_classify']").html('');
- $("select[name='fourth_classify']").html('');
- // 没有下级不继续
- if(second_key == -1 || !("children" in goods_spec[first_key]['children'][second_key])){
- $("#third").val(-1);
- window.form.render();
- return true;
- }
- var to_each = goods_spec[first_key]['children'][second_key]['children'];
- var third_html = '<option data-third_key="-1" selected value="0">请选择分类</option>';
- $.each(to_each,function (ck,cv) {
- if(source == 1 && sel_third == cv.id){
- third_html +='<option selected data-third_key="'+ck+'" value="'+cv.id+'">'+cv.title+'</option>';
- $("#third").val(ck);
- }else{
- third_html +='<option data-third_key="'+ck+'" value="'+cv.id+'">'+cv.title+'</option>';
- }
- })
- $("select[name='third_classify']").html(third_html);
- $("select[name='fourth_classify']").html('');
- window.form.render();
- }
- // 一级分类监听
- form.on('select(first_classify)', function(data){
- var first_key = data.elem[data.elem.selectedIndex].dataset.first_key;
- //与之前选择的一样不处理
- if($("#first").val() == first_key){
- return true;
- }
- first(2);
- })
- // 二级分类监听
- form.on('select(second_classify)', function(data){
- var second_key = data.elem[data.elem.selectedIndex].dataset.second_key;
- //与之前选择的一样不处理
- if($("#second").val() == second_key){
- return true;
- }
- second(2)
- })
- // 三级分类end
- </script></div>
|