index.html
11.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
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
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
<include file="public/layout" />
<body style="background-color: rgb(255, 255, 255); overflow: auto; cursor: default; -moz-user-select: inherit;">
<div id="append_parent"></div>
<div id="ajaxwaitid"></div>
<div class="page">
<div class="fixed-bar">
<div class="item-title">
<div class="ftitle">
<h3>分销会员列表</h3>
<h5>(共<span id="user_count"></span>条记录)</h5>
<div title="刷新数据" class="pReload"><i class="fa fa-refresh"></i></div>
</div>
</div>
</div>
<!-- 操作说明 -->
<div id="explanation" class="explanation" style="color: rgb(44, 188, 163); background-color: rgb(237, 251, 248); width: 99%; height: 100%;">
<div id="checkZoom" class="title"><i class="fa fa-lightbulb-o"></i>
<h4 title="提示相关设置操作时应注意的要点">操作提示</h4>
<span title="收起提示" id="explanationZoom" style="display: block;"></span>
</div>
<ul>
<li>分销系统可以查看会员上下级信息.</li>
</ul>
</div>
<div class="flexigrid">
<div class="mDiv">
<form class="navbar-form form-inline" id="search-form2" onsubmit="return false" method="get">
<input type="hidden" name="order_by" value="user_id">
<input type="hidden" name="sort" value="desc">
<input type="hidden" name="mobile" value="" id="input-mobile" />
<input type="hidden" name="email" value="" id="input-email" />
<!--分销时查看下级人数都有哪些-->
<input type="hidden" name="first_leader" value="{$_GET['first_leader']}">
<input type="hidden" name="second_leader" value="{$_GET['second_leader']}">
<input type="hidden" name="third_leader" value="{$_GET['third_leader']}">
<input type="hidden" name="user_id" value="{$_GET['user_id']}">
<div class="sDiv">
每<input type="text" size="2" maxlength="3" name="pagenum" id="pagenum" class="qsbox" value="20">条/页
<div class="sDiv2">
<input type="text" id="search_key" size="30" class="qsbox" placeholder="手机...">
<input type="submit" class="btn" onclick="ajax_get_table('search-form2',1)" value="搜索">
</div>
<div class="sDiv2" >
<input type="button" class="btn" value="导出数据" id="btnexcel"> </div>
</div>
</form>
</div>
<div class="hDiv">
<div class="hDivBox">
<table cellspacing="0" cellpadding="0">
<thead>
<tr>
<th align="center" abbr="mobile" axis="col6" class="w130">
<div style="text-align: center; " class="">手机号码</div>
</th>
<th align="left" abbr="nickname" axis="col4" class="w150">
<div style="text-align: center; " class="">会员昵称</div>
</th>
<th align="center" axis="col6" class="w100">
<div style="text-align: center; " class="">一级下线数</div>
</th>
<th align="center" axis="col6" class="w100">
<div style="text-align: center; " class="">二级下线数</div>
</th>
<th align="center" axis="col6" class="w100">
<div style="text-align: center; " class="">三级下线数</div>
</th>
<th align="center" abbr="reg_time" axis="col6" class="w150">
<div style="text-align: center; " class="">注册日期</div>
</th>
<th align="center" axis="col1" class="handle w200">
<div style="text-align: center; ">操作</div>
</th>
</tr>
</thead>
</table>
</div>
</div>
<div class="tDiv">
<div style="clear:both"></div>
</div>
<div class="bDiv" style="height: auto;" id="ajax_return">
</div>
</div>
</div>
<script>
$(document).ready(function(){
// 点击刷新数据
var ssort = 'sdesc';
var on_sclick = 0;
$('.hDivBox > table>thead>tr>th').hover(
function () {
if(typeof($(this).attr('abbr')) == "undefined"){
return false;
}
$(this).addClass('thOver');
if($(this).hasClass('sorted')){
if(ssort == 'sdesc'){
$(this).find('div').removeClass('sdesc');
$(this).find('div').addClass('sasc');
}else{
$(this).find('div').removeClass('sasc');
$(this).find('div').addClass('sdesc');
}
}else{
$(this).find('div').addClass(ssort);
}
}, function () {
if(typeof($(this).attr('abbr')) == "undefined"){
return false;
}
if(on_sclick == 0){
if($(this).hasClass('sorted')){
if(ssort == 'sdesc'){
$(this).find('div').removeClass('sasc');
$(this).find('div').addClass('sdesc');
}else{
$(this).find('div').removeClass('sdesc');
$(this).find('div').addClass('sasc');
}
}else{
$(this).find('div').removeClass(ssort);
}
}
$(this).removeClass("thOver");
on_sclick = 0;
}
);
$('.hDivBox > table>thead>tr>th').click(function(){
if(typeof($(this).attr('abbr')) == "undefined"){
return false;
}
if($(this).hasClass('sorted')){
$(this).find('div').removeClass(ssort);
if(ssort == 'sdesc'){
ssort = 'sasc';
}else{
ssort = 'sdesc';
}
$(this).find('div').addClass(ssort);
on_sclick = 1;
}else{
$('.hDivBox > table>thead>tr>th').removeClass('sorted');
$('.hDivBox > table>thead>tr>th').find('div').removeClass(ssort);
$(this).addClass('sorted');
$(this).find('div').addClass(ssort);
var hDivBox_th_index = $(this).index();
var flexigrid_tr = $('#flexigrid > table>tbody>tr')
flexigrid_tr.each(function(){
$(this).find('td').removeClass('sorted');
$(this).children('td').eq(hDivBox_th_index).addClass('sorted');
});
}
sort($(this).attr('abbr'));
});
$('.fa-refresh').click(function(){
location.href = location.href;
});
var p=getCookie("wxdnewshop_userindex_page");
var sear=getCookie("wxdnewshop_userindex_search");
if(sear!=""){
$("#search_key").val(sear);
}
if(p==undefined || p=="") p=1;
ajax_get_table('search-form2',p);
delCookie("wxdnewshop_userindex_page");
delCookie("wxdnewshop_userindex_search");
});
//选中全部
$('.hDivBox .sign').click(function(){
var sign = $('#flexigrid > table>tbody>tr');
if($(this).parent().hasClass('trSelected')){
sign.each(function(){
$(this).removeClass('trSelected');
});
$(this).parent().removeClass('trSelected');
}else{
sign.each(function(){
$(this).addClass('trSelected');
});
$(this).parent().addClass('trSelected');
}
})
// ajax 抓取页面
function ajax_get_table(tab,page){
layer.msg('加载中...', {icon: 16,shade: [0.5, '#f5f5f5'],scrollbar: false,offset: '10px', time:100000}) ;
var search_key = $.trim($('#search_key').val());
if(search_key.length > 0){
if(checkEmail(search_key)){
$('#input-email').val(search_key);
}else if(checkMobile(search_key)){
$('#input-mobile').val(search_key);
}else{
layer.alert('请输入正确手机号码', {icon: 2});
return;
}
}else{
$('#input-mobile').val("");
}
setCookie("wxdnewshop_userindex_page",page);
setCookie("wxdnewshop_userindex_search",search_key);
cur_page = page; //当前页面 保存为全局变量
$.ajax({
type : "POST",
url:"/index.php/Admin/user/ajaxindex/p/"+page,//+tab,
data : $('#'+tab).serialize(),// 你的formid
success: function(data){
$("#ajax_return").html('');
$("#ajax_return").append(data);
layer.closeAll();
}
});
}
//发送邮件
function send_mail()
{
var obj = $('.trSelected');
var url = "{:U('Admin/User/sendMail')}";
if(obj.length > 0){
var check_val = [];
obj.each(function(){
check_val.push($(this).attr('data-id'));
});
url += "?user_id_array="+check_val;
layer.open({
type: 2,
title: '发送邮箱',
shadeClose: true,
shade: 0.8,
area: ['580px', '480px'],
content: url
});
}else{
layer.msg('请选择会员',{icon: 2,time:1000});
}
}
//发送站内信
function send_message()
{
var obj = $('.trSelected');
var url = "{:U('Admin/User/sendMessage')}";
if(obj.length > 0){
var check_val = [];
obj.each(function(){
check_val.push($(this).attr('data-id'));
});
url += "?user_id_array="+check_val;
layer.open({
type: 2,
title: '站内信',
shadeClose: true,
shade: 0.8,
area: ['580px', '480px'],
content: url
});
}else{
layer.msg('请选择会员',{icon: 2,time:1000});
}
}
// 点击排序
function sort(field)
{
$("input[name='order_by']").val(field);
var v = $("input[name='sort']").val() == 'desc' ? 'asc' : 'desc';
$("input[name='sort']").val(v);
ajax_get_table('search-form2',cur_page);
}
/**
* 回调函数
*/
function call_back(v) {
layer.closeAll();
if (v == 1) {
layer.msg('发送成功',{icon: 2,time:1000});
} else {
layer.msg('发送失败',{icon: 2,time:1000});
}
}
// 导出数据
function ajax_exportreport(form, page) {
cur_page = page; //当前页面 保存为全局变量
location.href="/index.php?m=Admin&c=User&a=exportuser&p=" + page+$('#' + form).serialize();
}
$("#btnexcel").click(function (){
ajax_exportreport('search-form2',1);
})
</script>
</body>
</html>