Authored by 毕凯

完善收藏商品功能

... ... @@ -150,7 +150,7 @@ exports.init = function(num) {
$goodItemWrapper.mouseleave(function() {
removeHtmlFn();
// removeHtmlFn();
});
function removeHtmlFn() {
... ... @@ -171,15 +171,19 @@ $(document).on('hover', '.good-select-color li', function() {
});
$goodInfoMain.on('click', '.col-btn', function() {
var $this = $(this);
$.ajax({
type: 'POST',
url: '/product/list/changeFavorite',
data: {
skn: $(this).closest('.good-info').data('skn'),
isFavorite: !$(this).hasClass('coled')
skn: $this.closest('.good-info').data('skn'),
isFavorite: !$this.hasClass('coled')
}
}).then(function(res) {
console.log(res);
if (res.code === 200) {
$this.toggleClass('coled');
}
});
});
... ...
... ... @@ -123,7 +123,7 @@
display: block;
&:hover {
color: #f95b4f;
// color: #f95b4f;
cursor: pointer;
}
}
... ...