Authored by mark

商品详情页 评论和顾客咨询

... ... @@ -265,9 +265,8 @@
<div class="consult-comment info-block">
<p class="block-title">
<span class="title cur">购买评价(<em class="comment-num">0</em></span>
<span class="sep">|</span>
<span class="title">顾客咨询(<em class="consult-num">0</em></span>
<span class="title cur">商品评价 Customer Reviews</span>
</p>
<div class="comments cc-content">
<div class="comment-tabs clearfix">
... ... @@ -301,6 +300,28 @@
</p>
</div>
</div>
{{/ consultComment}}
{{# consultComment}}
<div class="lazy-load-object">
<textarea class="datalazyload" style="visibility: hidden;">
<script>
fetchComment();
fetchReturn();
loadRecommend();
</script>
</textarea>
</div>
<div class="consult-comment info-block">
<p class="block-title">
<span class="title cur">常见咨询 Q&amp;A</span>
</p>
<div class="consults cc-content">
<h2>顾客咨询(<em class="consult-num">0</em></h2>
<ul id="consults-ul"></ul>
... ...
... ... @@ -897,39 +897,49 @@ function fetchComment() {
});
}
// 评价和咨询切换
$('.consult-comment').on('click', '.title', function() {
var $this = $(this),
index = $this.index();
var $comments = $('.comments'),
$consults = $('.consults');
if ($this.hasClass('cur')) {
return;
}
$this.addClass('cur');
$this.siblings('.cur').removeClass('cur');
if (index !== 0) {
// 咨询
$consults.slideDown(SLIDETIME);
$comments.slideUp(SLIDETIME);
} else {
$consults.slideUp(SLIDETIME);
$comments.slideDown(SLIDETIME);
}
}).on('click', '.load-more', function() {
var $this = $(this);
if ($this.hasClass('load-more-comments')) {
loadAllComments(currentType);
} else {
loadConsults();
}
});
// $('.consult-comment').on('click', '.title', function() {
// var $this = $(this),
// index = $this.index();
//
// var $comments = $('.comments'),
// $consults = $('.consults');
//
// if ($this.hasClass('cur')) {
// return;
// }
//
// $this.addClass('cur');
// $this.siblings('.cur').removeClass('cur');
//
// if (index !== 0) {
//
// // 咨询
// $consults.slideDown(SLIDETIME);
// $comments.slideUp(SLIDETIME);
// } else {
// $consults.slideUp(SLIDETIME);
// $comments.slideDown(SLIDETIME);
// }
// }).on('click', '.load-more', function() {
// var $this = $(this);
//
// if ($this.hasClass('load-more-comments')) {
// loadAllComments(currentType);
// } else {
// loadConsults();
// }
// });
$('.consult-comment').on('click', '.load-more', function() {
var $this = $(this);
if ($this.hasClass('load-more-comments')) {
loadAllComments(currentType);
} else {
loadConsults();
}
});
// 我要咨询
$('#consults-btn').click(function() {
... ...
... ... @@ -886,15 +886,15 @@
}
}
.consults {
/*.consults {
display: none;
}
}*/
.consult-comment .title {
color: #666;
&.cur {
color: #666;
color: #000;
}
}
... ... @@ -1095,9 +1095,9 @@
line-height: 1.5;
}
.consults {
/*.consults {
display: none;
}
}*/
&.comments {
h2 {
... ...