...
|
...
|
@@ -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":' +
|
...
|
...
|
|