Showing
2 changed files
with
4 additions
and
2 deletions
@@ -50,7 +50,8 @@ const seckillDetail = require(`${cRoot}/seckill-detail`); | @@ -50,7 +50,8 @@ const seckillDetail = require(`${cRoot}/seckill-detail`); | ||
50 | // /pro_136349_455445/HEARTSOFARMianMaShuJiaoXiuXianKuPS1684.html | 50 | // /pro_136349_455445/HEARTSOFARMianMaShuJiaoXiuXianKuPS1684.html |
51 | 51 | ||
52 | // 因为正则匹配原因,秒杀详情页路由要放在普通详情页前面,待解决 | 52 | // 因为正则匹配原因,秒杀详情页路由要放在普通详情页前面,待解决 |
53 | -router.get(/^\/seckill\/show_([\d]+)/, seckillDetail.getUser, seckillDetail.indexSkn); // 秒杀商品详情页 SKN 进入 | 53 | +router.get(/^\/seckill\/show_([\d]+)/, seckillDetail.indexSkn); // 秒杀商品详情页 SKN 进入 |
54 | +router.get(/^\/seckill\/pro_([\d]+)_([\d]+)/, seckillDetail.index); // 秒杀商品详情页进入 | ||
54 | 55 | ||
55 | router.get(/\/pro_([\d]+)_([\d]+)\/(.*)/, detail.index); // 商品详情页 | 56 | router.get(/\/pro_([\d]+)_([\d]+)\/(.*)/, detail.index); // 商品详情页 |
56 | // /show_51047967.html | 57 | // /show_51047967.html |
@@ -19,9 +19,10 @@ module.exports = function(callback) { | @@ -19,9 +19,10 @@ module.exports = function(callback) { | ||
19 | success: function(data) { | 19 | success: function(data) { |
20 | // 如果当前是秒杀商品,且不在秒杀路径下,跳到该商品的秒杀详情页 | 20 | // 如果当前是秒杀商品,且不在秒杀路径下,跳到该商品的秒杀详情页 |
21 | var reg = /\/product\/show_([\d]+)/; | 21 | var reg = /\/product\/show_([\d]+)/; |
22 | + var regPro = /\/product\/pro_([\d]+)_([\d]+)/; | ||
22 | var thisHref = window.location.href; | 23 | var thisHref = window.location.href; |
23 | 24 | ||
24 | - if (data.isSecKill === 'Y' && reg.test(thisHref)) { | 25 | + if (data.isSecKill === 'Y' && (reg.test(thisHref) || regPro.test(thisHref))) { |
25 | window.location.href = '/product/seckill/show_' + $('#productSkn').val() + '.html'; | 26 | window.location.href = '/product/seckill/show_' + $('#productSkn').val() + '.html'; |
26 | } | 27 | } |
27 | render(data); | 28 | render(data); |
-
Please register or login to post a comment