Showing
3 changed files
with
13 additions
and
13 deletions
@@ -59,7 +59,7 @@ const brandList = (req, res, next) => { | @@ -59,7 +59,7 @@ const brandList = (req, res, next) => { | ||
59 | res.render('brand/brand-list', { | 59 | res.render('brand/brand-list', { |
60 | layout: false, | 60 | layout: false, |
61 | brandList: result.brandList | 61 | brandList: result.brandList |
62 | - }) | 62 | + }); |
63 | }).catch(next); | 63 | }).catch(next); |
64 | }; | 64 | }; |
65 | 65 | ||
@@ -67,13 +67,13 @@ const categoryData = (req, res, next) => { | @@ -67,13 +67,13 @@ const categoryData = (req, res, next) => { | ||
67 | let code; | 67 | let code; |
68 | let gender = req.query.gender || req.cookies._Channel && channels[req.cookies._Channel] || 1; | 68 | let gender = req.query.gender || req.cookies._Channel && channels[req.cookies._Channel] || 1; |
69 | 69 | ||
70 | - if (parseInt(gender) === 1) { | 70 | + if (parseInt(gender, 10) === 1) { |
71 | code = '7f885e9cab53231cff34ea236f3f1120'; | 71 | code = '7f885e9cab53231cff34ea236f3f1120'; |
72 | } else { | 72 | } else { |
73 | code = 'a6f9dc00219eb7d08520a18864929a30'; | 73 | code = 'a6f9dc00219eb7d08520a18864929a30'; |
74 | } | 74 | } |
75 | 75 | ||
76 | - brandModel.categoryData(code, gender).then(result => { | 76 | + brandModel.categoryData(code).then(result => { |
77 | res.render('brand/category', { | 77 | res.render('brand/category', { |
78 | layout: false, | 78 | layout: false, |
79 | categoryData: result.categoryData | 79 | categoryData: result.categoryData |
@@ -97,7 +97,7 @@ const cateAll = (req, res, next) => { | @@ -97,7 +97,7 @@ const cateAll = (req, res, next) => { | ||
97 | // showFooterTab: footerModel.getUrlData('category') | 97 | // showFooterTab: footerModel.getUrlData('category') |
98 | }); | 98 | }); |
99 | }).catch(next); | 99 | }).catch(next); |
100 | -} | 100 | +}; |
101 | 101 | ||
102 | module.exports = { | 102 | module.exports = { |
103 | index, | 103 | index, |
@@ -277,29 +277,29 @@ const brandListData = (code, gender) => { | @@ -277,29 +277,29 @@ const brandListData = (code, gender) => { | ||
277 | 277 | ||
278 | list.brandList = brandList; | 278 | list.brandList = brandList; |
279 | return list; | 279 | return list; |
280 | - }) | ||
281 | -} | 280 | + }); |
281 | +}; | ||
282 | 282 | ||
283 | -const categoryData = (code, gender) => { | 283 | +const categoryData = (code) => { |
284 | 284 | ||
285 | return _getResourcesData(code).then(result => { | 285 | return _getResourcesData(code).then(result => { |
286 | - let categoryData = {}; | 286 | + let category = {}; |
287 | let list = {}; | 287 | let list = {}; |
288 | 288 | ||
289 | if (result) { | 289 | if (result) { |
290 | _.forEach(result, function(data) { | 290 | _.forEach(result, function(data) { |
291 | if (data.template_name === 'recommend_content_five') { | 291 | if (data.template_name === 'recommend_content_five') { |
292 | - categoryData.list = data.data.list; | 292 | + category.list = data.data.list; |
293 | } else if (data.template_name === 'focus') { | 293 | } else if (data.template_name === 'focus') { |
294 | - categoryData.focusData = data; | 294 | + category.focusData = data; |
295 | } | 295 | } |
296 | }); | 296 | }); |
297 | } | 297 | } |
298 | 298 | ||
299 | - list.categoryData = categoryData; | 299 | + list.categoryData = category; |
300 | return list; | 300 | return list; |
301 | }); | 301 | }); |
302 | -} | 302 | +}; |
303 | 303 | ||
304 | const getCateData = (channel) => { | 304 | const getCateData = (channel) => { |
305 | return api.get('', { | 305 | return api.get('', { |
@@ -322,7 +322,7 @@ const getCateData = (channel) => { | @@ -322,7 +322,7 @@ const getCateData = (channel) => { | ||
322 | }).then((list) => { | 322 | }).then((list) => { |
323 | return _processCateData(list, channel); | 323 | return _processCateData(list, channel); |
324 | }); | 324 | }); |
325 | -} | 325 | +}; |
326 | 326 | ||
327 | module.exports = { | 327 | module.exports = { |
328 | indexData, | 328 | indexData, |
-
Please register or login to post a comment