190 lines
7.8 KiB
PHP
190 lines
7.8 KiB
PHP
<?php /*a:2:{s:98:"/Library/WebServer/Documents/dggxiangmu/dggzichahu/application/admin/view/goods_category/edit.html";i:1640500949;s:86:"/Library/WebServer/Documents/dggxiangmu/dggzichahu/application/admin/view/layout2.html";i:1628618358;}*/ ?>
|
||
<!DOCTYPE html>
|
||
<html>
|
||
<head>
|
||
<meta charset="utf-8">
|
||
<title><?php echo url(); ?></title>
|
||
<meta name="renderer" content="webkit">
|
||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
||
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
|
||
<link rel="stylesheet" href="/static/plug/layui-admin/dist/layuiadmin/layui/css/layui.css?v=<?php echo htmlentities($front_version); ?>" media="all">
|
||
<link rel="stylesheet" href="/static/plug/layui-admin/dist/layuiadmin/style/like.css?v=<?php echo htmlentities($front_version); ?>" media="all">
|
||
</head>
|
||
<body>
|
||
<?php echo $js_code; ?>
|
||
<script src="/static/plug/layui-admin/dist/layuiadmin/layui/layui.js?v=<?php echo htmlentities($front_version); ?>"></script>
|
||
<script src="/static/common/js/function.js?v=<?php echo htmlentities($front_version); ?>"></script>
|
||
|
||
<style>
|
||
.layui-form-label {
|
||
color: #6a6f6c;
|
||
width: 140px;
|
||
}
|
||
.layui-input-block{
|
||
margin-left:170px;
|
||
}
|
||
.img-content{
|
||
height:80px;
|
||
line-height:80px
|
||
}
|
||
.img-container {
|
||
float: left;
|
||
opacity: 1;
|
||
position: relative;
|
||
}
|
||
|
||
.img-src {
|
||
width: 80px;
|
||
height: 80px;
|
||
padding: 4px;
|
||
}
|
||
.img-del-x {
|
||
position: absolute;
|
||
z-index: 100;
|
||
top: -4px;
|
||
right: -2px;
|
||
width: 20px;
|
||
height: 20px;
|
||
font-size: 16px;
|
||
line-height: 16px;
|
||
color: #fff;
|
||
text-align: center;
|
||
cursor: pointer;
|
||
background: hsla(0, 0%, 60%, .6);
|
||
border-radius: 10px;
|
||
}
|
||
</style>
|
||
<div class="layui-form" lay-filter="layuiadmin-form-category" id="layuiadmin-form-category" style="padding: 20px 30px 0 0;">
|
||
<input type="hidden" value="<?php echo htmlentities($info['id']); ?>" name="id">
|
||
<input type="hidden" value="0" name="pid">
|
||
<div class="layui-form-item">
|
||
<label class="layui-form-label">名称:</label>
|
||
<div class="layui-input-inline">
|
||
<input type="text" name="name" value="<?php echo htmlentities($info['name']); ?>" lay-verify="required" lay-verType="tips" placeholder="请输入名称" autocomplete="off" class="layui-input">
|
||
</div>
|
||
</div>
|
||
<div class="layui-form-item">
|
||
<label class="layui-form-label">分类图标:</label>
|
||
<div class="layui-input-inline">
|
||
<div class="img-content">
|
||
<input name="image" type="hidden" value="<?php echo htmlentities($info['image']); ?>">
|
||
<div class="img-add" <?php if($info['image']): ?> style="display: none" <?php endif; ?> ></div>
|
||
<?php if(!empty($info['image'])): ?>
|
||
<div class="img-container">
|
||
<img class="img-src" src="<?php echo htmlentities($info['abs_image']); ?>">
|
||
<a class="img-del-x">x</a>
|
||
</div>
|
||
<?php endif; ?>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<div class="layui-form-item"><label class="layui-form-label"></label>
|
||
<span style="color: #a3a3a3;font-size: 9px">建议尺寸:宽200像素*高200像素的jpg,jpeg,png,gif图片</span>
|
||
</div>
|
||
<div class="layui-form-item layui-col-sm6 layui-col-md4">
|
||
<label class="layui-form-label">排序:</label>
|
||
<div class="layui-input-block">
|
||
<input type="number" name="sort" value="<?php echo htmlentities($info['sort']); ?>" placeholder="请输入排序" class="layui-input">
|
||
</div>
|
||
</div>
|
||
<?php if($info['pid'] == 0): ?>
|
||
<div class="layui-form-item is_recommend">
|
||
<label class="layui-form-label">惠藏百件:</label>
|
||
<div class="layui-input-inline">
|
||
<input type="radio" name="is_recommend" value="1" title="是" <?php if($info['is_recommend'] == 1): ?>checked<?php endif; ?>>
|
||
<input type="radio" name="is_recommend" value="0" title="否" <?php if($info['is_recommend'] == 0): ?>checked<?php endif; ?>>
|
||
</div>
|
||
</div>
|
||
<div class="layui-form-item is_recommend">
|
||
<label class="layui-form-label"></label>
|
||
<span style="color: #a3a3a3;font-size: 9px">当前分类推荐在PC商城首页显示,默认推荐</span>
|
||
</div>
|
||
<?php endif; ?>
|
||
<div class="layui-form-item">
|
||
<label class="layui-form-label">是否推荐:</label>
|
||
<div class="layui-input-inline">
|
||
<input type="radio" name="is_show" value="1" title="显示" <?php if($info['is_show'] == 1): ?>checked<?php endif; ?>>
|
||
<input type="radio" name="is_show" value="0" title="不显示" <?php if($info['is_show'] == 0): ?>checked<?php endif; ?>>
|
||
</div>
|
||
</div>
|
||
<div class="layui-form-item">
|
||
<label class="layui-form-label">备注:</label>
|
||
<div class="layui-input-inline">
|
||
<textarea type="text" name="remark" autocomplete="off" class="layui-textarea"><?php echo htmlentities($info['remark']); ?></textarea>
|
||
</div>
|
||
</div>
|
||
<div class="layui-form-item layui-hide">
|
||
<input type="button" lay-submit lay-filter="edit-goods_category-submit" id="edit-goods_category-submit" value="确认">
|
||
</div>
|
||
</div>
|
||
<script>
|
||
layui.config({
|
||
version:"<?php echo htmlentities($front_version); ?>",
|
||
base: '/static/plug/layui-admin/dist/layuiadmin/' //静态资源所在路径
|
||
}).extend({
|
||
index: 'lib/index' //主入口模块
|
||
}).use(['index', 'form','like'], function(){
|
||
var $ = layui.$
|
||
,form = layui.form
|
||
,like = layui.like;
|
||
var level = $(".category").find("option:selected").attr("data-level");
|
||
if(level == 2){
|
||
$('.alliance_ratio').show();
|
||
$('.autotrophy_ratio').show();
|
||
}
|
||
//监听分类父级选择
|
||
form.on('select(search_pid)', function(data){
|
||
if(0 == data.value){
|
||
$('.is_recommend').show();
|
||
}else{
|
||
$('.is_recommend').hide();
|
||
}
|
||
});
|
||
$(document).on('click', '.image-del-x', function () {
|
||
$(this).parent().prev().val('');
|
||
$(this).parent().siblings('.image-add').css('display','block');
|
||
$(this).parent().remove();
|
||
return false;
|
||
});
|
||
//上传图片
|
||
like.imageUpload('.img-add', function (uris, element) {
|
||
if(uris.length>1){
|
||
layer.msg('最多最能选中1张图片');
|
||
return;
|
||
}
|
||
var html = '<div class="img-container">\n' +
|
||
'<img class="img-src" ' +
|
||
'src="' + uris[0] + '">' +
|
||
'<a class="img-del-x">x</a>' +
|
||
'</div>';
|
||
element.prev().val(like.getUrlFileName(uris[0], '<?php echo htmlentities($storageUrl); ?>'));
|
||
element.parent().append(html);
|
||
element.css('display','none');
|
||
}, true);
|
||
//删除图片
|
||
$(document).on('click', '.img-del-x', function () {
|
||
$(this).parent().siblings('input').val('');
|
||
$(this).parent().prev().css('display','block');
|
||
$(this).parent().remove();
|
||
});
|
||
//显示图片
|
||
$(document).on('click', '.img-src', function () {
|
||
var image = $(this).attr('src');
|
||
like.showImg(image,600);
|
||
});
|
||
|
||
form.on('select(category)', function(data){
|
||
var level = $(data.elem).find("option:selected").attr("data-level");
|
||
$('.alliance_ratio').hide();
|
||
$('.autotrophy_ratio').hide();
|
||
if(level == 2){
|
||
$('.alliance_ratio').show();
|
||
$('.autotrophy_ratio').show();
|
||
|
||
}
|
||
});
|
||
})
|
||
|
||
</script>
|
||
</body>
|
||
</html>
|