...
|
...
|
@@ -143,17 +143,18 @@ const getBrandViewList = (channel, start, length) => { |
|
|
|
|
|
let res = yield brandApi.getBrandListData(switchParams.brandCode);
|
|
|
|
|
|
let result = {},
|
|
|
let result = [],
|
|
|
navigation = [];
|
|
|
|
|
|
// 品牌list A-Z 0-9
|
|
|
if (res.data.brands) {
|
|
|
let listTmp = {};
|
|
|
|
|
|
_.forEach(res.data.brands, subValue => {
|
|
|
_.forEach(res.data.brands, (subValue, key) => {
|
|
|
// if(_.isEmpty(subValue)){
|
|
|
// continue;
|
|
|
// }
|
|
|
let listTmp = [];
|
|
|
|
|
|
_.forEach(subValue, ssubValue => {
|
|
|
// 为品牌名称
|
|
|
let brandName = ssubValue.brand_name,
|
...
|
...
|
@@ -167,30 +168,30 @@ const getBrandViewList = (channel, start, length) => { |
|
|
href = helpers.urlFormat(ssubValue.brand_domain);
|
|
|
}
|
|
|
|
|
|
listTmp[brandName] = {
|
|
|
listTmp.push({
|
|
|
name: ssubValue.brand_name,
|
|
|
key: ssubValue.id,
|
|
|
href: href
|
|
|
};
|
|
|
if (ssubValue.is_hot === 'Y') {
|
|
|
listTmp[brandName].hot = 'hot';
|
|
|
}
|
|
|
href: href,
|
|
|
hot: ssubValue.is_hot === 'Y' ? 'hot' : ''
|
|
|
});
|
|
|
|
|
|
});
|
|
|
navigation.push(key);
|
|
|
|
|
|
// 按键值排序
|
|
|
result.push({
|
|
|
key: key,
|
|
|
val: listTmp
|
|
|
});
|
|
|
});
|
|
|
|
|
|
}
|
|
|
|
|
|
// 只取部分数据
|
|
|
let begin,
|
|
|
end;
|
|
|
let begin;
|
|
|
|
|
|
begin = (start - 1) ? (start - 1) : 0;
|
|
|
begin = (begin > 0) ? begin : 0;
|
|
|
end = length - begin;
|
|
|
result = length ? result.slice(begin, end) : result.slice(begin, end);
|
|
|
result = length ? result.slice(begin, length + begin) : result.slice(begin);
|
|
|
result.navigation = navigation;
|
|
|
|
|
|
return result;
|
...
|
...
|
|