Authored by 郭成尧

前端入参修改

@@ -12,14 +12,17 @@ const mRoot = '../models'; @@ -12,14 +12,17 @@ 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),
23 result: result, 26 result: result,
24 devEnv: true, 27 devEnv: true,
25 module: 'product', 28 module: 'product',
@@ -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',
1 -/**  
2 - * router of sub app product  
3 - * @author: xuqi<qi.xu@yoho.cn>  
4 - * @date: 2016/05/06  
5 - */  
6 -  
7 -'use strict';  
8 -  
9 -const router = require('express').Router();  
10 -const cRoot = './controllers';  
11 -  
12 -// 商品详情controller  
13 -const detail = require(`${cRoot}/detail`);  
14 -  
15 -// routers  
16 -router.get('/detail/:id', detail.index);  
17 -  
18 -module.exports = router;  
  1 +/**
  2 + * router of sub app product
  3 + * @author: xuqi<qi.xu@yoho.cn>
  4 + * @date: 2016/05/06
  5 + */
  6 +
  7 +'use strict';
  8 +
  9 +const router = require('express').Router();
  10 +const cRoot = './controllers';
  11 +
  12 +// 商品详情controller
  13 +const detail = require(`${cRoot}/detail`);
  14 +
  15 +// routers
  16 +router.get('/detail/:id/:gid', detail.index);
  17 +
  18 +module.exports = router;