...
|
...
|
@@ -97,7 +97,8 @@ function shopListData(tabName, stoping) { |
|
|
$('.collect-btn').on('click', function(e) {
|
|
|
var opt,
|
|
|
$this = $(this),
|
|
|
fansCount = parseInt($this.parent().find('.fans-count').html());
|
|
|
fansCount = $this.parent().find('.fans-count').html();
|
|
|
console.log(fansCount)
|
|
|
|
|
|
shopId = $this.parents('.shop-info').data('id');
|
|
|
|
...
|
...
|
@@ -132,11 +133,15 @@ function shopListData(tabName, stoping) { |
|
|
if ($this.hasClass('already-collect')) {
|
|
|
$this.removeClass('already-collect');
|
|
|
tip.show('店铺取消收藏成功');
|
|
|
$this.parent().find('.fans-count').html(fansCount - 1);
|
|
|
if(fansCount.indexOf('w') === -1) {
|
|
|
$this.parent().find('.fans-count').html(parseInt(fansCount) - 1);
|
|
|
}
|
|
|
} else {
|
|
|
$this.addClass('already-collect');
|
|
|
tip.show('店铺收藏成功');
|
|
|
$this.parent().find('.fans-count').html(fansCount + 1);
|
|
|
if(fansCount.indexOf('w') === -1) {
|
|
|
$this.parent().find('.fans-count').html(parseInt(fansCount) + 1);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
...
|
...
|
|