<html xmlns:th="http://www.thymeleaf.org">
<head>
	<title>私塾家</title>
	<script th:include="sys/common/metaCSS" th:remove="tag"></script>
	<script th:include="sys/common/metaJS" th:remove="tag"></script>
</head>
<style>
	.tablelink{margin-right:10px;}
	.stylecss{
		color: red;
	}
	.select_width{
		width: 70px;
	}
	.date_width{
		width: 100px;
	}
</style>
<body>
<div class="place">
	<span>位置：</span>
	<ul class="placeul">
		<li><a href="#">用户管理中心</a></li>
		<li><a th:href="@{/sys/usercenter/userList.html}">用户列表</a></li>
	</ul>
</div>
<div class="rightinfo">
	<form id="seachform" th:action="@{/sys/usercenter/userList.html}" method="post">
		<ul class="seachform">
			<li>
				<label>名字：</label>
				<input name="LIKE_userName" type="text" class="scinput" th:value="${search.get('LIKE_userName')}"/>
			</li>
			<li>
				<label>&nbsp;</label>
				<input type="button" class="scbtn" value="查询" />
			</li>
		</ul>
	</form>
	<table class="tablelist">
		<thead>
		<tr>
			<th hidden>id</th>
			<th>名字</th>
			<th>微信昵称</th>
			<th>头像</th>
			<th>手机号</th>
			<th>地区</th>
			<th style="width: 141px;" >创建日期</th>
			<th>用户角色</th>
		</tr>
		</thead>
		<tbody>
		<tr th:each="item:${list}" >
			<td th:text="${item.id}"  hidden></td>
			<td th:text="${item.userName}" ></td>
			<td th:text="${item.name}" ></td>
			<td  class="imgtd">
				<img  th:if="${item.photo}!=null" th:src="${imgUrl}+''+${item.photo}+'?x-oss-process=image/resize,m_lfit,h_100,w_100'" style="width: 50px;height: 50px;" />
			</td>
			<td th:text="${item.mobile}" ></td>
			<td th:text="(${item.country} ne null ? ${item.country} : '' ) +''+(${item.province} ne null ? ${item.province} : '' )+''+(${item.city} ne null ? ${item.city} : '' )"></td>
			<td style="width: 141px;" th:text="${#calendars.format(item.createTime,'yyyy-MM-dd HH:mm:ss')}" ></td>
			<td>
				<a href="javascript:;" th:onclick="'getRole(\''+${item.id}+'\')'" class="tablelink" >详情</a>
				<a href="javascript:;" th:onclick="'addChecker(\''+${item.id}+'\')'" class="tablelink" >添加为质检员</a>
			</td>
		</tr>
		</tbody>
	</table>
	<!--分页-->
	<div class="pagin">
		<div class="message">共<i class="blue">[[${page.rowCnt}]]</i>条记录，当前显示第&nbsp;<i class="blue">[[${page.pageNo }]]&nbsp;</i>页</div>
		<div th:utext='${listNavigatHtml}' th:remove="tag" ></div>
	</div>
</div>
</body>
<script type="text/javascript">
    function getRole(id){
        layer.open({
            type: 2,
            title: '用户角色',
            shadeClose: false,
            shade: 0.8,
            //offset: '60px',
            area: ['400px', '400px'],
            content: '[[${sysUrl}]]/sys/usercenter/role.html?id='+id
        });
    }

	function addChecker(id) {
		layer.open({
			type: 2,
			title: '添加质检员',
			closeBtn: 1, //不显示关闭按钮
			shift: 0.8,
			//offset: '100px',
			area: ['50%', '90%'],
			content: '[[${sysUrl}]]/sys/usercenter/addChecker.html?id='+id
		});

		/*parent.layer.confirm("您确定添加该身份?", {
			icon: 4, btn: ['确定', '关闭'] //按钮
		}, function () {
			var url = "[[${sysUrl}]]/sys/usercenter/addChecker";
			var params = {
				'userId': id
			};
			$.post(url, params, function (data) {
				if (data.code == '999') {
					if (data.msg) {
						parent.layer.msg(data.msg, {icon: 1});
					} else {
						parent.layer.msg("添加成功", {icon: 1});
					}
					closeWin();
				} else {
					parent.layer.msg(data.msg, {icon: 11});
				}
			});
		});*/
	}
</script>
</html>