Merge branch 'feature/plusstar' into 'gray'
潮流优选优化、sale报错 See merge request !604
Showing
4 changed files
with
22 additions
and
2 deletions
@@ -182,7 +182,7 @@ let discountDetail = (req, res, next) => { | @@ -182,7 +182,7 @@ let discountDetail = (req, res, next) => { | ||
182 | params.renderData.pageHeader.navTitle = result.title; | 182 | params.renderData.pageHeader.navTitle = result.title; |
183 | 183 | ||
184 | // 唤起 APP 的路径 | 184 | // 唤起 APP 的路径 |
185 | - res.locals.appPath = `yohobuy://yohobuy.com/goapp?openby:yohobuy={"action":"go.discountmarketpro","params":{"id":"${id}","cover_url":"${result.activity.cover_url.split('?')[0]}","title":"${result.title}"}}`; | 185 | + res.locals.appPath = result.activity && result.activity.cover_url ? `yohobuy://yohobuy.com/goapp?openby:yohobuy={"action":"go.discountmarketpro","params":{"id":"${id}","cover_url":"${result.activity.cover_url.split('?')[0]}","title":"${result.title}"}}` : ''; |
186 | 186 | ||
187 | res.render('sale/discount-detail', Object.assign(params.renderData, result, { | 187 | res.render('sale/discount-detail', Object.assign(params.renderData, result, { |
188 | localCss: true | 188 | localCss: true |
@@ -306,7 +306,7 @@ plusstar = { | @@ -306,7 +306,7 @@ plusstar = { | ||
306 | }); | 306 | }); |
307 | }, 300); | 307 | }, 300); |
308 | }, | 308 | }, |
309 | - goodsList: function() { | 309 | + goodsList: function(reload) { |
310 | let that = this, | 310 | let that = this, |
311 | skn = []; | 311 | skn = []; |
312 | 312 | ||
@@ -319,6 +319,10 @@ plusstar = { | @@ -319,6 +319,10 @@ plusstar = { | ||
319 | return false; | 319 | return false; |
320 | } | 320 | } |
321 | 321 | ||
322 | + if (!reload) { | ||
323 | + $('.goods').append('<div class="divide">正在加载...</div>'); | ||
324 | + } | ||
325 | + | ||
322 | loading.showLoadingMask(); | 326 | loading.showLoadingMask(); |
323 | skn = that.common.productSkns.slice((that.common.page - 1) * | 327 | skn = that.common.productSkns.slice((that.common.page - 1) * |
324 | that.common.pagesize, that.common.page * that.common.pagesize); | 328 | that.common.pagesize, that.common.page * that.common.pagesize); |
@@ -356,6 +360,7 @@ plusstar = { | @@ -356,6 +360,7 @@ plusstar = { | ||
356 | PAGE_NUM: that.common.page - 1 | 360 | PAGE_NUM: that.common.page - 1 |
357 | }); | 361 | }); |
358 | 362 | ||
363 | + $('.divide').remove(); | ||
359 | $('.plusstar-resources .goods').append(data); | 364 | $('.plusstar-resources .goods').append(data); |
360 | 365 | ||
361 | $('.plusstar-resources .goods').find('img.lazy:not([src])').lazyload(); | 366 | $('.plusstar-resources .goods').find('img.lazy:not([src])').lazyload(); |
@@ -399,6 +404,8 @@ $(function() { | @@ -399,6 +404,8 @@ $(function() { | ||
399 | 404 | ||
400 | plusstar.init(); | 405 | plusstar.init(); |
401 | 406 | ||
407 | + plusstar.goodsList(true); | ||
408 | + | ||
402 | // 滚动翻页 | 409 | // 滚动翻页 |
403 | $(window).scroll(function() { | 410 | $(window).scroll(function() { |
404 | scrollFn(); | 411 | scrollFn(); |
@@ -356,6 +356,10 @@ function filterInit() { | @@ -356,6 +356,10 @@ function filterInit() { | ||
356 | url: '/product/sale/filter', | 356 | url: '/product/sale/filter', |
357 | data: defaultOpt, | 357 | data: defaultOpt, |
358 | success: function(data) { | 358 | success: function(data) { |
359 | + if (data === '') { | ||
360 | + return false; | ||
361 | + } | ||
362 | + | ||
359 | $goodsContainer.append(data); | 363 | $goodsContainer.append(data); |
360 | 364 | ||
361 | // 初始化filter&注册filter回调 | 365 | // 初始化filter&注册filter回调 |
@@ -198,6 +198,15 @@ | @@ -198,6 +198,15 @@ | ||
198 | .goods { | 198 | .goods { |
199 | background-color: #fff; | 199 | background-color: #fff; |
200 | padding: 0 14px; | 200 | padding: 0 14px; |
201 | + | ||
202 | + .divide { | ||
203 | + float: left; | ||
204 | + height: 50px; | ||
205 | + width: 100%; | ||
206 | + padding: 10px 0; | ||
207 | + color: #ccc; | ||
208 | + text-align: center; | ||
209 | + } | ||
201 | } | 210 | } |
202 | } | 211 | } |
203 | 212 |
-
Please register or login to post a comment