116 lines
		
	
	
		
			3.2 KiB
		
	
	
	
		
			PHP
		
	
	
	
	
	
			
		
		
	
	
			116 lines
		
	
	
		
			3.2 KiB
		
	
	
	
		
			PHP
		
	
	
	
	
	
| {include file="public/header" /}
 | |
| <div class="config-container">
 | |
| 	<!-- 页面头部样式 -->
 | |
|     <div class="config-header" style="display: flex;flex-direction: column;flex-wrap: wrap;align-items: flex-start;">
 | |
|         <div class="maintitle">
 | |
|             <i class="layui-icon layui-icon-user"></i>
 | |
|             <span>用户列表</span>
 | |
|         </div>
 | |
|         <div style="display: flex;align-items: flex-start;flex-direction: column;gap: 15px;margin-bottom: 10px;">
 | |
|             <div>
 | |
|                 <button class="layui-btn layui-bg-blue" onclick="add()">
 | |
|                     <i class="layui-icon layui-icon-add-1"></i>添加
 | |
|                 </button>
 | |
|                 <button type="button" class="layui-btn layui-btn-primary layui-border-blue" onclick="refresh()">
 | |
|                     <i class="layui-icon layui-icon-refresh"></i>刷新
 | |
|                 </button>
 | |
|             </div>
 | |
|         </div>
 | |
|     </div>
 | |
| 
 | |
| 	<table class="layui-table">
 | |
| 		<thead>
 | |
| 			<tr>
 | |
| 				<th>真实姓名</th>
 | |
| 				<th>账户</th>
 | |
| 				<th>手机</th>
 | |
| 				<th>QQ</th>
 | |
| 				<th>角色</th>
 | |
| 				<th>性别</th>
 | |
| 				<th>状态</th>
 | |
| 				<th>登陆次数</th>
 | |
| 				<th>登陆时间</th>
 | |
| 				<th>操作</th>
 | |
| 			</tr>
 | |
| 		</thead>
 | |
| 		<tbody>
 | |
| 			{volist name="lists" id='vo'}
 | |
| 			<tr>
 | |
| 				<td>{$vo.name}</td>
 | |
| 				<td>{$vo.account}</td>
 | |
| 				<td>{$vo.phone}</td>
 | |
| 				<td>{$vo.qq}</td>
 | |
| 				<td>{:isset($group[$vo.group_id])?$group[$vo.group_id]['group_name']:''}</td>
 | |
| 				<td>
 | |
| 					{if $vo['sex']==1}
 | |
| 					<span style="color:red;">男</span>
 | |
| 					{elseif $vo['sex'] == 2 /}
 | |
| 					<span style="color:green;">女</span>
 | |
| 					{else /}
 | |
| 					未知
 | |
| 					{/if}
 | |
| 				</td>
 | |
| 				<td>{$vo.status==1?'开启':'<span style="color:red;">禁用</span>'}</td>
 | |
| 				<td>{$vo.login_count}</td>
 | |
| 				<td>{:date('Y-m-d H:i:s',$vo.update_time)}</td>
 | |
| 				<td>
 | |
| 					<button type="button" class="layui-btn layui-btn-primary layui-btn-xs" onclick="edit({$vo.uid})">
 | |
| 						<i class="layui-icon layui-icon-edit"></i>编辑
 | |
| 					</button>
 | |
| 					<button type="button" class="layui-btn layui-btn-primary layui-btn-xs" onclick="del({$vo.uid})">
 | |
| 						<i class="layui-icon layui-icon-delete"></i>删除
 | |
| 					</button>
 | |
| 				</td>
 | |
| 			</tr>
 | |
| 			{/volist}
 | |
| 		</tbody>
 | |
| 	</table>
 | |
| </div>
 | |
| 
 | |
| <script type="text/javascript">
 | |
| 	layui.use(['layer'], function () {
 | |
| 		layer = layui.layer;
 | |
| 		$ = layui.jquery;
 | |
| 	});
 | |
| 	// 添加
 | |
| 	function add() {
 | |
| 		layer.open({
 | |
| 			type: 2,
 | |
| 			title: '添加管理员',
 | |
| 			shade: 0.3,
 | |
| 			area: ['450px', '550px'],
 | |
| 			content: "{$config['admin_route']}yunzeradmin/useradd"
 | |
| 		});
 | |
| 	}
 | |
| 	// 编辑
 | |
| 	function edit(uid) {
 | |
| 		layer.open({
 | |
| 			type: 2,
 | |
| 			title: '编辑管理员',
 | |
| 			shade: 0.3,
 | |
| 			area: ['450px', '550px'],
 | |
| 			content: "{$config['admin_route']}yunzeradmin/useredit?uid=" + uid
 | |
| 		});
 | |
| 	}
 | |
| 	// 删除
 | |
| 	function del(uid) {
 | |
| 		layer.confirm('确定要删除吗?', {
 | |
| 			icon: 3,
 | |
| 			btn: ['确定', '取消']
 | |
| 		}, function () {
 | |
| 			$.post("{$config['admin_route']}yunzeradmin/userdel", { 'uid': uid }, function (res) {
 | |
| 				if (res.code > 0) {
 | |
| 					layer.alert(res.msg, { icon: 2 });
 | |
| 				} else {
 | |
| 					layer.msg(res.msg);
 | |
| 					setTimeout(function () { window.location.reload(); }, 1000);
 | |
| 				}
 | |
| 			}, 'json');
 | |
| 		});
 | |
| 	}
 | |
| 	//刷新列表
 | |
| 	function refresh() {
 | |
| 		window.location.reload();
 | |
| 	}
 | |
| </script>
 | |
| {include file="public/tail" /} |