审计记录

WebContent/WEB-INF/jsp/pc/report/fans.jsp 4.7 KB
zxt@theyeasy.com committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
<%@ 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">
		<title>粉丝列表</title>
		<link rel="stylesheet" href="/zzhnc/res/plugins/layui/css/layui.css">
		<link rel="stylesheet" href="/zzhnc/res/css/basic.css">
	</head>

	<body class="wrap">
		<form class="layui-form">
			<div class="layui-form-item searchbox" style="margin-bottom: 0px;">
				<div class="layui-input-inline" style="width: 150px;">
					<input class="layui-input" name="keyword" placeholder="关键字" />
				</div>
				<button class="layui-btn" lay-submit lay-filter="querybtn">查询</button>
				<button class="layui-btn layui-btn-primary" lay-submit lay-filter="resetbtn">重置</button>
22
			</div>
zxt@theyeasy.com committed
23 24 25 26 27 28 29 30 31 32 33 34 35 36 37
		</form>
		<table class="layui-table">
			<thead>
				<tr>
					<th style="width:30px;">No</th>
					<th style="min-width:120px;">头像昵称</th>
					<th style="width:160px;">地区</th>
					<th style="min-width:80px;">上级粉丝</th>
					<th style="min-width:60px;">销售人员</th>
					<th style="min-width:60px;">小程序 openid</th>
					<th style="min-width:80px;">创建时间</th>
					<th style="min-width:80px;">上次登录时间</th>
				</tr>
			</thead>
			<tbody id="fanslist">
38

zxt@theyeasy.com committed
39 40 41 42
			</tbody>
		</table>
		<div class="nulldata">暂无数据</div>
		<div id="page"></div>
43

zxt@theyeasy.com committed
44 45 46 47 48 49 50 51 52 53 54
	</body>
	<script src='/zzhnc/res/js/jquery.min.js'></script>
	<script src="/zzhnc/res/plugins/layui/layui.js" charset="utf-8"></script>
	<script type="text/javascript" src="/zzhnc/res/js/me.js"></script>
	<script>
		layui.use(['form', 'element', 'laydate', 'layer', 'laypage'], function() {
			var form = layui.form(),
				element = layui.element(),
				laydate = layui.laydate,
				layer = layui.layer,
				laypage = layui.laypage;
55 56 57 58

			var page = 1,
				keyword = ""

zxt@theyeasy.com committed
59 60
			//初始化数据
			initData(page, keyword)
61 62 63 64 65 66

			function initData(page, keyword) {
				$.post("/zzhnc/report/getFansList", {
					page: page,
					keyword: keyword
				}, function(data) {
zxt@theyeasy.com committed
67
					console.log(data)
68 69
					data = data.data;

zxt@theyeasy.com committed
70 71
					laypage({
						cont: 'page',
72
						pages: data.totalPages,
zxt@theyeasy.com committed
73 74 75 76 77 78 79 80 81
						curr: page,
						skip: true,
						jump: function(obj, first) {
							if(!first) {
								page = obj.curr
								initData(page, keyword)
							}
						}
					});
82

zxt@theyeasy.com committed
83
					$("#fanslist").html("")
84 85

					if(data.rows.length > 0) {
zxt@theyeasy.com committed
86
						$(".nulldata").hide();
87 88 89 90 91 92 93 94 95 96
						var str = "";
						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
97 98
								}
							}
99 100 101 102 103 104 105 106 107 108 109

							str += '<tr data-id=' + data.rows[i].id + '>' +
								'<td>' + ((data.page - 1) * data.pageSize + i + 1) + '</td>' +
								'<td style="text-align:left;">' + nick + '</td>' +
								'<td>' + ToAddress(data.rows[i]) + '</td>' +
								'<td>' + data.rows[i].parentfans + '</td>' +
								'<td>' + data.rows[i].salesname + '</td>' +
								'<td>' + data.rows[i].miniopenid + '</td>' +
								'<td>' + toTime_G(data.rows[i].createdtime) + '</td>' +
								'<td>' + toTime_G(data.rows[i].lastlogintime) + '</td>' +
								'</tr>'
zxt@theyeasy.com committed
110 111 112
						}
						$("#fanslist").html(str)
						toNull_G();
113
					} else {
zxt@theyeasy.com committed
114 115 116
						$(".nulldata").show()
						return false;
					}
117

zxt@theyeasy.com committed
118 119
				})
			}
120 121

			form.on("submit(querybtn)", function(e) {
zxt@theyeasy.com committed
122 123 124
				initData(1, e.field.keyword)
				return false
			})
125 126

			form.on("submit(resetbtn)", function(e) {
zxt@theyeasy.com committed
127 128 129 130
				$("[name=keyword]").val("")
				initData(1, "");
				return false
			})
131 132 133

			function fanstype(t) {
				if(t == 1) {
zxt@theyeasy.com committed
134
					return "销售助手粉丝"
135 136 137
				} else if(t == 2) {
					return "万小二粉丝"
				} else {
zxt@theyeasy.com committed
138 139 140 141
					return ""
				}
			}

142
			function ToAddress(data) {
zxt@theyeasy.com committed
143 144 145
				var p = data.province || ""
				var c = data.city || ""
				var d = data.district || ""
146
				return !!(p + c + d) ? (p + c + d) : "未知城市"
zxt@theyeasy.com committed
147
			}
148

zxt@theyeasy.com committed
149 150 151 152
		})
	</script>

</html>