Authored by 沈志敏

Merge branch 'release/wap-optim' of git.yoho.cn:fe/yohobuywap-node into release/wap-optim

{{# shopIndex}}
<div class="shop-index yoho-page scroll-wrapper" id="wrapper">
<div class="shop-index yoho-page scroll-wrapper new-shop" id="wrapper">
<div id="scroller">
<div id="nav-top">
... ... @@ -54,9 +54,7 @@
<div id="home-page" class="main">
<div id="nav-main" class="nav-main">
<!-- 优惠卷 -->
{{#if shopCoupons}}
{{> shop/shop-coupon}}
{{/if}}
<div class="coupon-group"></div>
<!-- 大导航 -->
{{#if brandList}}
... ...
... ... @@ -115,7 +115,7 @@ var defaultOpt = require('../common/query-param');
channel: defaultOpt.channel
},
success: function(data) {
$goodsContainer.append(data);
$('.shop-index').after(data);
// 初始化filter&注册filter回调
filter.initFilter({
... ... @@ -344,10 +344,13 @@ function tabChange(dom, index) {
// 首页导航
(function(nav, posNav, main) {
var scrollToNav1 = function() {
setTimeout(function(){
window.scrollTo(0, $('#nav').offset().top + 5);
}, 100)
};
$(nav + ' li, ' + posNav + ' li').not('li.all-goods').on('touchstart', function() {
var isPos = $(this).parent().attr('id') === 'pos-nav';
var index = $(this).index(),
activeTab = $(this).attr('tab');
... ... @@ -362,17 +365,17 @@ function tabChange(dom, index) {
$('#' + activeTab).fadeIn();
if (activeTab === 'new-arrival') {
toTop = true;
newData(scrollToNav1);
newData(isPos ? scrollToNav1 : function() {});
viewType = 2;
} else if (activeTab === 'popularity') {
toTop = true;
hotData(scrollToNav1);
hotData(isPos ? scrollToNav1 : function() {});
viewType = 3;
} else if (activeTab === 'home-page') {
$nav1.removeClass('fixed-top absolute');
$nav2.removeClass('fixed-top absolute');
viewType = 1;
scrollToNav1();
isPos && scrollToNav1();
}
scH = $('#scroller').outerHeight();
});
... ... @@ -742,6 +745,7 @@ $newList.on('touchstart', 'li', function(e) {
}, function() {
});
}
e.stopPropagation();
});
... ... @@ -753,7 +757,9 @@ $(document).on('touchstart', function(e) {
}
});
function subNavScrollTo() {
setTimeout(function() {
window.scrollTo(0, $('#list-nav').offset().top + 5);
}, 100)
}
$subNav.on('touchend touchcancel', function(e) {
var $this = $(e.target).closest('li'),
... ... @@ -910,7 +916,6 @@ $subNav.on('touchend touchcancel', function(e) {
url: '/product/search/search',
nextPage: false
}, function() {
subNavScrollTo();
});
}
}
... ...
... ... @@ -10,7 +10,7 @@ shopCoupon = {
common: {
appVersion: window.queryString.app_version || window.queryString.appVersion,
uid: window.queryString.uid,
shopId: parseInt($('.shop-id').val(), 10) || null,
shopId: parseInt($('.shop-id').val() || $('.shopId').val(), 10) || null,
brandId: parseInt($('.brand-header').data('id'), 10) || null,
couponTemplate: require('product/shop/coupon.hbs')
},
... ...
.shop-index {
/*position: absolute;
position: absolute;
top: 0;
bottom: 0;
left: 0;
right: 0;
overflow: hidden;*/
overflow: hidden;
&.new-shop {
position: initial;
overflow: initial;
#pos-nav, #pos-list {
position: fixed;
left: 0;
top: 0;
}
.nav {
li {
height: 100%;
line-height: 100%;
margin-top: 0px;
border-left: none;
.text {
display: block;
width: 100%;
border-left: 1px solid #e0e0e0;
margin-top: 30px;
height: 28px;
}
&:first-child {
.text {
border-left: none;
}
}
}
}
.shop-foot-wrapper {
position: fixed;
left: 0;
}
}
.nav-main {
margin-bottom: 30px;
}
... ... @@ -90,25 +120,18 @@
li{
display: block;
height: 100%;
line-height: 100%;
height: 28px;
float: left;
line-height: 28px;
width: 24.7%;
text-align: center;
border-sizing: border-box;
color: #b0b0b0;
.text {
display: block;
width: 100%;
border-left: 1px solid #e0e0e0;
margin-top: 30px;
height: 28px;
}
border-sizing: border-box;
color: #b0b0b0;
&:first-child {
border-left: none;
.text {
border-left: none;
}
}
a {
... ... @@ -417,9 +440,8 @@
}
.shop-foot-wrapper {
position: fixed;
position: absolute;
bottom: 0;
left: 0;
display: table;
width: 100%;
height: 88px;
... ... @@ -623,9 +645,9 @@
}
.shop-index + .filter-mask {
margin-top: 1px;
.filter-body {
top: 1px;
overflow: auto;
}
... ... @@ -634,6 +656,15 @@
}
&.call-by-fix {
top: 78px;
}
}
.new-shop + .filter-mask {
margin-top: initial;
position: fixed;
top: 46px;
&.call-by-fix {
top: 80px;
position: fixed;
left: 0;
... ...
... ... @@ -22,4 +22,7 @@
@import "product/search/list";
@import "product/sale/sale";
@import "product/shop/shop-index";
@import "product/shop/shop-prodfile";
@import "product/shop/product-category";
@import "product/shop/shop-index-coupon";
@import "home/hot-category";
... ...