Authored by hf

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

framework @ 119c247f
Subproject commit 75bbc3b075de19f239532f60c5995d06c5f814e2
Subproject commit 119c247f5cf929aa1e059e40609bb16dd6b58f05
... ...
... ... @@ -15,36 +15,52 @@ var winH = $(window).height(),
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;
///recom/maylikekids
if(kidsType){
url = '/product/recom/maylikekids';
}
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({
type: 'GET',
url: '/product/recom/maylike?gender=' + gender,
url: url,
data: {
page: page + 1
},
success: function(data) {
if (data.code === 200) {
res = data.data;
if (data === ' ') {
//opt.end = true;
loading = false;
if (res.end) {
end = res.end;
}
$loading.addClass('hide');
$noMore.removeClass('hide');
$goodList.append(res.product);
return;
}
$goodList.append(data);
//lazyLoad
lazyLoad($goodList.children('.good-info:gt(' + (num - 1) + ')').find('img.lazy'));
//lazyLoad($goodList.children('.good-info:gt(' + (num - 1) + ')').find('img.lazy'));
lazyLoad($('.good-info').find('img.lazy'));
loading = false;
page++;
}
},
error: function() {
tip.show('网络断开连接了~');
... ...
... ... @@ -7,6 +7,17 @@ var $curNav,
$newArrivalList = $('#newarrival-goods-list'),
$goods = $newArrivalList.children('.goods-list');
var winH = $(window).height(),
loadMoreH = $('#load-more').height(),
$goodList = $('.goods-list'),
loading = false,
end = false,
page = 0,
index = 0,
num,
url,
res;
var swiper;
swiper = new Swiper('.swiper-container', {
... ... @@ -19,8 +30,8 @@ $curNav = $navList.children('.focus');
$('#newarrival-nav').delegate('li', 'touchstart', function() {
var $this = $(this),
$content,
index;
$content;
if ($this.hasClass('focus')) {
return;
... ... @@ -39,3 +50,45 @@ $('#newarrival-nav').delegate('li', 'touchstart', function() {
$(document).trigger('scroll'); //Trigger lazyLoad
});
//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({
type: 'GET',
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
//lazyLoad($goodList.children('.good-info:gt(' + (num - 1) + ')').find('img.lazy'));
lazyLoad($('.good-info').find('img.lazy'));
loading = false;
page++;
},
error: function() {
tip.show('网络断开连接了~');
loading = false;
}
});
}
});
\ No newline at end of file
... ...
... ... @@ -12,10 +12,6 @@
{{> home/content}}
{{! 可能喜欢}}
{{# maybeLike}}
{{> home/maybe_like}}
{{/ maybeLike}}
<div class="overlay"></div>
</div>
{{> home/side_nav}}
... ...
... ... @@ -14,6 +14,13 @@
{{> product/goods_container}}
</div>
<div id="load-more-info" class="load-more-info">
<div class="loading status hide">
正在加载...
</div>
<span class="no-more status hide">没有更多啦</span>
</div>
</div>
{{>layout/footer}}
... ...
... ... @@ -14,6 +14,13 @@
{{> product/goods_container}}
</div>
<div id="load-more-info" class="load-more-info">
<div class="loading status">
正在加载...
</div>
<span class="no-more status hide">没有更多啦</span>
</div>
</div>
{{>layout/footer}}
... ...
{{# content}}
{{# content}}
{{! 头部banner}}
{{# bannerTop}}
{{> home/banner_top}}
... ... @@ -54,9 +53,7 @@
{{# plusStar}}
{{> home/plus_star}}
{{/ plusStar}}
{{/ content}}
{{! 可能喜欢}}
{{> home/maybe_like}}
{{/ content}}
\ No newline at end of file
{{! 可能喜欢}}
{{> home/maybe_like}}
\ No newline at end of file
... ...
... ... @@ -3,13 +3,8 @@
<i class="icon"></i>
<span>你可能喜欢</span>
</p>
{{# maybeLike}}
<div class="goods-list clearfix">
{{# goods}}
{{> good}}
{{/ goods}}
</div>
{{/ maybeLike}}
<div id="goods-list" class="goods-list clearfix"></div>
<div id="load-more-info" class="load-more-info">
<div class="loading status">
... ...
... ... @@ -30,8 +30,6 @@ class GirlsController extends AbstractAction
$data['content'] = FloorProcess::getContent($channelData['data'], 2);
}
$data['maybeLike'] = true;
$this->_view->display('index', $data);
}
... ...