|
|
'use strict';
|
|
|
|
|
|
const api = global.yoho.API;
|
|
|
const helpers = global.yoho.helpers;
|
|
|
const _ = require('lodash');
|
|
|
const serviceAPI = global.yoho.ServiceAPI;
|
|
|
const logger = global.yoho.logger;
|
...
|
...
|
@@ -37,7 +36,7 @@ const getHotRank = (codeKey) => { |
|
|
});
|
|
|
};
|
|
|
|
|
|
const selectHotrank = (yhChannel, gender, sort, tab_id, limit, page, notab) => {
|
|
|
const selectHotrank = (yhChannel, gender, sort, tabId, limit, page, notab) => {
|
|
|
let param = {
|
|
|
method: 'app.search.top',
|
|
|
gender: gender,
|
...
|
...
|
@@ -50,12 +49,10 @@ const selectHotrank = (yhChannel, gender, sort, tab_id, limit, page, notab) => { |
|
|
param.sort = sort;
|
|
|
}
|
|
|
|
|
|
if (tab_id) {
|
|
|
param.tab_id = tab_id;
|
|
|
if (tabId) {
|
|
|
param.tab_id = tabId;
|
|
|
}
|
|
|
|
|
|
console.log(param);
|
|
|
|
|
|
return api.get('', param).then((result) => {
|
|
|
|
|
|
if (result && result.code === 200 && result.data.product_list) {
|
...
|
...
|
@@ -97,8 +94,8 @@ const selectHotrank = (yhChannel, gender, sort, tab_id, limit, page, notab) => { |
|
|
}
|
|
|
|
|
|
one = _.assign(one, {
|
|
|
url: '/product/pro_' + data.product_id + '_' + data.goods_list[0].goods_id
|
|
|
+ '/' + data.cn_alphabet + '.html',
|
|
|
url: '/product/pro_' + data.product_id + '_' + data.goods_list[0].goods_id +
|
|
|
'/' + data.cn_alphabet + '.html',
|
|
|
thumb: data.default_images,
|
|
|
rank: limit * (page - 1) + index + 1,
|
|
|
name: data.product_name,
|
...
|
...
|
|