...
|
...
|
@@ -11,10 +11,7 @@ var employ, |
|
|
page = 1,
|
|
|
|
|
|
// 防止重复请求
|
|
|
AjaxFlag = 0,
|
|
|
|
|
|
// 上滑不请求
|
|
|
direction = true;
|
|
|
AjaxFlag = 0;
|
|
|
|
|
|
var couponAJAX = function(statu, page) {
|
|
|
if (AjaxFlag) {
|
...
|
...
|
@@ -31,6 +28,12 @@ var couponAJAX = function(statu, page) { |
|
|
page: page
|
|
|
},
|
|
|
success: function(data) {
|
|
|
if(!data){
|
|
|
AjaxFlag = 1;
|
|
|
window.rePosFooter();
|
|
|
loading.hideLoadingMask();
|
|
|
return;
|
|
|
}
|
|
|
$('#employ').append(data);
|
|
|
window.rePosFooter();
|
|
|
loading.hideLoadingMask();
|
...
|
...
|
@@ -40,7 +43,7 @@ var couponAJAX = function(statu, page) { |
|
|
};
|
|
|
|
|
|
var scrollHandler = function() {
|
|
|
if (direction && ($(window).scrollTop() + $(window).height() > $('body').height() - 100)) {
|
|
|
if ($(window).scrollTop() + $(window).height() > $('body').height() - 100) {
|
|
|
page++;
|
|
|
couponAJAX(statu, page);
|
|
|
return;
|
...
|
...
|
@@ -52,31 +55,6 @@ require('../common'); |
|
|
|
|
|
ellipsis.init();
|
|
|
|
|
|
// 判断滑动方向
|
|
|
$('body').on('touchstart', function(e) {
|
|
|
var touch = e.originalEvent,
|
|
|
startX = touch.changedTouches[0].pageX,
|
|
|
startY = touch.changedTouches[0].pageY;
|
|
|
$('body').on('touchmove', function(e) {
|
|
|
touch = e.originalEvent.touches[0] ||
|
|
|
e.originalEvent.changedTouches[0];
|
|
|
if (touch.pageX - startX > 10) {
|
|
|
$('body').off('touchmove');
|
|
|
} else if (touch.pageX - startX < -10) {
|
|
|
$('body').off('touchmove');
|
|
|
}
|
|
|
if (touch.pageY - startY > 10) {
|
|
|
direction = false;
|
|
|
} else if (touch.pageY - startY < -10) {
|
|
|
direction = true;
|
|
|
}
|
|
|
});
|
|
|
}).on('touchend', function() {
|
|
|
$('body').off('touchmove');
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
$('.yoho-footer').css('border-top', '1px solid #e0e0e0');
|
|
|
$('.employ span').each(function(index) {
|
|
|
employ = new Hammer($('.employ span')[index]);
|
...
|
...
|
|