Authored by zhangxiaoru

shop

@@ -41,7 +41,6 @@ const shopIndex = (req, res) => { @@ -41,7 +41,6 @@ const shopIndex = (req, res) => {
41 const shopNav = (req, res, next) => { 41 const shopNav = (req, res, next) => {
42 42
43 shopModel.shopNav().then((result) => { 43 shopModel.shopNav().then((result) => {
44 - console.log(result);  
45 res.json(result); 44 res.json(result);
46 }).catch(next); 45 }).catch(next);
47 }; 46 };
@@ -97,7 +97,8 @@ function shopListData(tabName, stoping) { @@ -97,7 +97,8 @@ function shopListData(tabName, stoping) {
97 $('.collect-btn').on('click', function(e) { 97 $('.collect-btn').on('click', function(e) {
98 var opt, 98 var opt,
99 $this = $(this), 99 $this = $(this),
100 - fansCount = parseInt($this.parent().find('.fans-count').html()); 100 + fansCount = $this.parent().find('.fans-count').html();
  101 + console.log(fansCount)
101 102
102 shopId = $this.parents('.shop-info').data('id'); 103 shopId = $this.parents('.shop-info').data('id');
103 104
@@ -132,11 +133,15 @@ function shopListData(tabName, stoping) { @@ -132,11 +133,15 @@ function shopListData(tabName, stoping) {
132 if ($this.hasClass('already-collect')) { 133 if ($this.hasClass('already-collect')) {
133 $this.removeClass('already-collect'); 134 $this.removeClass('already-collect');
134 tip.show('店铺取消收藏成功'); 135 tip.show('店铺取消收藏成功');
135 - $this.parent().find('.fans-count').html(fansCount - 1); 136 + if(fansCount.indexOf('w') === -1) {
  137 + $this.parent().find('.fans-count').html(parseInt(fansCount) - 1);
  138 + }
136 } else { 139 } else {
137 $this.addClass('already-collect'); 140 $this.addClass('already-collect');
138 tip.show('店铺收藏成功'); 141 tip.show('店铺收藏成功');
139 - $this.parent().find('.fans-count').html(fansCount + 1); 142 + if(fansCount.indexOf('w') === -1) {
  143 + $this.parent().find('.fans-count').html(parseInt(fansCount) + 1);
  144 + }
140 } 145 }
141 } 146 }
142 147
@@ -64,8 +64,10 @@ @@ -64,8 +64,10 @@
64 color: #b0b0b0; 64 color: #b0b0b0;
65 display: inline-block; 65 display: inline-block;
66 width: 50px; 66 width: 50px;
67 - font-size: 26px; 67 + font-size: 32px;
68 text-align: center; 68 text-align: center;
  69 + position: relative;
  70 + top: 4px;
69 } 71 }
70 72
71 .already-collect { 73 .already-collect {
@@ -111,6 +113,8 @@ @@ -111,6 +113,8 @@
111 .giving { 113 .giving {
112 color: #b0b0b0; 114 color: #b0b0b0;
113 font-size: 22px; 115 font-size: 22px;
  116 + position: relative;
  117 + bottom: -3px;
114 } 118 }
115 } 119 }
116 120