Merge branch 'hotfix/sale-pager' into 'master'
Hotfix/sale pager See merge request !392
Showing
4 changed files
with
26 additions
and
13 deletions
@@ -430,10 +430,6 @@ function getSaleDiscountData(params, channel) { | @@ -430,10 +430,6 @@ function getSaleDiscountData(params, channel) { | ||
430 | Object.assign(finalResult, { | 430 | Object.assign(finalResult, { |
431 | leftContent: publicHandler.handleSaleSortData(subResult[0].data.filter.group_sort, | 431 | leftContent: publicHandler.handleSaleSortData(subResult[0].data.filter.group_sort, |
432 | params, 'discount', baseUrl), | 432 | params, 'discount', baseUrl), |
433 | - saleList: { | ||
434 | - footPager: listHandler.handlePagerData(subResult[0].data.total, params, true, baseUrl), | ||
435 | - opts: publicHandler.handleSaleOptsData(params, subResult[0].data.total, 'default', baseUrl) | ||
436 | - } | ||
437 | }); | 433 | }); |
438 | } | 434 | } |
439 | 435 | ||
@@ -441,9 +437,13 @@ function getSaleDiscountData(params, channel) { | @@ -441,9 +437,13 @@ function getSaleDiscountData(params, channel) { | ||
441 | if (subResult[1].code === 200) { | 437 | if (subResult[1].code === 200) { |
442 | let sknArr = []; | 438 | let sknArr = []; |
443 | 439 | ||
444 | - finalResult.saleList = finalResult.saleList || {}; | ||
445 | - finalResult.saleList.goods = productProcess.processProductList(subResult[1].data.product_list); | ||
446 | - finalResult.saleList.totalCount = subResult[1].data.total; | 440 | + finalResult.saleList = { |
441 | + footPager: listHandler.handlePagerData(subResult[1].data.total, Object.assign({ | ||
442 | + limit: 60 | ||
443 | + }, params), true, baseUrl), | ||
444 | + opts: publicHandler.handleSaleOptsData(params, subResult[1].data.total, 'default', baseUrl), | ||
445 | + goods: productProcess.processProductList(subResult[1].data.product_list) | ||
446 | + }; | ||
447 | _.forEach(finalResult.saleList.goods, (value, key) => { | 447 | _.forEach(finalResult.saleList.goods, (value, key) => { |
448 | if (sknArr.length < 3) { | 448 | if (sknArr.length < 3) { |
449 | sknArr.push(value.product_skn); | 449 | sknArr.push(value.product_skn); |
@@ -39,6 +39,14 @@ const online = (req, res, next) => { | @@ -39,6 +39,14 @@ const online = (req, res, next) => { | ||
39 | return next(); | 39 | return next(); |
40 | } | 40 | } |
41 | 41 | ||
42 | + if (order.pay_lefttime) { | ||
43 | + order.pay_lefttime = +order.pay_lefttime - 3600; | ||
44 | + | ||
45 | + if (order.pay_lefttime < 0) { | ||
46 | + order.pay_lefttime = 0; | ||
47 | + } | ||
48 | + } | ||
49 | + | ||
42 | order.payment_type = parseInt(order.payment_type, 10); | 50 | order.payment_type = parseInt(order.payment_type, 10); |
43 | 51 | ||
44 | if (amount <= 0 || order.payment_type === 2) { | 52 | if (amount <= 0 || order.payment_type === 2) { |
@@ -11,6 +11,7 @@ var $btnby = $('input.btnby'), | @@ -11,6 +11,7 @@ var $btnby = $('input.btnby'), | ||
11 | $formGo = $('.form-go'), | 11 | $formGo = $('.form-go'), |
12 | Alert = dialog.Alert, | 12 | Alert = dialog.Alert, |
13 | time = $('.js-time').data('time'), | 13 | time = $('.js-time').data('time'), |
14 | + timeInterval, | ||
14 | $timer = $('.js-timer'), | 15 | $timer = $('.js-timer'), |
15 | C_ID; | 16 | C_ID; |
16 | 17 | ||
@@ -61,7 +62,7 @@ payPage = { | @@ -61,7 +62,7 @@ payPage = { | ||
61 | }); | 62 | }); |
62 | 63 | ||
63 | this.setTimer(); | 64 | this.setTimer(); |
64 | - setInterval(function() { | 65 | + timeInterval = setInterval(function() { |
65 | self.setTimer(); | 66 | self.setTimer(); |
66 | }, 1000); | 67 | }, 1000); |
67 | }, | 68 | }, |
@@ -139,10 +140,14 @@ payPage = { | @@ -139,10 +140,14 @@ payPage = { | ||
139 | }); | 140 | }); |
140 | }, | 141 | }, |
141 | setTimer: function() { | 142 | setTimer: function() { |
142 | - var hour = Math.floor(time / 3600); | ||
143 | - var minus = Math.floor((time % 3600) / 60); | ||
144 | - var second = time % 60; | ||
145 | - var text = ''; | 143 | + if (time < 0) { |
144 | + return clearInterval(timeInterval); | ||
145 | + } | ||
146 | + | ||
147 | + let hour = Math.floor(time / 3600); | ||
148 | + let minus = Math.floor((time % 3600) / 60); | ||
149 | + let second = time % 60; | ||
150 | + let text = ''; | ||
146 | 151 | ||
147 | if (hour > 0) { | 152 | if (hour > 0) { |
148 | text += hour + '小时'; | 153 | text += hour + '小时'; |
-
Please register or login to post a comment