|
@@ -21,31 +21,19 @@ const contentCode = { |
|
@@ -21,31 +21,19 @@ const contentCode = { |
21
|
girl: '8512bf0755cc549ac323f852c9fd945d'
|
21
|
girl: '8512bf0755cc549ac323f852c9fd945d'
|
22
|
};
|
22
|
};
|
23
|
|
23
|
|
24
|
-const processFloor = (list) => {
|
|
|
25
|
- const formatData = {};
|
|
|
26
|
-
|
|
|
27
|
- list = list || [];
|
|
|
28
|
- _.forEach(list, (floor) => {
|
|
|
29
|
-
|
|
|
30
|
- // FIXME 楼层数据处理有问题
|
|
|
31
|
- formatData[_.camelCase(floor.template_name)] = floor.data; // 接口数据格式化,键使用驼峰写法
|
|
|
32
|
- });
|
|
|
33
|
- return formatData;
|
|
|
34
|
-};
|
|
|
35
|
-
|
|
|
36
|
/**
|
24
|
/**
|
37
|
* 获取二级菜单顶部颜色
|
25
|
* 获取二级菜单顶部颜色
|
38
|
- * @param {[string]} guangChoosed
|
26
|
+ * @param {[string]} choosed
|
39
|
* @return {[string]}
|
27
|
* @return {[string]}
|
40
|
*/
|
28
|
*/
|
41
|
-const getSidebarColor = (guangChoosed) => {
|
29
|
+const getSidebarColor = (choosed) => {
|
42
|
let color = false;
|
30
|
let color = false;
|
43
|
|
31
|
|
44
|
- if (guangChoosed === 'girls') {
|
32
|
+ if (choosed === 'girls') {
|
45
|
color = '#FF88AE';
|
33
|
color = '#FF88AE';
|
46
|
- } else if (guangChoosed === 'kids') {
|
34
|
+ } else if (choosed === 'kids') {
|
47
|
color = '#7ad9f9';
|
35
|
color = '#7ad9f9';
|
48
|
- } else if (guangChoosed === 'lifestyle') {
|
36
|
+ } else if (choosed === 'lifestyle') {
|
49
|
color = '#4f4138';
|
37
|
color = '#4f4138';
|
50
|
}
|
38
|
}
|
51
|
|
39
|
|
|
@@ -61,23 +49,18 @@ const processSideBar = (list, choosed) => { |
|
@@ -61,23 +49,18 @@ const processSideBar = (list, choosed) => { |
61
|
const formatData = [];
|
49
|
const formatData = [];
|
62
|
let offset = 0; // 分割数组用到的游标
|
50
|
let offset = 0; // 分割数组用到的游标
|
63
|
|
51
|
|
64
|
- _.forEach(list, (item, i) => {
|
|
|
65
|
- item = camelCase.listCamelCase(item);
|
52
|
+ list = list || [];
|
|
|
53
|
+ list = camelCase(list);
|
66
|
|
54
|
|
|
|
55
|
+ _.forEach(list, (item, i) => {
|
67
|
if (item.sub) {
|
56
|
if (item.sub) {
|
68
|
- let sub = [{
|
57
|
+ item.sub.unshift({
|
69
|
sortName: item.sortName,
|
58
|
sortName: item.sortName,
|
70
|
sortNameEn: item.sortNameEn,
|
59
|
sortNameEn: item.sortNameEn,
|
71
|
back: true,
|
60
|
back: true,
|
72
|
isSelect: false,
|
61
|
isSelect: false,
|
73
|
bgColor: getSidebarColor(choosed)
|
62
|
bgColor: getSidebarColor(choosed)
|
74
|
- }];
|
|
|
75
|
-
|
|
|
76
|
- _.forEach(item.sub, (s) => {
|
|
|
77
|
- s = camelCase.listCamelCase(s); // 子菜单键名驼峰化
|
|
|
78
|
- sub.push(s);
|
|
|
79
|
});
|
63
|
});
|
80
|
- item.sub = sub;
|
|
|
81
|
}
|
64
|
}
|
82
|
|
65
|
|
83
|
// 如果有分隔符,分割数组
|
66
|
// 如果有分隔符,分割数组
|
|
@@ -93,8 +76,29 @@ const processSideBar = (list, choosed) => { |
|
@@ -93,8 +76,29 @@ const processSideBar = (list, choosed) => { |
93
|
};
|
76
|
};
|
94
|
|
77
|
|
95
|
/**
|
78
|
/**
|
96
|
-* 获取频道页面资源位
|
|
|
97
|
-*/
|
79
|
+ * 处理楼层数据
|
|
|
80
|
+ * @param {[array]} list
|
|
|
81
|
+ * @return {[array]}
|
|
|
82
|
+ */
|
|
|
83
|
+const processFloor = (list) => {
|
|
|
84
|
+ const formatData = [];
|
|
|
85
|
+
|
|
|
86
|
+ list = list || [];
|
|
|
87
|
+ list = camelCase(list);
|
|
|
88
|
+
|
|
|
89
|
+ _.forEach(list, (floor) => {
|
|
|
90
|
+ floor[_.camelCase(floor.templateName)] = true;
|
|
|
91
|
+ formatData.push(floor);
|
|
|
92
|
+ });
|
|
|
93
|
+
|
|
|
94
|
+ return formatData;
|
|
|
95
|
+};
|
|
|
96
|
+
|
|
|
97
|
+/**
|
|
|
98
|
+ * 获取频道页面资源位
|
|
|
99
|
+ * @param {[object]} gender
|
|
|
100
|
+ * @return {[type]}
|
|
|
101
|
+ */
|
98
|
const getChannelResource = (gender) => {
|
102
|
const getChannelResource = (gender) => {
|
99
|
gender = gender || 'boy';
|
103
|
gender = gender || 'boy';
|
100
|
|
104
|
|
|
@@ -115,6 +119,11 @@ const getChannelResource = (gender) => { |
|
@@ -115,6 +119,11 @@ const getChannelResource = (gender) => { |
115
|
});
|
119
|
});
|
116
|
};
|
120
|
};
|
117
|
|
121
|
|
|
|
122
|
+/**
|
|
|
123
|
+ * 获取左侧边栏数据
|
|
|
124
|
+ * @param {[string]} choosed
|
|
|
125
|
+ * @return {[object]}
|
|
|
126
|
+ */
|
118
|
const getLeftNav = (choosed) => {
|
127
|
const getLeftNav = (choosed) => {
|
119
|
choosed = choosed || 'all';
|
128
|
choosed = choosed || 'all';
|
120
|
|
129
|
|