Authored by 郝肖肖

'店铺miniPath'

... ... @@ -185,6 +185,19 @@ const shop = {
}).catch(next);
},
_getMiniAppPath(brands) {
if (!brands || brands.length !== 1) {
return '';
}
let brandId = _.get(brands, '[0].brand_id', 0);
let brandName = _.get(brands, '[0].brand_name', 0);
// param:品牌ID, name:品牌名称, miniQrType 1:商品 2 品牌,miniapp_type 0:有货,1:新与力
let miniPath = `${global.yoho.config.domains.api}wechat/miniapp/img-check.jpg?miniapp_type=0&param=${brandId}&name=${brandName}&miniQrType=2`; // eslint-disable-line
return {miniPath};
},
/**
* 品牌
*/
... ... @@ -375,14 +388,14 @@ const shop = {
}
req.ctx(shopModel).getShopBrands(req.query.shop_id).then(result => {
res.render('newshop/all-brand', {
res.render('newshop/all-brand', Object.assign({
result: result,
pageHeader: headerModel.setNav({
navTitle: '品牌'
}),
module: 'product',
page: 'all-brand',
});
page: 'all-brand'
}, shop._getMiniAppPath(result)));
}).catch(next);
},
... ...