Authored by lijing

秒杀详情页

@@ -117,9 +117,27 @@ const getProductList = (req, res, next) => { @@ -117,9 +117,27 @@ const getProductList = (req, res, next) => {
117 */ 117 */
118 const detail = (req, res, next) => { 118 const detail = (req, res, next) => {
119 119
120 - return seckillModel.queryDetail().then((result) => { 120 + let headerData = headerModel.setNav({
  121 + navTitle: '商品详情'
  122 + });
  123 +
  124 + let responseData = {
  125 + pageHeader: headerData,
  126 + module: 'product',
  127 + page: 'detail',
  128 + title: '商品详情 | Yoho!Buy有货 | 潮流购物逛不停',
  129 + //pageFooter: true
  130 + };
  131 +
  132 + let params = {
  133 + uid: req.query.uid || 11084019,
  134 + productSkn: req.query.product_skn || 51178553,
  135 + productId: req.query.product_id || 321819
  136 + }
121 137
122 - res.render('detail/detail', result); 138 + return seckillModel.queryDetail(params).then((result) => {
  139 + console.log(result.data);
  140 + res.render('detail/detail', Object.assign(responseData, result));
123 141
124 }); 142 });
125 }; 143 };
@@ -37,9 +37,12 @@ const queryProductList = (activityId) => { @@ -37,9 +37,12 @@ const queryProductList = (activityId) => {
37 /** 37 /**
38 * 详情页 38 * 详情页
39 */ 39 */
40 -const queryDetail = () => { 40 +const queryDetail = (params) => {
41 return api.get('', { 41 return api.get('', {
42 - method: 'app.product.data' 42 + method: 'app.product.data',
  43 + uid: params.uid,
  44 + product_skn: params.productSkn,
  45 + product_id: params.productId
43 }, { 46 }, {
44 cache: true 47 cache: true
45 }); 48 });