Authored by lijing

普通秒杀详情跳转

... ... @@ -50,7 +50,8 @@ const seckillDetail = require(`${cRoot}/seckill-detail`);
// /pro_136349_455445/HEARTSOFARMianMaShuJiaoXiuXianKuPS1684.html
// 因为正则匹配原因,秒杀详情页路由要放在普通详情页前面,待解决
router.get(/^\/seckill\/show_([\d]+)/, seckillDetail.getUser, seckillDetail.indexSkn); // 秒杀商品详情页 SKN 进入
router.get(/^\/seckill\/show_([\d]+)/, seckillDetail.indexSkn); // 秒杀商品详情页 SKN 进入
router.get(/^\/seckill\/pro_([\d]+)_([\d]+)/, seckillDetail.index); // 秒杀商品详情页进入
router.get(/\/pro_([\d]+)_([\d]+)\/(.*)/, detail.index); // 商品详情页
// /show_51047967.html
... ...
... ... @@ -19,9 +19,10 @@ module.exports = function(callback) {
success: function(data) {
// 如果当前是秒杀商品,且不在秒杀路径下,跳到该商品的秒杀详情页
var reg = /\/product\/show_([\d]+)/;
var regPro = /\/product\/pro_([\d]+)_([\d]+)/;
var thisHref = window.location.href;
if (data.isSecKill === 'Y' && reg.test(thisHref)) {
if (data.isSecKill === 'Y' && (reg.test(thisHref) || regPro.test(thisHref))) {
window.location.href = '/product/seckill/show_' + $('#productSkn').val() + '.html';
}
render(data);
... ...