Authored by 梁志锋

update

@@ -5,10 +5,12 @@ @@ -5,10 +5,12 @@
5 */ 5 */
6 6
7 var $ = require('jquery'), 7 var $ = require('jquery'),
  8 + Hammer = require('hammer'),
8 tip = require('../plugin/tip'), 9 tip = require('../plugin/tip'),
9 lazyLoad = require('yoho.lazyload'); 10 lazyLoad = require('yoho.lazyload');
10 11
11 -var winH = $(window).height(), 12 +var navHammer,
  13 + winH = $(window).height(),
12 loadMoreH = $('#load-more').height(), 14 loadMoreH = $('#load-more').height(),
13 $goodList = $('#goods-list'), 15 $goodList = $('#goods-list'),
14 loading = false, 16 loading = false,
@@ -35,8 +37,11 @@ if (kidsType) { @@ -35,8 +37,11 @@ if (kidsType) {
35 37
36 $curNav = $navList.children('.focus'); 38 $curNav = $navList.children('.focus');
37 39
38 -$('#maybe-like-nav').delegate('li', 'tap', function() {  
39 - var $this = $(this), 40 +navHammer = new Hammer($navList[0]);
  41 +navHammer.on('tap', function(e) {
  42 + var $this = $(e.target).closest('li'),
  43 +//$('#maybe-like-nav').delegate('li', 'touchstart', function() {
  44 +// var $this = $(this),
40 $goods = $('.goods-list'), 45 $goods = $('.goods-list'),
41 $content; 46 $content;
42 47
@@ -59,9 +64,18 @@ $('#maybe-like-nav').delegate('li', 'tap', function() { @@ -59,9 +64,18 @@ $('#maybe-like-nav').delegate('li', 'tap', function() {
59 $(document).trigger('scroll'); //Trigger lazyLoad 64 $(document).trigger('scroll'); //Trigger lazyLoad
60 }); 65 });
61 66
  67 +$('.maybe-like p').on('touchstart', function (e) {
  68 + search();
  69 +});
  70 +
62 //srcoll to load more 71 //srcoll to load more
63 $(window).scroll(function () { 72 $(window).scroll(function () {
64 if ($(window).scrollTop() + winH >= $(document).height() - loadMoreH - 50) { 73 if ($(window).scrollTop() + winH >= $(document).height() - loadMoreH - 50) {
  74 + search();
  75 + }
  76 +});
  77 +
  78 +function search() {
65 if (loading) { 79 if (loading) {
66 return; 80 return;
67 } 81 }
@@ -120,6 +134,4 @@ $(window).scroll(function () { @@ -120,6 +134,4 @@ $(window).scroll(function () {
120 loading = false; 134 loading = false;
121 } 135 }
122 }); 136 });
123 - }  
124 -  
125 -});  
  137 +}
@@ -39,16 +39,6 @@ $searchBox.find('.clear-text').click(function () { @@ -39,16 +39,6 @@ $searchBox.find('.clear-text').click(function () {
39 $searchBox.find('input').val('').trigger('focus'); 39 $searchBox.find('input').val('').trigger('focus');
40 }); 40 });
41 41
42 -// clearTextHammer = new Hammer($searchBox.find('.clear-text')[0]);  
43 -// clearTextHammer.on('tap', function(e) {  
44 -// $searchBox.find('input').val('').trigger('focus');  
45 -// });  
46 -  
47 $searchBox.find('.search-icon').click(function () { 42 $searchBox.find('.search-icon').click(function () {
48 $indexSearch.submit(); 43 $indexSearch.submit();
49 }); 44 });
50 -  
51 -// searchIconHammer = new Hammer($searchBox.find('.search-icon')[0]);  
52 -// searchIconHammer.on('tap', function(e) {  
53 -// $indexSearch.submit();  
54 -// });  
@@ -17,7 +17,6 @@ @@ -17,7 +17,6 @@
17 height: 192rem / $pxConvertRem; 17 height: 192rem / $pxConvertRem;
18 border-bottom: 1px solid #e0e0e0; 18 border-bottom: 1px solid #e0e0e0;
19 border-right: 1px solid #e0e0e0; 19 border-right: 1px solid #e0e0e0;
20 - border-top: 1px solid #e0e0e0;  
21 } 20 }
22 21
23 .classify-logo { 22 .classify-logo {
@@ -31,6 +31,8 @@ @@ -31,6 +31,8 @@
31 31
32 img { 32 img {
33 vertical-align: middle; 33 vertical-align: middle;
  34 + width: 100%;
  35 + height: 100%;
34 max-width: 100%; 36 max-width: 100%;
35 max-height: 100%; 37 max-height: 100%;
36 } 38 }
1 <div class="maybe-like"> 1 <div class="maybe-like">
2 - <p class="title">  
3 - <i class="icon"></i>  
4 - <span>你可能喜欢</span>  
5 - </p>  
6 -  
7 <ul id="maybe-like-nav" class="maybe-like-nav clearfix"> 2 <ul id="maybe-like-nav" class="maybe-like-nav clearfix">
8 <li class="maybe-like-nav-item focus">新品到着</li> 3 <li class="maybe-like-nav-item focus">新品到着</li>
9 <li class="maybe-like-nav-item">人气单品</li> 4 <li class="maybe-like-nav-item">人气单品</li>