Showing
3 changed files
with
10 additions
and
5 deletions
@@ -12,11 +12,14 @@ const mRoot = '../models'; | @@ -12,11 +12,14 @@ const mRoot = '../models'; | ||
12 | const detail = require(`${mRoot}/detail`); | 12 | const detail = require(`${mRoot}/detail`); |
13 | 13 | ||
14 | exports.index = (req, res) => { | 14 | exports.index = (req, res) => { |
15 | - var id = req.params.id; | 15 | + var uid = null, // 需要修改为正式取 UID 的方式 |
16 | + vipLevel = 0;// 用户等级 | ||
16 | 17 | ||
17 | detail({ | 18 | detail({ |
18 | - id: id, | ||
19 | - ua: req.get('user-agent') || '' | 19 | + id: req.params.id, |
20 | + uid: uid, | ||
21 | + vipLevel: vipLevel, | ||
22 | + ua: req.get('user-agent') || '' | ||
20 | }).then((result) => { | 23 | }).then((result) => { |
21 | res.render('detail', { | 24 | res.render('detail', { |
22 | resultShow: JSON.stringify(result, null, 4), | 25 | resultShow: JSON.stringify(result, null, 4), |
@@ -502,9 +502,11 @@ module.exports = (data) => { | @@ -502,9 +502,11 @@ module.exports = (data) => { | ||
502 | 502 | ||
503 | return api.get('', sign.apiSign({ | 503 | return api.get('', sign.apiSign({ |
504 | productId: data.id, | 504 | productId: data.id, |
505 | + uid: data.uid, | ||
506 | + vipLevel: data.vipLevel, | ||
505 | method: 'h5.product.data' | 507 | method: 'h5.product.data' |
506 | })).then(result => { | 508 | })).then(result => { |
507 | - finalResult = detailDataPkg(result, null, 0, data.ua); | 509 | + finalResult = detailDataPkg(result, data.uid, data.vipLevel, data.ua); |
508 | 510 | ||
509 | return api.get('', sign.apiSign({ | 511 | return api.get('', sign.apiSign({ |
510 | method: 'app.shop.queryShopsByBrandId', | 512 | method: 'app.shop.queryShopsByBrandId', |
@@ -13,6 +13,6 @@ const cRoot = './controllers'; | @@ -13,6 +13,6 @@ const cRoot = './controllers'; | ||
13 | const detail = require(`${cRoot}/detail`); | 13 | const detail = require(`${cRoot}/detail`); |
14 | 14 | ||
15 | // routers | 15 | // routers |
16 | -router.get('/detail/:id', detail.index); | 16 | +router.get('/detail/:id/:gid', detail.index); |
17 | 17 | ||
18 | module.exports = router; | 18 | module.exports = router; |
-
Please register or login to post a comment