Authored by 郝肖肖

Merge branch 'release/5.1' of git.yoho.cn:fe/yohobuywap-node into release/5.1

@@ -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,7 @@ function shopListData(tabName, stoping) { @@ -97,7 +97,7 @@ 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 101
102 shopId = $this.parents('.shop-info').data('id'); 102 shopId = $this.parents('.shop-info').data('id');
103 103
@@ -132,11 +132,15 @@ function shopListData(tabName, stoping) { @@ -132,11 +132,15 @@ function shopListData(tabName, stoping) {
132 if ($this.hasClass('already-collect')) { 132 if ($this.hasClass('already-collect')) {
133 $this.removeClass('already-collect'); 133 $this.removeClass('already-collect');
134 tip.show('店铺取消收藏成功'); 134 tip.show('店铺取消收藏成功');
135 - $this.parent().find('.fans-count').html(fansCount - 1); 135 + if (fansCount.indexOf('w') === -1) {
  136 + $this.parent().find('.fans-count').html(parseInt(fansCount) - 1);
  137 + }
136 } else { 138 } else {
137 $this.addClass('already-collect'); 139 $this.addClass('already-collect');
138 tip.show('店铺收藏成功'); 140 tip.show('店铺收藏成功');
139 - $this.parent().find('.fans-count').html(fansCount + 1); 141 + if (fansCount.indexOf('w') === -1) {
  142 + $this.parent().find('.fans-count').html(parseInt(fansCount) + 1);
  143 + }
140 } 144 }
141 } 145 }
142 146
@@ -206,8 +210,6 @@ function shopNavData() { @@ -206,8 +210,6 @@ function shopNavData() {
206 shopListData($('.shop-nav').find('li').eq(0).data('type')); 210 shopListData($('.shop-nav').find('li').eq(0).data('type'));
207 } 211 }
208 212
209 - console.log($('.shop-nav').length);  
210 -  
211 // 导航点击事件 213 // 导航点击事件
212 $('.shop-nav').find('li').on('click', function() { 214 $('.shop-nav').find('li').on('click', function() {
213 var $this = $(this), 215 var $this = $(this),
@@ -226,7 +228,6 @@ function shopNavData() { @@ -226,7 +228,6 @@ function shopNavData() {
226 228
227 }, 229 },
228 error: function() { 230 error: function() {
229 - console.log('123');  
230 231
231 // tip.show('网络断开连接了~'); 232 // tip.show('网络断开连接了~');
232 $('.shop-nav').hide(); 233 $('.shop-nav').hide();
@@ -230,6 +230,7 @@ seckillObj = { @@ -230,6 +230,7 @@ seckillObj = {
230 '/product/seckill/get-product-list'; 230 '/product/seckill/get-product-list';
231 231
232 loading.show(); 232 loading.show();
  233 + self.el.$navList.toggleClass('fix-top', false);
233 $.ajax({ 234 $.ajax({
234 url: url, 235 url: url,
235 data: { 236 data: {
@@ -299,13 +300,16 @@ seckillObj = { @@ -299,13 +300,16 @@ seckillObj = {
299 bindEvents: function() { 300 bindEvents: function() {
300 var self = this; 301 var self = this;
301 var $nav = self.el.$navList; 302 var $nav = self.el.$navList;
302 - var top = $nav.position().top + $nav.height(); 303 + var h = $nav.height();
  304 + var top = $nav.position().top;
  305 +
  306 + $nav.wrap('<div style="height:' + h + 'px;"></div>');
303 307
304 if (yoho.isApp) { 308 if (yoho.isApp) {
305 this.$productList.on('click', '[data-remind]', $.proxy(this.toggleRemind, this)); 309 this.$productList.on('click', '[data-remind]', $.proxy(this.toggleRemind, this));
306 } 310 }
307 311
308 - $(document).on('scroll', function() { 312 + $(document).on('scroll touchmove', function() {
309 $nav.toggleClass('fix-top', $(window).scrollTop() > top); 313 $nav.toggleClass('fix-top', $(window).scrollTop() > top);
310 }); 314 });
311 }, 315 },
@@ -392,7 +396,10 @@ seckillObj = { @@ -392,7 +396,10 @@ seckillObj = {
392 var $xhr; 396 var $xhr;
393 397
394 loading.show(); 398 loading.show();
395 - $xhr = $.get(location.href) 399 + $xhr = $.ajax({
  400 + url: location.href,
  401 + cache: false
  402 + })
396 .done(function(result) { 403 .done(function(result) {
397 self.$container.replaceWith( 404 self.$container.replaceWith(
398 self.pageTemplate($.extend(result, { 405 self.pageTemplate($.extend(result, {
@@ -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 {
@@ -104,13 +106,15 @@ @@ -104,13 +106,15 @@
104 106
105 .shop-name { 107 .shop-name {
106 font-weight: bold; 108 font-weight: bold;
107 - font-size: 24px; 109 + font-size: 26px;
108 height: 35px; 110 height: 35px;
109 } 111 }
110 112
111 .giving { 113 .giving {
112 color: #b0b0b0; 114 color: #b0b0b0;
113 font-size: 22px; 115 font-size: 22px;
  116 + position: relative;
  117 + bottom: -7px;
114 } 118 }
115 } 119 }
116 120
@@ -2,7 +2,7 @@ @@ -2,7 +2,7 @@
2 .seckill-list { 2 .seckill-list {
3 .nav-list { 3 .nav-list {
4 background-color: #fff; 4 background-color: #fff;
5 - width: auto; 5 + width: 750px;
6 border-top: solid 1PX #e1e1e1; 6 border-top: solid 1PX #e1e1e1;
7 height: 119px; 7 height: 119px;
8 overflow: hidden; 8 overflow: hidden;
@@ -59,7 +59,7 @@ @@ -59,7 +59,7 @@
59 } 59 }
60 .selected { 60 .selected {
61 display: none; 61 display: none;
62 - color: #d0021b !important; 62 + color: #d0021b !important;
63 font-weight: bold; 63 font-weight: bold;
64 height: 79px; 64 height: 79px;
65 line-height: 40px; 65 line-height: 40px;
1 .seckill-list { 1 .seckill-list {
2 .product-list { 2 .product-list {
3 background-color: #fff; 3 background-color: #fff;
  4 + margin-top: 1px;
4 .item { 5 .item {
5 position: relative; 6 position: relative;
6 padding: 20px 30px; 7 padding: 20px 30px;
7 display: -webkit-box; 8 display: -webkit-box;
8 border-bottom: solid 1PX #e1e1e1; 9 border-bottom: solid 1PX #e1e1e1;
9 - &:first-child { 10 + &:first-child {
10 border-top: solid 1PX #e1e1e1; 11 border-top: solid 1PX #e1e1e1;
11 } 12 }
12 13
@@ -51,7 +52,7 @@ @@ -51,7 +52,7 @@
51 } 52 }
52 .item-time { 53 .item-time {
53 -webkit-box-flex: 1; 54 -webkit-box-flex: 1;
54 - 55 +
55 font-size: 22px; 56 font-size: 22px;
56 padding-top: 28px; 57 padding-top: 28px;
57 -webkit-box-align: end; 58 -webkit-box-align: end;
@@ -121,5 +122,5 @@ @@ -121,5 +122,5 @@
121 z-index: 1; 122 z-index: 1;
122 } 123 }
123 } 124 }
124 -  
125 -}  
  125 +
  126 +}