Authored by uedxwg

Merge branch 'develop' of http://git.dev.yoho.cn/web/yohobuy into develop

@@ -99,7 +99,11 @@ function thumbTouchEvt(e) { @@ -99,7 +99,11 @@ function thumbTouchEvt(e) {
99 } 99 }
100 100
101 if (isIphone) { 101 if (isIphone) {
  102 + if ($('.yoho-header').length > 0) {
  103 + $('#wrapper').addClass('ios has-head');
  104 + } else {
102 $('#wrapper').addClass('ios'); 105 $('#wrapper').addClass('ios');
  106 + }
103 } 107 }
104 108
105 ellipsis.init(); 109 ellipsis.init();
@@ -211,3 +211,10 @@ setTimeout(tsAnimate, 3000); @@ -211,3 +211,10 @@ setTimeout(tsAnimate, 3000);
211 $('#yoho-footer').css({ 211 $('#yoho-footer').css({
212 'margin-bottom': '2.5rem' 212 'margin-bottom': '2.5rem'
213 }); 213 });
  214 +
  215 +//set cookie
  216 +exports.set = function(c) {
  217 + window.setCookie('_Channel', c, {
  218 + expires: 365
  219 + });
  220 +};
@@ -9,49 +9,27 @@ var $searchBox = $('.search-box'), @@ -9,49 +9,27 @@ var $searchBox = $('.search-box'),
9 $indexSearch = $('.index-search'), 9 $indexSearch = $('.index-search'),
10 $indexLogo = $('.index-logo'); 10 $indexLogo = $('.index-logo');
11 11
  12 +var $search = $searchBox.children('input'),
  13 + $cancelSearch = $indexSearch.children('.no-search');
  14 +
12 require('../common'); 15 require('../common');
13 16
14 -function showBigSearch() {  
15 - $indexLogo.css({  
16 - opacity: 0  
17 - });  
18 - $searchBox.css({  
19 - width: '12.8rem'  
20 - });  
21 - $indexSearch.css({  
22 - width: '15.5rem'  
23 - });  
24 - $('.clear-text, .no-search').show();  
25 -}  
26 -  
27 -function hideBigSearch() {  
28 - $indexLogo.css({  
29 - opacity: 1  
30 - });  
31 - $searchBox.css({  
32 - width: '8.8rem'  
33 - });  
34 - $indexSearch.css({  
35 - width: '9.6rem'  
36 - });  
37 - $('.clear-text, .no-search').hide();  
38 -}  
39 -  
40 -$searchBox.find('input').on('focus', function() {  
41 - showBigSearch(); 17 +$search.on('focus', function() {
  18 + $indexSearch.addClass('action');
  19 + $indexLogo.addClass('action');
42 }); 20 });
43 21
44 -$searchBox.find('.clear-text').on('touchend', function() {  
45 - $searchBox.find('input').val('');  
46 -});  
47 -$searchBox.find('.search-icon').on('touchend', function() {  
48 - $indexSearch.submit(); 22 +$cancelSearch.on('touchstart', function() {
  23 + $indexSearch.removeClass('action');
  24 + $indexLogo.removeClass('action');
  25 +
  26 + $search.blur();
49 }); 27 });
50 28
51 -$('.no-search').on('touchend', function() {  
52 - $searchBox.find('input').val('');  
53 - hideBigSearch(); 29 +$searchBox.children('.clear-text').on('touchstart', function() {
  30 + $search.val('').focus();
54 }); 31 });
55 32
56 -// 底部计算有误  
57 -// window.rePosFooter && window.rePosFooter(); 33 +$searchBox.children('.search-icon').on('touchstart', function() {
  34 + $indexSearch.submit();
  35 +});
@@ -35,6 +35,10 @@ $clothes: sprite-map("guang/clothes/*.png"); @@ -35,6 +35,10 @@ $clothes: sprite-map("guang/clothes/*.png");
35 left: 0; 35 left: 0;
36 right: 0; 36 right: 0;
37 overflow: hidden; 37 overflow: hidden;
  38 +
  39 + &.has-head {
  40 + top: 90rem / $pxConvertRem;
  41 + }
38 } 42 }
39 43
40 .author { 44 .author {
@@ -15,6 +15,11 @@ @@ -15,6 +15,11 @@
15 color: #343434; 15 color: #343434;
16 opacity: 1; 16 opacity: 1;
17 transition: all 400ms; 17 transition: all 400ms;
  18 +
  19 + &.action {
  20 + opacity: 0;
  21 + width: 0;
  22 + }
18 } 23 }
19 24
20 .index-search { 25 .index-search {
@@ -27,6 +32,18 @@ @@ -27,6 +32,18 @@
27 overflow: hidden; 32 overflow: hidden;
28 z-index: 3; 33 z-index: 3;
29 @include transition(width .4s); 34 @include transition(width .4s);
  35 +
  36 + &.action {
  37 + width: 620rem / $pxConvertRem;
  38 + .no-search, .clear-text {
  39 + display: block;
  40 + }
  41 +
  42 + .search-box {
  43 + width: 512rem / $pxConvertRem;
  44 + }
  45 + }
  46 +
30 .search-box { 47 .search-box {
31 float: left; 48 float: left;
32 position: relative; 49 position: relative;
@@ -14,7 +14,7 @@ @@ -14,7 +14,7 @@
14 </form> 14 </form>
15 </div> 15 </div>
16 <div class="index-channel"> 16 <div class="index-channel">
17 - <img class="img" src="{{background}}" alt=""> 17 + <img class="img" src="{{background}}">
18 <div class="index-channel-list"> 18 <div class="index-channel-list">
19 <a href="/boys" class="list-item">男生 <span class="lighter">BOYS</span> <span class="iconfont right-icon">&#xe614;</span></a> 19 <a href="/boys" class="list-item">男生 <span class="lighter">BOYS</span> <span class="iconfont right-icon">&#xe614;</span></a>
20 <a href="/girls" class="list-item">女生 <span class="lighter">GIRLS</span> <span class="iconfont right-icon">&#xe614;</span></a> 20 <a href="/girls" class="list-item">女生 <span class="lighter">GIRLS</span> <span class="iconfont right-icon">&#xe614;</span></a>
@@ -96,25 +96,33 @@ @@ -96,25 +96,33 @@
96 {{!-- 首页 --}} 96 {{!-- 首页 --}}
97 {{#if grilsHomePage}} 97 {{#if grilsHomePage}}
98 <script> 98 <script>
99 - seajs.use('js/home/home'); 99 + seajs.use('js/home/home', function(h) {
  100 + h.set('girls');
  101 + });
100 seajs.use('js/index/footer'); 102 seajs.use('js/index/footer');
101 </script> 103 </script>
102 {{/if}} 104 {{/if}}
103 {{#if boysHomePage}} 105 {{#if boysHomePage}}
104 <script> 106 <script>
105 - seajs.use('js/home/home'); 107 + seajs.use('js/home/home', function(h) {
  108 + h.set('boys');
  109 + });
106 seajs.use('js/index/footer'); 110 seajs.use('js/index/footer');
107 </script> 111 </script>
108 {{/if}} 112 {{/if}}
109 {{#if kidsHomePage}} 113 {{#if kidsHomePage}}
110 <script> 114 <script>
111 - seajs.use('js/home/home'); 115 + seajs.use('js/home/home', function(h) {
  116 + h.set('kids');
  117 + });
112 seajs.use('js/index/footer'); 118 seajs.use('js/index/footer');
113 </script> 119 </script>
114 {{/if}} 120 {{/if}}
115 {{#if lifestyleHomePage}} 121 {{#if lifestyleHomePage}}
116 <script> 122 <script>
117 - seajs.use('js/home/home'); 123 + seajs.use('js/home/home', function(h) {
  124 + h.set('lifestyle');
  125 + });
118 seajs.use('js/index/footer'); 126 seajs.use('js/index/footer');
119 </script> 127 </script>
120 {{/if}} 128 {{/if}}