...
|
...
|
@@ -171,6 +171,18 @@ const _getLeftNav = (choosed) => { |
|
|
* 获取热门搜索
|
|
|
**/
|
|
|
const _getSearchIndex = (params) => {
|
|
|
let channels = {
|
|
|
boys: 1,
|
|
|
girl: 2,
|
|
|
kids: 3,
|
|
|
lifestyle: 4
|
|
|
};
|
|
|
|
|
|
if (params.gender && channels[params.gender]) {
|
|
|
params.yh_channel = channels[params.gender];
|
|
|
delete params.gender;
|
|
|
}
|
|
|
|
|
|
return API.get('', _.assign({
|
|
|
method: 'app.search.getTerms'
|
|
|
}, params), {
|
...
|
...
|
@@ -270,7 +282,10 @@ let getChannelData = (params) => { |
|
|
var channelData = {};
|
|
|
let navGender = _.cloneDeep(params.gender);
|
|
|
|
|
|
return Promise.all([getChannelResource(params), _getLeftNav(navGender), _getSearchIndex(params)]).then((data) => {
|
|
|
return Promise.all([getChannelResource(params), _getLeftNav(navGender), _getSearchIndex({
|
|
|
gender: navGender,
|
|
|
uid: params.uid,
|
|
|
})]).then((data) => {
|
|
|
channelData.content = data[0] || []; // 资源位数据
|
|
|
channelData.sideNav = data[1] || []; // 侧边栏数据
|
|
|
channelData.defaultTerms = (data[2] && data[2].defaultTerms && data[2].defaultTerms.length) ?
|
...
|
...
|
|