Authored by 郝肖肖

'miniapp-open'

... ... @@ -73,10 +73,11 @@ const newDetail = {
pageFooter: true,
localCss: true,
appPath: appPath,
miniPath: helpers.urlFormat('/api/wechat/miniapp.jpg', {
miniPath: helpers.urlFormat('/wechat/miniapp.jpg', {
miniapp_type: 0,
param: result.productSkn,
miniQrType: 1
miniQrType: 1,
isOpen: _.get(req.app, 'locals.wap.wechat.miniPathOpen', false)
}), // param:品牌ID, name:品牌名称, miniQrType 1:商品 2 品牌,miniapp_type 0:有货,1:新与力
isMarsApp: req.yoho.isMarsApp // 判断mars
});
... ...
... ... @@ -185,17 +185,18 @@ const shop = {
}).catch(next);
},
_getMiniAppPath(brands) {
_getMiniAppPath(req, brands) {
if (!brands || brands.length !== 1) {
return {};
}
// param:品牌ID, name:品牌名称, miniQrType 1:商品 2 品牌,miniapp_type 0:有货,1:新与力
let miniPath = helpers.urlFormat('/api/wechat/miniapp.jpg', {
let miniPath = helpers.urlFormat('/wechat/miniapp.jpg', {
miniapp_type: 0,
param: _.get(brands, '[0].brand_id', 0),
name: encodeURIComponent(_.get(brands, '[0].brand_name', '')),
miniQrType: 2
miniQrType: 2,
isOpen: _.get(req.app, 'locals.wap.wechat.miniPathOpen', false)
});
return {miniPath};
... ... @@ -239,7 +240,7 @@ const shop = {
_noLazy: true,
localCss: true
}, _tdkProcess(title),
shop._getMiniAppPath([{brand_id: brandId, brand_name: brandInfo.title}])));
shop._getMiniAppPath(req, [{brand_id: brandId, brand_name: brandInfo.title}])));
})().catch(next);
},
... ... @@ -324,7 +325,7 @@ const shop = {
shppFavHide: shppFavHide
},
_tdkProcess(shopInfo.shop_name),
shop._getMiniAppPath(shopBrands)
shop._getMiniAppPath(req, shopBrands)
));
})().catch(next);
},
... ... @@ -385,7 +386,7 @@ const shop = {
couponData
},
_tdkProcess(title),
shop._getMiniAppPath(shopBrands)
shop._getMiniAppPath(req, shopBrands)
));
})().catch(next);
... ... @@ -409,7 +410,7 @@ const shop = {
}),
module: 'product',
page: 'all-brand'
}, shop._getMiniAppPath(result)));
}, shop._getMiniAppPath(req, result)));
}).catch(next);
},
... ...