...
|
...
|
@@ -8,7 +8,6 @@ const utils = '../../../utils'; |
|
|
const contentCodeConfig = require('../../../config/content-code');
|
|
|
const _ = require('lodash');
|
|
|
const api = global.yoho.ServiceAPI;
|
|
|
const camelCase = global.yoho.camelCase;
|
|
|
const logger = global.yoho.logger;
|
|
|
const resourcesProcess = require(`${utils}/resources-process`);
|
|
|
|
...
|
...
|
@@ -87,13 +86,12 @@ const _processSideBar = (list, choosed) => { |
|
|
let offset = 0; // 分割数组用到的游标
|
|
|
|
|
|
list = list || [];
|
|
|
list = camelCase(list);
|
|
|
|
|
|
_.forEach(list, (item, i) => {
|
|
|
if (item.sub) {
|
|
|
item.sub.unshift({
|
|
|
sortName: item.sortName,
|
|
|
sortNameEn: item.sortNameEn,
|
|
|
sort_name: item.sort_name,
|
|
|
sort_name_en: item.sort_name_en,
|
|
|
back: true,
|
|
|
isSelect: false,
|
|
|
bgColor: _getSidebarColor(choosed)
|
...
|
...
|
@@ -101,7 +99,7 @@ const _processSideBar = (list, choosed) => { |
|
|
}
|
|
|
|
|
|
// 如果有分隔符,分割数组
|
|
|
if (item.separativeSign === 'Y') {
|
|
|
if (item.separative_sign === 'Y') {
|
|
|
formatData.push(list.slice(offset, i));
|
|
|
offset = i;
|
|
|
}
|
...
|
...
|
@@ -130,6 +128,8 @@ const _getChannelResource = (params) => { |
|
|
params.new_device = true; // eslint-disable-line
|
|
|
}
|
|
|
|
|
|
params.new_device = true;
|
|
|
|
|
|
return api.get('operations/api/v5/resource/home', params, {
|
|
|
cache: true
|
|
|
}).then(result => {
|
...
|
...
|
@@ -180,16 +180,16 @@ const _getChannelList = () => { |
|
|
|
|
|
list.channelList = [];
|
|
|
list.yohood = {};
|
|
|
result.data.list = camelCase(result.data.list || []);
|
|
|
result.data.list = result.data.list || [];
|
|
|
|
|
|
_.forEach(result.data.list, function(item) {
|
|
|
const channel = channelList[item.yhChannel - 1];
|
|
|
const channel = channelList[item.yh_channel - 1];
|
|
|
|
|
|
if (channel) {
|
|
|
list.channelList.push(channel);
|
|
|
}
|
|
|
|
|
|
if (_.toNumber(item.yhChannel) === 5) {
|
|
|
if (_.toNumber(item.yh_channel) === 5) {
|
|
|
list.yohood.showYohood = true;
|
|
|
list.yohood.yohoodHref = 'http://www.yohood.cn';
|
|
|
}
|
...
|
...
|
|