Showing
1 changed file
with
16 additions
and
3 deletions
@@ -185,6 +185,19 @@ const shop = { | @@ -185,6 +185,19 @@ const shop = { | ||
185 | }).catch(next); | 185 | }).catch(next); |
186 | }, | 186 | }, |
187 | 187 | ||
188 | + _getMiniAppPath(brands) { | ||
189 | + if (!brands || brands.length !== 1) { | ||
190 | + return ''; | ||
191 | + } | ||
192 | + | ||
193 | + let brandId = _.get(brands, '[0].brand_id', 0); | ||
194 | + let brandName = _.get(brands, '[0].brand_name', 0); | ||
195 | + | ||
196 | + // param:品牌ID, name:品牌名称, miniQrType 1:商品 2 品牌,miniapp_type 0:有货,1:新与力 | ||
197 | + let miniPath = `${global.yoho.config.domains.api}wechat/miniapp/img-check.jpg?miniapp_type=0¶m=${brandId}&name=${brandName}&miniQrType=2`; // eslint-disable-line | ||
198 | + return {miniPath}; | ||
199 | + }, | ||
200 | + | ||
188 | /** | 201 | /** |
189 | * 品牌 | 202 | * 品牌 |
190 | */ | 203 | */ |
@@ -375,14 +388,14 @@ const shop = { | @@ -375,14 +388,14 @@ const shop = { | ||
375 | } | 388 | } |
376 | 389 | ||
377 | req.ctx(shopModel).getShopBrands(req.query.shop_id).then(result => { | 390 | req.ctx(shopModel).getShopBrands(req.query.shop_id).then(result => { |
378 | - res.render('newshop/all-brand', { | 391 | + res.render('newshop/all-brand', Object.assign({ |
379 | result: result, | 392 | result: result, |
380 | pageHeader: headerModel.setNav({ | 393 | pageHeader: headerModel.setNav({ |
381 | navTitle: '品牌' | 394 | navTitle: '品牌' |
382 | }), | 395 | }), |
383 | module: 'product', | 396 | module: 'product', |
384 | - page: 'all-brand', | ||
385 | - }); | 397 | + page: 'all-brand' |
398 | + }, shop._getMiniAppPath(result))); | ||
386 | }).catch(next); | 399 | }).catch(next); |
387 | }, | 400 | }, |
388 | 401 |
-
Please register or login to post a comment