You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
137 lines
5.7 KiB
137 lines
5.7 KiB
<?php /*a:2:{s:68:"D:\waibao\ahbcqz\server\app\admin\view\setting\hot_search\index.html";i:1679478874;s:51:"D:\waibao\ahbcqz\server\app\admin\view\layout1.html";i:1679478874;}*/ ?>
|
|
<!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/lib/layui/css/layui.css?v=<?php echo htmlentities($front_version); ?>">
|
|
<link rel="stylesheet" href="/static/admin/css/app.css?v=<?php echo htmlentities($front_version); ?>">
|
|
<link rel="stylesheet" href="/static/admin/css/like.css?v=<?php echo htmlentities($front_version); ?>">
|
|
<script src="/static/lib/layui/layui.js?v=<?php echo htmlentities($front_version); ?>"></script>
|
|
<script src="/static/admin/js/app.js"></script>
|
|
</head>
|
|
|
|
<body>
|
|
<?php echo $js_code; ?>
|
|
<script src="/static/admin/js/jquery.min.js"></script>
|
|
<script src="/static/admin/js/function.js"></script>
|
|
|
|
|
|
|
|
<style>
|
|
#card-body {
|
|
margin-top: 20px;
|
|
}
|
|
</style>
|
|
<div class="wrapper">
|
|
<div class="layui-card">
|
|
<div class="layui-card-body" >
|
|
<div class="layui-form" lay-filter="layuiadmin-form-hot_search" id="layuiadmin-form-hot_search">
|
|
|
|
<div class="layui-form-item div-flex" style="margin-top: 20px">
|
|
<fieldset class="layui-elem-field layui-field-title" style="margin-top: 50px;">
|
|
<legend>热门搜索设置</legend>
|
|
</fieldset>
|
|
</div>
|
|
|
|
<div class="layui-card-body" id="card-body">
|
|
|
|
<?php foreach($info as $k => $v): ?>
|
|
<div class="layui-form-item">
|
|
<?php if($k == '0'): ?>
|
|
<label class="layui-form-label">热门搜索:</label>
|
|
<?php else: ?>
|
|
<label class="layui-form-label"></label>
|
|
<?php endif; ?>
|
|
<div class="layui-input-inline">
|
|
<input type="text" name="hot_keyword[]" value="<?php echo htmlentities($v); ?>" placeholder="请输入热门搜索关键字" lay-verify="" autocomplete="off" class="layui-input">
|
|
</div>
|
|
<button class="layui-btn layui-btn-small <?php echo htmlentities($view_theme_button); ?> add " type="button" ><i class="layui-icon"></i></button>
|
|
<?php if($k > '0'): ?>
|
|
<button class="layui-btn layui-btn-small layui-btn-danger del" type="button" ><i class="layui-icon"></i></button>
|
|
<?php endif; ?>
|
|
</div>
|
|
<?php endforeach; ?>
|
|
|
|
<div class="layui-form-item">
|
|
<div class="layui-input-block">
|
|
<button class="layui-btn <?php echo htmlentities($view_theme_color); ?>" lay-submit lay-filter="set_hot_keyword">确认修改</button>
|
|
</div>
|
|
</div>
|
|
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<script>
|
|
layui.config({
|
|
version:"<?php echo htmlentities($front_version); ?>",
|
|
base: '/static/lib/' //静态资源所在路径
|
|
}).use(['form','element'], function(){
|
|
var $ = layui.$,form = layui.form,element = layui.element;
|
|
|
|
// 添加
|
|
$(document).on('click','.add',function(){
|
|
var len = $(this).parent().prevAll().length + 1;
|
|
var str = "";
|
|
str += "<div class='layui-form-item'>";
|
|
str += "<label class='layui-form-label'></label>";
|
|
str += "<div class='layui-input-inline' >";
|
|
str += "<input type='text' name='hot_keyword[]' value='' placeholder='请输入热门搜索关键字' lay-verify='' autocomplete='off' class='layui-input'>";
|
|
str += "</div>";
|
|
str += "<button class='layui-btn layui-btn-small <?php echo htmlentities($view_theme_button); ?> add' type='button'><i class='layui-icon'></i></button>";
|
|
if ( len >= 1 ) {
|
|
str += "<button class='layui-btn layui-btn-small layui-btn-danger del' type='button' ><i class='layui-icon'></i></button>";
|
|
}
|
|
str += "</div>";
|
|
|
|
$(this).parent().after(str);
|
|
});
|
|
|
|
$(document).on('click','.del',function(){
|
|
var len = $(this).parent().prevAll().length + 1;
|
|
if ( len == 1 ){
|
|
layer.msg('不能删除');
|
|
return;
|
|
}
|
|
$(this).parent().remove();
|
|
});
|
|
|
|
form.on('submit(set_hot_keyword)',function (data) {
|
|
like.ajax({
|
|
url: '<?php echo url("setting.HotSearch/set"); ?>'
|
|
,data: data.field
|
|
,type: 'post'
|
|
,success: function(res){
|
|
if(res.code == 1)
|
|
{
|
|
layer.msg(res.msg, {
|
|
offset: '15px'
|
|
,icon: 1
|
|
,time: 1500
|
|
}, function(){
|
|
location.href = location.href;
|
|
});
|
|
}
|
|
},
|
|
error:function(res){
|
|
layer.msg('网络错误', {
|
|
offset: '15px'
|
|
,icon: 2
|
|
,time: 1000
|
|
}, function(){
|
|
return;
|
|
});
|
|
}
|
|
});
|
|
});
|
|
|
|
});
|
|
</script>
|
|
</body>
|
|
</html>
|