Commit 57be50d3 authored by agping's avatar agping

搜索项为空 不传参数

parent 2d1ef0fd
......@@ -36,8 +36,8 @@
<select class="form-control btn2 ld-Marheight" id="staus_red">
<option value="-1">红包状态</option>
<option value="0">有效</option>
<option value="1">过期</option>
<option value="2">已使用</option>
<option value="1">已使用</option>
<option value="2">过期</option>
</select>
<span class="btn btn-info btn3 ld-Marheight" id="search">搜索</span>
<span class="btn btn-info btn3 ld-Marheight" id="reset">重置</span>
......
......@@ -9,19 +9,16 @@ define (['doT', 'text!temp/cash_back_list_template_tpl.html', 'css!style/home.cs
redEnvelope.getList (1);
},
event: function () {
//图片,附件上传删除键事件
$(document).on('click', '.delet-pic-btn', function(e) {
$(document).on('click', '#search', function(e) {//搜索
var _this = $(this);
e.preventDefault();
e.stopPropagation();
$(this).parent().parent().remove();
/*if(confirm('确定删除该图片吗?')) {
var _imgId = _this.parent().attr('data-imgid');
var file_id = $(this).parent('li').attr('id') - 0 ;
_this.parent().remove();
user.addDeleteNewsEvent(file_id);
};*/
redEnvelope.getList(1);
});
$("#reset").click(function() { //重置
document.getElementById("form_search").reset();
});
},
......@@ -32,12 +29,25 @@ define (['doT', 'text!temp/cash_back_list_template_tpl.html', 'css!style/home.cs
var params = {};
params.pageNo = redEnvelope.pageNo;
params.pageSize = redEnvelope.pageSize;
if($('#create_time_start').val()){
params.start_time = $('#create_time_start').val();
}
if($('#create_time_end').val()){
params.end_time = $('#create_time_end').val();
}
if($('#user_id').val()){
params.user_id = $('#user_id').val();
}
if($('#red_bag_id').val()){
params.id = $('#red_bag_id').val();
}
if($('#activity_id').val()){
params.activity_id = $('#activity_id').val();
}
if($('#staus_red').val()*1 != -1){
params.status = $('#staus_red').val();
}
$.ajax ({
url: '/index/couponList',//获取列表
type: 'GET',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment