审计记录

WebContent/WEB-INF/jsp/pc/report/goods.jsp 4.1 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
		<div class="layui-form">
			<div class="layui-form-item">
				<div class="layui-input-inline">
					<input type="text" class="layui-input" name="keyword" placeholder="关键字" />
zxt@theyeasy.com committed
31 32
				</div>
				<button class="layui-btn" lay-submit lay-filter="querybtn">查询</button>
33
				<button class="layui-btn layui-btn-primary resetBtn" type="reset">重置</button>
34
			</div>
35
		</div>
zxt@theyeasy.com committed
36 37 38
		<table class="layui-table">
			<thead>
				<tr>
39 40 41 42 43
					<th>No</th>
					<th>商品主图</th>
					<th>商品标题</th>
					<th>转发数</th>
					<th>浏览数</th>
zxt@theyeasy.com committed
44 45
				</tr>
			</thead>
46
			<tbody id="tablelist">
47

zxt@theyeasy.com committed
48 49
			</tbody>
		</table>
50
		<div class="nodata">暂无数据</div>
zxt@theyeasy.com committed
51 52
		<div id="page"></div>
	</body>
53

zxt@theyeasy.com committed
54
	<script src='/zzhnc/res/js/jquery.min.js'></script>
55 56
	<script src="/zzhnc/res/plugins/layui/layui.js"></script>
	<script src="/zzhnc/res/js/me.js"></script>
zxt@theyeasy.com committed
57
	<script>
58 59 60
		layui.use(['form', 'element', 'laypage'], function() {
			var form = layui.form,
				element = layui.element,
zxt@theyeasy.com committed
61
				laypage = layui.laypage;
62

63 64 65 66 67 68
			//查询条件
			var queryObj = {
				page: 1,
				pagesize: 10,
				keyword: null
			}
69

70 71 72
			//初始化方法
			function initData(queryObj) {
				$.post("/zzhnc/activity/getLotteryLogList", queryObj, function(data) {
73
					data = data.data;
74
					console.log(data)
75

76 77 78 79 80 81 82
					var str = "";
					if(data.rows.length < 1) {
						$(".nodata").show();
						$("#page").hide();
					} else {
						$(".nodata").hide();
						$("#page").show();
83 84 85 86 87 88 89 90 91
						for(var i = 0; i < data.rows.length; i++) {
							var nick = "";
							if((data.rows[i].nickname == null || data.rows[i].nickname == "") && (data.rows[i].logo == null || data.rows[i].logo == "")) {
								nick = '<div style="text-align:left;">未授权(id:' + data.rows[i].id + ')</div>';
							} else {
								if(data.rows[i].logo == null || data.rows[i].logo == "") {
									nick = '<div class="nickbox"><div id="wlogo" style="background:url(/zzhnc/res/images/default_user.png) no-repeat center;-webkit-background-size:contain;background-size:contain;"></div><span class="nick"> ' + data.rows[i].nickname + '</span></div>';
								} else {
									nick = '<div class="nickbox"><div id="wlogo" style="background:url(' + data.rows[i].logo + ') no-repeat center;-webkit-background-size:contain;background-size:contain;"></div><span class="nick"> ' + data.rows[i].nickname + '</span></div>';
zxt@theyeasy.com committed
92 93
								}
							}
94
							str += '<tr>' +
95
								'<td>' + ((data.page - 1) * data.pageSize + i + 1) + '</td>' +
96 97 98 99
								'<td>' + data.rows[i].turn + '</td>' +
								'<td>' + nick + '</td>' +
								'<td>' + data.rows[i].mny + '元</td>' +
								'<td>' + data.rows[i].name + '元</td>' +
100
								'<td>' + toTime_G(data.rows[i].createdtime) + '</td>' +
101
								'</tr>';
zxt@theyeasy.com committed
102
						}
103
					}
104

105 106
					$("#tablelist").html(str);
					toNull_G();
107

108 109 110 111 112 113 114 115 116 117
					laypage.render({
						elem: 'page',
						count: data.totalPages, //总页数
						curr: queryObj.page,
						skip: true,
						jump: function(obj, first) {
							if(!first) {
								queryObj.page = obj.curr
								initData(queryObj);
							}
118

119 120 121
						}
					});
				})
122
			}
zxt@theyeasy.com committed
123

124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140
			//初始化数据
			initData(queryObj);

			//查询
			form.on('submit(querybtn)', function(data) {
				queryObj.page = 1;
				queryObj.keyword = $("[name=keyword]").val();
				initData(queryObj);
			});

			//重置
			$(".resetBtn").on("click", function() {
				$("[name=keyword]").val("");
				queryObj.page = 1;
				queryObj.keyword = null;
				initData(queryObj);
			})
141

zxt@theyeasy.com committed
142 143 144 145
		})
	</script>

</html>