<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;
	}
</style>
<body>
<div class="rightinfo">
	<form id="seachform" th:action="@{/sys/userCard/userList.html}" method="post">
	<ul class="seachform">
	<li>
			<label>微信昵称</label>
			<input name="name" type="text" class="scinput" th:value="${search.get('name')}"/>
		</li>
		<li>
			<label>&nbsp;</label>
			<input type="button" class="scbtn" value="查询" />
		</li>
		<li>
		<li>
				<ul class="toolbar">
					<li class="click"><span><img style="width: 24px;height: 24px" th:src="@{/static/sys/images/select.png}" /></span>选择</li>
				</ul>
		</li>
		
	</ul>
	</form>
	<table class="tablelist">
		<thead>
		    <tr>
		        <th></th>
		        <th style="width: 50px;">序号</th>
		        <th>微信昵称</th>
		        <th>微信头像</th>
		    </tr>
		</thead>
		<tbody>
			<tr th:each="item:${list}" >
				    <td><input name="selectlist" type="radio" th:data-id="${item.id}" /></td>
				    <td th:text="${itemStat.count}" ></td>
					<td class="getname" th:text="${item.wx_name}"></td>
					<td  class="imgtd">
						<img  th:if="${item.get('photo')}!=null" th:src="${imgUrl}+''+${item.get('photo')}+'?x-oss-process=image/resize,m_lfit,h_100,w_100'" style="width: 50px;height: 50px;" />
					</td>
					<input class="getid" type="hidden" th:value="${item.id}"></input>
			</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(){
	$('ul.toolbar li.click').click(function () {
		 $.each($('[name=selectlist]'), function () {
			 if ($(this).prop('checked')) {
			 var libId= $(this).parent().siblings(".getid").val();
			 var wxName= $(this).parent().siblings(".getname").html();
			 window.opener.document.getElementById("userId").value=libId;
			 window.opener.document.getElementById("wxName").value=wxName;
			 }
         });
	        window.close();
	 });
	
	
	 $.each($('[name=selectlist]'), function () {
		 var isbn131= $(this).parent().siblings(".getid").val();
		var isbn13=window.opener.document.getElementById("userId").value;
		if(isbn13==isbn131){
			  $(this).prop('checked', true);
		}
     });
})


</script>
</html>