Authored by zhangxiaoru

shop collect

... ... @@ -15,8 +15,7 @@ const shopList = (uid, tabName) => {
uid: uid,
tab_name: tabName
}, {
code: 200,
cache: true
code: 200
}).then((result) => {
if (result && result.code === 200) {
_.forEach(result.data, function(data) {
... ...
... ... @@ -3,7 +3,7 @@
<a href="{{href}}">
<div class="info-title">
<div class="collect">
<span class="fans">粉丝:{{collectionNum}}</span>
<span class="fans">粉丝:<b class="fans-count">{{collectionNum}}</b></span>
<i class="iconfont collect-btn {{#if isFavorite}}already-collect{{/ if}}">&#xe605;</i>
</div>
... ...
... ... @@ -96,7 +96,8 @@ function shopListData(tabName, stoping) {
// 店铺收藏
$('.collect-btn').on('click', function(e) {
var opt,
$this = $(this);
$this = $(this),
fansCount = parseInt($this.parent().find('.fans-count').html());
shopId = $this.parents('.shop-info').data('id');
... ... @@ -131,9 +132,11 @@ function shopListData(tabName, stoping) {
if ($this.hasClass('already-collect')) {
$this.removeClass('already-collect');
tip.show('店铺取消收藏成功');
$this.parent().find('.fans-count').html(fansCount - 1);
} else {
$this.addClass('already-collect');
tip.show('店铺收藏成功');
$this.parent().find('.fans-count').html(fansCount + 1);
}
}
... ...
... ... @@ -26,7 +26,6 @@
.active {
color: #000;
font-weight: bold;
}
}
... ... @@ -86,7 +85,7 @@
float: left;
margin-left: 25px;
font-size: 22px;
width: 170px;
width: 200px;
height: 65px;
}
... ... @@ -98,17 +97,16 @@
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
width: 240px;
}
.shop-name {
width: 170px;
font-weight: bold;
font-size: 24px;
height: 35px;
}
.giving {
width: 170px;
color: #b0b0b0;
font-size: 22px;
}
... ...