...
|
...
|
@@ -13,9 +13,9 @@ var goodsSwiper, |
|
|
// winH = $(window).height(),
|
|
|
sizeSwiper,
|
|
|
refSwiper,
|
|
|
commentsNum,
|
|
|
handleHelper;
|
|
|
|
|
|
|
|
|
lazyLoad($('img.lazy'));
|
|
|
|
|
|
goodsSwiper = new Swiper('.banner-swiper', {
|
...
|
...
|
@@ -28,22 +28,56 @@ goodsSwiper = new Swiper('.banner-swiper', { |
|
|
prevButton: '.my-swiper-button-prev'
|
|
|
});
|
|
|
|
|
|
//初始化tab
|
|
|
(function() {
|
|
|
var consultsNum = $('#nav-tab .consults-num').html() - 0;
|
|
|
|
|
|
$('#nav-tab li').on('click', function() {
|
|
|
var index = $(this).index();
|
|
|
|
|
|
commentsNum = $('#nav-tab .comments-num').html() - 0;
|
|
|
|
|
|
if (!$(this).hasClass('focus')) {
|
|
|
$('#nav-tab li').each(function() {
|
|
|
$(this).removeClass('focus');
|
|
|
});
|
|
|
|
|
|
$('#feedback-content .content').each(function() {
|
|
|
$(this).addClass('hide');
|
|
|
});
|
|
|
if (0 !== commentsNum) {
|
|
|
$('#nav-tab .comment-nav').addClass('focus');
|
|
|
$('#feedback-content .comment-content').removeClass('hide');
|
|
|
|
|
|
} else if (0 !== consultsNum) {
|
|
|
$('#nav-tab .consult-nav').addClass('focus');
|
|
|
$('#feedback-content .consult-content').removeClass('hide');
|
|
|
}
|
|
|
})();
|
|
|
|
|
|
$('#nav-tab li').each(function() {
|
|
|
$(this).removeClass('focus');
|
|
|
});
|
|
|
$('#feedback-content .content').each(function() {
|
|
|
$(this).addClass('hide');
|
|
|
});
|
|
|
$('#nav-tab li').on('click', function() {
|
|
|
var index = $(this).index();
|
|
|
|
|
|
if ($(this).hasClass('comment-nav') && 0 === commentsNum) {
|
|
|
alert('暂无商品评价');
|
|
|
} else {
|
|
|
if (!$(this).hasClass('focus')) {
|
|
|
|
|
|
$('#nav-tab li').each(function() {
|
|
|
$(this).removeClass('focus');
|
|
|
});
|
|
|
$('#feedback-content .content').each(function() {
|
|
|
$(this).addClass('hide');
|
|
|
});
|
|
|
|
|
|
$(this).addClass('focus');
|
|
|
$('#feedback-content .content:eq(' + index + ')').removeClass('hide');
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
|
|
|
$(this).addClass('focus');
|
|
|
$('#feedback-content .content:eq(' + index + ')').removeClass('hide');
|
|
|
$('.goodsDiscount .dropdown').on('click', function() {
|
|
|
if ($('.goodsDiscount .discount-folder').is(':hidden')) {
|
|
|
$('.goodsDiscount .discount-folder').slideDown();
|
|
|
} else {
|
|
|
$('.goodsDiscount .discount-folder').slideUp();
|
|
|
}
|
|
|
});
|
|
|
|
...
|
...
|
|