Authored by hongweigao

D:/Program Files/Git/brands/plusstar链接+channel参数

... ... @@ -96,6 +96,7 @@ const getBrandViewTop = channel => {
// 头部10个品牌小图块 url
if (res.data && res.data instanceof Array && res.data[1].data && res.data[1].data.list) {
_.forEach(res.data[1].data.list, subValue => {
brandAds.push({
name: subValue.name,
... ... @@ -117,11 +118,21 @@ const getBrandViewTop = channel => {
srcUrl = (k === 0) ? helpers.image(subValue.src, 570, 280, 3) :
helpers.image(subValue.src, 280, 280, 3);
}
brandLogos.push({
let brandPlusstarItem = {
name: subValue.title,
src: srcUrl,
url: subValue.url
});
};
if (channel === BOYS || channel === GIRLS) {
if (k === 0) {
brandPlusstarItem.url = helpers.urlFormat('/brands/plusstar', {channel: channel})
} else {
brandPlusstarItem.url = helpers.urlFormat('/brands/plusstar', {id: k, channel: channel})
}
}
brandLogos.push(brandPlusstarItem);
});
}
... ... @@ -307,7 +318,7 @@ const getPlusstarBrandListItem = (channel) => {
return items;
}
if (resource.data && resource.code === 200) {
items[0] = {name: '所有品牌', src: '', url: helpers.urlFormat('/brands', ''), brandType: ''};
items[0] = {name: '所有品牌', src: '', url: helpers.urlFormat('/brands', {channel: channel}), brandType: ''};
items[1] = {name: '设计新潮', src: '', url: '', brandType: 4};
items[2] = {name: '潮流经典', src: '', url: '', brandType: 1};
items[3] = {name: '明星潮牌', src: '', url: '', brandType: 2};
... ... @@ -318,11 +329,10 @@ const getPlusstarBrandListItem = (channel) => {
_.forEach(items, (subValue, k) => {
if (_.isEmpty(subValue.url)) {
subValue.url = helpers.urlFormat('/brands/plusstar?id=' + k);
subValue.url = helpers.urlFormat('/brands/plusstar', {id: k, channel: channel});
}
if (pos in resourceData[0].data) {
subValue.url = resourceData[0].data[pos].url;
subValue.src = helpers.image(resourceData[0].data[pos].src, 222, 180, 1);
subValue.name = resourceData[0].data[pos].title;
}
... ...
... ... @@ -215,6 +215,7 @@ exports.plusstarList = (channel, req) => {
brandIds = plustarList.brandsIds.slice((page - 1) * limit, page * limit);
if (plustarList.brandsIds.length > limit) {
pageList = pager(Math.ceil(plustarList.brandsIds.length / limit), {
channel: channel,
page: page,
id: id
});
... ... @@ -232,7 +233,6 @@ exports.plusstarList = (channel, req) => {
brands.push(list[brandId]);
});
}
let data = {
brandsHomePage: true,
brands: {
... ...