...
|
...
|
@@ -21,31 +21,19 @@ const contentCode = { |
|
|
girl: '8512bf0755cc549ac323f852c9fd945d'
|
|
|
};
|
|
|
|
|
|
const processFloor = (list) => {
|
|
|
const formatData = {};
|
|
|
|
|
|
list = list || [];
|
|
|
_.forEach(list, (floor) => {
|
|
|
|
|
|
// FIXME 楼层数据处理有问题
|
|
|
formatData[_.camelCase(floor.template_name)] = floor.data; // 接口数据格式化,键使用驼峰写法
|
|
|
});
|
|
|
return formatData;
|
|
|
};
|
|
|
|
|
|
/**
|
|
|
* 获取二级菜单顶部颜色
|
|
|
* @param {[string]} guangChoosed
|
|
|
* @param {[string]} choosed
|
|
|
* @return {[string]}
|
|
|
*/
|
|
|
const getSidebarColor = (guangChoosed) => {
|
|
|
const getSidebarColor = (choosed) => {
|
|
|
let color = false;
|
|
|
|
|
|
if (guangChoosed === 'girls') {
|
|
|
if (choosed === 'girls') {
|
|
|
color = '#FF88AE';
|
|
|
} else if (guangChoosed === 'kids') {
|
|
|
} else if (choosed === 'kids') {
|
|
|
color = '#7ad9f9';
|
|
|
} else if (guangChoosed === 'lifestyle') {
|
|
|
} else if (choosed === 'lifestyle') {
|
|
|
color = '#4f4138';
|
|
|
}
|
|
|
|
...
|
...
|
@@ -61,23 +49,18 @@ const processSideBar = (list, choosed) => { |
|
|
const formatData = [];
|
|
|
let offset = 0; // 分割数组用到的游标
|
|
|
|
|
|
_.forEach(list, (item, i) => {
|
|
|
item = camelCase.listCamelCase(item);
|
|
|
list = list || [];
|
|
|
list = camelCase(list);
|
|
|
|
|
|
_.forEach(list, (item, i) => {
|
|
|
if (item.sub) {
|
|
|
let sub = [{
|
|
|
item.sub.unshift({
|
|
|
sortName: item.sortName,
|
|
|
sortNameEn: item.sortNameEn,
|
|
|
back: true,
|
|
|
isSelect: false,
|
|
|
bgColor: getSidebarColor(choosed)
|
|
|
}];
|
|
|
|
|
|
_.forEach(item.sub, (s) => {
|
|
|
s = camelCase.listCamelCase(s); // 子菜单键名驼峰化
|
|
|
sub.push(s);
|
|
|
});
|
|
|
item.sub = sub;
|
|
|
}
|
|
|
|
|
|
// 如果有分隔符,分割数组
|
...
|
...
|
@@ -93,8 +76,29 @@ const processSideBar = (list, choosed) => { |
|
|
};
|
|
|
|
|
|
/**
|
|
|
* 获取频道页面资源位
|
|
|
*/
|
|
|
* 处理楼层数据
|
|
|
* @param {[array]} list
|
|
|
* @return {[array]}
|
|
|
*/
|
|
|
const processFloor = (list) => {
|
|
|
const formatData = [];
|
|
|
|
|
|
list = list || [];
|
|
|
list = camelCase(list);
|
|
|
|
|
|
_.forEach(list, (floor) => {
|
|
|
floor[_.camelCase(floor.templateName)] = true;
|
|
|
formatData.push(floor);
|
|
|
});
|
|
|
|
|
|
return formatData;
|
|
|
};
|
|
|
|
|
|
/**
|
|
|
* 获取频道页面资源位
|
|
|
* @param {[object]} gender
|
|
|
* @return {[type]}
|
|
|
*/
|
|
|
const getChannelResource = (gender) => {
|
|
|
gender = gender || 'boy';
|
|
|
|
...
|
...
|
@@ -115,6 +119,11 @@ const getChannelResource = (gender) => { |
|
|
});
|
|
|
};
|
|
|
|
|
|
/**
|
|
|
* 获取左侧边栏数据
|
|
|
* @param {[string]} choosed
|
|
|
* @return {[object]}
|
|
|
*/
|
|
|
const getLeftNav = (choosed) => {
|
|
|
choosed = choosed || 'all';
|
|
|
|
...
|
...
|
|