审计记录

WebContent/WEB-INF/jsp/pc/report/goods.jsp 3.7 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
		<div class="layui-form">
			<div class="layui-form-item">
				<div class="layui-input-inline">
沈姿.前端(已离职) committed
30
					<input type="text" class="layui-input" name="key" placeholder="关键字" />
zxt@theyeasy.com committed
31
				</div>
沈姿.前端(已离职) committed
32 33 34 35 36 37 38 39
				<div class="layui-input-inline">
					<select name="sort">
						<option value="">排序类型</option>
						<option value="1">按更新时间排序</option>
						<option value="2">按转发数排序</option>
						<option value="3">按浏览数排序</option>
					</select>
				</div>
zxt@theyeasy.com committed
40
				<button class="layui-btn" lay-submit lay-filter="querybtn">查询</button>
41
				<button class="layui-btn layui-btn-primary resetBtn" type="reset">重置</button>
42
			</div>
沈姿.前端(已离职) committed
43

44
		</div>
zxt@theyeasy.com committed
45 46 47
		<table class="layui-table">
			<thead>
				<tr>
48 49 50 51 52
					<th>No</th>
					<th>商品主图</th>
					<th>商品标题</th>
					<th>转发数</th>
					<th>浏览数</th>
zxt@theyeasy.com committed
53 54
				</tr>
			</thead>
55
			<tbody id="tablelist">
56

zxt@theyeasy.com committed
57 58
			</tbody>
		</table>
59
		<div class="nodata">暂无数据</div>
zxt@theyeasy.com committed
60 61
		<div id="page"></div>
	</body>
62

zxt@theyeasy.com committed
63
	<script src='/zzhnc/res/js/jquery.min.js'></script>
64 65
	<script src="/zzhnc/res/plugins/layui/layui.js"></script>
	<script src="/zzhnc/res/js/me.js"></script>
zxt@theyeasy.com committed
66
	<script>
67 68 69
		layui.use(['form', 'element', 'laypage'], function() {
			var form = layui.form,
				element = layui.element,
zxt@theyeasy.com committed
70
				laypage = layui.laypage;
71

72 73 74
			//查询条件
			var queryObj = {
				page: 1,
75
				size: 20,
沈姿.前端(已离职) committed
76
				sellerId: 0,
沈姿.前端(已离职) committed
77
				sort: 1,
沈姿.前端(已离职) committed
78 79
				key: null
			};
80

81 82
			//初始化方法
			function initData(queryObj) {
沈姿.前端(已离职) committed
83
				$.get("/zzhnc/goods/search", queryObj, function(data) {
84
					data = data.data;
85
					console.log(data)
沈姿.前端(已离职) committed
86
					$("#tablelist").html("");
87 88 89 90 91
					var str = "";
					if(data.rows.length < 1) {
						$(".nodata").show();
					} else {
						$(".nodata").hide();
92
						var str = "";
93
						for(var i = 0; i < data.rows.length; i++) {
沈姿.前端(已离职) committed
94
							str += '<tr data-id=' + data.rows[i].id + '>' +
95
								'<td>' + ((data.page - 1) * data.pageSize + i + 1) + '</td>' +
沈姿.前端(已离职) committed
96 97
								'<td><img class="imgUrl" src="' + data.rows[i].bannerUrl + '"  /></td>' +
								'<td>' + data.rows[i].name + '</td>' +
沈姿.前端(已离职) committed
98 99
								'<td>' + data.rows[i].shareCount + '</td>' +
								'<td>' + data.rows[i].pageViews + '</td>' +
100
								'</tr>';
zxt@theyeasy.com committed
101
						}
沈姿.前端(已离职) committed
102 103
						$("#tablelist").html(str);
						form.render();
104 105
						toNull_G();
					}
106 107 108 109 110 111 112 113 114 115 116 117 118
					laypage.render({
						elem: 'page',
						count: data.total,
						limit: queryObj.size,
						curr: queryObj.page,
						layout: ['count', 'prev', 'page', 'next', 'skip'],
						jump: function(obj, first) {
							if(!first) {
								queryObj.page = obj.curr
								initData(queryObj);
							}
						}
					})
119
				})
120
			}
zxt@theyeasy.com committed
121

122 123 124 125 126 127
			//初始化数据
			initData(queryObj);

			//查询
			form.on('submit(querybtn)', function(data) {
				queryObj.page = 1;
128
				queryObj.size = 20;
沈姿.前端(已离职) committed
129
				queryObj.key = $("[name=key]").val();
沈姿.前端(已离职) committed
130
				queryObj.sort = $("[name=sort]").val();
131 132 133 134 135
				initData(queryObj);
			});

			//重置
			$(".resetBtn").on("click", function() {
沈姿.前端(已离职) committed
136
				$("[name=key]").val("");
沈姿.前端(已离职) committed
137
				$("[name=sort]").val("1");
138
				queryObj.page = 1;
139
				queryObj.size = 20;
沈姿.前端(已离职) committed
140
				queryObj.key = null;
沈姿.前端(已离职) committed
141
				queryObj.sort = 1;
142 143
				initData(queryObj);
			})
144

zxt@theyeasy.com committed
145 146 147 148
		})
	</script>

</html>