Merge branch 'develop' of http://git.dev.yoho.cn/web/yohobuy into develop
Showing
2 changed files
with
8 additions
and
28 deletions
@@ -12,29 +12,22 @@ var winH = $(window).height(), | @@ -12,29 +12,22 @@ var winH = $(window).height(), | ||
12 | loadMoreH = $('#load-more').height(), | 12 | loadMoreH = $('#load-more').height(), |
13 | $goodList = $('#goods-list'), | 13 | $goodList = $('#goods-list'), |
14 | loading = false, | 14 | loading = false, |
15 | - end = false, | ||
16 | page = 0, | 15 | page = 0, |
17 | gender = $('.mobile-wrap').hasClass('boys-wrap') ? '1,3' : '2,3', | 16 | gender = $('.mobile-wrap').hasClass('boys-wrap') ? '1,3' : '2,3', |
18 | kidsType = $('.mobile-wrap').hasClass('kids-wrap') ? true : false, | 17 | kidsType = $('.mobile-wrap').hasClass('kids-wrap') ? true : false, |
19 | num, | 18 | num, |
20 | - url, | ||
21 | - res; | 19 | + url; |
22 | 20 | ||
23 | ///recom/maylikekids | 21 | ///recom/maylikekids |
24 | -if(kidsType){ | 22 | +if (kidsType) { |
25 | url = '/product/recom/maylikekids'; | 23 | url = '/product/recom/maylikekids'; |
26 | -} | ||
27 | -else | ||
28 | -{ | 24 | +} else { |
29 | url = '/product/recom/maylike?gender=' + gender; | 25 | url = '/product/recom/maylike?gender=' + gender; |
30 | } | 26 | } |
31 | 27 | ||
32 | //srcoll to load more | 28 | //srcoll to load more |
33 | $(window).scroll(function () { | 29 | $(window).scroll(function () { |
34 | if ($(window).scrollTop() + winH >= $(document).height() - loadMoreH) { | 30 | if ($(window).scrollTop() + winH >= $(document).height() - loadMoreH) { |
35 | - if (loading) { | ||
36 | - return; | ||
37 | - } | ||
38 | loading = true; | 31 | loading = true; |
39 | num = $goodList.children('.good-info').length; | 32 | num = $goodList.children('.good-info').length; |
40 | $.ajax({ | 33 | $.ajax({ |
@@ -44,15 +37,6 @@ $(window).scroll(function () { | @@ -44,15 +37,6 @@ $(window).scroll(function () { | ||
44 | page: page + 1 | 37 | page: page + 1 |
45 | }, | 38 | }, |
46 | success: function(data) { | 39 | success: function(data) { |
47 | - if (data === ' ') { | ||
48 | - //opt.end = true; | ||
49 | - loading = false; | ||
50 | - | ||
51 | - $loading.addClass('hide'); | ||
52 | - $noMore.removeClass('hide'); | ||
53 | - | ||
54 | - return; | ||
55 | - } | ||
56 | $goodList.append(data); | 40 | $goodList.append(data); |
57 | 41 | ||
58 | //lazyLoad | 42 | //lazyLoad |
1 | var $ = require('yoho.zepto'), | 1 | var $ = require('yoho.zepto'), |
2 | + tip = require('../../plugin/tip'), | ||
2 | Swiper = require('yoho.iswiper'), | 3 | Swiper = require('yoho.iswiper'), |
3 | lazyLoad = require('yoho.zeptolazyload'); | 4 | lazyLoad = require('yoho.zeptolazyload'); |
4 | 5 | ||
@@ -11,12 +12,9 @@ var winH = $(window).height(), | @@ -11,12 +12,9 @@ var winH = $(window).height(), | ||
11 | loadMoreH = $('#load-more').height(), | 12 | loadMoreH = $('#load-more').height(), |
12 | $goodList = $('.goods-list'), | 13 | $goodList = $('.goods-list'), |
13 | loading = false, | 14 | loading = false, |
14 | - end = false, | ||
15 | page = 0, | 15 | page = 0, |
16 | index = 0, | 16 | index = 0, |
17 | - num, | ||
18 | - url, | ||
19 | - res; | 17 | + num; |
20 | 18 | ||
21 | var swiper; | 19 | var swiper; |
22 | 20 | ||
@@ -61,20 +59,18 @@ $(window).scroll(function () { | @@ -61,20 +59,18 @@ $(window).scroll(function () { | ||
61 | num = $goodList.children('.good-info').length; | 59 | num = $goodList.children('.good-info').length; |
62 | $.ajax({ | 60 | $.ajax({ |
63 | type: 'GET', | 61 | type: 'GET', |
64 | - url: '/product/newsale/selectNewSale?dayLimit'+(index+1), | 62 | + url: '/product/newsale/selectNewSale?dayLimit' + (index + 1), |
65 | data: { | 63 | data: { |
66 | page: page + 1 | 64 | page: page + 1 |
67 | }, | 65 | }, |
68 | success: function(data) { | 66 | success: function(data) { |
69 | if (data === ' ') { | 67 | if (data === ' ') { |
68 | + | ||
70 | //opt.end = true; | 69 | //opt.end = true; |
71 | loading = false; | 70 | loading = false; |
72 | - | ||
73 | - $loading.addClass('hide'); | ||
74 | - $noMore.removeClass('hide'); | ||
75 | - | ||
76 | return; | 71 | return; |
77 | } | 72 | } |
73 | + | ||
78 | $goodList.append(data); | 74 | $goodList.append(data); |
79 | 75 | ||
80 | //lazyLoad | 76 | //lazyLoad |
-
Please register or login to post a comment