...
|
...
|
@@ -8,7 +8,6 @@ var $ = require('yoho.zepto'), |
|
|
Swiper = require('yoho.iswiper');
|
|
|
|
|
|
var info = require('./info'),
|
|
|
setLazyLoadAndMellipsis = info.setLazyLoadAndMellipsis,
|
|
|
loadMore = info.loadMore;
|
|
|
|
|
|
var $loadMoreInfo = $('#load-more-info');
|
...
|
...
|
@@ -45,10 +44,11 @@ info.initInfosEvt($infoList); |
|
|
var gender = $('#gender').val();
|
|
|
|
|
|
$nav.children('.guang-nav-item').each(function() {
|
|
|
var type = $(this).data('type');
|
|
|
var type = $(this).data('type'),
|
|
|
focus = $(this).hasClass('focus');
|
|
|
|
|
|
state[type] = {
|
|
|
page: 1,
|
|
|
page: focus ? 1 : 0,
|
|
|
gender: gender,
|
|
|
type: type,
|
|
|
end: false
|
...
|
...
|
@@ -65,6 +65,9 @@ $nav.delegate('.guang-nav-item', 'tap', function() { |
|
|
return;
|
|
|
}
|
|
|
|
|
|
$curNav = $this;
|
|
|
curType = $this.data('type');
|
|
|
|
|
|
index = $this.index();
|
|
|
|
|
|
$this.addClass('focus');
|
...
|
...
|
@@ -75,11 +78,7 @@ $nav.delegate('.guang-nav-item', 'tap', function() { |
|
|
$content = $infos.eq(index);
|
|
|
$content.removeClass('hide');
|
|
|
|
|
|
//lazyload & mellipsis
|
|
|
setLazyLoadAndMellipsis($content.children('.guang-info'));
|
|
|
|
|
|
$curNav = $this;
|
|
|
curType = $this.data('type');
|
|
|
loadMore($content, state[curType]);
|
|
|
|
|
|
//重置当前Tab的load-more
|
|
|
if (state[curType].end) {
|
...
|
...
|
@@ -93,6 +92,6 @@ $nav.delegate('.guang-nav-item', 'tap', function() { |
|
|
|
|
|
$(document).scroll(function() {
|
|
|
if ($(window).scrollTop() + winH >= $(document).height() - loadMoreH) {
|
|
|
loadMore($infos, state[curType]);
|
|
|
loadMore($infos.not('hide'), state[curType]);
|
|
|
}
|
|
|
}); |
|
|
\ No newline at end of file |
...
|
...
|
|