Showing
3 changed files
with
11 additions
and
2 deletions
@@ -221,3 +221,7 @@ exports.tplPraiseToggle = function(req, res, next) { | @@ -221,3 +221,7 @@ exports.tplPraiseToggle = function(req, res, next) { | ||
221 | res.jsonp(result); | 221 | res.jsonp(result); |
222 | }).catch(next); | 222 | }).catch(next); |
223 | }; | 223 | }; |
224 | + | ||
225 | +exports.getServerTimes = function(req, res) { | ||
226 | + res.jsonp(Math.round(new Date() / 1000)); | ||
227 | +}; |
@@ -284,6 +284,7 @@ router.get('/feature/goods', feature.goods); // 批量获取商品信息 | @@ -284,6 +284,7 @@ router.get('/feature/goods', feature.goods); // 批量获取商品信息 | ||
284 | router.get('/feature/goods/detail', feature.goodsDetail); // 获取商品详情 | 284 | router.get('/feature/goods/detail', feature.goodsDetail); // 获取商品详情 |
285 | router.get('/feature/floors/praise', feature.tplPraiseInfo); // 楼层点赞信息 | 285 | router.get('/feature/floors/praise', feature.tplPraiseInfo); // 楼层点赞信息 |
286 | router.get('/feature/floors/togglepraise', feature.tplPraiseToggle); // 楼层点赞/取消 | 286 | router.get('/feature/floors/togglepraise', feature.tplPraiseToggle); // 楼层点赞/取消 |
287 | +router.get('/feature/getServerTimes', feature.getServerTimes); // 获取服务段时间 | ||
287 | 288 | ||
288 | // 2016 年度账单 | 289 | // 2016 年度账单 |
289 | router.get('/annual-account', annualAccount.index); | 290 | router.get('/annual-account', annualAccount.index); |
@@ -828,13 +828,16 @@ function activityPlan() { | @@ -828,13 +828,16 @@ function activityPlan() { | ||
828 | let templateId = $('.template-id').val(); | 828 | let templateId = $('.template-id').val(); |
829 | 829 | ||
830 | if (atlBo) { | 830 | if (atlBo) { |
831 | - let curTime = Math.round(new Date() / 1000); | 831 | + $.ajax({ |
832 | + url: '//m.yohobuy.com/activity/feature/getServerTimes', | ||
833 | + dataType: 'jsonp' | ||
834 | + }).then(function(curTime) { | ||
832 | let showTimes = []; | 835 | let showTimes = []; |
833 | let planTimes = []; | 836 | let planTimes = []; |
834 | let localUrl = ''; | 837 | let localUrl = ''; |
835 | let query = ''; | 838 | let query = ''; |
836 | 839 | ||
837 | - qs.timeStamp = curTime; | 840 | + qs.timeStamp = curTime || Math.round(new Date() / 1000); |
838 | 841 | ||
839 | Object.keys(qs).map((key, index) => { | 842 | Object.keys(qs).map((key, index) => { |
840 | if (index === 0) { | 843 | if (index === 0) { |
@@ -875,6 +878,7 @@ function activityPlan() { | @@ -875,6 +878,7 @@ function activityPlan() { | ||
875 | clearTimeout(countDown); | 878 | clearTimeout(countDown); |
876 | }, time); | 879 | }, time); |
877 | } | 880 | } |
881 | + }); | ||
878 | } | 882 | } |
879 | } | 883 | } |
880 | 884 |
-
Please register or login to post a comment