审计记录

WebContent/WEB-INF/jsp/pc/report/prize.jsp 5.3 KB
zxt@theyeasy.com committed
1 2 3 4 5 6 7 8
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>

	<head>
		<meta charset="UTF-8">
		<meta name="viewport" content="width=device-width, initial-scale=1.0">
		<meta http-equiv="X-UA-Compatible" content="ie=edge">
9
		<title>抽奖记录</title>
zxt@theyeasy.com committed
10 11 12
		<link rel="stylesheet" href="/zzhnc/res/plugins/layui/css/layui.css">
		<link rel="stylesheet" href="/zzhnc/res/css/basic.css">
	</head>
13 14 15 16 17 18 19 20 21 22 23 24
	<style>
		.floatR {
			float: right;
			line-height: 36px;
			padding-right: 40px;
		}
		
		.floatR span {
			color: red;
			font-size: 1.4em;
		}
	</style>
25

zxt@theyeasy.com committed
26
	<body class="wrap">
27 28 29 30 31 32 33
		<div class="layui-form">
			<div class="layui-form-item">
				<div class="layui-input-inline" style="width: 140px;">
					<input type="number" class="layui-input" name="turn" placeholder="轮次(数字)" />
				</div>
				<div class="layui-input-inline" style="width: 140px;">
					<select name="status">
34 35 36
						<option value="">状态</option>
						<option value="1">未兑换</option>
						<option value="2">已兑换</option>
37 38 39
					</select>
				</div>
				<div class="layui-input-inline" style="width: 140px;">
40 41 42 43 44 45 46 47
					<select name="type">
						<option value="">奖品类型</option>
						<option value="0">全部</option>
						<option value="1">红包</option>
						<!--<option value="2">否</option>-->
					</select>
				</div>
				<div class="layui-input-inline" style="width: 140px;">
48
					<input type="text" class="layui-input" name="keyword" placeholder="关键字" />
zxt@theyeasy.com committed
49 50
				</div>
				<button class="layui-btn" lay-submit lay-filter="querybtn">查询</button>
51 52
				<button class="layui-btn layui-btn-primary resetBtn" type="reset">重置</button>
				<div class="floatR">已中奖金额:<span id="moneySum"></span></div>
53
			</div>
54 55

		</div>
zxt@theyeasy.com committed
56 57 58
		<table class="layui-table">
			<thead>
				<tr>
59 60 61 62 63
					<th>No</th>
					<th>轮次</th>
					<th>中奖人员</th>
					<th>红包</th>
					<th>礼品</th>
64
					<th>状态</th>
65
					<th style="min-width: 84px;">时间 </th>
zxt@theyeasy.com committed
66 67
				</tr>
			</thead>
68
			<tbody id="tablelist">
69

zxt@theyeasy.com committed
70 71
			</tbody>
		</table>
72
		<div class="nodata">暂无数据</div>
zxt@theyeasy.com committed
73 74
		<div id="page"></div>
	</body>
75

zxt@theyeasy.com committed
76
	<script src='/zzhnc/res/js/jquery.min.js'></script>
77 78
	<script src="/zzhnc/res/plugins/layui/layui.js"></script>
	<script src="/zzhnc/res/js/me.js"></script>
zxt@theyeasy.com committed
79
	<script>
80 81 82
		layui.use(['form', 'element', 'laypage'], function() {
			var form = layui.form,
				element = layui.element,
zxt@theyeasy.com committed
83
				laypage = layui.laypage;
84

85 86 87
			//查询条件
			var queryObj = {
				page: 1,
88
				pagesize: 20,
89
				turn: null,
90
				status: null,
91
				type: 0,
92 93
				keyword: null
			}
94

95 96
			//初始化方法
			function initData(queryObj) {
97
				$.post("/zzhnc/activity/lotterys", queryObj, function(data) {
98
					data = data.data;
99 100
					$('#moneySum').text(data.sum)
					console.log(data)
101
					$("#tablelist").html("");
102 103 104 105 106
					var str = "";
					if(data.rows.length < 1) {
						$(".nodata").show();
					} else {
						$(".nodata").hide();
107
						for(var i = 0; i < data.rows.length; i++) {
108
							str += '<tr>' +
109
								'<td>' + ((data.page - 1) * data.pageSize + i + 1) + '</td>' +
110
								'<td>' + data.rows[i].turn + '</td>' +
111
								'<td><img class="fansImg" src="' + data.rows[i].logo + '" />' + data.rows[i].nickname + '</td>' +
112 113 114
								'<td>' + showMny(data.rows[i].mny) + '</td>' +
								'<td>' + showPrizeName(data.rows[i].mny, data.rows[i].prizeName) + '</td>' +
								'<td>' + showStatus(data.rows[i].status) + '</td>'+
115
								'<td>' + toTime_G(data.rows[i].createdtime) + '</td>' +
116
								'</tr>';
zxt@theyeasy.com committed
117
						}
118 119 120 121
						$("#tablelist").html(str);
						form.render();
						toNull_G();
					}
122
					console.log(queryObj.pagesize)
123 124 125 126 127 128 129 130 131 132 133 134 135 136
					laypage.render({
						elem: 'page',
						count: data.total,
						limit: queryObj.pagesize,
						curr: queryObj.page,
						layout: ['count', 'prev', 'page', 'next', 'skip'],
						jump: function(obj, first) {
							if(!first) {
								queryObj.page = obj.curr
								initData(queryObj);
							}

						}
					})
137
				})
138
			}
zxt@theyeasy.com committed
139

140 141 142 143 144 145 146
			//初始化数据
			initData(queryObj);

			//查询
			form.on('submit(querybtn)', function(data) {
				queryObj = data.field;
				queryObj.page = 1;
147
				queryObj.pagesize = 20;
148 149
				queryObj.keyword = $("[name=keyword]").val();
				queryObj.turn = $("[name=turn]").val();
150
				queryObj.type = $("[name=type]").val();
151
				queryObj.status = $("[name=status]").val();
152 153 154 155 156 157 158 159
				initData(queryObj);
			});

			//重置
			$(".resetBtn").on("click", function() {
				$("[name=keyword]").val("");
				$("[name=turn]").val("");
				$('[name=status]').val("")
160
				$('[name=type]').val("")
161 162
				queryObj.turn = null;
				queryObj.keyword = null;
163 164 165 166
				queryObj.status = null;
				queryObj.type = null;
				queryObj.page = 1;
				queryObj.pagesize = 20;
167 168 169
				form.render();
				initData(queryObj);
			})
170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202
			
			//显示红包
			function showMny(mny){
				var val = "";
				if(mny > 0){
					val = mny + "元";
				}else{
					val = "";
				}
				return val;
			}
			
			//显示礼品
			function showPrizeName(mny, name){
				var val = "";
				if(mny > 0){
					val = "";
				}else{
					val = name;
				}
				return val;
			}
			
			//显示状态
			function showStatus(s){
				var val = "";
				if(s == 1){
					val = "未兑换";
				}else if(s == 2){
					val = "已兑换";
				}
				return val;
			}
zxt@theyeasy.com committed
203 204 205 206
		})
	</script>

</html>