Showing
14 changed files
with
37 additions
and
34 deletions
@@ -163,7 +163,7 @@ let shopRecom = (req, res, next) => { | @@ -163,7 +163,7 @@ let shopRecom = (req, res, next) => { | ||
163 | }).then(result => { | 163 | }).then(result => { |
164 | res.send(result); | 164 | res.send(result); |
165 | }).catch(next); | 165 | }).catch(next); |
166 | -} | 166 | +}; |
167 | 167 | ||
168 | /** | 168 | /** |
169 | * 获取用户vip信息 | 169 | * 获取用户vip信息 |
@@ -187,12 +187,12 @@ let userVip = (req, res, next) => { | @@ -187,12 +187,12 @@ let userVip = (req, res, next) => { | ||
187 | res.json({ | 187 | res.json({ |
188 | code: 500, | 188 | code: 500, |
189 | msg: '出错了', | 189 | msg: '出错了', |
190 | - }) | 190 | + }); |
191 | } | 191 | } |
192 | }); | 192 | }); |
193 | } | 193 | } |
194 | 194 | ||
195 | -} | 195 | +}; |
196 | 196 | ||
197 | module.exports = { | 197 | module.exports = { |
198 | switchChannel, | 198 | switchChannel, |
@@ -31,5 +31,5 @@ router.get('/brands/delBrandHistory', brandController.delBrandHistory); // 删 | @@ -31,5 +31,5 @@ router.get('/brands/delBrandHistory', brandController.delBrandHistory); // 删 | ||
31 | 31 | ||
32 | // 5.2新楼层功能 | 32 | // 5.2新楼层功能 |
33 | router.post('/channel/shopRecom', channel.shopRecom); // 店铺推荐收藏状态 | 33 | router.post('/channel/shopRecom', channel.shopRecom); // 店铺推荐收藏状态 |
34 | -router.post('/channel/userVip', channel.userVip) | 34 | +router.post('/channel/userVip', channel.userVip); |
35 | module.exports = router; | 35 | module.exports = router; |
@@ -31,9 +31,9 @@ const index = (req, res, next) => { | @@ -31,9 +31,9 @@ const index = (req, res, next) => { | ||
31 | copyright: '2015 yoho.inc', | 31 | copyright: '2015 yoho.inc', |
32 | generator: 'http://m.yohobuy.com', | 32 | generator: 'http://m.yohobuy.com', |
33 | updated: new Date(), | 33 | updated: new Date(), |
34 | - }) | 34 | + }); |
35 | _.forEach(result, item => { | 35 | _.forEach(result, item => { |
36 | - item.url = item.url.indexOf('http') >= 0 ? item.url : 'http://'+item.url | 36 | + item.url = item.url.indexOf('http') >= 0 ? item.url : 'http://' + item.url; |
37 | feed.addItem({ | 37 | feed.addItem({ |
38 | title: item.title, | 38 | title: item.title, |
39 | link: `${item.url}&ref=rss`, | 39 | link: `${item.url}&ref=rss`, |
@@ -41,13 +41,13 @@ const index = (req, res, next) => { | @@ -41,13 +41,13 @@ const index = (req, res, next) => { | ||
41 | author: [{ | 41 | author: [{ |
42 | name: (item.author && item.author.name) || ' ' | 42 | name: (item.author && item.author.name) || ' ' |
43 | }], | 43 | }], |
44 | - date: new Date(item.publishTimeLong && parseFloat(item.publishTimeLong) || moment(item.publishTime, "MM月DD日 HH:mm")) | 44 | + date: new Date(item.publishTimeLong && parseFloat(item.publishTimeLong) || moment(item.publishTime, 'MM月DD日 HH:mm')) |
45 | }); | 45 | }); |
46 | }); | 46 | }); |
47 | if (req.params[0] && req.params[0] === '/atom') { | 47 | if (req.params[0] && req.params[0] === '/atom') { |
48 | return res.send(feed.render('atom-1.0')); | 48 | return res.send(feed.render('atom-1.0')); |
49 | } | 49 | } |
50 | - return res.send(feed.render('rss-2.0')) | 50 | + return res.send(feed.render('rss-2.0')); |
51 | }); | 51 | }); |
52 | }; | 52 | }; |
53 | const rss = (req, res, next, gmt) => { | 53 | const rss = (req, res, next, gmt) => { |
@@ -59,8 +59,8 @@ const rss = (req, res, next, gmt) => { | @@ -59,8 +59,8 @@ const rss = (req, res, next, gmt) => { | ||
59 | return next(); | 59 | return next(); |
60 | } | 60 | } |
61 | _.forEach(result, item => { | 61 | _.forEach(result, item => { |
62 | - item.url = item.url.indexOf('http') >= 0 ? item.url : 'http://'+item.url; | ||
63 | - let time = new Date(item.publishTimeLong && parseFloat(item.publishTimeLong) || moment(item.publishTime, "MM月DD日 HH:mm")); | 62 | + item.url = item.url.indexOf('http') >= 0 ? item.url : 'http://' + item.url; |
63 | + let time = new Date(item.publishTimeLong && parseFloat(item.publishTimeLong) || moment(item.publishTime, 'MM月DD日 HH:mm')); | ||
64 | let format = gmt ? 'ddd, MM MMM YYYY hh:mm:ss +0800' : 'YYYY-MM-DD hh:mm:ss +0800'; | 64 | let format = gmt ? 'ddd, MM MMM YYYY hh:mm:ss +0800' : 'YYYY-MM-DD hh:mm:ss +0800'; |
65 | 65 | ||
66 | item.publishTime = moment(time).format(format); | 66 | item.publishTime = moment(time).format(format); |
@@ -45,7 +45,7 @@ const getRssArticle = (gender) => { | @@ -45,7 +45,7 @@ const getRssArticle = (gender) => { | ||
45 | if (typeof value.id !== 'undefined') { | 45 | if (typeof value.id !== 'undefined') { |
46 | build = guangProcess.formatArticle(value, false, false, true); | 46 | build = guangProcess.formatArticle(value, false, false, true); |
47 | build.author = build.author || {}; | 47 | build.author = build.author || {}; |
48 | - build.author.name = (build.author && build.author.name) || '' | 48 | + build.author.name = (build.author && build.author.name) || ''; |
49 | return _genIntro(value.id).then((intro) => { | 49 | return _genIntro(value.id).then((intro) => { |
50 | build.intro = intro; | 50 | build.intro = intro; |
51 | result.push(build); | 51 | result.push(build); |
@@ -311,10 +311,10 @@ const account = (req, res) => { | @@ -311,10 +311,10 @@ const account = (req, res) => { | ||
311 | if (req.cookies.appVersion) { | 311 | if (req.cookies.appVersion) { |
312 | var versions = req.cookies.appVersion.split('.'); | 312 | var versions = req.cookies.appVersion.split('.'); |
313 | if (versions.length >= 2) { | 313 | if (versions.length >= 2) { |
314 | - if (versions[0] < 5 || (parseInt(versions[0], 10)===5 && versions[1] <= 1)) { | 314 | + if (versions[0] < 5 || (parseInt(versions[0], 10) === 5 && versions[1] <= 1)) { |
315 | 315 | ||
316 | } else { | 316 | } else { |
317 | - url = helpers.appUrlFormat(url, 'go.instalmentMyCard') | 317 | + url = helpers.appUrlFormat(url, 'go.instalmentMyCard'); |
318 | } | 318 | } |
319 | } | 319 | } |
320 | } | 320 | } |
@@ -9,7 +9,7 @@ exports.getQr = (params) => { | @@ -9,7 +9,7 @@ exports.getQr = (params) => { | ||
9 | 9 | ||
10 | try { | 10 | try { |
11 | uid = crypto.decrypt(PASSWORD, decodeURIComponent(params.token)); | 11 | uid = crypto.decrypt(PASSWORD, decodeURIComponent(params.token)); |
12 | - uid = parseInt(uid, 10) | 12 | + uid = parseInt(uid, 10); |
13 | } catch (e) { | 13 | } catch (e) { |
14 | uid = params.token; | 14 | uid = params.token; |
15 | } | 15 | } |
@@ -1595,7 +1595,7 @@ let _detailDataPkgAsync = (origin, uid, vipLevel, ua) => { | @@ -1595,7 +1595,7 @@ let _detailDataPkgAsync = (origin, uid, vipLevel, ua) => { | ||
1595 | 1595 | ||
1596 | if (origin.is_secKill) { | 1596 | if (origin.is_secKill) { |
1597 | dest.isDepositAdvance = origin.isDeposit_advance;// A定金预售字段 = origin.is_deposit_advance === 'Y'; // 是否定金预售 | 1597 | dest.isDepositAdvance = origin.isDeposit_advance;// A定金预售字段 = origin.is_deposit_advance === 'Y'; // 是否定金预售 |
1598 | - dest.isPresale = Boolean(origin.expect_arrival_time) | 1598 | + dest.isPresale = Boolean(origin.expect_arrival_time); |
1599 | } | 1599 | } |
1600 | 1600 | ||
1601 | // 商品返回 YOHO 币 | 1601 | // 商品返回 YOHO 币 |
@@ -339,7 +339,7 @@ $reaMask.on('touchend', function(event) { | @@ -339,7 +339,7 @@ $reaMask.on('touchend', function(event) { | ||
339 | event.stopPropagation(); | 339 | event.stopPropagation(); |
340 | }); | 340 | }); |
341 | 341 | ||
342 | -$('.nav-tap').on('click', function(e){ | 342 | +$('.nav-tap').on('click', function(e) { |
343 | var $cur = $(e.target); | 343 | var $cur = $(e.target); |
344 | location.replace($cur.data('url')); | 344 | location.replace($cur.data('url')); |
345 | -}) | ||
345 | +}); |
@@ -32,11 +32,11 @@ $content.on('focus', function() { | @@ -32,11 +32,11 @@ $content.on('focus', function() { | ||
32 | $content.val('请输入咨询内容'); | 32 | $content.val('请输入咨询内容'); |
33 | } | 33 | } |
34 | }); | 34 | }); |
35 | -var getUrlParam = function (paramName) { | ||
36 | - var reg = "[\\?|\\&]+" + paramName + "=([^&]*)[^&]?"; | ||
37 | - var exp = (window.location.href + "").match(reg); | ||
38 | - return exp ? exp[1] : ""; | ||
39 | -} | 35 | +var getUrlParam = function(paramName) { |
36 | + var reg = '[\\?|\\&]+' + paramName + '=([^&]*)[^&]?'; | ||
37 | + var exp = (window.location.href + '').match(reg); | ||
38 | + return exp ? exp[1] : ''; | ||
39 | +}; | ||
40 | 40 | ||
41 | // 提交表单请求 | 41 | // 提交表单请求 |
42 | $consultForm.on('submit', function() { | 42 | $consultForm.on('submit', function() { |
@@ -43,6 +43,7 @@ var winH = $(window).height(), | @@ -43,6 +43,7 @@ var winH = $(window).height(), | ||
43 | noResult = '<p class="no-result">未找到相关搜索结果</p>'; | 43 | noResult = '<p class="no-result">未找到相关搜索结果</p>'; |
44 | 44 | ||
45 | require('../common'); | 45 | require('../common'); |
46 | + | ||
46 | // 默认筛选条件 | 47 | // 默认筛选条件 |
47 | var defaultOpt = require('../common/query-param'); | 48 | var defaultOpt = require('../common/query-param'); |
48 | 49 | ||
@@ -51,7 +52,7 @@ var defaultOpt = require('../common/query-param'); | @@ -51,7 +52,7 @@ var defaultOpt = require('../common/query-param'); | ||
51 | var param = location.search; | 52 | var param = location.search; |
52 | var isApp = param.indexOf('app_version') > -1 || param.indexOf('appVersion') > -1; | 53 | var isApp = param.indexOf('app_version') > -1 || param.indexOf('appVersion') > -1; |
53 | 54 | ||
54 | - //不阻塞字体文件加载 | 55 | + // 不阻塞字体文件加载 |
55 | setTimeout(function() { | 56 | setTimeout(function() { |
56 | if (isApp) { | 57 | if (isApp) { |
57 | $.ajax({ | 58 | $.ajax({ |
@@ -95,7 +96,7 @@ var defaultOpt = require('../common/query-param'); | @@ -95,7 +96,7 @@ var defaultOpt = require('../common/query-param'); | ||
95 | skns: $('.popularity-title').data('skns'), | 96 | skns: $('.popularity-title').data('skns'), |
96 | }, | 97 | }, |
97 | success: function(data) { | 98 | success: function(data) { |
98 | - $('.product-warp>.goods-container').html(data) | 99 | + $('.product-warp>.goods-container').html(data); |
99 | }, | 100 | }, |
100 | error: function() { | 101 | error: function() { |
101 | tip.show('网络断开连接了~'); | 102 | tip.show('网络断开连接了~'); |
@@ -126,7 +127,7 @@ var defaultOpt = require('../common/query-param'); | @@ -126,7 +127,7 @@ var defaultOpt = require('../common/query-param'); | ||
126 | }); | 127 | }); |
127 | } | 128 | } |
128 | }); | 129 | }); |
129 | - }, 0) | 130 | + }, 0); |
130 | 131 | ||
131 | }()); | 132 | }()); |
132 | 133 | ||
@@ -229,6 +230,7 @@ function getPageGoods(info) { | @@ -229,6 +230,7 @@ function getPageGoods(info) { | ||
229 | 230 | ||
230 | navType = info.data.type; | 231 | navType = info.data.type; |
231 | nav = navInfo[navType]; | 232 | nav = navInfo[navType]; |
233 | + | ||
232 | // 不需要重新加载并且数据请求结束 | 234 | // 不需要重新加载并且数据请求结束 |
233 | if (nav.end && toTop) { | 235 | if (nav.end && toTop) { |
234 | toTop = false; | 236 | toTop = false; |
@@ -332,8 +334,8 @@ function tabChange(dom, index) { | @@ -332,8 +334,8 @@ function tabChange(dom, index) { | ||
332 | // 首页导航 | 334 | // 首页导航 |
333 | (function(nav, posNav, main) { | 335 | (function(nav, posNav, main) { |
334 | var scrollToNav1 = function() { | 336 | var scrollToNav1 = function() { |
335 | - window.scrollTo(0, $('#nav').offset().top + 5) | ||
336 | - } | 337 | + window.scrollTo(0, $('#nav').offset().top + 5); |
338 | + }; | ||
337 | $(nav + ' li, ' + posNav + ' li').not('li.all-goods').on('touchstart', function() { | 339 | $(nav + ' li, ' + posNav + ' li').not('li.all-goods').on('touchstart', function() { |
338 | var index = $(this).index(), | 340 | var index = $(this).index(), |
339 | activeTab = $(this).attr('tab'); | 341 | activeTab = $(this).attr('tab'); |
@@ -376,7 +378,8 @@ function scrollHandler() { | @@ -376,7 +378,8 @@ function scrollHandler() { | ||
376 | nav2OffsetTop = $('#list-nav').length ? $('#list-nav').offset().top : 0; | 378 | nav2OffsetTop = $('#list-nav').length ? $('#list-nav').offset().top : 0; |
377 | 379 | ||
378 | var tra; | 380 | var tra; |
379 | - //分页加载店铺商品列表 | 381 | + |
382 | + // 分页加载店铺商品列表 | ||
380 | if (sTop + winH > scH - 0.25 * $goodsContainer.height() - 50) { | 383 | if (sTop + winH > scH - 0.25 * $goodsContainer.height() - 50) { |
381 | if ($pre !== undefined) { | 384 | if ($pre !== undefined) { |
382 | search({ | 385 | search({ |
@@ -389,7 +392,7 @@ function scrollHandler() { | @@ -389,7 +392,7 @@ function scrollHandler() { | ||
389 | } | 392 | } |
390 | } | 393 | } |
391 | 394 | ||
392 | - //分页加载“上新”和“人气”商品数据 | 395 | + // 分页加载“上新”和“人气”商品数据 |
393 | if (sTop + winH * 2 > scH) { | 396 | if (sTop + winH * 2 > scH) { |
394 | switch (viewType) { | 397 | switch (viewType) { |
395 | case 2: | 398 | case 2: |
@@ -419,7 +422,7 @@ function scrollHandler() { | @@ -419,7 +422,7 @@ function scrollHandler() { | ||
419 | document.addEventListener('touchmove', function(e) { | 422 | document.addEventListener('touchmove', function(e) { |
420 | // sub classify不阻止默认事件 | 423 | // sub classify不阻止默认事件 |
421 | if ($(e.target).closest('.sub-classify').length === 0) { | 424 | if ($(e.target).closest('.sub-classify').length === 0) { |
422 | - //e.preventDefault(); | 425 | + // e.preventDefault(); |
423 | } | 426 | } |
424 | if ($('.filter-mask').length && !$('.filter-mask').hasClass('hide')) { | 427 | if ($('.filter-mask').length && !$('.filter-mask').hasClass('hide')) { |
425 | e.preventDefault(); | 428 | e.preventDefault(); |
@@ -445,7 +448,7 @@ $(window).ready(function() { | @@ -445,7 +448,7 @@ $(window).ready(function() { | ||
445 | scH = $('#scroller').outerHeight(); | 448 | scH = $('#scroller').outerHeight(); |
446 | }, 500); | 449 | }, 500); |
447 | 450 | ||
448 | - $(document).scroll(scrollHandler) | 451 | + $(document).scroll(scrollHandler); |
449 | lazyLoad($('img.lazy')); | 452 | lazyLoad($('img.lazy')); |
450 | }); | 453 | }); |
451 | 454 | ||
@@ -682,7 +685,7 @@ $subNav.on('touchend touchcancel', function(e) { | @@ -682,7 +685,7 @@ $subNav.on('touchend touchcancel', function(e) { | ||
682 | } | 685 | } |
683 | 686 | ||
684 | } | 687 | } |
685 | - window.scrollTo(0, $('#list-nav').offset().top + 5) | 688 | + window.scrollTo(0, $('#list-nav').offset().top + 5); |
686 | } else { | 689 | } else { |
687 | 690 | ||
688 | filter.hideFilter();// 隐藏面板 | 691 | filter.hideFilter();// 隐藏面板 |
@@ -776,7 +779,7 @@ $subNav.on('touchend touchcancel', function(e) { | @@ -776,7 +779,7 @@ $subNav.on('touchend touchcancel', function(e) { | ||
776 | url: '/product/search/search', | 779 | url: '/product/search/search', |
777 | nextPage: false | 780 | nextPage: false |
778 | }, function() { | 781 | }, function() { |
779 | - window.scrollTo(0, $('#list-nav').offset().top + 5) | 782 | + window.scrollTo(0, $('#list-nav').offset().top + 5); |
780 | }); | 783 | }); |
781 | } | 784 | } |
782 | } | 785 | } |
-
Please register or login to post a comment