Authored by biao

Merge branch 'feature/outlet' of http://git.yoho.cn/fe/yohobuywap-node into feature/outlet

@@ -16,8 +16,9 @@ const renderData = { @@ -16,8 +16,9 @@ const renderData = {
16 exports.index = (req, res) => { 16 exports.index = (req, res) => {
17 let channel = req.query.channel || req.cookies._Channel || 'boys'; 17 let channel = req.query.channel || req.cookies._Channel || 'boys';
18 let headerData = headerModel.setNavHeader('OUTLET', channel, true, '', null); 18 let headerData = headerModel.setNavHeader('OUTLET', channel, true, '', null);
  19 + let categoryId = req.query.category_id;
19 20
20 - outletModel.getContent().then(result => { 21 + outletModel.getContent(categoryId).then(result => {
21 res.render('outlet', Object.assign({ 22 res.render('outlet', Object.assign({
22 pageHeader: headerData, 23 pageHeader: headerData,
23 pageFooter: true 24 pageFooter: true
@@ -54,18 +54,18 @@ const convertNavData = (list) => { @@ -54,18 +54,18 @@ const convertNavData = (list) => {
54 return {data: formatData}; 54 return {data: formatData};
55 }; 55 };
56 56
57 -const getNavData = () => { 57 +const getNavData = (categoryId) => {
58 const params = { 58 const params = {
59 // client_type: 'iphone', 59 // client_type: 'iphone',
60 // os_version: 8.4, 60 // os_version: 8.4,
61 // screen_size: '320x568', 61 // screen_size: '320x568',
62 v: 7, 62 v: 7,
63 63
64 - // parent_id: 1107, 64 + parent_id: categoryId,
65 debug: 'XYZ' 65 debug: 'XYZ'
66 }; 66 };
67 67
68 - return api.get('operations/api/v6/category/getCategory', sign.apiSign(params)).then(result => { 68 + return serviceApi.get('operations/api/v6/category/getCategory', sign.apiSign(params)).then(result => {
69 if (result && result.code === 200) { 69 if (result && result.code === 200) {
70 return convertNavData(result.data); 70 return convertNavData(result.data);
71 } else { 71 } else {
@@ -162,10 +162,10 @@ const getHomeActivity = (id) => { @@ -162,10 +162,10 @@ const getHomeActivity = (id) => {
162 }); 162 });
163 }; 163 };
164 164
165 -exports.getContent = () => { 165 +exports.getContent = (categoryId) => {
166 let floorsData = {}; 166 let floorsData = {};
167 167
168 - return Promise.all([getNavData(), getOutletResource(), getHomeActivity(0), getGoodsList()]).then(data => { 168 + return Promise.all([getNavData(categoryId), getOutletResource(), getHomeActivity(0), getGoodsList()]).then(data => {
169 floorsData.nav = data[0] || []; 169 floorsData.nav = data[0] || [];
170 floorsData.content = data[1] || []; 170 floorsData.content = data[1] || [];
171 floorsData.activity = data[2] || []; 171 floorsData.activity = data[2] || [];