...
|
...
|
@@ -6,17 +6,13 @@ |
|
|
|
|
|
var $ = require('yoho-jquery'),
|
|
|
lazyLoad = require('yoho-jquery-lazyload'),
|
|
|
dialog = require('../common/dialog');
|
|
|
dialog = require('../common/dialog'),
|
|
|
$sellBox = $('.cart-table .pre-sell-box');
|
|
|
|
|
|
require('../plugins/slider');
|
|
|
require('../common/center-slider');
|
|
|
require('../common');
|
|
|
|
|
|
var Dialog = dialog.Dialog,
|
|
|
Alert = dialog.Alert,
|
|
|
$cartGoodsDetail = $('#goodsTogetherDetail'),
|
|
|
$sellBox = $('.cart-table .pre-sell-box');
|
|
|
|
|
|
$('.side-img-dd').slider2({
|
|
|
shownum: 5,
|
|
|
isCircle: true
|
...
|
...
|
@@ -26,93 +22,6 @@ $('.side-img-dd').slider2({ |
|
|
|
|
|
lazyLoad($('#details-html img'));
|
|
|
|
|
|
|
|
|
// ----------------底部 为你优选,最近浏览 begin--------------
|
|
|
|
|
|
// 推荐、优选、浏览切换
|
|
|
$(function() {
|
|
|
var $togetherGoods = $('.individual-item-togetherGoods'),
|
|
|
$recommendGoods = $('.individual-item-recommendGoods'),
|
|
|
$latestWalk = $('.individual-item-latestWalk');
|
|
|
|
|
|
if ($togetherGoods.hasClass('none')) {
|
|
|
$recommendGoods.show();
|
|
|
}
|
|
|
|
|
|
$('.bottom-tab-slide').on('click', '.bottom-title', function() {
|
|
|
var $this = $(this),
|
|
|
index = $this.index();
|
|
|
console.log(index);
|
|
|
$togetherGoods.hide();
|
|
|
$recommendGoods.hide();
|
|
|
|
|
|
if ($this.hasClass('change')) {
|
|
|
return;
|
|
|
}
|
|
|
if ($this.hasClass('cur')) {
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
$this.addClass('cur');
|
|
|
$this.siblings('.cur').removeClass('cur');
|
|
|
|
|
|
switch (index) {
|
|
|
case 0: {
|
|
|
$togetherGoods.slideDown();
|
|
|
$recommendGoods.hide();
|
|
|
$latestWalk.hide();
|
|
|
break;
|
|
|
}
|
|
|
case 1: {
|
|
|
$togetherGoods.hide();
|
|
|
$recommendGoods.slideDown();
|
|
|
$latestWalk.hide();
|
|
|
break;
|
|
|
}
|
|
|
case 2: {
|
|
|
$togetherGoods.hide();
|
|
|
$recommendGoods.hide();
|
|
|
$latestWalk.slideDown();
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
});
|
|
|
|
|
|
|
|
|
// 凑单 底部 轮播
|
|
|
function loadSlideGoods() {
|
|
|
$.ajax({
|
|
|
type: 'GET',
|
|
|
url: '',
|
|
|
data: {
|
|
|
// skn: skn,
|
|
|
size: 20,
|
|
|
num: 1
|
|
|
}
|
|
|
}).then(function(data) {
|
|
|
// var pro = data.data.products;
|
|
|
|
|
|
// if (data.code === 200) {
|
|
|
// if (pro.length === 0) {
|
|
|
// return;
|
|
|
// }
|
|
|
|
|
|
$('#recommend-shop').removeClass('none');
|
|
|
|
|
|
$('.individual-item ').slider2({
|
|
|
shownum: 5,
|
|
|
isCircle: true
|
|
|
});
|
|
|
|
|
|
// } else {
|
|
|
// $('.bottom-title').filter('.change').addClass('none');
|
|
|
// }
|
|
|
});
|
|
|
}
|
|
|
loadSlideGoods();
|
|
|
|
|
|
|
|
|
function isCheckAll() {
|
|
|
|
|
|
var isAllCheck = true;
|
...
|
...
|
@@ -187,31 +96,6 @@ $(function() { |
|
|
isCheckFav();
|
|
|
});
|
|
|
|
|
|
// ----------------底部 为你优选,最近浏览 end--------------
|
|
|
|
|
|
// 凑单弹框 商品信息弹出框,加入收藏夹
|
|
|
$cartGoodsDetail.on('click', '.btn-favCount', function() {
|
|
|
$.ajax({
|
|
|
type: 'POST',
|
|
|
dataType: 'json',
|
|
|
url: '',
|
|
|
data: {
|
|
|
productId: productId,
|
|
|
type: 'add'
|
|
|
}
|
|
|
}).then(function(d) {
|
|
|
if (d.code === 200) {
|
|
|
new Alert(d.message).show();
|
|
|
} else if (d.code === 403) {
|
|
|
if (d.data.url) {
|
|
|
window.location = d.data.url;
|
|
|
}
|
|
|
} else {
|
|
|
new Alert(d.message).show();
|
|
|
}
|
|
|
});
|
|
|
});
|
|
|
|
|
|
require('./cart-action');
|
|
|
require('./cart-color-panel');
|
|
|
require('./cart-goods-win');
|
...
|
...
|
|