Commit 57be50d3 authored by agping's avatar agping

搜索项为空 不传参数

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