<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> 
<script src="sys/js/My97DatePicker/WdatePicker.js" th:src="@{/static/sys/js/My97DatePicker/WdatePicker.js}"></script>
</head>
<style>
	.tablelink{margin-right:10px;}
	.stylecss{
	      color: red;
	}
	.select_width{
	     width: 220px;
	}
	.date_width{
	     width: 150px;
	}
</style>
<body>
<div class="place">
	<span>位置：</span>
	<ul class="placeul">
		<li><a href="#">新版抽奖管理</a></li>
		<li><a href="#">活动抽奖记录，活动ID:[[${param.id}]]</a></li>
	</ul>
</div>
<div class="rightinfo">
	<form id="seachform" th:action="@{/sys/award/activity/log.html}" method="post">
	<ul class="seachform">
		<input type="hidden" id="id" name="id" autocomplete="off"  th:value="${search.get('id')}"  >
		<li>
			<label>用户姓名：</label>
			<input type="text" id="name" name="name" autocomplete="off"  th:value="${search.get('name')}"  class="scinput date_width" placeholder="用户姓名">
		</li>
		
		<li>
			<label>兑换码：</label>
			<input type="text" id="sncode" name="sncode" autocomplete="off"  th:value="${search.get('sncode')}"  class="scinput date_width" placeholder="兑换码">
		</li>
		
		<li>
			<label>奖品等奖</label>
			<select class="scinput select_width"  id="level" name="level"   style="width: 150px;" >
				<option value="">全部</option>
				<option value="1" th:selected="${search.get('level')+'' eq '1' ? true : false}">一等奖</option>
				<option value="2" th:selected="${search.get('level')+'' eq '2' ? true : false}">二等奖</option>
				<option value="3" th:selected="${search.get('level')+'' eq '3' ? true : false}">三等奖</option>
			</select>
		</li>
		
		<li>
			<label>开始时间</label>
			<input type="text" id="startTime" name="startTime" autocomplete="off" onclick="WdatePicker()" th:value="${search.get('startTime')}"   class="scinput date_width " placeholder="开始时间">
		</li>
		<li>
			<label>结束时间</label>
			<input type="text" id="endTime" name="endTime" autocomplete="off"  onclick="WdatePicker()"  th:value="${search.get('endTime')}" class="scinput date_width " placeholder="结束时间">
		</li>
		
		
		<li>
			<input type="button" class="scbtn" value="查询" />
		</li>
		
		<li>
			<ul class="toolbar">
				<a th:href="@{/sys/award/activity/list.html}" >
						<li class="click">&nbsp;&nbsp;<< 返回&nbsp;&nbsp;</li>
				</a>
			</ul>
		</li>
				
	</ul>
	</form>
	<table class="tablelist">
		<thead>
		    <tr>
				<th style="width: 50px;">序号</th>
				<th>活动名称</th>
				<th>微信昵称</th>
				<th>微信头像</th>
				<th>家长姓名</th>
				<th>小孩姓名</th>
		    	<th>抽奖状态</th>
		    	<th>奖品名称</th>
		    	<th>奖品等奖</th>
		    	<th>兑换码</th>
		    	<th>兑换码状态</th>
		    	<th>参与时间</th>
		    </tr>
		</thead>
		<tbody>
			<tr th:each="item:${list}" >
					<td th:text="${itemStat.count}"></td>
					<td th:text="${item.get('title')}"></td>
					<td th:text="${item.get('wx_name')}"></td>
					<td >
						<img style="height: 40px;" th:if="${item.get('photo')!=null && item.get('photo')!=''}" th:src="${imgUrl+item.get('photo')}">
					</td>
					
					<td th:text="${item.get('parent_name')}"></td>
					<td th:text="${item.get('child_name')}"></td>
					
					<td th:switch="${item.status}">
					   <span th:case="0">未中奖</span>
					   <span th:case="1" style="color:red">已中奖</span>
					   <span th:case="2" style="color:red">兑换奖品</span>
					</td>
					
					<td th:text="${item.get('name')}"></td>
					<td th:switch="${item.level}">
					   <span th:case="1" style="color:red">一等奖</span>
					   <span th:case="2" style="color:red">二等奖</span>
					   <span th:case="3" style="color:red">三等奖</span>
					</td>
					<td th:text="${item.get('sn_code')}"></td>
					
					<td th:switch="${item.sstatus}">
					   <span th:case="0" style="color:red">未开奖</span>
					   <span th:case="1" style="color:red">中奖未领取</span>
					   <span th:case="2" style="color:red">中奖已领取</span>
					   <span th:case="3" style="color:red">已兑奖未核销</span>
					   <span th:case="4" style="color:red">已兑换已核销</span>
					</td>
					<td th:text="${item.get('create_time')}"></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">
	
	$("#button").on('click',function(){
		document.getElementById("seachform").action = "[[${sysUrl}]]/sys/award/material/list";
		$("#seachform").submit();
		window.setTimeout(function(){
			document.getElementById("seachform").action = "[[${sysUrl}]]/sys/award/material/list.html";
		},3000);
	});
</script>


</html>