...
|
...
|
@@ -19,7 +19,9 @@ var activeType = $navLi.filter('.active').data('type'); //当前active的项的i |
|
|
|
|
|
var orderPage = {};
|
|
|
|
|
|
var loading = false;
|
|
|
var inAjax = false;
|
|
|
|
|
|
var loading = require('../plugin/loading');
|
|
|
|
|
|
var navHammer, orderHammer;
|
|
|
|
...
|
...
|
@@ -30,10 +32,13 @@ function getOrders() { |
|
|
page: orderPage[activeType] ? (orderPage[activeType] + 1) : 1
|
|
|
};
|
|
|
|
|
|
if (loading) {
|
|
|
if (inAjax) {
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
inAjax = true;
|
|
|
loading.show();
|
|
|
|
|
|
$.ajax({
|
|
|
type: 'GET',
|
|
|
url: '/home/getOrders',
|
...
|
...
|
@@ -55,6 +60,9 @@ function getOrders() { |
|
|
lazyLoad($curContainer.children('.order:gt(' + (num - 1) + ') .lazy'));
|
|
|
}
|
|
|
}
|
|
|
|
|
|
inAjax = false;
|
|
|
loading.hide();
|
|
|
}
|
|
|
});
|
|
|
}
|
...
|
...
|
@@ -73,6 +81,8 @@ lazyLoad(); |
|
|
$navLi.width(100 / liCount + '%');
|
|
|
}());
|
|
|
|
|
|
loading.init();
|
|
|
|
|
|
//导航切换
|
|
|
navHammer = new Hammer(document.getElementById('order-nav'));
|
|
|
navHammer.on('tap', function(e) {
|
...
|
...
|
|