Merge branch 'release/4.6' of http://git.yoho.cn/fe/yohobuy-node into release/4.6
Showing
1 changed file
with
19 additions
and
7 deletions
@@ -85,17 +85,29 @@ exports.getOutletsTrendData = (params) => { | @@ -85,17 +85,29 @@ exports.getOutletsTrendData = (params) => { | ||
85 | * @return {[type]} [description] | 85 | * @return {[type]} [description] |
86 | */ | 86 | */ |
87 | exports.getOutletsGoodsList = (params) => { | 87 | exports.getOutletsGoodsList = (params) => { |
88 | + // 频道 | ||
89 | + let tempChannel = params.channel || 'boys'; | ||
88 | 90 | ||
89 | - let tempChannel = _.isEmpty(params.channel) ? 'boys' : params.channel; | 91 | + // 接口可接收的参数 |
92 | + let apiParams = ['outlets', 'page', 'limit', 'order', 'productSize', 'yh_channel', 'query', | ||
93 | + 'p_d', 'gender', 'msort', 'misort', 'sort', 'brand', 'color', 'size', 'saleType', | ||
94 | + 'breakSize', 'breakSort', 'productPool', 'price']; | ||
90 | 95 | ||
91 | - params = Object.assign({ | 96 | + // 初始化必填的接口参数 |
97 | + let tempParams = { | ||
92 | method: 'app.search.li', | 98 | method: 'app.search.li', |
93 | outlets: 1, | 99 | outlets: 1, |
94 | - limit: 60, | ||
95 | - order: 's_t_desc', | 100 | + page: params.page || 1, |
101 | + limit: params.limit || 60, | ||
102 | + order: params.order || 's_t_desc', | ||
96 | productSize: '384x511', | 103 | productSize: '384x511', |
97 | yh_channel: yhChannel[tempChannel].channel | 104 | yh_channel: yhChannel[tempChannel].channel |
98 | - }, params); | ||
99 | - params.yh_channel = yhChannel[tempChannel].channel; | ||
100 | - return api.get('', sign.apiSign(params)); | 105 | + }; |
106 | + | ||
107 | + _.forEach(apiParams, (paramsName) => { | ||
108 | + if (params[paramsName]) { | ||
109 | + tempParams[paramsName] = params[paramsName]; | ||
110 | + } | ||
111 | + }); | ||
112 | + return api.get('', sign.apiSign(tempParams)); | ||
101 | }; | 113 | }; |
-
Please register or login to post a comment