...
|
...
|
@@ -745,7 +745,8 @@ lazyLoad($('#details-html img')); |
|
|
function fetchComment() {
|
|
|
var commentPage = {}, // 每个类型的分页页码
|
|
|
currentType = '7', // 当前评论展示的类型
|
|
|
consultPage = 1;
|
|
|
consultPage = 1,
|
|
|
cNumReady = false; // 只第一次请求后更新数量
|
|
|
|
|
|
var commentsTpl = require('hbs/product/comment-item.hbs'),
|
|
|
consultsTpl = require('hbs/product/consult-item.hbs'),
|
...
|
...
|
@@ -790,15 +791,19 @@ function fetchComment() { |
|
|
|
|
|
// 更新总数显示
|
|
|
// $commentNum.text(res[0].total);
|
|
|
$(filter).each(function(idx, fit) {
|
|
|
if (fit.num) {
|
|
|
$('.comments [data-comment-type=' + fit.filterId + '] em').text(fit.num);
|
|
|
|
|
|
if (fit.filterId === '7') { // 全部数量
|
|
|
$('.consult-comment .block-title .comment-num').text(fit.num);
|
|
|
if (filter && filter.length && !cNumReady) {
|
|
|
cNumReady = true;
|
|
|
$(filter).each(function(idx, fit) {
|
|
|
if (fit.num) {
|
|
|
$('.comments [data-comment-type=' + fit.filterId + '] em').text(fit.num);
|
|
|
|
|
|
if (fit.filterId === '7') { // 全部数量
|
|
|
$('.consult-comment .block-title .comment-num').text(fit.num);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
});
|
|
|
}
|
|
|
|
|
|
$ul.append(commentsTpl({
|
|
|
comments: res
|
...
|
...
|
|