Authored by 郭成尧

Merge branch 'hotfix/errorlog' of git.yoho.cn:fe/yohobuywap-node into hotfix/errorlog

@@ -7,11 +7,17 @@ @@ -7,11 +7,17 @@
7 7
8 const newsaleModel = require('../models/newsale'); 8 const newsaleModel = require('../models/newsale');
9 const headerModel = require('../../../doraemon/models/header'); 9 const headerModel = require('../../../doraemon/models/header');
  10 +
  11 +let yhchannels = {
  12 + '1,3': 1,
  13 + '2,3': 2
  14 +};
  15 +
10 let channels = { 16 let channels = {
11 - boys: '1,3',  
12 - girl: '2,3',  
13 - kids: '1,2,3',  
14 - lifestyle: '1,2,3' 17 + boys: 1,
  18 + girls: 2,
  19 + kids: 3,
  20 + lifestyle: 4
15 }; 21 };
16 22
17 const index = (req, res, next) => { 23 const index = (req, res, next) => {
@@ -56,10 +62,10 @@ const selectHotrank = (req, res, next) => { @@ -56,10 +62,10 @@ const selectHotrank = (req, res, next) => {
56 let limit = 50; 62 let limit = 50;
57 let page = req.query.page || 1; 63 let page = req.query.page || 1;
58 let notab = req.query.notab || 0; 64 let notab = req.query.notab || 0;
59 - let yhChannel = req.query.yh_channel || 1;  
60 - let gender = req.query.gender || req.cookies._Channel && channels[req.cookies._Channel] || '1,3'; 65 + let yhChannel = (req.query.gender && yhchannels[req.query.gender]) ||
  66 + (req.cookies._Channel && channels[req.cookies._Channel]) || 1;
61 67
62 - newsaleModel.selectHotrank(yhChannel, gender, sort, tab_id, limit, page, notab).then((result) => { 68 + newsaleModel.selectHotrank(yhChannel, sort, tab_id, limit, page, notab).then((result) => {
63 69
64 res.render('newsale/hotlist', { 70 res.render('newsale/hotlist', {
65 layout: false, 71 layout: false,
@@ -40,10 +40,9 @@ const getHotRank = (codeKey) => { @@ -40,10 +40,9 @@ const getHotRank = (codeKey) => {
40 }); 40 });
41 }; 41 };
42 42
43 -const selectHotrank = (yhChannel, gender, sort, tabId, limit, page, notab) => { 43 +const selectHotrank = (yhChannel, sort, tabId, limit, page, notab) => {
44 let param = { 44 let param = {
45 method: 'app.search.top', 45 method: 'app.search.top',
46 - gender: gender,  
47 yh_channel: yhChannel, 46 yh_channel: yhChannel,
48 page: page, 47 page: page,
49 limit: limit 48 limit: limit
1 let $ = require('yoho-jquery'), 1 let $ = require('yoho-jquery'),
2 Swiper = require('yoho-swiper'), 2 Swiper = require('yoho-swiper'),
3 lazyLoad = require('yoho-jquery-lazyload'), 3 lazyLoad = require('yoho-jquery-lazyload'),
4 - loading = require('plugin/loading'); 4 + loading = require('plugin/loading'),
  5 + qs = require('yoho-qs');
5 6
6 let page = 1, 7 let page = 1,
7 winH, 8 winH,
@@ -34,7 +35,8 @@ function hotrank(pageIndex, sortIndex, tabId, noTab) { @@ -34,7 +35,8 @@ function hotrank(pageIndex, sortIndex, tabId, noTab) {
34 data: { 35 data: {
35 page: pageIndex, 36 page: pageIndex,
36 tab_id: tabId, 37 tab_id: tabId,
37 - notab: noTab 38 + notab: noTab,
  39 + gender: qs.gender
38 }, 40 },
39 success: function(data) { 41 success: function(data) {
40 if (data === ' ') { 42 if (data === ' ') {