154 lines
6.1 KiB
HTML
154 lines
6.1 KiB
HTML
{include file="public/header"}
|
|
<style type="text/css">
|
|
textarea, input[type="text"], input[type="password"],
|
|
.uneditable-input{border: 1px solid #ccc;background-color: #fff; }
|
|
.change_box a{font-size: 14px;padding: 10.5px 10px;}
|
|
.change_box .actived{border-right:1px solid #e5e5e5;border-left:1px solid #e5e5e5;border-top:1px solid #e5e5e5; position: relative; color: #3daae9; }
|
|
.change_box .actived:after{content: ""; bottom: -2px; background: #fff; width: 100%; height: 5px; position: absolute; left: 0; }
|
|
.x-nav{overflow: inherit; }
|
|
.x-nav .refresh{margin-right: 20px; }
|
|
.control-group{overflow: hidden; margin-bottom: 15px; padding-bottom: 15px; border-bottom: 1px dotted #dddddd; }
|
|
.control-label{float: left; padding-top: 3px; width: 160px; text-align: right; font-size: 14px; }
|
|
.controls{text-align: left; overflow-x: auto; overflow-y: hidden; margin-left: 180px; }
|
|
.controls input{width: 300px; height: 24px; font-size: 14px; border-radius: 4px; padding-left:6px; }
|
|
.controls select{width: 300px; height: 24px; font-size: 14px; border-radius: 4px; padding-left:6px; }
|
|
.controls textarea{width: 400px; height: 90px; border-radius: 4px; } .form-horizontal{margin: 0 10px; }
|
|
.bottom-buttom{border-top: 1px solid #e5e5e5; margin-top: 20px; background-color: #f5f5f5; padding: 30px 0; }
|
|
.submit{width: 50px; text-align: center; background-color:#3daae9; color: #fff; padding: 5px 10px; font-size: 16px; border-radius: 4px; cursor:pointer; }
|
|
</style>
|
|
<body>
|
|
<div class="x-nav" style="padding: 0px;">
|
|
<span class="change_box">
|
|
<a href="javascript:;" class="list-one" data-id="1">用户列表</a>
|
|
<a href="javascript:;" class="list-two actived" data-id="2">用户添加</a>
|
|
</span>
|
|
<a class="layui-btn layui-btn-small refresh" style="line-height:1.6em;margin-top:3px;float:right"
|
|
href="javascript:location.replace(location.href);" title="刷新">
|
|
<i class="layui-icon" style="line-height:30px">ဂ</i></a>
|
|
</div>
|
|
<br>
|
|
<div class="info_from form-horizontal">
|
|
<div class="control-group">
|
|
<label class="control-label">appid:</label>
|
|
<div class="controls">
|
|
<input id="L_username" name="L_username" type="text" value maxlength="50" minlength="3" class="required">
|
|
<span class="help-inline">
|
|
<font color="red"> * 将会成为您唯一的登入名</font>
|
|
</span>
|
|
</div>
|
|
</div>
|
|
<div class="control-group">
|
|
<label class="control-label">密码:</label>
|
|
<div class="controls">
|
|
<input id="L_pass" name="L_pass" type="password" value maxlength="50" minlength="3" class="required">
|
|
<span class="help-inline">
|
|
<font color="red"> * 6到16个字符</font>
|
|
</span>
|
|
</div>
|
|
</div>
|
|
<div class="control-group">
|
|
<label class="control-label">确认密码:</label>
|
|
<div class="controls">
|
|
<input id="L_repass" name="L_repass" type="password" value maxlength="50" minlength="3" class="required"><span class="help-inline">
|
|
<font color="red"> * 与密码保持一致</font>
|
|
</span>
|
|
</div>
|
|
</div>
|
|
<div class="control-group">
|
|
<label class="control-label">名称:</label>
|
|
<div class="controls">
|
|
<input id="L_name" name="L_name" type="text" value maxlength="50" minlength="3" class="required"><span class="help-inline">
|
|
<font color="red"> *</font>
|
|
</span>
|
|
</div>
|
|
</div>
|
|
<div class="control-group">
|
|
<label class="control-label">备注:</label>
|
|
<div class="controls">
|
|
<textarea id="L_remake" name="L_remake" type="text" value maxlength="50" minlength="3" class="required"></textarea>
|
|
</div>
|
|
</div>
|
|
<div class="bottom-buttom">
|
|
<label class="control-label"></label>
|
|
<div class="controls">
|
|
<div class='submit'>保存</div>
|
|
</div>
|
|
|
|
</div>
|
|
</div>
|
|
<script>
|
|
// 代理列表和添加代理切换
|
|
$('.x-nav .change_box a').click(function(){
|
|
// 样式切换
|
|
$('.x-nav .change_box a').removeClass('actived');
|
|
$(this).addClass('actived');
|
|
// 页面切换
|
|
var id = $(this).attr('data-id');
|
|
if(id == "1") location.href = '/log/scan_admin';
|
|
if(id == "2") location.href = '/log/scan_admin_add';
|
|
});
|
|
|
|
//监听提交
|
|
$('.submit').click(function (data) {
|
|
// 获取和拼装添加代理的数据
|
|
var query = new Object();
|
|
query.appid = $('#L_username').val();
|
|
query.pass = $('#L_pass').val();
|
|
query.repass = $('#L_repass').val();
|
|
query.name = $('#L_name').val();
|
|
query.remake = $('#L_remake').val();
|
|
|
|
// 验证数据
|
|
if(query.appid.length == 0){
|
|
layer.alert("请填写账号!");
|
|
return false;
|
|
}
|
|
if(query.pass.length <= 0){
|
|
layer.alert("请填写密码!");
|
|
return false;
|
|
}
|
|
if(query.pass.length > 0 && query.pass.length < 6){
|
|
layer.alert("密码长度为6到16个字符!");
|
|
return false;
|
|
}
|
|
if(query.pass != query.repass){
|
|
layer.alert("两次密码不一致!");
|
|
return false;
|
|
}
|
|
if(query.name.length <= 0){
|
|
layer.alert("请填写名称!");
|
|
return false;
|
|
}
|
|
// console.log(query);return false;
|
|
|
|
// 发送数据到后台添加会员
|
|
var result = ajax('/log/do_scan_admin_add',query);
|
|
if(result.code == 1){
|
|
layer.alert(result.msg, {icon: 6}, function () {
|
|
location.href = "/log/scan_admin";
|
|
});
|
|
}else{
|
|
layer.alert(result.msg,{icon:2});
|
|
}
|
|
return false;
|
|
});
|
|
|
|
// AJAX函数封装
|
|
function ajax(url,query){
|
|
var returnData = 0;
|
|
$.ajax({
|
|
url:url,
|
|
data:query,
|
|
type:'POST',
|
|
dataType:'JSON',
|
|
async:false,
|
|
success:function(data){
|
|
returnData = data;
|
|
}
|
|
});
|
|
return returnData;
|
|
}
|
|
</script>
|
|
</body>
|
|
|
|
</html> |