...
|
...
|
@@ -1125,24 +1125,15 @@ function fetchComment() { |
|
|
// 提交咨询
|
|
|
$('#submit-consult').click(function() {
|
|
|
var $this = $(this),
|
|
|
$parent = $this.closest('.new-consult'),
|
|
|
$textarea = $parent.find('.my-consult'),
|
|
|
content = $.trim($textarea.val());
|
|
|
|
|
|
var $consultWarn = $parent.find('.consult-warn');
|
|
|
|
|
|
$textarea = $('#textbox'),
|
|
|
content = $.trim($textarea.val()),
|
|
|
$success = $('.success-msg');
|
|
|
var pass = true;
|
|
|
|
|
|
if (content === '') {
|
|
|
$textarea.addClass('error');
|
|
|
$consultWarn.removeClass('hide');
|
|
|
|
|
|
$textarea.attr('placeholder', '请输入咨询内容');
|
|
|
$textarea.addClass('err');
|
|
|
pass = false;
|
|
|
} else {
|
|
|
$textarea.removeClass('error');
|
|
|
$consultWarn.addClass('hide');
|
|
|
}
|
|
|
|
|
|
if (pass === false) {
|
|
|
return;
|
|
|
}
|
...
|
...
|
@@ -1158,20 +1149,21 @@ function fetchComment() { |
|
|
var code = data.code;
|
|
|
|
|
|
if (code === 200) {
|
|
|
$parent.addClass('hide');
|
|
|
|
|
|
$parent.siblings('.consult-success').removeClass('hide');
|
|
|
$textarea.removeClass('err');
|
|
|
$success.removeClass('hide');
|
|
|
|
|
|
// 清空输入
|
|
|
// 清空输入
|
|
|
$textarea.val('');
|
|
|
} else if (code === 400) {
|
|
|
|
|
|
// 跳转登录页
|
|
|
// 跳转登录页
|
|
|
location.href = data.data.refer;
|
|
|
}
|
|
|
});
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
// 评论类型的切换
|
|
|
$('.comments').on('click', '.comment-tabs h2[data-comment-type]', function() {
|
|
|
|
...
|
...
|
@@ -1475,13 +1467,13 @@ $('.bottom-tab').on('click', '.bottom-title', function() { |
|
|
// 店铺推荐
|
|
|
$recommendComment.slideDown(SLIDETIME);
|
|
|
$latestWalk.slideUp(SLIDETIME);
|
|
|
$('.change').css('display','inline-block');
|
|
|
$('.change').css('display', 'inline-block');
|
|
|
} else {
|
|
|
// 最近游览
|
|
|
fetchLatestWalk(); // eslint-disable-line
|
|
|
$recommendComment.slideUp(SLIDETIME);
|
|
|
$latestWalk.slideDown(SLIDETIME);
|
|
|
$('.change').css('display','none');
|
|
|
$('.change').css('display', 'none');
|
|
|
}
|
|
|
|
|
|
});
|
...
|
...
|
@@ -1581,7 +1573,8 @@ $(window).scroll(function() { |
|
|
|
|
|
});
|
|
|
|
|
|
$('.redcar').on('click', '.option', function() {
|
|
|
$('.redcar').on('click', '.option', function(e) {
|
|
|
e.stopPropagation();
|
|
|
var $this = $(this);
|
|
|
|
|
|
if ($this.hasClass('fixed')) {
|
...
|
...
|
@@ -1592,14 +1585,18 @@ $('.redcar').on('click', '.option', function() { |
|
|
$this.addClass('fixed');
|
|
|
});
|
|
|
|
|
|
$('.redcar').on('click', function(){
|
|
|
var $addToCart = $('#add-to-cart');
|
|
|
var sc = $(document);
|
|
|
if(maxStock === -1){
|
|
|
sc.scrollTop(0);
|
|
|
}else{
|
|
|
$addToCart.trigger('click');
|
|
|
}
|
|
|
$('.redcar').on('click', function() {
|
|
|
var $addToCart = $('#add-to-cart');
|
|
|
var sc = $(document);
|
|
|
if (maxStock === -1) {
|
|
|
sc.scrollTop(0);
|
|
|
} else {
|
|
|
$addToCart.trigger('click');
|
|
|
}
|
|
|
});
|
|
|
|
|
|
$('.redcar-nav').on('click', function(e){
|
|
|
e.stopPropagation();
|
|
|
});
|
|
|
|
|
|
$(function() {
|
...
|
...
|
|