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
//lazyLoad($goodList.children('.good-info:gt(' + (num - 1) + ')').find('img.lazy'));
lazyLoad($('.good-info').find('img.lazy'));
loading = false;
page++;
}
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;
... ... @@ -38,4 +49,46 @@ $('#newarrival-nav').delegate('li', 'touchstart', function() {
$curNav = $this;
$(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}}
{{! 头部banner}}
{{# bannerTop}}
{{> home/banner_top}}
{{/ bannerTop}}
{{! 图标入口}}
{{# iconsEnter}}
{{> home/icons_enter}}
{{/ iconsEnter}}
{{! 中间banner}}
{{# banner}}
{{> home/banner}}
{{/ banner}}
{{! 热门品类}}
{{# hotCategory}}
{{> home/hot_category}}
{{/ hotCategory}}
{{! 热门品牌}}
{{# hotBrands}}
{{> home/hot_brands_list}}
{{/ hotBrands}}
{{! 热门品牌可滑动}}
{{# hotBrandsScroll}}
{{> home/hot_brands_swipe}}
{{/ hotBrandsScroll}}
{{! 潮人搭配}}
{{# trendColloaction}}
{{> home/trendsetter_collocation}}
{{/trendColloaction}}
{{! 潮流话题}}
{{# trendTopics}}
{{> home/trend_topics}}
{{/ trendTopics}}
{{! 潮流时装/经典裤裙/时尚靴履/潮人配饰/潮流上装}}
{{# goodsCategory}}
{{> home/goods_category}}
{{/ goodsCategory}}
{{! 新入住品牌/品味生活/创意生活}}
{{# creativeLife}}
{{> home/creative_life}}
{{/ creativeLife}}
{{! PLUS}}
{{# plusStar}}
{{> home/plus_star}}
{{/ plusStar}}
{{! 可能喜欢}}
{{> home/maybe_like}}
{{/ content}}
\ No newline at end of file
{{# content}}
{{! 头部banner}}
{{# bannerTop}}
{{> home/banner_top}}
{{/ bannerTop}}
{{! 图标入口}}
{{# iconsEnter}}
{{> home/icons_enter}}
{{/ iconsEnter}}
{{! 中间banner}}
{{# banner}}
{{> home/banner}}
{{/ banner}}
{{! 热门品类}}
{{# hotCategory}}
{{> home/hot_category}}
{{/ hotCategory}}
{{! 热门品牌}}
{{# hotBrands}}
{{> home/hot_brands_list}}
{{/ hotBrands}}
{{! 热门品牌可滑动}}
{{# hotBrandsScroll}}
{{> home/hot_brands_swipe}}
{{/ hotBrandsScroll}}
{{! 潮人搭配}}
{{# trendColloaction}}
{{> home/trendsetter_collocation}}
{{/trendColloaction}}
{{! 潮流话题}}
{{# trendTopics}}
{{> home/trend_topics}}
{{/ trendTopics}}
{{! 潮流时装/经典裤裙/时尚靴履/潮人配饰/潮流上装}}
{{# goodsCategory}}
{{> home/goods_category}}
{{/ goodsCategory}}
{{! 新入住品牌/品味生活/创意生活}}
{{# creativeLife}}
{{> home/creative_life}}
{{/ creativeLife}}
{{! PLUS}}
{{# plusStar}}
{{> home/plus_star}}
{{/ plusStar}}
{{/ content}}
{{! 可能喜欢}}
{{> home/maybe_like}}
\ No newline at end of file
... ...
... ... @@ -3,18 +3,13 @@
<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">
正在加载...
</div>
<span class="no-more status hide">没有更多啦</span>
<div class="loading status">
正在加载...
</div>
<span class="no-more status hide">没有更多啦</span>
</div>
</div>
\ No newline at end of file
... ...
... ... @@ -85,7 +85,7 @@
{{!-- 首页 --}}
{{#if grilsHomePage}}
<script>
seajs.use('js/home/home');
seajs.use('js/home/home');
</script>
{{/if}}
{{#if boysHomePage}}
... ...
... ... @@ -29,8 +29,6 @@ class GirlsController extends AbstractAction
if (isset($channelData['code']) && $channelData['code'] == 200) {
$data['content'] = FloorProcess::getContent($channelData['data'], 2);
}
$data['maybeLike'] = true;
$this->_view->display('index', $data);
}
... ...