Authored by Aiden Xu

分期订单

... ... @@ -13,11 +13,15 @@ var search = {
* @param type
*/
var loadOrderList = function(pageIndex, type) {
if (type && type !== search.type) {
if (type && type !== search.type || pageIndex !== search.pageIndex) {
$.get('/home/installment/order.html', {
page: pageIndex,
type: type
}).then(function(result) {
if (result && result.replace(/\s/g,'')) {
search.pageIndex = pageIndex;
}
if (type !== search.type) {
// 切换TAB时清空列表
$('#order-list').empty();
... ... @@ -56,11 +60,11 @@ var scrollFn = debounce(function() {
if (scrollTop > lastScrollTop &&
(scrollTop + windowHeight >
$(document).height() - 0.25 * $('#order-list').height() - 50)) {
loadOrderList(++search.pageIndex, search.type);
loadOrderList(search.pageIndex + 1, search.type);
}
lastScrollTop = scrollTop;
}, 500);
}, 100);
/**
* 顶部TAB
... ...