Merge branch 'release/5.1' of git.yoho.cn:fe/yohobuywap-node into release/5.1
Showing
8 changed files
with
24 additions
and
22 deletions
@@ -20,11 +20,15 @@ const shopList = (uid, tabName) => { | @@ -20,11 +20,15 @@ const shopList = (uid, tabName) => { | ||
20 | }).then((result) => { | 20 | }).then((result) => { |
21 | if (result && result.code === 200) { | 21 | if (result && result.code === 200) { |
22 | _.forEach(result.data, function(data) { | 22 | _.forEach(result.data, function(data) { |
23 | - let href = '//m.yohobuy.com/product/index/brand?shop_id=' + data.shopsId + '&openby:yohobuy={"action":"go.shop","params":{"shop_id":"' | ||
24 | - + data.shopsId + '","shop_template_type":"' + data.shopTemplateType + '","shop_name":"' + data.shopName + '"}}'; | 23 | + let href = '//m.yohobuy.com/product/index/brand?shop_id=' + data.shopsId + '&openby:yohobuy={"action":"go.shop","params":{"shop_id":"' + |
24 | + data.shopsId + '","shop_template_type":"' + data.shopTemplateType + '","shop_name":"' + data.shopName + '"}}'; | ||
25 | 25 | ||
26 | data.isFavorite = data.isFavorite === 'Y'; | 26 | data.isFavorite = data.isFavorite === 'Y'; |
27 | 27 | ||
28 | + if (parseInt(data.collectionNum) > 10000) { | ||
29 | + data.collectionNum = (data.collectionNum / 10000).toFixed(1) + ' w'; | ||
30 | + } | ||
31 | + | ||
28 | data.href = href; | 32 | data.href = href; |
29 | }); | 33 | }); |
30 | return result.data; | 34 | return result.data; |
@@ -128,8 +128,9 @@ const index = (req, res, next) => { | @@ -128,8 +128,9 @@ const index = (req, res, next) => { | ||
128 | return seckillModel.queryActivity().then((resultActivity) => { | 128 | return seckillModel.queryActivity().then((resultActivity) => { |
129 | // console.log(resultActivity) | 129 | // console.log(resultActivity) |
130 | let focusIndex = false; | 130 | let focusIndex = false; |
131 | - let nowTime = Date.parse(new Date()); | 131 | + let nowTime = Date.now(); |
132 | 132 | ||
133 | + result.currentTime = nowTime; | ||
133 | if (resultActivity.code !== 200) { | 134 | if (resultActivity.code !== 200) { |
134 | return next(); | 135 | return next(); |
135 | } | 136 | } |
@@ -17,7 +17,7 @@ | @@ -17,7 +17,7 @@ | ||
17 | </div> | 17 | </div> |
18 | 18 | ||
19 | <div class="info-content"> | 19 | <div class="info-content"> |
20 | - <img class="lazy content" data-original="{{image bannerUrl 690 175}}"></img> | 20 | + <img class="lazy content" data-original="{{image bannerUrl 690 235}}"></img> |
21 | </div> | 21 | </div> |
22 | </a> | 22 | </a> |
23 | </div> | 23 | </div> |
@@ -229,7 +229,7 @@ function updateConformButtonClassAndText() { | @@ -229,7 +229,7 @@ function updateConformButtonClassAndText() { | ||
229 | if ($chosed.closest('.zero-stock').length === 2) { | 229 | if ($chosed.closest('.zero-stock').length === 2) { |
230 | $('#chose-btn-sure').css('background-color', '#c0c0c0').html('已售罄'); | 230 | $('#chose-btn-sure').css('background-color', '#c0c0c0').html('已售罄'); |
231 | } else { | 231 | } else { |
232 | - $('#chose-btn-sure').css('background-color', '#eb0313').html(isEdit ? '确认' : '立即结算'); | 232 | + $('#chose-btn-sure').css('background-color', '#eb0313').html(isEdit ? '确认' : '立即购买'); |
233 | } | 233 | } |
234 | } | 234 | } |
235 | 235 |
@@ -188,7 +188,7 @@ seckillObj = { | @@ -188,7 +188,7 @@ seckillObj = { | ||
188 | $el.$navUl.find('>li').each(function() { | 188 | $el.$navUl.find('>li').each(function() { |
189 | $(this).removeClass('now over wait'); | 189 | $(this).removeClass('now over wait'); |
190 | time = new Date(parseInt($(this).find('input.date').val(), 10)); | 190 | time = new Date(parseInt($(this).find('input.date').val(), 10)); |
191 | - nowTime = new Date(); | 191 | + nowTime = new Date(Date.now() + that.diff * 1000); |
192 | 192 | ||
193 | if (nowTime > time) { // 当前时间大于这个时间段,已经开始和即将开始两种情况 | 193 | if (nowTime > time) { // 当前时间大于这个时间段,已经开始和即将开始两种情况 |
194 | if ($(this).next('.time-item').length) { | 194 | if ($(this).next('.time-item').length) { |
@@ -258,7 +258,7 @@ seckillObj = { | @@ -258,7 +258,7 @@ seckillObj = { | ||
258 | initTick: function(elem) { | 258 | initTick: function(elem) { |
259 | var $el = this.el, that = this, | 259 | var $el = this.el, that = this, |
260 | time, | 260 | time, |
261 | - nowTime = Date.parse(new Date()) / 1000, | 261 | + nowTime = Date.parse(new Date()) / 1000 + that.diff, |
262 | offsetTime; | 262 | offsetTime; |
263 | 263 | ||
264 | if ($(elem).hasClass('now')) { | 264 | if ($(elem).hasClass('now')) { |
@@ -288,7 +288,7 @@ seckillObj = { | @@ -288,7 +288,7 @@ seckillObj = { | ||
288 | $(elem).find('.tick.second').text(second < 0 ? '00' : (second < 10 ? ('0' + second) : second)); | 288 | $(elem).find('.tick.second').text(second < 0 ? '00' : (second < 10 ? ('0' + second) : second)); |
289 | 289 | ||
290 | $el.currentTick = setTimeout(function() { | 290 | $el.currentTick = setTimeout(function() { |
291 | - var curSec = Math.floor(Date.now() / 1000); | 291 | + var curSec = Math.floor(Date.now() / 1000) + that.diff; |
292 | 292 | ||
293 | offsetTime = offsetTime - (curSec - nowTime); | 293 | offsetTime = offsetTime - (curSec - nowTime); |
294 | that.startTick(elem, offsetTime, curSec); | 294 | that.startTick(elem, offsetTime, curSec); |
@@ -392,16 +392,14 @@ seckillObj = { | @@ -392,16 +392,14 @@ seckillObj = { | ||
392 | })) | 392 | })) |
393 | ); | 393 | ); |
394 | 394 | ||
395 | - // if (result && result.currentTime) { | ||
396 | - // self.diff = Math.round((Date.now() - result.currentTime) / 1000); | ||
397 | - // } | 395 | + if (result && result.activitys && result.activitys.length) { |
396 | + window.diff = self.diff = Math.round((result.currentTime - Date.now()) / 1000); | ||
397 | + callback(); | ||
398 | + } | ||
398 | 399 | ||
399 | lazyload('img.lazy'); | 400 | lazyload('img.lazy'); |
400 | window.rePosFooter(); | 401 | window.rePosFooter(); |
401 | 402 | ||
402 | - if (result && result.activitys && result.activitys.length) { | ||
403 | - callback(); | ||
404 | - } | ||
405 | }) | 403 | }) |
406 | .error(function() { | 404 | .error(function() { |
407 | }) | 405 | }) |
@@ -57,7 +57,7 @@ seckillObj = { | @@ -57,7 +57,7 @@ seckillObj = { | ||
57 | $(elem).find('.tick.hour').text(hour < 0 ? '00' : (hour < 10 ? ('0' + hour) : hour)); | 57 | $(elem).find('.tick.hour').text(hour < 0 ? '00' : (hour < 10 ? ('0' + hour) : hour)); |
58 | $(elem).find('.tick.minute').text(minute < 0 ? '00' : (minute < 10 ? ('0' + minute) : minute)); | 58 | $(elem).find('.tick.minute').text(minute < 0 ? '00' : (minute < 10 ? ('0' + minute) : minute)); |
59 | $(elem).find('.tick.second').text(second < 0 ? '00' : (second < 10 ? ('0' + second) : second)); | 59 | $(elem).find('.tick.second').text(second < 0 ? '00' : (second < 10 ? ('0' + second) : second)); |
60 | - if (offsetTime <= 0) { // 结束倒计时刷新状态 | 60 | + if (offsetTime <= 1) { // 结束倒计时刷新状态 |
61 | window.location.reload(); | 61 | window.location.reload(); |
62 | } else { | 62 | } else { |
63 | $el.currentTick = setTimeout(function() { | 63 | $el.currentTick = setTimeout(function() { |
@@ -164,7 +164,7 @@ $( | @@ -164,7 +164,7 @@ $( | ||
164 | $('.left-num').hide(); | 164 | $('.left-num').hide(); |
165 | $('.btn-plus').removeClass('btn-plus'); | 165 | $('.btn-plus').removeClass('btn-plus'); |
166 | $('.addto-cart').text('立即购买'); | 166 | $('.addto-cart').text('立即购买'); |
167 | - $('#chose-btn-sure').text('立即抢购').addClass('isSecKill'); | 167 | + $('#chose-btn-sure').text('立即购买').addClass('isSecKill'); |
168 | $('.cart-bar').show(); | 168 | $('.cart-bar').show(); |
169 | var seckillNum = 0; | 169 | var seckillNum = 0; |
170 | 170 |
@@ -56,13 +56,14 @@ | @@ -56,13 +56,14 @@ | ||
56 | .fans { | 56 | .fans { |
57 | margin-right: 10px; | 57 | margin-right: 10px; |
58 | color: #666; | 58 | color: #666; |
59 | + font-size: 22px; | ||
59 | } | 60 | } |
60 | 61 | ||
61 | .collect-btn { | 62 | .collect-btn { |
62 | color: #b0b0b0; | 63 | color: #b0b0b0; |
63 | display: inline-block; | 64 | display: inline-block; |
64 | width: 50px; | 65 | width: 50px; |
65 | - font-size: 24px; | 66 | + font-size: 26px; |
66 | text-align: center; | 67 | text-align: center; |
67 | } | 68 | } |
68 | 69 | ||
@@ -109,19 +110,17 @@ | @@ -109,19 +110,17 @@ | ||
109 | .giving { | 110 | .giving { |
110 | width: 170px; | 111 | width: 170px; |
111 | color: #b0b0b0; | 112 | color: #b0b0b0; |
112 | - position: relative; | ||
113 | - top: -10px; | 113 | + font-size: 22px; |
114 | } | 114 | } |
115 | } | 115 | } |
116 | 116 | ||
117 | .info-content { | 117 | .info-content { |
118 | height: 235px; | 118 | height: 235px; |
119 | - padding: 30px; | ||
120 | border-top: 1px solid #e0e0e0; | 119 | border-top: 1px solid #e0e0e0; |
121 | 120 | ||
122 | .content { | 121 | .content { |
123 | width: 690px; | 122 | width: 690px; |
124 | - height: 175px; | 123 | + height: 233px; |
125 | } | 124 | } |
126 | } | 125 | } |
127 | } | 126 | } |
@@ -153,7 +153,7 @@ function tranformPayment(data, orderInfo) { | @@ -153,7 +153,7 @@ function tranformPayment(data, orderInfo) { | ||
153 | 153 | ||
154 | // 有货币 | 154 | // 有货币 |
155 | result.yohoCoin = data.yoho_coin; | 155 | result.yohoCoin = data.yoho_coin; |
156 | - result.useYohoCoin = false; //data.use_yoho_coin; | 156 | + result.useYohoCoin = false; // data.use_yoho_coin; |
157 | 157 | ||
158 | // 发票 | 158 | // 发票 |
159 | if (data.invoices) { | 159 | if (data.invoices) { |
-
Please register or login to post a comment