Authored by Lynnic

更新

@@ -30,21 +30,23 @@ goodsSwiper = new Swiper('.banner-swiper', { @@ -30,21 +30,23 @@ goodsSwiper = new Swiper('.banner-swiper', {
30 30
31 //初始化tab 31 //初始化tab
32 (function() { 32 (function() {
33 - commentsNum = $('#nav-tab .comments-num').html()-0;  
34 - var consultsNum = $('#nav-tab .consults-num').html()-0; 33 + var consultsNum = $('#nav-tab .consults-num').html() - 0;
  34 +
  35 +
  36 + commentsNum = $('#nav-tab .comments-num').html() - 0;
35 37
36 $('#nav-tab li').each(function() { 38 $('#nav-tab li').each(function() {
37 $(this).removeClass('focus'); 39 $(this).removeClass('focus');
38 - }); 40 + });
39 41
40 $('#feedback-content .content').each(function() { 42 $('#feedback-content .content').each(function() {
41 - $(this).addClass('hide'); 43 + $(this).addClass('hide');
42 }); 44 });
43 - if(0!=commentsNum) { 45 + if (0 !== commentsNum) {
44 $('#nav-tab .comment-nav').addClass('focus'); 46 $('#nav-tab .comment-nav').addClass('focus');
45 $('#feedback-content .comment-content').removeClass('hide'); 47 $('#feedback-content .comment-content').removeClass('hide');
46 48
47 - }else if(0!=consultsNum) { 49 + } else if (0 !== consultsNum) {
48 $('#nav-tab .consult-nav').addClass('focus'); 50 $('#nav-tab .consult-nav').addClass('focus');
49 $('#feedback-content .consult-content').removeClass('hide'); 51 $('#feedback-content .consult-content').removeClass('hide');
50 } 52 }
@@ -53,9 +55,9 @@ goodsSwiper = new Swiper('.banner-swiper', { @@ -53,9 +55,9 @@ goodsSwiper = new Swiper('.banner-swiper', {
53 $('#nav-tab li').on('click', function() { 55 $('#nav-tab li').on('click', function() {
54 var index = $(this).index(); 56 var index = $(this).index();
55 57
56 - if($(this).hasClass('comment-nav')&&0==commentsNum) { 58 + if ($(this).hasClass('comment-nav') && 0 === commentsNum) {
57 alert('暂无商品评价'); 59 alert('暂无商品评价');
58 - }else{ 60 + } else {
59 if (!$(this).hasClass('focus')) { 61 if (!$(this).hasClass('focus')) {
60 62
61 $('#nav-tab li').each(function() { 63 $('#nav-tab li').each(function() {
@@ -67,14 +69,14 @@ $('#nav-tab li').on('click', function() { @@ -67,14 +69,14 @@ $('#nav-tab li').on('click', function() {
67 69
68 $(this).addClass('focus'); 70 $(this).addClass('focus');
69 $('#feedback-content .content:eq(' + index + ')').removeClass('hide'); 71 $('#feedback-content .content:eq(' + index + ')').removeClass('hide');
70 - } 72 + }
71 } 73 }
72 }); 74 });
73 75
74 -$('.goodsDiscount .dropdown').on('click',function() {  
75 - if($('.goodsDiscount .discount-folder').is(':hidden')) { 76 +$('.goodsDiscount .dropdown').on('click', function() {
  77 + if ($('.goodsDiscount .discount-folder').is(':hidden')) {
76 $('.goodsDiscount .discount-folder').slideDown(); 78 $('.goodsDiscount .discount-folder').slideDown();
77 - }else{ 79 + } else {
78 $('.goodsDiscount .discount-folder').slideUp(); 80 $('.goodsDiscount .discount-folder').slideUp();
79 } 81 }
80 }); 82 });