...
|
...
|
@@ -738,7 +738,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'),
|
...
|
...
|
@@ -783,6 +784,9 @@ function fetchComment() { |
|
|
|
|
|
// 更新总数显示
|
|
|
// $commentNum.text(res[0].total);
|
|
|
|
|
|
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);
|
...
|
...
|
@@ -792,6 +796,7 @@ function fetchComment() { |
|
|
}
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
|
|
|
$ul.append(commentsTpl({
|
|
|
comments: res
|
...
|
...
|
|