Authored by Rock Zhang

Merge branch 'develop' into test

@@ -10,6 +10,7 @@ var $ = require('jquery'), @@ -10,6 +10,7 @@ var $ = require('jquery'),
10 $mobileWrap = $('.mobile-wrap'), 10 $mobileWrap = $('.mobile-wrap'),
11 $overlay = $('.overlay'), 11 $overlay = $('.overlay'),
12 $sideNav = $('.side-nav'), 12 $sideNav = $('.side-nav'),
  13 + $subNav = $('.sub-nav'),
13 bannerSwiper, 14 bannerSwiper,
14 recommendSwiper, 15 recommendSwiper,
15 hotBrandsSwiper, 16 hotBrandsSwiper,
@@ -48,8 +49,7 @@ navHammer.on('tap', function(event) { @@ -48,8 +49,7 @@ navHammer.on('tap', function(event) {
48 return false; 49 return false;
49 }); 50 });
50 51
51 -mobileWrapHammer = new Hammer($('.mobile-wrap')[0]);  
52 -mobileWrapHammer.on('tap', function(e) { 52 +function hideSideBar() {
53 if ($mobileWrap.hasClass('menu-open')) { 53 if ($mobileWrap.hasClass('menu-open')) {
54 $mobileWrap.removeClass('menu-open'); 54 $mobileWrap.removeClass('menu-open');
55 $overlay.css('opacity', 0); 55 $overlay.css('opacity', 0);
@@ -62,28 +62,40 @@ mobileWrapHammer.on('tap', function(e) { @@ -62,28 +62,40 @@ mobileWrapHammer.on('tap', function(e) {
62 setTimeout(function() { 62 setTimeout(function() {
63 $('.overlay').hide(); 63 $('.overlay').hide();
64 }, 300); 64 }, 300);
65 - e.srcEvent.stopPropagation();  
66 - return false;  
67 } 65 }
  66 +}
  67 +
  68 +mobileWrapHammer = new Hammer($('.mobile-wrap')[0]);
  69 +mobileWrapHammer.on('tap', function(e) {
  70 + hideSideBar();
  71 + e.srcEvent.stopPropagation();
  72 + return false;
68 }); 73 });
69 74
70 //点击一级导航,弹出二级导航 75 //点击一级导航,弹出二级导航
71 -$sideNav.on('touchend', 'li', function () { 76 +$sideNav.on('touchend', 'li', function (e) {
72 if ($(this).find('.sub-nav').size() > 0) { 77 if ($(this).find('.sub-nav').size() > 0) {
73 $('.sub-nav').removeClass('show'); 78 $('.sub-nav').removeClass('show');
74 $(this).find('.sub-nav').addClass('show'); 79 $(this).find('.sub-nav').addClass('show');
75 } 80 }
76 - return false; 81 + e.stopPropagation();
  82 + if (e.target.pathname === location.pathname) {
  83 + hideSideBar();
  84 + return false;
  85 + }
77 }); 86 });
78 87
79 //返回一级导航,收起二级导航 88 //返回一级导航,收起二级导航
80 -$('.sub-nav').each(function () { 89 +$subNav.each(function () {
81 $(this).find('li').eq(0).on('touchend', function (e) { 90 $(this).find('li').eq(0).on('touchend', function (e) {
82 $('.sub-nav').removeClass('show'); 91 $('.sub-nav').removeClass('show');
  92 + e.stopPropagation();
83 return false; 93 return false;
84 }); 94 });
85 -}).on('touchend', function() {  
86 - $('.sub-nav').find('li').removeClass('current'); 95 +}).on('touchend', function(e) {
  96 + if (e.currentTarget !== e.target) {
  97 + $subNav.find('li').removeClass('current');
  98 + }
87 }); 99 });
88 100
89 //头部banner轮播 101 //头部banner轮播
@@ -72,9 +72,10 @@ @@ -72,9 +72,10 @@
72 height: 158rem / $pxConvertRem; 72 height: 158rem / $pxConvertRem;
73 73
74 .img-box { 74 .img-box {
  75 + display: table-cell;
  76 + vertical-align: middle;
75 width: 100%; 77 width: 100%;
76 - height: 100%;  
77 - 78 + height: 158rem / $pxConvertRem;
78 } 79 }
79 } 80 }
80 } 81 }
1 .side-nav { 1 .side-nav {
  2 + display: block;
2 background: #fff; 3 background: #fff;
3 position: fixed; 4 position: fixed;
4 top: 0; 5 top: 0;
5 - right: 640rem / $pxConvertRem;  
6 bottom: 0; 6 bottom: 0;
7 - left: 0; 7 + // left: 0;
  8 + right: 640rem / $pxConvertRem;
  9 + width: 540rem / $pxConvertRem;
8 z-index: -1; 10 z-index: -1;
9 overflow: hidden; 11 overflow: hidden;
10 @include transition(right .3s); 12 @include transition(right .3s);
@@ -115,8 +117,9 @@ @@ -115,8 +117,9 @@
115 bottom: 0; 117 bottom: 0;
116 top: 0; 118 top: 0;
117 left: 0; 119 left: 0;
118 - width: 100%; 120 + width: 540rem / $pxConvertRem;
119 background: #fff !important; 121 background: #fff !important;
  122 + overflow: hidden;
120 123
121 @include transform(translateX(540rem / $pxConvertRem)); 124 @include transform(translateX(540rem / $pxConvertRem));
122 @include transition(transform 0.3s); 125 @include transition(transform 0.3s);
1 .search-page { 1 .search-page {
2 .search-input { 2 .search-input {
3 position: relative; 3 position: relative;
4 - padding: 7px 46px 7px 15px; 4 + padding: 7px 98px 7px 15px;
5 background: #f8f8f8; 5 background: #f8f8f8;
6 6
7 .search-icon { 7 .search-icon {
@@ -16,7 +16,7 @@ @@ -16,7 +16,7 @@
16 height: 30px; 16 height: 30px;
17 width: 100%; 17 width: 100%;
18 border-radius: 15px; 18 border-radius: 15px;
19 - text-indent: 26px; 19 + padding: 0 26px;
20 background: #fff; 20 background: #fff;
21 border: none; 21 border: none;
22 } 22 }
@@ -15,18 +15,6 @@ @@ -15,18 +15,6 @@
15 <div class="swiper-pagination"></div> 15 <div class="swiper-pagination"></div>
16 </div> 16 </div>
17 17
18 - {{# authorInfo}}  
19 - <div id="author-infos" class="editor-header clearfix" data-id={{id}}>  
20 - <div class="avatar">  
21 - <img src="{{avatar}}">  
22 - </div>  
23 - <div class="text">  
24 - <p class="name">{{name}}</p>  
25 - <p class="info">{{info}}</p>  
26 - </div>  
27 - </div>  
28 - {{/ authorInfo}}  
29 -  
30 <ul id="guang-nav" class="guang-nav clearfix"> 18 <ul id="guang-nav" class="guang-nav clearfix">
31 {{# navs}} 19 {{# navs}}
32 <li class="guang-nav-item {{#focus}}focus{{/focus}}" data-type={{typeId}}> 20 <li class="guang-nav-item {{#focus}}focus{{/focus}}" data-type={{typeId}}>
1 {{> layout/header}} 1 {{> layout/header}}
2 <div class="guang-list-page guang-page yoho-page"> 2 <div class="guang-list-page guang-page yoho-page">
3 {{# guang}} 3 {{# guang}}
4 - {{# author}} 4 + {{# authorInfo}}
5 <div id="author-infos" class="editor-header clearfix" data-id={{id}}> 5 <div id="author-infos" class="editor-header clearfix" data-id={{id}}>
6 <div class="avatar"> 6 <div class="avatar">
7 <img src="{{avatar}}"> 7 <img src="{{avatar}}">
@@ -11,7 +11,7 @@ @@ -11,7 +11,7 @@
11 <p class="info">{{info}}</p> 11 <p class="info">{{info}}</p>
12 </div> 12 </div>
13 </div> 13 </div>
14 - {{/ author}} 14 + {{/ authorInfo}}
15 15
16 <div id="info-list" class="info-list"> 16 <div id="info-list" class="info-list">
17 {{# infos}} 17 {{# infos}}