...
|
...
|
@@ -37,6 +37,11 @@ var oldtatus = { |
|
|
html: '<a class="coupon-btn">去使用</a>'
|
|
|
};
|
|
|
|
|
|
var commentType = {
|
|
|
PIC: 6,
|
|
|
ALL: 7
|
|
|
}
|
|
|
|
|
|
var $saleReturn = $('#saleReturn');
|
|
|
|
|
|
var dialogTpl = require('hbs/product/coupon-dialog.hbs');
|
...
|
...
|
@@ -717,8 +722,8 @@ function fetchComment() { |
|
|
var commentPage = 1,
|
|
|
consultPage = 1;
|
|
|
|
|
|
var commentsTpl = Handlebars.compile($('#comments-tpl').html()),
|
|
|
consultsTpl = Handlebars.compile($('#consults-tpl').html());
|
|
|
var commentsTpl = require('hbs/product/comment-item.hbs'),
|
|
|
consultsTpl = require('hbs/product/consult-item.hbs');
|
|
|
|
|
|
var $commentsUl = $('#comments-ul'),
|
|
|
$consultsUl = $('#consults-ul');
|
...
|
...
|
@@ -729,21 +734,26 @@ function fetchComment() { |
|
|
var loadingComments,
|
|
|
loadingConsults;
|
|
|
|
|
|
// 购买评价
|
|
|
function loadComments() {
|
|
|
function loadComments(type) {
|
|
|
if (loadingComments) {
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
loadingComments = true;
|
|
|
$.ajax({
|
|
|
return $.ajax({
|
|
|
type: 'GET',
|
|
|
url: '/product/detail/comment',
|
|
|
data: {
|
|
|
productId: id,
|
|
|
page: commentPage
|
|
|
page: commentPage,
|
|
|
filterId: type
|
|
|
}
|
|
|
}).then(function(data) {
|
|
|
});
|
|
|
}
|
|
|
|
|
|
// 购买评价
|
|
|
function loadAllComments() {
|
|
|
loadComments(commentType.ALL).then(function(data) {
|
|
|
var res;
|
|
|
|
|
|
if (data.code === 200) {
|
...
|
...
|
@@ -767,6 +777,13 @@ function fetchComment() { |
|
|
});
|
|
|
}
|
|
|
|
|
|
// 购买有图评价
|
|
|
function loadPicComments() {
|
|
|
loadComments(commentType.PIC).then(function(data){
|
|
|
|
|
|
});
|
|
|
}
|
|
|
|
|
|
// 顾客咨询
|
|
|
function loadConsults() {
|
|
|
if (loadingConsults) {
|
...
|
...
|
@@ -834,7 +851,7 @@ function fetchComment() { |
|
|
var $this = $(this);
|
|
|
|
|
|
if ($this.hasClass('load-more-comments')) {
|
|
|
loadComments();
|
|
|
loadAllComments();
|
|
|
} else {
|
|
|
loadConsults();
|
|
|
}
|
...
|
...
|
@@ -898,7 +915,7 @@ function fetchComment() { |
|
|
});
|
|
|
});
|
|
|
|
|
|
loadComments();
|
|
|
loadAllComments();
|
|
|
loadConsults();
|
|
|
}
|
|
|
|
...
|
...
|
|