Authored by zhangxiaoru

plustar

@@ -8,18 +8,19 @@ @@ -8,18 +8,19 @@
8 const mRoot = '../models'; 8 const mRoot = '../models';
9 const plustarModel = require(`${mRoot}/plustar`); 9 const plustarModel = require(`${mRoot}/plustar`);
10 const headerModel = require('../../../doraemon/models/header'); // 头部model 10 const headerModel = require('../../../doraemon/models/header'); // 头部model
11 -// let channels = {  
12 -// boys: 1,  
13 -// girl: 2,  
14 -// kids: 3,  
15 -// lifestyle: 4  
16 -// }; 11 +let channels = {
  12 + boys: 1,
  13 + girl: 2,
  14 + kids: 3,
  15 + lifestyle: 4
  16 +};
17 17
18 const getListData = (req, res, next) => { 18 const getListData = (req, res, next) => {
19 let gender = req.query.gender || req.cookies._Channel && channels[req.cookies._Channel] || 1; 19 let gender = req.query.gender || req.cookies._Channel && channels[req.cookies._Channel] || 1;
20 let recom = '4'; 20 let recom = '4';
21 let all = '1'; 21 let all = '1';
22 - //console.log(gender); 22 +
  23 + // console.log(gender);
23 24
24 plustarModel.getListData(gender, recom, all).then((result) => { 25 plustarModel.getListData(gender, recom, all).then((result) => {
25 26
@@ -32,11 +33,11 @@ const getListData = (req, res, next) => { @@ -32,11 +33,11 @@ const getListData = (req, res, next) => {
32 ps: { 33 ps: {
33 sName: '设计师', 34 sName: '设计师',
34 pName: '经典潮牌' 35 pName: '经典潮牌'
35 - } 36 + }
36 }); 37 });
37 }).catch(next); 38 }).catch(next);
38 }; 39 };
39 40
40 module.exports = { 41 module.exports = {
41 getListData 42 getListData
42 -};  
  43 +};
@@ -6,13 +6,13 @@ const productProcess = require('../../../utils/product-process'); @@ -6,13 +6,13 @@ const productProcess = require('../../../utils/product-process');
6 6
7 7
8 const getContentData = (gender, type) => { 8 const getContentData = (gender, type) => {
9 - 9 +
10 return serviceAPI.get('guang/api/v3/plustar/getlist', { 10 return serviceAPI.get('guang/api/v3/plustar/getlist', {
11 gender: gender, 11 gender: gender,
12 brand_type: type 12 brand_type: type
13 }).then((result) => { 13 }).then((result) => {
14 if (result && result.code === 200) { 14 if (result && result.code === 200) {
15 - //console.log(result) 15 + // console.log(result)
16 return result; 16 return result;
17 } else { 17 } else {
18 logger.error('列表 list data return code is not 200'); 18 logger.error('列表 list data return code is not 200');
@@ -27,10 +27,10 @@ const getListData = (gender, recom, all) => { @@ -27,10 +27,10 @@ const getListData = (gender, recom, all) => {
27 star: result[0], 27 star: result[0],
28 plus: result[1] 28 plus: result[1]
29 }; 29 };
30 - }); 30 + });
31 }; 31 };
32 32
33 module.exports = { 33 module.exports = {
34 getListData, 34 getListData,
35 getContentData 35 getContentData
36 -};  
  36 +};
@@ -39,6 +39,6 @@ router.post('/opt/praiseArticle', opt.praiseArticle); // 资讯文章点赞 (H5 @@ -39,6 +39,6 @@ router.post('/opt/praiseArticle', opt.praiseArticle); // 资讯文章点赞 (H5
39 39
40 router.get('/info/index', info.index); // 逛详情页 40 router.get('/info/index', info.index); // 逛详情页
41 41
42 -router.get('/plustar', plustar.getListData); //国际优选 42 +router.get('/plustar', plustar.getListData); // 国际优选
43 43
44 module.exports = router; 44 module.exports = router;