Authored by 陈轩

Merge branch 'hoftix/productDetailSkn' into 'release/5.3'

商品详情页支持 SKN 访问



See merge request !36
... ... @@ -10,10 +10,16 @@ const headerModel = require('../../../doraemon/models/header'); // 头部model
const newDetail = {
index(req, res, next) {
let id = req.params[0],
goodsId = req.params[1];
let id;
let goodsId;
let productSkn;
if (!id || !goodsId) {
if (req.params[0] && req.params[1]) {
id = req.params[0];
goodsId = req.params[1];
} else if (req.params[0]) {
productSkn = req.params[0];
} else {
return next();
}
... ... @@ -24,13 +30,15 @@ const newDetail = {
newDetailModel.getProductData({
id: id,
goodsId: goodsId,
productSkn: productSkn,
ua: req.get('user-agent') || ''
}).then((result) => {
if (_.isEmpty(result)) {
return next();
}
result.id = id;
result.goodsId = goodsId;
// result.id = id;
// result.goodsId = goodsId;
let appParams = {product_skn: result.productSkn};
let appPath = 'yohobuy://yohobuy.com/goapp?openby:yohobuy={"action":"go.productDetail","params":' +
... ...
... ... @@ -57,7 +57,7 @@ router.get(/^\/seckill\/show_([\d]+)/, seckillDetail.indexSkn); // 秒æ€å•†å“è
router.get(/^\/seckill\/pro_([\d]+)_([\d]+)/, seckillDetail.index); // 秒杀商品详情页进入
router.get(/^\/pro_([\d]+)_([\d]+)/, newDetail.index); // 商品详情页
// /show_51047967.html
router.get(/^\/show_([\d]+)/, detail.indexSkn); // 商品详情页 SKN 进入
router.get(/^\/show_([\d]+)/, newDetail.index); // 商品详情页 SKN 进入
router.get('/detail/sknData.json', newDetail.sknData); // 商品咨询,评价,店铺
router.get('/detail/intro/:productskn', detail.intro); // 商品内嵌页
... ...