...
|
...
|
@@ -49,6 +49,9 @@ function isEmpty(el) { |
|
|
return !$.trim(el.html());
|
|
|
}
|
|
|
|
|
|
require('../plugins/slider');
|
|
|
require('../common/center-slider');
|
|
|
|
|
|
bindEvent.add(function() {
|
|
|
var $imgShow = $('#img-show'),
|
|
|
$thumbs = $('#thumbs > .thumb-wrap');
|
...
|
...
|
@@ -789,9 +792,6 @@ function fetchComment() { |
|
|
return;
|
|
|
}
|
|
|
|
|
|
// 更新总数显示
|
|
|
// $commentNum.text(res[0].total);
|
|
|
|
|
|
if (filter && filter.length && !cNumReady) {
|
|
|
cNumReady = true;
|
|
|
$(filter).each(function(idx, fit) {
|
...
|
...
|
@@ -815,13 +815,6 @@ function fetchComment() { |
|
|
});
|
|
|
}
|
|
|
|
|
|
// 购买有图评价
|
|
|
/* function loadPicComments() {
|
|
|
loadComments(commentType.PIC).then(function(data){
|
|
|
|
|
|
});
|
|
|
}*/
|
|
|
|
|
|
// 顾客咨询
|
|
|
function loadConsults() {
|
|
|
if (loadingConsults) {
|
...
|
...
|
@@ -1019,6 +1012,78 @@ $('.comments').on('click', '.img-preview [data-role="preview-right"]', function( |
|
|
$img.css('transform', 'rotate(' + rotate + 'deg)');
|
|
|
});
|
|
|
|
|
|
// 店铺推荐
|
|
|
function loadRecommend() {
|
|
|
$.ajax({
|
|
|
type: 'GET',
|
|
|
url: '/product/detail/recommend',
|
|
|
data: {
|
|
|
skn: skn,
|
|
|
size: 20,
|
|
|
num: 1
|
|
|
}
|
|
|
}).then(function(data) {
|
|
|
var pro = data.data.products;
|
|
|
var recommendTpl = require('hbs/product/recommend.hbs');
|
|
|
var html = recommendTpl(data.data);
|
|
|
|
|
|
if (data.code === 200) {
|
|
|
if (pro.length === 0) {
|
|
|
$('.individual-comment').find('.block-title .title:first-child').addClass('hide');
|
|
|
$('.individual-comment').find('.block-title').find('.title')
|
|
|
.addClass('cur').prev('.sep').addClass('hide');
|
|
|
$('#recommend-shop').detach();
|
|
|
}
|
|
|
|
|
|
$('#recommend-shop').removeClass('hide');
|
|
|
$('#recommend-content').append(html);
|
|
|
$('.recommend-slider').slider2({
|
|
|
shownum: 5,
|
|
|
isCircle: false
|
|
|
});
|
|
|
} else {
|
|
|
$('.individual-comment').find('.block-title .title:first-child').addClass('hide');
|
|
|
$('.individual-comment').find('.block-title').find('.title').addClass('cur').prev('.sep').addClass('hide');
|
|
|
$('#recommend-shop').detach();
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
|
|
|
window.loadRecommend = loadRecommend;
|
|
|
|
|
|
// 推荐和浏览切换
|
|
|
$('.individual-comment').on('click', '.title', function() {
|
|
|
var $this = $(this),
|
|
|
index = $this.index();
|
|
|
|
|
|
var $latestWalk = $('.latest-walk'),
|
|
|
$recommendComment = $('#recommend-shop');
|
|
|
|
|
|
if ($this.hasClass('cur')) {
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
$this.addClass('cur');
|
|
|
$this.siblings('.cur').removeClass('cur');
|
|
|
|
|
|
if (index === 0) {
|
|
|
// 店铺推荐
|
|
|
$recommendComment.slideDown(SLIDETIME);
|
|
|
$latestWalk.slideUp(SLIDETIME);
|
|
|
} else {
|
|
|
// 最近游览
|
|
|
fetchLatestWalk(); // eslint-disable-line
|
|
|
$recommendComment.slideUp(SLIDETIME);
|
|
|
$latestWalk.slideDown(SLIDETIME);
|
|
|
}
|
|
|
});
|
|
|
|
|
|
$('.recommend-content').find('.iconfont').mouseenter(function() {
|
|
|
$(this).addClass('focus');
|
|
|
}).mouseleave(function() {
|
|
|
$(this).removeClass('focus');
|
|
|
});
|
|
|
|
|
|
// 特殊商品退换货
|
|
|
function fetchReturn() {
|
|
|
return $.ajax({
|
...
|
...
|
|