|
@@ -1125,24 +1125,15 @@ function fetchComment() { |
|
@@ -1125,24 +1125,15 @@ function fetchComment() { |
1125
|
// 提交咨询
|
1125
|
// 提交咨询
|
1126
|
$('#submit-consult').click(function() {
|
1126
|
$('#submit-consult').click(function() {
|
1127
|
var $this = $(this),
|
1127
|
var $this = $(this),
|
1128
|
- $parent = $this.closest('.new-consult'),
|
|
|
1129
|
- $textarea = $parent.find('.my-consult'),
|
|
|
1130
|
- content = $.trim($textarea.val());
|
|
|
1131
|
-
|
|
|
1132
|
- var $consultWarn = $parent.find('.consult-warn');
|
|
|
1133
|
-
|
1128
|
+ $textarea = $('#textbox'),
|
|
|
1129
|
+ content = $.trim($textarea.val()),
|
|
|
1130
|
+ $success = $('.success-msg');
|
1134
|
var pass = true;
|
1131
|
var pass = true;
|
1135
|
-
|
|
|
1136
|
if (content === '') {
|
1132
|
if (content === '') {
|
1137
|
- $textarea.addClass('error');
|
|
|
1138
|
- $consultWarn.removeClass('hide');
|
|
|
1139
|
-
|
1133
|
+ $textarea.attr('placeholder', '请输入咨询内容');
|
|
|
1134
|
+ $textarea.addClass('err');
|
1140
|
pass = false;
|
1135
|
pass = false;
|
1141
|
- } else {
|
|
|
1142
|
- $textarea.removeClass('error');
|
|
|
1143
|
- $consultWarn.addClass('hide');
|
|
|
1144
|
}
|
1136
|
}
|
1145
|
-
|
|
|
1146
|
if (pass === false) {
|
1137
|
if (pass === false) {
|
1147
|
return;
|
1138
|
return;
|
1148
|
}
|
1139
|
}
|
|
@@ -1158,20 +1149,21 @@ function fetchComment() { |
|
@@ -1158,20 +1149,21 @@ function fetchComment() { |
1158
|
var code = data.code;
|
1149
|
var code = data.code;
|
1159
|
|
1150
|
|
1160
|
if (code === 200) {
|
1151
|
if (code === 200) {
|
1161
|
- $parent.addClass('hide');
|
|
|
1162
|
-
|
|
|
1163
|
- $parent.siblings('.consult-success').removeClass('hide');
|
1152
|
+ $textarea.removeClass('err');
|
|
|
1153
|
+ $success.removeClass('hide');
|
1164
|
|
1154
|
|
1165
|
- // 清空输入
|
1155
|
+ // 清空输入
|
1166
|
$textarea.val('');
|
1156
|
$textarea.val('');
|
1167
|
} else if (code === 400) {
|
1157
|
} else if (code === 400) {
|
1168
|
|
1158
|
|
1169
|
- // 跳转登录页
|
1159
|
+ // 跳转登录页
|
1170
|
location.href = data.data.refer;
|
1160
|
location.href = data.data.refer;
|
1171
|
}
|
1161
|
}
|
1172
|
});
|
1162
|
});
|
1173
|
});
|
1163
|
});
|
1174
|
|
1164
|
|
|
|
1165
|
+
|
|
|
1166
|
+
|
1175
|
// 评论类型的切换
|
1167
|
// 评论类型的切换
|
1176
|
$('.comments').on('click', '.comment-tabs h2[data-comment-type]', function() {
|
1168
|
$('.comments').on('click', '.comment-tabs h2[data-comment-type]', function() {
|
1177
|
|
1169
|
|
|
@@ -1475,13 +1467,13 @@ $('.bottom-tab').on('click', '.bottom-title', function() { |
|
@@ -1475,13 +1467,13 @@ $('.bottom-tab').on('click', '.bottom-title', function() { |
1475
|
// 店铺推荐
|
1467
|
// 店铺推荐
|
1476
|
$recommendComment.slideDown(SLIDETIME);
|
1468
|
$recommendComment.slideDown(SLIDETIME);
|
1477
|
$latestWalk.slideUp(SLIDETIME);
|
1469
|
$latestWalk.slideUp(SLIDETIME);
|
1478
|
- $('.change').css('display','inline-block');
|
1470
|
+ $('.change').css('display', 'inline-block');
|
1479
|
} else {
|
1471
|
} else {
|
1480
|
// 最近游览
|
1472
|
// 最近游览
|
1481
|
fetchLatestWalk(); // eslint-disable-line
|
1473
|
fetchLatestWalk(); // eslint-disable-line
|
1482
|
$recommendComment.slideUp(SLIDETIME);
|
1474
|
$recommendComment.slideUp(SLIDETIME);
|
1483
|
$latestWalk.slideDown(SLIDETIME);
|
1475
|
$latestWalk.slideDown(SLIDETIME);
|
1484
|
- $('.change').css('display','none');
|
1476
|
+ $('.change').css('display', 'none');
|
1485
|
}
|
1477
|
}
|
1486
|
|
1478
|
|
1487
|
});
|
1479
|
});
|
|
@@ -1581,7 +1573,8 @@ $(window).scroll(function() { |
|
@@ -1581,7 +1573,8 @@ $(window).scroll(function() { |
1581
|
|
1573
|
|
1582
|
});
|
1574
|
});
|
1583
|
|
1575
|
|
1584
|
-$('.redcar').on('click', '.option', function() {
|
1576
|
+$('.redcar').on('click', '.option', function(e) {
|
|
|
1577
|
+ e.stopPropagation();
|
1585
|
var $this = $(this);
|
1578
|
var $this = $(this);
|
1586
|
|
1579
|
|
1587
|
if ($this.hasClass('fixed')) {
|
1580
|
if ($this.hasClass('fixed')) {
|
|
@@ -1592,14 +1585,18 @@ $('.redcar').on('click', '.option', function() { |
|
@@ -1592,14 +1585,18 @@ $('.redcar').on('click', '.option', function() { |
1592
|
$this.addClass('fixed');
|
1585
|
$this.addClass('fixed');
|
1593
|
});
|
1586
|
});
|
1594
|
|
1587
|
|
1595
|
-$('.redcar').on('click', function(){
|
|
|
1596
|
- var $addToCart = $('#add-to-cart');
|
|
|
1597
|
- var sc = $(document);
|
|
|
1598
|
- if(maxStock === -1){
|
|
|
1599
|
- sc.scrollTop(0);
|
|
|
1600
|
- }else{
|
|
|
1601
|
- $addToCart.trigger('click');
|
|
|
1602
|
- }
|
1588
|
+$('.redcar').on('click', function() {
|
|
|
1589
|
+ var $addToCart = $('#add-to-cart');
|
|
|
1590
|
+ var sc = $(document);
|
|
|
1591
|
+ if (maxStock === -1) {
|
|
|
1592
|
+ sc.scrollTop(0);
|
|
|
1593
|
+ } else {
|
|
|
1594
|
+ $addToCart.trigger('click');
|
|
|
1595
|
+ }
|
|
|
1596
|
+});
|
|
|
1597
|
+
|
|
|
1598
|
+$('.redcar-nav').on('click', function(e){
|
|
|
1599
|
+ e.stopPropagation();
|
1603
|
});
|
1600
|
});
|
1604
|
|
1601
|
|
1605
|
$(function() {
|
1602
|
$(function() {
|