Authored by 梁志锋

购物车有数据时 不需要请求为你优选数据

... ... @@ -22,9 +22,14 @@ var navHammer,
freebieHammer,
switchChose = false;
require('../product/recommend-for-you');
require('./good');
if ($('.cart-zero').length > 0) {
require('../product/recommend-for-you');
} else {
require('./good');
}
ellipsis.init();
function cartContentShow() {
... ...
... ... @@ -106,7 +106,7 @@ function updateConformButtonClassAndText() {
if (2 === $chosed.closest('.zero-stock').length) {
$('#chose-btn-sure').css('background-color', '#c0c0c0').html('已售罄');
} else {
$('#chose-btn-sure').css('background-color', '#eb0313').html('确定');
$('#chose-btn-sure').css('background-color', '#eb0313').html('加入购物车');
}
}
... ...
... ... @@ -28,8 +28,6 @@ var requestFrame,
var navHammer;
require('./maybe-like');
lazyLoad($('img.lazy'));
navHammer = new Hammer($('.nav-btn')[0]);
... ... @@ -39,13 +37,6 @@ navHammer.on('tap', function(event) {
$overlay.show().css('opacity', 0.3);
$sideNav.addClass('on');
//设置boy高宽,页面不能上下滑动
$('body').css({
height: $(window).height(),
width: $(window).width(),
overflow: 'hidden'
});
event.srcEvent.stopPropagation();
return false;
});
... ... @@ -56,10 +47,6 @@ function hideSideBar() {
$('.overlay').hide();
$('.sub-nav').removeClass('show');
$sideNav.removeClass('on');
$('body').css({
height: 'auto',
overflow: 'auto'
});
}
}
... ... @@ -68,6 +55,11 @@ $('.overlay').on('touchstart', function(e) {
return false;
});
//禁止在侧边栏可以上下滚动
$('.side-nav').on('touchmove', function() {
return false;
});
//点击一级导航,弹出二级导航
$sideNav.on('touchstart', 'li', function(e) {
if ($(this).find('.sub-nav').size() > 0) {
... ... @@ -161,28 +153,6 @@ $('.category-swiper').each(function(i, index) {
});
//logo动画
requestFrame = (function() {
var tempFunc = null,
prefixList = ['webkit', 'moz', 'ms'];
for (i = 0; i < prefixList.length; i++) {
thisFunc = prefixList[i] + 'RequestAnimationFrame';
if (window[thisFunc]) {
supportCss3 = true;
tempFunc = thisFunc;
}
}
if (supportCss3) {
return function(callback) {
window[tempFunc](callback);
};
}
return function(callback) {
window.setTimeout(callback, 67);
};
})();
function tsAnimate() {
start = start + 10;
$logotrans.css({
... ... @@ -205,9 +175,7 @@ function tsAnimate() {
if (start % 360 === 0) {
window.setTimeout(tsAnimate, 60 * 1000);
} else {
requestFrame(function() {
tsAnimate();
});
window.requestAnimationFrame(tsAnimate);
}
}
}
... ... @@ -230,3 +198,5 @@ exports.set = function(c) {
domain: '.m.yohobuy.com'
});
};
require('./maybe-like');
\ No newline at end of file
... ...
... ... @@ -63,7 +63,7 @@
</div>
</div>
<div class="btn-wrap">
<button id="chose-btn-sure" class="btn btn-sure">确定</button>
<button id="chose-btn-sure" class="btn btn-sure">加入购物车</button>
</div>
</div>
</div>
... ...