Authored by Rock Zhang

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

framework @ 75bbc3b0
1 -Subproject commit 119c247f5cf929aa1e059e40609bb16dd6b58f05 1 +Subproject commit 75bbc3b075de19f239532f60c5995d06c5f814e2
@@ -12,9 +12,9 @@ var $ = require('jquery'), @@ -12,9 +12,9 @@ var $ = require('jquery'),
12 var swiper, 12 var swiper,
13 $brandList = $('.brand-list'); 13 $brandList = $('.brand-list');
14 14
15 -var searchH = $('.newbrand-search').height(),  
16 - headerH = $('.yoho-header').height(),  
17 - brandSwipe = parseInt(searchH) + parseInt(headerH); 15 +var searchH = $('.newbrand-search').outerHeight(),
  16 + headerH = $('.yoho-header').outerHeight(),
  17 + brandSwipe = parseInt(searchH) + parseInt(headerH) - 1;
18 18
19 var myHammer; 19 var myHammer;
20 20
  1 +/**
  2 + * 频道选择页面顶部搜索
  3 + * @author: bikai<kai.bi@yoho.cn>
  4 + * @date: 2015/10/28
  5 + */
  6 +var $ = require('jquery');
  7 +
  8 +var $searchBox = $('.search-box'),
  9 + $indexSearch = $('.index-search'),
  10 + $indexLogo = $('.index-logo');
  11 +
  12 +$searchBox.find('input').on('focus', function () {
  13 + $indexLogo.css({
  14 + width: 0,
  15 + display: 'none'
  16 + });
  17 + $searchBox.css({
  18 + width: '12.8rem'
  19 + });
  20 + $indexSearch.css({
  21 + width: '15.5rem'
  22 + });
  23 + $('.clear-text, .no-search').show();
  24 +}).on('blur', function () {
  25 + $indexLogo.css({
  26 + width: '5.4rem',
  27 + display: 'block'
  28 + });
  29 + $searchBox.css({
  30 + width: '8.8rem'
  31 + });
  32 + $indexSearch.css({
  33 + width: '9.6rem'
  34 + });
  35 + $('.clear-text, .no-search').hide();
  36 +});
  37 +
  38 +$searchBox.find('.clear-text').click(function () {
  39 + $searchBox.find('input').val('').trigger('focus');
  40 +});
  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 () {
  48 + $indexSearch.submit();
  49 +});
  50 +
  51 +// searchIconHammer = new Hammer($searchBox.find('.search-icon')[0]);
  52 +// searchIconHammer.on('tap', function(e) {
  53 +// $indexSearch.submit();
  54 +// });
@@ -7,10 +7,6 @@ @@ -7,10 +7,6 @@
7 var $ = require('jquery'), 7 var $ = require('jquery'),
8 Hammer = require('hammer'); 8 Hammer = require('hammer');
9 9
10 -var $searchBox = $('.search-box'),  
11 - $indexSearch = $('.index-search'),  
12 - $indexLogo = $('.index-logo');  
13 -  
14 var floatLayerCloseHammer, floatLayerBtnHammer; 10 var floatLayerCloseHammer, floatLayerBtnHammer;
15 11
16 function downLoadApp() { 12 function downLoadApp() {
@@ -37,8 +33,9 @@ function downLoadApp() { @@ -37,8 +33,9 @@ function downLoadApp() {
37 // }); 33 // });
38 // }); 34 // });
39 35
40 -floatLayerCloseHammer = new Hammer($('#float-layer-close')[0]);  
41 -floatLayerCloseHammer.on('tap', function(e) { 36 +if ($('#float-layer-close') && $('#float-layer-close')[0]) {
  37 + floatLayerCloseHammer = new Hammer($('#float-layer-close')[0]);
  38 + floatLayerCloseHammer.on('tap', function(e) {
42 $('#float-layer-app').hide(); 39 $('#float-layer-app').hide();
43 window.setCookie('_float-layer-app', 'id490655927', 40 window.setCookie('_float-layer-app', 'id490655927',
44 { 41 {
@@ -49,69 +46,22 @@ floatLayerCloseHammer.on('tap', function(e) { @@ -49,69 +46,22 @@ floatLayerCloseHammer.on('tap', function(e) {
49 domain: '.yohobuy.com', 46 domain: '.yohobuy.com',
50 expires: 1 47 expires: 1
51 }); 48 });
52 -}); 49 + });
  50 +}
53 51
54 // $('#float-layer-btn').tap(function () { 52 // $('#float-layer-btn').tap(function () {
55 // downLoadApp('bottom'); 53 // downLoadApp('bottom');
56 // }); 54 // });
57 55
58 -floatLayerBtnHammer = new Hammer($('#float-layer-btn')[0]);  
59 -floatLayerBtnHammer.on('tap', function(e) { 56 +if ($('#float-layer-btn') && $('#float-layer-btn')[0]) {
  57 + floatLayerBtnHammer = new Hammer($('#float-layer-btn')[0]);
  58 + floatLayerBtnHammer.on('tap', function(e) {
60 downLoadApp('bottom'); 59 downLoadApp('bottom');
61 -}); 60 + });
62 61
63 -if (!window.cookie('_float-layer-app')) { 62 + if (!window.cookie('_float-layer-app')) {
64 $('#float-layer-app').show(); 63 $('#float-layer-app').show();
65 -} else { 64 + } else {
66 $('#float-layer-app').hide(); 65 $('#float-layer-app').hide();
  66 + }
67 } 67 }
68 -  
69 -/**  
70 - * 频道选择页面顶部搜索  
71 - * @author: bikai<kai.bi@yoho.cn>  
72 - * @date: 2015/10/28  
73 - */  
74 -  
75 -$searchBox.find('input').on('focus', function () {  
76 - $indexLogo.css({  
77 - width: 0,  
78 - display: 'none'  
79 - });  
80 - $searchBox.css({  
81 - width: '12.8rem'  
82 - });  
83 - $indexSearch.css({  
84 - width: '15.5rem'  
85 - });  
86 - $('.clear-text, .no-search').show();  
87 -}).on('blur', function () {  
88 - $indexLogo.css({  
89 - width: '5.4rem',  
90 - display: 'block'  
91 - });  
92 - $searchBox.css({  
93 - width: '8.8rem'  
94 - });  
95 - $indexSearch.css({  
96 - width: '9.6rem'  
97 - });  
98 - $('.clear-text, .no-search').hide();  
99 -});  
100 -  
101 -$searchBox.find('.clear-text').click(function () {  
102 - $searchBox.find('input').val('').trigger('focus');  
103 -});  
104 -  
105 -// clearTextHammer = new Hammer($searchBox.find('.clear-text')[0]);  
106 -// clearTextHammer.on('tap', function(e) {  
107 -// $searchBox.find('input').val('').trigger('focus');  
108 -// });  
109 -  
110 -$searchBox.find('.search-icon').click(function () {  
111 - $indexSearch.submit();  
112 -});  
113 -  
114 -// searchIconHammer = new Hammer($searchBox.find('.search-icon')[0]);  
115 -// searchIconHammer.on('tap', function(e) {  
116 -// $indexSearch.submit();  
117 -// });  
@@ -85,7 +85,7 @@ @@ -85,7 +85,7 @@
85 font-size: 22rem / $pxConvertRem; 85 font-size: 22rem / $pxConvertRem;
86 } 86 }
87 } 87 }
88 - li:nth-child(4), li:nth-child(5) {  
89 - border-top: 1px solid #e0e0e0;  
90 - } 88 + // li:nth-child(4), li:nth-child(5) {
  89 + // border-top: 1px solid #e0e0e0;
  90 + // }
91 } 91 }
@@ -7,7 +7,7 @@ @@ -7,7 +7,7 @@
7 img { 7 img {
8 display: block; 8 display: block;
9 width: 100%; 9 width: 100%;
10 - height: 100%; 10 + height: 198rem / $pxConvertRem;
11 } 11 }
12 } 12 }
13 .category-list { 13 .category-list {
@@ -16,7 +16,7 @@ @@ -16,7 +16,7 @@
16 li { 16 li {
17 float: left; 17 float: left;
18 width: 158rem / $pxConvertRem; 18 width: 158rem / $pxConvertRem;
19 - height: 174rem / $pxConvertRem; 19 + height: 154rem / $pxConvertRem;
20 border-top: 1px solid #e0e0e0; 20 border-top: 1px solid #e0e0e0;
21 border-left: 1px solid #e0e0e0; 21 border-left: 1px solid #e0e0e0;
22 overflow: hidden; 22 overflow: hidden;
@@ -24,7 +24,7 @@ @@ -24,7 +24,7 @@
24 .img-box { 24 .img-box {
25 width: 100%; 25 width: 100%;
26 height: 100%; 26 height: 100%;
27 - line-height: 174rem / $pxConvertRem; 27 + line-height: 154rem / $pxConvertRem;
28 text-align: center; 28 text-align: center;
29 overflow: hidden; 29 overflow: hidden;
30 font-size: 0; 30 font-size: 0;
@@ -36,7 +36,7 @@ @@ -36,7 +36,7 @@
36 height: 44px; 36 height: 44px;
37 text-align: center; 37 text-align: center;
38 color: #fff; 38 color: #fff;
39 - background-color: #000; 39 + background-image: linear-gradient(#323232, #0f0f0f);
40 border-radius: 10px; 40 border-radius: 10px;
41 } 41 }
42 } 42 }
1 -@import "new-arrival", "discount", "list", "detail";  
  1 +@import "new-arrival", "discount", "list", "detail", "suspend-cart";
  1 +.suspend-cart {
  2 + position: fixed;
  3 + width: 44px;
  4 + height: 44px;
  5 + line-height: 44px;
  6 + border-radius: 50%;
  7 + background: rgba(0,0,0,0.3);
  8 + text-align: center;
  9 + right: 15px;
  10 + bottom: 70px;
  11 + z-index: 10;
  12 +
  13 + .iconfont {
  14 + color: #fff;
  15 + font-size: 22px;
  16 + }
  17 +
  18 + .cart-count {
  19 + position: absolute;
  20 + width: 18px;
  21 + height: 18px;
  22 + line-height: 18px;
  23 + border-radius: 50%;
  24 + background: #f00;
  25 + top: 0;
  26 + right: 0;
  27 + color: #fff;
  28 + }
  29 +}
@@ -2,7 +2,7 @@ @@ -2,7 +2,7 @@
2 {{> home/floor_header}} 2 {{> home/floor_header}}
3 3
4 {{# banner}} 4 {{# banner}}
5 - <a class="banner" href="{{url}}"> 5 + <a class="category-banner" href="{{url}}">
6 <img class="lazy" data-original="{{img}}"> 6 <img class="lazy" data-original="{{img}}">
7 </a> 7 </a>
8 {{/ banner}} 8 {{/ banner}}
@@ -13,7 +13,6 @@ @@ -13,7 +13,6 @@
13 <div class="img-box"> 13 <div class="img-box">
14 <img class="lazy" data-original="{{img}}" alt=""> 14 <img class="lazy" data-original="{{img}}" alt="">
15 </div> 15 </div>
16 - <p class="category-title">{{textCn}}</p>  
17 </a> 16 </a>
18 </li> 17 </li>
19 {{/ list}} 18 {{/ list}}
@@ -89,6 +89,7 @@ @@ -89,6 +89,7 @@
89 {{!-- 频道选择页 --}} 89 {{!-- 频道选择页 --}}
90 {{#if channelPage}} 90 {{#if channelPage}}
91 <script> 91 <script>
  92 + seajs.use('js/index/channel');
92 seajs.use('js/index/footer'); 93 seajs.use('js/index/footer');
93 </script> 94 </script>
94 {{/if}} 95 {{/if}}
@@ -120,4 +120,6 @@ @@ -120,4 +120,6 @@
120 {{#if query}} 120 {{#if query}}
121 <input id="query" type="hidden" value={{query}}> 121 <input id="query" type="hidden" value={{query}}>
122 {{/if}} 122 {{/if}}
  123 +
  124 + {{> product/suspend-cart}}
123 {{/ goodList}} 125 {{/ goodList}}
  1 +<div id="suspend-cart" class="suspend-cart">
  2 + <a href={{cartUrl}}>
  3 + <span class="iconfont">&#xe62c;</span>
  4 + </a>
  5 + <span class="cart-count hide">1</span>
  6 +</div>