Merge branch 'feature/homePage' of http://git.dev.yoho.cn/web/yohobuy-mobile into feature/homePage
Showing
1 changed file
with
10 additions
and
3 deletions
@@ -8,12 +8,22 @@ var $ = require('jquery'), | @@ -8,12 +8,22 @@ var $ = require('jquery'), | ||
8 | Mustache = require('mustache'), | 8 | Mustache = require('mustache'), |
9 | lazyLoad = require('./lazyload'); | 9 | lazyLoad = require('./lazyload'); |
10 | 10 | ||
11 | +var $maybeLike = $('.maybe-like:last'); | ||
12 | + | ||
13 | +// 无可能喜欢模块时直接返回 | ||
14 | +if ($maybeLike.length === 0) { | ||
15 | + return; | ||
16 | +} | ||
17 | + | ||
11 | var winH = $(window).height(), | 18 | var winH = $(window).height(), |
12 | loading = false, | 19 | loading = false, |
13 | end = false, | 20 | end = false, |
14 | page = 1, | 21 | page = 1, |
15 | tpl; | 22 | tpl; |
16 | 23 | ||
24 | +var $goodList = $maybeLike.children('.goods-list'), | ||
25 | + mblTop = $maybeLike.offset().top; //页面内容固定,可以预先求出高度 | ||
26 | + | ||
17 | //read good-info template | 27 | //read good-info template |
18 | $.get('/common/goodinfo', function(data) { | 28 | $.get('/common/goodinfo', function(data) { |
19 | tpl = '{{# goods}}' + data + '{{/ goods}}'; | 29 | tpl = '{{# goods}}' + data + '{{/ goods}}'; |
@@ -54,9 +64,6 @@ $('.goods-list').delegate('.good-islike', 'touchstart', function(e) { | @@ -54,9 +64,6 @@ $('.goods-list').delegate('.good-islike', 'touchstart', function(e) { | ||
54 | } | 64 | } |
55 | }); | 65 | }); |
56 | 66 | ||
57 | -var $maybeLike = $('.maybe-like:last'), | ||
58 | - $goodList = $maybeLike.children('.goods-list'), | ||
59 | - mblTop = $maybeLike.offset().top; //页面内容固定,可以预先求出高度 | ||
60 | 67 | ||
61 | //srcoll to load more | 68 | //srcoll to load more |
62 | $(window).scroll(function() { | 69 | $(window).scroll(function() { |
-
Please register or login to post a comment