页面分页及click失效

java类

// 分页
String nums = RequestResponseContext.getRequest().getParameter("nums");
Integer pageSize = null;
Integer curPage = 0;
if (pageSize == null) {
pageSize = 1;
}
if (StringUtils.isNotBlank(nums)) {
curPage = Integer.valueOf(nums);
}
Map<String, Object> map = new HashMap<>();
map.put("memberShopsId", userContext.getMemberShopsId());
map.put("nums", curPage * pageSize);
map.put("pageSize", pageSize);
List<ConsumeRecord> consumeRecordList = consumeRecordService.selectByMemberShopsIdList(map);

mapper.xml

<select id="selectByMemberShopsId" resultMap="BaseResultMap"
resultType="java.util.Map">
select
x_consume_record.*,x_consume_message.message
from
x_consume_record,x_consume_message
where
x_consume_record.consume_message_id=x_consume_message.id and
member_shops_id = #{memberShopsId}
order by create_time desc
limit #{nums},#{pageSize}
</select>

jsp页面:

$(".next").bind("click",function(){
var nums = $('#nums').val();
nums++;
$('#nums').val(nums);
window.location = '/shop/myshop.htm?nums=' + nums;
    })
    var list = "${consumeRecordList}";
    if(list == '' ||list == '[]' || typeof(list) == 'undefined'){
    $(".next").unbind("click");//让click事件失效
    }


你可能感兴趣的:(页面分页及click失效)