文件
mashangyoujiu/Application/Super/View/Plug/class_manager.html

162 行
4.9 KiB
HTML
可执行文件

<!doctype html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport"
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<link rel="stylesheet" href="__PUBLIC__/layui/css/layui.css">
<title>添加插件分类</title>
<style>
html,body{
background-color: rgb(246, 248, 249);
font-size: 0;
margin: 0;
padding: 0;
}
a{
font-size: 12px;
}
.box{
border: 1px solid #bbb;
border-radius: 5px;
background-color: white;
padding-bottom: 20px;
}
.list{
display: flex;
flex-direction: row;
align-items: flex-start;
margin: 10px 0;
}
.title{
background-color: #f5f5f5;
color: black;
font-size: 18px;
border-bottom: 1px solid #e6e6e6;
line-height: 60px;
border-radius: 5px 5px 0 0;
text-indent: 15px;
}
.left_name{
width: 100px;
text-align: right;
font-size: 14px;
line-height: 56px;
color: #666;
margin-right: 20px;
}
.list>input{
margin: 10px 0;
width: 300px;
border: 1px solid #ccc;
padding: 10px;
border-radius: 5px;
outline: none;
font-size: 14px;
}
.list>select{
width: 322px;
margin: 10px 0;
padding: 10px;
border: 1px solid #ccc;
border-radius: 5px;
outline: none;
font-size: 14px;
color: #333;
}
.list>textarea{
resize: none;
width: 300px;
height: 100px;
padding: 10px;
border: 1px solid #ccc;
border-radius: 5px;
outline: none;
font-size: 14px;
color: #333;
}
.save{
font-size: 16px;
width: 50px;
background-color: #009688;
color: white;
text-align: center;
padding: 8px 10px;
border-radius: 5px;
margin: 50px 200px;
cursor: pointer;
}
.save:hover{
background-color: #099688;
}
.del_plug{
font-size: 14px;
text-align: center;
color: red;
margin-bottom: 30px;
padding: 5px;
border-top: 1px solid #f1f1f1;
border-bottom: 1px solid #f1f1f1;
cursor: pointer;
}
.del_plug:hover{
color: #999;
}
</style>
</head>
<body style="padding: 50px">
<div class="box">
<div class="title">编辑插件分类</div>
<input type="hidden" id="id" name="id" value="{$classInfo['id']}">
<div class="list">
<div class="left_name">分类名称:</div>
<input type="text" id="class_name" name="class_name" value="{$classInfo['class_name']}" placeholder="分类名称">
</div>
<div class="save">更新</div>
<div class="del_plug">删除插件</div>
</div>
</body>
<script src="__PUBLIC__/jquery/js/jquery-3.2.1.min.js"></script>
<script src="__PUBLIC__/layui/layui.js"></script>
<script src="__PUBLIC__/js/tips.js"></script>
<script>
layui.use('form', function() {
var form = layui.form;
$('.del_plug').click(function () {
layer.confirm("确认删除该分类吗?<br/>分类下有插件不可删除!<br/>分类删除后不可恢复,请谨慎操作!", function () {
$.post("{:U('doDelPlugClass')}",{
id:$('#id').val()
},function (res) {
layer.closeAll();
if(res.status==1){
showTips(res.msg,function () {
location.replace("{:U('index')}");
})
}else{
showTips(res.msg);
}
})
})
})
})
$('.save').click(function () {
if(!$('#class_name').val().trim()){
showTips('请输入分类名称');
return;
}
$.post("{:U('doUpdateClass')}",{
id:$('#id').val(),
class_name:$('#class_name').val().trim()
},function (res) {
if(res.status==1){
showTips(res.msg,function () {
location.replace("{:U('index')}");
})
}else {
showTips(res.msg);
}
})
})
</script>
</html>