Authored by biao

merge detail page update. code review by XWG

... ... @@ -12,13 +12,17 @@ var goodsSwiper,
$discountFolder = $('.goodsDiscount .discount-folder'),
$discountArrow = $('.goodsDiscount .first-item span');
var goodsDiscountHammer = new Hammer(document.getElementById('goodsDiscount'));
var goodsDiscountEl = document.getElementById('goodsDiscount'),
goodsDiscountHammer = goodsDiscountEl && new Hammer(goodsDiscountEl);
require('./desc');
require('./comments-consults');
//add extra marign-bottom for footer to show the yoho copyright
window.reMarginFooter('.cart-bar');
function showFooter() {
window.reMarginFooter('.cart-bar');
}
lazyLoad($('img.lazy'));
... ... @@ -40,7 +44,8 @@ if (0 === $('.goodsDiscount .discount-folder').children().length) {
}
//goods-discount下拉按钮点击事件
goodsDiscountHammer.on('tap', function(e) {
if (goodsDiscountHammer) {
goodsDiscountHammer.on('tap', function(e) {
if ($discountFolder.is(':hidden')) {
$discountArrow.removeClass('icon-down').addClass('icon-up').html('');
$discountFolder.slideDown();
... ... @@ -49,6 +54,9 @@ goodsDiscountHammer.on('tap', function(e) {
$discountFolder.slideUp();
}
return false;
});
});
}
require('./like');
$(document).ready(showFooter);
... ...