search_goods3.html
5.67 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
<include file="public/layout"/>
<style>
select{
height: 27px;
}
.bot {
float: right;
padding: 15px 0;
width: 10%
}
.vdisib {
display: inline-block;
*display: inline;
*zoom: 1;
vertical-align: middle;
}
.flexigrid .bDiv tr {
display: block;
}
.flexigrid .bDiv td.dny {
display: none;
}
</style>
<body style="background-color: rgb(255, 255, 255); overflow: auto; cursor: default; -moz-user-select: inherit;">
<div class="page" style="padding: 0px 1% 0 1%;">
<!-- 操作说明 -->
<div class="flexigrid">
<div class="mDiv">
<div class="ftitle vdisib">
<h3 class="vdisib">商品列表</h3>
<h5 id="good_count" class="vdisib"></h5>
</div>
<div title="刷新数据" class="pReload vdisib"><i class="fa fa-refresh"></i></div>
<form class="navbar-form form-inline" id="search-form2" onSubmit="return false">
<input type="hidden" name="id" value="{$id}">
<input type="hidden" name="dis_type" value="{$dis_type}">
<input type="hidden" name="main_goods" value="{$main_goods}">
<div class="sDiv">
<span style="font-size: 12px"> 每<input type="text" size="4" maxlength="4" name="pagenum" id="pagenum" class="qsbox" value="{$pagenum}">条/页</span>
<div class="sDiv2" style="margin-right: 10px;border:none;">
<select name="cat_id" id="cat_id">
<option value="">所有分类</option>
<foreach name="categoryList" item="v" key="k">
<option value="{$v['id']}">{$v['name']}</option>
</foreach>
</select>
</div>
<div class="sDiv2" style="margin-right: 10px;border:none;">
<select name="brand_id" id="brand_id">
<option value="">所有品牌</option>
<foreach name="brandList" item="v" key="k">
<option value="{$v['id']}">{$v['name']}</option>
</foreach>
</select>
</div>
<div class="sDiv2" style="margin-right: 10px;border:none;">
<select name="intro">
<option value="0">全部</option>
<option value="is_new">新品</option>
<option value="is_recommend">推荐</option>
</select>
</div>
<div class="sDiv2">
<!--<select name="status" class="select">-->
<!--<option value="">活动状态</option>-->
<!--</select>-->
<input type="hidden" id="idlist" value="{$idlist}">
<input type="hidden" id="list" value="{$idlist}">
<input size="30" name="keywords" class="qsbox" placeholder="商品名称或者关键词" type="text">
<input class="btn" style="height: 27px" value="搜索" type="submit"
onclick="ajax_get_table('search-form2',1)">
</div>
</div>
</form>
</div>
<div class="bDiv" style="height: auto;">
<div id="ajax_return" cellpadding="0" cellspacing="0" border="0"></div>
</div>
<!--分页位置-->
<div class="bot"><a onclick="select_goods();" class="ncap-btn-big ncap-btn-green">确认提交</a></div>
</div>
<div id="goods_table" style="display: none"></div>
</div>
<script>
$(document).ready(function () {
$('.fa-refresh').click(function () {
location.href = location.href;
});
ajax_get_table('search-form2', 1);
});
var idlist = $('#idlist').val();
if (idlist != '') {
arr = idlist.split(',');
} else {
arr = new Array();
}
function select_goods() {
//将没选中的复选框所在的 tr remove 然后删除复选框
$("table :checkbox").each(function () {
if ($(this).is(':checked')) {
if ($(this).attr('id') == 'check') {
return true;
}
var id = $(this).attr('data-id');
if ($.inArray(id, brr) == -1) {
$(this).parent().parent().css('display', 'none');
$(this).parent().parent().parent().removeAttrs('class');
table += $(this).parent().parent().parent().prop('outerHTML');
list += id + ',';
}
}
});
$('#list').val(list);
$('#goods_table').append(table);
javascript:window.parent.call_back_search($('#goods_table').html());
}
function ajax_get_table(form, page) {
cur_page = page; //当前页面 保存为全局变量
layer.msg('加载中...', {
icon: 16,
shade: [0.5, '#f5f5f5'],
scrollbar: false,
offset: '200px',
time: 100000
});
$.ajax({
type: "POST",
url: "/index.php?m=Admin&c=promotion&a=ajax_search_goods&p=" + page+"¬in=1", //+tab,
data: $('#' + form).serialize(), // 你的formid
success: function (data) {
$("#ajax_return").html('');
$("#ajax_return").append(data);
layer.closeAll();
}
});
}
</script>
</body>
</html>