Authored by Rock Zhang

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

framework @ 75bbc3b0
Subproject commit 119c247f5cf929aa1e059e40609bb16dd6b58f05
Subproject commit 75bbc3b075de19f239532f60c5995d06c5f814e2
... ...
... ... @@ -12,9 +12,9 @@ var $ = require('jquery'),
var swiper,
$brandList = $('.brand-list');
var searchH = $('.newbrand-search').height(),
headerH = $('.yoho-header').height(),
brandSwipe = parseInt(searchH) + parseInt(headerH);
var searchH = $('.newbrand-search').outerHeight(),
headerH = $('.yoho-header').outerHeight(),
brandSwipe = parseInt(searchH) + parseInt(headerH) - 1;
var myHammer;
... ...
/**
* 频道选择页面顶部搜索
* @author: bikai<kai.bi@yoho.cn>
* @date: 2015/10/28
*/
var $ = require('jquery');
var $searchBox = $('.search-box'),
$indexSearch = $('.index-search'),
$indexLogo = $('.index-logo');
$searchBox.find('input').on('focus', function () {
$indexLogo.css({
width: 0,
display: 'none'
});
$searchBox.css({
width: '12.8rem'
});
$indexSearch.css({
width: '15.5rem'
});
$('.clear-text, .no-search').show();
}).on('blur', function () {
$indexLogo.css({
width: '5.4rem',
display: 'block'
});
$searchBox.css({
width: '8.8rem'
});
$indexSearch.css({
width: '9.6rem'
});
$('.clear-text, .no-search').hide();
});
$searchBox.find('.clear-text').click(function () {
$searchBox.find('input').val('').trigger('focus');
});
// clearTextHammer = new Hammer($searchBox.find('.clear-text')[0]);
// clearTextHammer.on('tap', function(e) {
// $searchBox.find('input').val('').trigger('focus');
// });
$searchBox.find('.search-icon').click(function () {
$indexSearch.submit();
});
// searchIconHammer = new Hammer($searchBox.find('.search-icon')[0]);
// searchIconHammer.on('tap', function(e) {
// $indexSearch.submit();
// });
\ No newline at end of file
... ...
... ... @@ -7,10 +7,6 @@
var $ = require('jquery'),
Hammer = require('hammer');
var $searchBox = $('.search-box'),
$indexSearch = $('.index-search'),
$indexLogo = $('.index-logo');
var floatLayerCloseHammer, floatLayerBtnHammer;
function downLoadApp() {
... ... @@ -37,8 +33,9 @@ function downLoadApp() {
// });
// });
floatLayerCloseHammer = new Hammer($('#float-layer-close')[0]);
floatLayerCloseHammer.on('tap', function(e) {
if ($('#float-layer-close') && $('#float-layer-close')[0]) {
floatLayerCloseHammer = new Hammer($('#float-layer-close')[0]);
floatLayerCloseHammer.on('tap', function(e) {
$('#float-layer-app').hide();
window.setCookie('_float-layer-app', 'id490655927',
{
... ... @@ -49,69 +46,22 @@ floatLayerCloseHammer.on('tap', function(e) {
domain: '.yohobuy.com',
expires: 1
});
});
});
}
// $('#float-layer-btn').tap(function () {
// downLoadApp('bottom');
// });
floatLayerBtnHammer = new Hammer($('#float-layer-btn')[0]);
floatLayerBtnHammer.on('tap', function(e) {
if ($('#float-layer-btn') && $('#float-layer-btn')[0]) {
floatLayerBtnHammer = new Hammer($('#float-layer-btn')[0]);
floatLayerBtnHammer.on('tap', function(e) {
downLoadApp('bottom');
});
});
if (!window.cookie('_float-layer-app')) {
if (!window.cookie('_float-layer-app')) {
$('#float-layer-app').show();
} else {
} else {
$('#float-layer-app').hide();
}
}
/**
* 频道选择页面顶部搜索
* @author: bikai<kai.bi@yoho.cn>
* @date: 2015/10/28
*/
$searchBox.find('input').on('focus', function () {
$indexLogo.css({
width: 0,
display: 'none'
});
$searchBox.css({
width: '12.8rem'
});
$indexSearch.css({
width: '15.5rem'
});
$('.clear-text, .no-search').show();
}).on('blur', function () {
$indexLogo.css({
width: '5.4rem',
display: 'block'
});
$searchBox.css({
width: '8.8rem'
});
$indexSearch.css({
width: '9.6rem'
});
$('.clear-text, .no-search').hide();
});
$searchBox.find('.clear-text').click(function () {
$searchBox.find('input').val('').trigger('focus');
});
// clearTextHammer = new Hammer($searchBox.find('.clear-text')[0]);
// clearTextHammer.on('tap', function(e) {
// $searchBox.find('input').val('').trigger('focus');
// });
$searchBox.find('.search-icon').click(function () {
$indexSearch.submit();
});
// searchIconHammer = new Hammer($searchBox.find('.search-icon')[0]);
// searchIconHammer.on('tap', function(e) {
// $indexSearch.submit();
// });
\ No newline at end of file
... ...
... ... @@ -85,7 +85,7 @@
font-size: 22rem / $pxConvertRem;
}
}
li:nth-child(4), li:nth-child(5) {
border-top: 1px solid #e0e0e0;
}
// li:nth-child(4), li:nth-child(5) {
// border-top: 1px solid #e0e0e0;
// }
}
\ No newline at end of file
... ...
... ... @@ -7,7 +7,7 @@
img {
display: block;
width: 100%;
height: 100%;
height: 198rem / $pxConvertRem;
}
}
.category-list {
... ... @@ -16,7 +16,7 @@
li {
float: left;
width: 158rem / $pxConvertRem;
height: 174rem / $pxConvertRem;
height: 154rem / $pxConvertRem;
border-top: 1px solid #e0e0e0;
border-left: 1px solid #e0e0e0;
overflow: hidden;
... ... @@ -24,7 +24,7 @@
.img-box {
width: 100%;
height: 100%;
line-height: 174rem / $pxConvertRem;
line-height: 154rem / $pxConvertRem;
text-align: center;
overflow: hidden;
font-size: 0;
... ...
... ... @@ -36,7 +36,7 @@
height: 44px;
text-align: center;
color: #fff;
background-color: #000;
background-image: linear-gradient(#323232, #0f0f0f);
border-radius: 10px;
}
}
... ...
@import "new-arrival", "discount", "list", "detail";
\ No newline at end of file
@import "new-arrival", "discount", "list", "detail", "suspend-cart";
\ No newline at end of file
... ...
.suspend-cart {
position: fixed;
width: 44px;
height: 44px;
line-height: 44px;
border-radius: 50%;
background: rgba(0,0,0,0.3);
text-align: center;
right: 15px;
bottom: 70px;
z-index: 10;
.iconfont {
color: #fff;
font-size: 22px;
}
.cart-count {
position: absolute;
width: 18px;
height: 18px;
line-height: 18px;
border-radius: 50%;
background: #f00;
top: 0;
right: 0;
color: #fff;
}
}
\ No newline at end of file
... ...
... ... @@ -2,7 +2,7 @@
{{> home/floor_header}}
{{# banner}}
<a class="banner" href="{{url}}">
<a class="category-banner" href="{{url}}">
<img class="lazy" data-original="{{img}}">
</a>
{{/ banner}}
... ... @@ -13,7 +13,6 @@
<div class="img-box">
<img class="lazy" data-original="{{img}}" alt="">
</div>
<p class="category-title">{{textCn}}</p>
</a>
</li>
{{/ list}}
... ...
... ... @@ -89,6 +89,7 @@
{{!-- 频道选择页 --}}
{{#if channelPage}}
<script>
seajs.use('js/index/channel');
seajs.use('js/index/footer');
</script>
{{/if}}
... ...
... ... @@ -120,4 +120,6 @@
{{#if query}}
<input id="query" type="hidden" value={{query}}>
{{/if}}
{{> product/suspend-cart}}
{{/ goodList}}
\ No newline at end of file
... ...
<div id="suspend-cart" class="suspend-cart">
<a href={{cartUrl}}>
<span class="iconfont">&#xe62c;</span>
</a>
<span class="cart-count hide">1</span>
</div>
\ No newline at end of file
... ...