...
|
...
|
@@ -53,7 +53,8 @@ const handleBrandList = origin => { |
|
|
brands.push({
|
|
|
name: subValue.brand_name_en || subValue.brand_name_cn || subValue.brand_name,
|
|
|
logo: subValue.brand_ico,
|
|
|
domain: subValue.brand_domain
|
|
|
domain: subValue.brand_domain,
|
|
|
brandUrl: '//m.yohobuy.com/product/index/brand?domain=' + subValue.brand_domain
|
|
|
});
|
|
|
});
|
|
|
|
...
|
...
|
@@ -164,7 +165,7 @@ const _getBrandListOriginData = (channel) => { |
|
|
});
|
|
|
};
|
|
|
|
|
|
let _processCateData = (list, channel) => {
|
|
|
const _processCateData = (list, channel) => {
|
|
|
let nav = ['MEN男士', 'WOMEN女士'];
|
|
|
|
|
|
nav = _.map(nav, function(item) {
|
...
|
...
|
@@ -213,6 +214,18 @@ let _processCateData = (list, channel) => { |
|
|
};
|
|
|
};
|
|
|
|
|
|
const _dealBrandUrl = (list) => {
|
|
|
var domain;
|
|
|
|
|
|
_.forEach(list.data, function(val) {
|
|
|
domain = val.url.substring(val.url.indexOf('shop/') + 5, val.url.indexOf('?'));
|
|
|
|
|
|
val.url = '//m.yohobuy.com/product/index/brand?domain=' + domain;
|
|
|
})
|
|
|
|
|
|
return list;
|
|
|
}
|
|
|
|
|
|
const indexData = (gender, brandCode, cateCode) => {
|
|
|
return Promise.all([_getChannelData(gender), _getResourcesData(brandCode), _getBrandListOriginData(gender), _getResourcesData(cateCode)]).then(result => {
|
|
|
let brandList = {};
|
...
|
...
|
@@ -227,14 +240,17 @@ const indexData = (gender, brandCode, cateCode) => { |
|
|
if (result[1]) {
|
|
|
_.forEach(result[1], function(data) {
|
|
|
if (data.focus_type === '1') {
|
|
|
brandList.bannerTop = data;
|
|
|
|
|
|
brandList.bannerTop = _dealBrandUrl(data);
|
|
|
} else if (data.focus_type === '2') {
|
|
|
brandList.focusData = data.data;
|
|
|
|
|
|
brandList.focusData = _dealBrandUrl(data).data;
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
|
|
|
if (result[2]) {
|
|
|
|
|
|
brandList.listData = result[2].ListData;
|
|
|
brandList.indexList = result[2].indexList;
|
|
|
}
|
...
|
...
|
@@ -242,8 +258,17 @@ const indexData = (gender, brandCode, cateCode) => { |
|
|
if (result[3]) {
|
|
|
_.forEach(result[3], function(data) {
|
|
|
if (data.template_name === 'recommend_content_five') {
|
|
|
_.forEach(data.data.list, function(val) {
|
|
|
var param = val.url.substring(val.url.indexOf('list?') + 5);
|
|
|
|
|
|
val.url = '//list.m.yohobuy.com/?' + param;
|
|
|
})
|
|
|
categoryData.list = data.data.list;
|
|
|
} else if (data.template_name === 'focus') {
|
|
|
_.forEach(data.data, function(val) {
|
|
|
|
|
|
val.url = '//m.yohobuy.com/guang/cate-all';
|
|
|
})
|
|
|
categoryData.focusData = data;
|
|
|
}
|
|
|
});
|
...
|
...
|
@@ -263,9 +288,9 @@ const brandListData = (code, gender) => { |
|
|
if (result[0]) {
|
|
|
_.forEach(result[0], function(data) {
|
|
|
if (data.focus_type === '1') {
|
|
|
brandList.bannerTop = data;
|
|
|
brandList.bannerTop = _dealBrandUrl(data);
|
|
|
} else if (data.focus_type === '2') {
|
|
|
brandList.focusData = data.data;
|
|
|
brandList.focusData = _dealBrandUrl(data).data;
|
|
|
}
|
|
|
});
|
|
|
}
|
...
|
...
|
@@ -289,8 +314,18 @@ const categoryData = (code) => { |
|
|
if (result) {
|
|
|
_.forEach(result, function(data) {
|
|
|
if (data.template_name === 'recommend_content_five') {
|
|
|
_.forEach(data.data.list, function(val) {
|
|
|
var param = val.url.substring(val.url.indexOf('list?') + 5);
|
|
|
|
|
|
val.url = '//list.m.yohobuy.com/?' + param;
|
|
|
})
|
|
|
category.list = data.data.list;
|
|
|
} else if (data.template_name === 'focus') {
|
|
|
_.forEach(data.data, function(val) {
|
|
|
|
|
|
val.url = '//m.yohobuy.com/guang/cate-all';
|
|
|
})
|
|
|
|
|
|
category.focusData = data;
|
|
|
}
|
|
|
});
|
...
|
...
|
|