Authored by 郭成尧

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

... ... @@ -3,66 +3,3 @@
* @author: xuqi<qi.xu@yoho.cn>
* @date: 2015/10/14
*/
var $ = require('jquery');
var $categoryContainer = $('.category-container'),
$contents = $categoryContainer.children('.content'),
$subLevelItem = $categoryContainer.find('.sub-level li'),
$primaryItem = $categoryContainer.find('.primary-level li');
var $curContent = $contents.not('.hide');
//初始化container高度
(function() {
var $header = $('.yoho-header'),
$search = $('#search-input');
var h = $(window).height() - $header.outerHeight() - $search.outerHeight() - $nav.outerHeight();
$categoryContainer.css('min-height', h);
$contents.height(h);
}());
$('.category-container').bind('contextmenu', function(e) {
return false;
});
$categoryContainer.on('touchend', function(e) {
var $this = $(e.target),
$subLevel,
$cur, index;
$cur = $this.closest('.p-level-item');
if ($cur.length > 0) {
index = $cur.index();
$subLevel = $this.closest('.content').find('.sub-level');
if ($this.hasClass('focus')) {
return;
}
$this.closest('.primary-level').children('.focus').removeClass('focus');
$this.addClass('focus');
$subLevel.not('.hide').addClass('hide');
$subLevel.eq(index).removeClass('hide');
}
});
$categoryContainer.find('.primary-level').on('touchstart touchend touchcancel', 'li', function() {
$primaryItem.removeClass('highlight');
$(this).addClass('highlight');
}).on('touchend touchcancel', 'li', function() {
$(this).removeClass('highlight');
});
$categoryContainer.find('.sub-level').on('touchstart', 'li', function() {
$subLevelItem.removeClass('highlight');
$(this).addClass('highlight');
}).on('touchend touchcancel', 'li', function() {
$(this).removeClass('highlight');
});
\ No newline at end of file
... ...
.product-category {
font-size: 30rem / $pxConvertRem;
.allproduct {
position: relative;
padding: 15px 0px;
background: #f8f8f8;
border-top: 15px;
border-bottom: 15px;
}
.arrow-icon {
position: absolute;
font-size: 12px;
top: 15px;
right: 20px;
}
.allproductParagaraph {
font-size: 18px;
left: 20px;
}
.category-nav {
height: 70rem / $pxConvertRem;
border-bottom: 1px solid #e6e6e6;
... ...
{{> layout/header}}
<style>
.allproduct {
position: relative;
padding: 15px 0px;
background: #f8f8f8;
border-top: 15px;
border-bottom: 15px;
}
.arrow-icon {
position: absolute;
font-size: 12px;
top: 15px;
right: 20px;
}
.allproductParagaraph {
font-size: 18px;
left: 20px;
}
</style>
<div class="product-category yoho-page">
... ...
... ... @@ -344,6 +344,6 @@
{{!-- 品牌分类 --}}
{{#if productCategoryPage}}
<script>
seajs.use('js/prodcut/product-category');
seajs.use('js/product/product-category');
</script>
{{/if}}
\ No newline at end of file
... ...