Authored by hf

Merge branch 'develop' of http://git.dev.yoho.cn/web/yohobuy into develop

... ... @@ -12,29 +12,22 @@ var winH = $(window).height(),
loadMoreH = $('#load-more').height(),
$goodList = $('#goods-list'),
loading = false,
end = false,
page = 0,
gender = $('.mobile-wrap').hasClass('boys-wrap') ? '1,3' : '2,3',
kidsType = $('.mobile-wrap').hasClass('kids-wrap') ? true : false,
num,
url,
res;
url;
///recom/maylikekids
if(kidsType){
if (kidsType) {
url = '/product/recom/maylikekids';
}
else
{
} else {
url = '/product/recom/maylike?gender=' + gender;
}
//srcoll to load more
$(window).scroll(function () {
if ($(window).scrollTop() + winH >= $(document).height() - loadMoreH) {
if (loading) {
return;
}
loading = true;
num = $goodList.children('.good-info').length;
$.ajax({
... ... @@ -44,15 +37,6 @@ $(window).scroll(function () {
page: page + 1
},
success: function(data) {
if (data === ' ') {
//opt.end = true;
loading = false;
$loading.addClass('hide');
$noMore.removeClass('hide');
return;
}
$goodList.append(data);
//lazyLoad
... ... @@ -60,7 +44,7 @@ $(window).scroll(function () {
lazyLoad($('.good-info').find('img.lazy'));
loading = false;
page++;
page++;
},
error: function() {
tip.show('网络断开连接了~');
... ...
var $ = require('yoho.zepto'),
tip = require('../../plugin/tip'),
Swiper = require('yoho.iswiper'),
lazyLoad = require('yoho.zeptolazyload');
... ... @@ -11,12 +12,9 @@ var winH = $(window).height(),
loadMoreH = $('#load-more').height(),
$goodList = $('.goods-list'),
loading = false,
end = false,
page = 0,
index = 0,
num,
url,
res;
num;
var swiper;
... ... @@ -31,7 +29,7 @@ $curNav = $navList.children('.focus');
$('#newarrival-nav').delegate('li', 'touchstart', function() {
var $this = $(this),
$content;
if ($this.hasClass('focus')) {
return;
... ... @@ -55,26 +53,24 @@ $('#newarrival-nav').delegate('li', 'touchstart', function() {
$(window).scroll(function () {
if ($(window).scrollTop() + winH >= $(document).height() - loadMoreH) {
if (loading) {
return;
return;
}
loading = true;
num = $goodList.children('.good-info').length;
$.ajax({
type: 'GET',
url: '/product/newsale/selectNewSale?dayLimit'+(index+1),
url: '/product/newsale/selectNewSale?dayLimit' + (index + 1),
data: {
page: page + 1
},
success: function(data) {
if (data === ' ') {
//opt.end = true;
loading = false;
$loading.addClass('hide');
$noMore.removeClass('hide');
return;
}
}
$goodList.append(data);
//lazyLoad
... ... @@ -82,7 +78,7 @@ $(window).scroll(function () {
lazyLoad($('.good-info').find('img.lazy'));
loading = false;
page++;
page++;
},
error: function() {
tip.show('网络断开连接了~');
... ...