...
|
...
|
@@ -236,12 +236,18 @@ GoodsWinAction = { |
|
|
}
|
|
|
|
|
|
},
|
|
|
//收藏
|
|
|
btnFav: function() {
|
|
|
|
|
|
var favBtn = $('[data-role="fav-count"]');
|
|
|
var $this = $(this);
|
|
|
var $goodsDetail = $this.closest('.detail-goods');
|
|
|
var pid = $goodsDetail.data('productid');
|
|
|
var colTxt = {
|
|
|
normal: '收藏商品',
|
|
|
coled: '已收藏',
|
|
|
hover: '取消收藏'
|
|
|
};
|
|
|
|
|
|
function tipFav(parent) {
|
|
|
|
...
|
...
|
@@ -256,7 +262,6 @@ GoodsWinAction = { |
|
|
|
|
|
if (favBtn.find('.favCount').hasClass('coled')) {
|
|
|
console.log('取消'+888);
|
|
|
console.log(pid);
|
|
|
|
|
|
capi.productCollect(pid,true).done(function(obj){
|
|
|
|
...
|
...
|
@@ -264,14 +269,13 @@ GoodsWinAction = { |
|
|
tipFav(pid);
|
|
|
return false;
|
|
|
}
|
|
|
// $favBtn.addClass('none');
|
|
|
// $favBtn.hasClass('favCancel').removeClass('none').show();
|
|
|
favBtn.mouseover(function(){
|
|
|
favBtn.html('<i class="favCount iconfont"></i>收藏商品');
|
|
|
favBtn.find('.favCount').removeClass('coled');
|
|
|
favBtn.find('em').text(colTxt.normal);
|
|
|
favBtn.mouseenter(function(){
|
|
|
favBtn.find('em').text(colTxt.normal);
|
|
|
}).mouseleave(function(){
|
|
|
favBtn.html('<i class="favCount iconfont"></i>收藏商品');
|
|
|
}).html('<i class="favCount iconfont"></i>收藏商品');
|
|
|
event.stopPropagation();
|
|
|
favBtn.find('em').text(colTxt.normal);
|
|
|
});
|
|
|
|
|
|
}).fail(function(){
|
|
|
|
...
|
...
|
@@ -282,7 +286,6 @@ GoodsWinAction = { |
|
|
|
|
|
} else {
|
|
|
console.log('收藏'+9999);
|
|
|
console.log(pid);
|
|
|
capi.productCollect(pid).done(function(obj){
|
|
|
|
|
|
if(!obj && obj.code !== 200){
|
...
|
...
|
@@ -290,14 +293,14 @@ GoodsWinAction = { |
|
|
return false;
|
|
|
}
|
|
|
|
|
|
// $favBtn.addClass('none');
|
|
|
// $favBtn.hasClass('favAdd').removeClass('none').show();
|
|
|
favBtn.mouseover(function(){
|
|
|
favBtn.html('<i class="favCount iconfont coled"></i>取消收藏').mouseleave(function(){
|
|
|
favBtn.html('<i class="favCount iconfont coled"></i>已收藏');
|
|
|
});
|
|
|
}).html('<i class="favCount iconfont coled"></i>已收藏');
|
|
|
event.stopPropagation();
|
|
|
favBtn.find('.favCount').addClass('coled');
|
|
|
favBtn.find('em').text(colTxt.coled);
|
|
|
favBtn.mouseenter(function(){
|
|
|
favBtn.find('em').text(colTxt.hover);
|
|
|
}).mouseleave(function(){
|
|
|
favBtn.find('em').text(colTxt.coled);
|
|
|
});
|
|
|
obj.stopPropagation();
|
|
|
|
|
|
}).fail(function(){
|
|
|
|
...
|
...
|
@@ -321,6 +324,7 @@ GoodsWinAction = { |
|
|
|
|
|
if ($curSize.length <= 0) {
|
|
|
$this.closest('.detail-info').find('.size-p-tip').show();
|
|
|
$this.closest('.detail-info').find('.submit').css('marginTop','0');
|
|
|
|
|
|
// new Alert('请选择尺码').show();
|
|
|
return false;
|
...
|
...
|
|