Authored by whb

index.js css

... ... @@ -2415,12 +2415,18 @@ exports.init = function(num) {
removeHtmlFn();
ulStr = createColorList(data).colorListStr; //ajax请求的颜色列表
ulNum = createColorList(data).ulNum;//ajax请求的颜色的数量
ulStr = createColorList(data.pics).colorListStr; //ajax请求的颜色列表
ulNum = createColorList(data.pics).ulNum;//ajax请求的颜色的数量
$goodInfoMain.append(event.targetDuplicate);
$goodSelectColor.append($(ulStr));
if (data.isFavorite) {
$goodInfoMain.find('.col-btn').addClass('coled');
} else {
$goodInfoMain.find('.col-btn').removeClass('coled');
}
wrapperPl = $goodItemWrapper.css('paddingLeft');
wrapperPt = $goodItemWrapper.css('paddingTop');
containerPt = $goodsContainer.css('paddingTop');
... ... @@ -2448,8 +2454,8 @@ exports.init = function(num) {
});
// 鼠标悬浮获取到商品信息后显示第一张图片
if (data[0] && data[0].src) {
$goodInfoMain.find('.good-thumb img').attr('src', data[0].src);
if (data.pics[0] && data.pics[0].src) {
$goodInfoMain.find('.good-thumb img').attr('src', data.pics[0].src);
}
//}, 1000);
... ... @@ -2457,6 +2463,7 @@ exports.init = function(num) {
});
$goodItemWrapper.mouseleave(function() {
removeHtmlFn();
});
... ... @@ -2477,6 +2484,19 @@ $(document).on('hover', '.good-select-color li', function() {
$coverImg.attr('src', coverImg);
});
$goodInfoMain.on('click', '.col-btn', function() {
$.ajax({
type: 'POST',
url: '/product/list/changeFavorite',
data: {
skn: $(this).closest('.good-info').data('skn'),
isFavorite: !$(this).hasClass('coled')
}
}).then(function(res) {
console.log(res);
});
});
// 左侧导航
$productListNav.click(function() {
if ($(this).hasClass('active')) {
... ...
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.