|
@@ -53,7 +53,8 @@ const handleBrandList = origin => { |
|
@@ -53,7 +53,8 @@ const handleBrandList = origin => { |
53
|
brands.push({
|
53
|
brands.push({
|
54
|
name: subValue.brand_name_en || subValue.brand_name_cn || subValue.brand_name,
|
54
|
name: subValue.brand_name_en || subValue.brand_name_cn || subValue.brand_name,
|
55
|
logo: subValue.brand_ico,
|
55
|
logo: subValue.brand_ico,
|
56
|
- domain: subValue.brand_domain
|
56
|
+ domain: subValue.brand_domain,
|
|
|
57
|
+ brandUrl: '//m.yohobuy.com/product/index/brand?domain=' + subValue.brand_domain
|
57
|
});
|
58
|
});
|
58
|
});
|
59
|
});
|
59
|
|
60
|
|
|
@@ -164,7 +165,7 @@ const _getBrandListOriginData = (channel) => { |
|
@@ -164,7 +165,7 @@ const _getBrandListOriginData = (channel) => { |
164
|
});
|
165
|
});
|
165
|
};
|
166
|
};
|
166
|
|
167
|
|
167
|
-let _processCateData = (list, channel) => {
|
168
|
+const _processCateData = (list, channel) => {
|
168
|
let nav = ['MEN男士', 'WOMEN女士'];
|
169
|
let nav = ['MEN男士', 'WOMEN女士'];
|
169
|
|
170
|
|
170
|
nav = _.map(nav, function(item) {
|
171
|
nav = _.map(nav, function(item) {
|
|
@@ -213,6 +214,18 @@ let _processCateData = (list, channel) => { |
|
@@ -213,6 +214,18 @@ let _processCateData = (list, channel) => { |
213
|
};
|
214
|
};
|
214
|
};
|
215
|
};
|
215
|
|
216
|
|
|
|
217
|
+const _dealBrandUrl = (list) => {
|
|
|
218
|
+ var domain;
|
|
|
219
|
+
|
|
|
220
|
+ _.forEach(list.data, function(val) {
|
|
|
221
|
+ domain = val.url.substring(val.url.indexOf('shop/') + 5, val.url.indexOf('?'));
|
|
|
222
|
+
|
|
|
223
|
+ val.url = '//m.yohobuy.com/product/index/brand?domain=' + domain;
|
|
|
224
|
+ })
|
|
|
225
|
+
|
|
|
226
|
+ return list;
|
|
|
227
|
+}
|
|
|
228
|
+
|
216
|
const indexData = (gender, brandCode, cateCode) => {
|
229
|
const indexData = (gender, brandCode, cateCode) => {
|
217
|
return Promise.all([_getChannelData(gender), _getResourcesData(brandCode), _getBrandListOriginData(gender), _getResourcesData(cateCode)]).then(result => {
|
230
|
return Promise.all([_getChannelData(gender), _getResourcesData(brandCode), _getBrandListOriginData(gender), _getResourcesData(cateCode)]).then(result => {
|
218
|
let brandList = {};
|
231
|
let brandList = {};
|
|
@@ -227,14 +240,17 @@ const indexData = (gender, brandCode, cateCode) => { |
|
@@ -227,14 +240,17 @@ const indexData = (gender, brandCode, cateCode) => { |
227
|
if (result[1]) {
|
240
|
if (result[1]) {
|
228
|
_.forEach(result[1], function(data) {
|
241
|
_.forEach(result[1], function(data) {
|
229
|
if (data.focus_type === '1') {
|
242
|
if (data.focus_type === '1') {
|
230
|
- brandList.bannerTop = data;
|
243
|
+
|
|
|
244
|
+ brandList.bannerTop = _dealBrandUrl(data);
|
231
|
} else if (data.focus_type === '2') {
|
245
|
} else if (data.focus_type === '2') {
|
232
|
- brandList.focusData = data.data;
|
246
|
+
|
|
|
247
|
+ brandList.focusData = _dealBrandUrl(data).data;
|
233
|
}
|
248
|
}
|
234
|
});
|
249
|
});
|
235
|
}
|
250
|
}
|
236
|
|
251
|
|
237
|
if (result[2]) {
|
252
|
if (result[2]) {
|
|
|
253
|
+
|
238
|
brandList.listData = result[2].ListData;
|
254
|
brandList.listData = result[2].ListData;
|
239
|
brandList.indexList = result[2].indexList;
|
255
|
brandList.indexList = result[2].indexList;
|
240
|
}
|
256
|
}
|
|
@@ -242,8 +258,17 @@ const indexData = (gender, brandCode, cateCode) => { |
|
@@ -242,8 +258,17 @@ const indexData = (gender, brandCode, cateCode) => { |
242
|
if (result[3]) {
|
258
|
if (result[3]) {
|
243
|
_.forEach(result[3], function(data) {
|
259
|
_.forEach(result[3], function(data) {
|
244
|
if (data.template_name === 'recommend_content_five') {
|
260
|
if (data.template_name === 'recommend_content_five') {
|
|
|
261
|
+ _.forEach(data.data.list, function(val) {
|
|
|
262
|
+ var param = val.url.substring(val.url.indexOf('list?') + 5);
|
|
|
263
|
+
|
|
|
264
|
+ val.url = '//list.m.yohobuy.com/?' + param;
|
|
|
265
|
+ })
|
245
|
categoryData.list = data.data.list;
|
266
|
categoryData.list = data.data.list;
|
246
|
} else if (data.template_name === 'focus') {
|
267
|
} else if (data.template_name === 'focus') {
|
|
|
268
|
+ _.forEach(data.data, function(val) {
|
|
|
269
|
+
|
|
|
270
|
+ val.url = '//m.yohobuy.com/guang/cate-all';
|
|
|
271
|
+ })
|
247
|
categoryData.focusData = data;
|
272
|
categoryData.focusData = data;
|
248
|
}
|
273
|
}
|
249
|
});
|
274
|
});
|
|
@@ -263,9 +288,9 @@ const brandListData = (code, gender) => { |
|
@@ -263,9 +288,9 @@ const brandListData = (code, gender) => { |
263
|
if (result[0]) {
|
288
|
if (result[0]) {
|
264
|
_.forEach(result[0], function(data) {
|
289
|
_.forEach(result[0], function(data) {
|
265
|
if (data.focus_type === '1') {
|
290
|
if (data.focus_type === '1') {
|
266
|
- brandList.bannerTop = data;
|
291
|
+ brandList.bannerTop = _dealBrandUrl(data);
|
267
|
} else if (data.focus_type === '2') {
|
292
|
} else if (data.focus_type === '2') {
|
268
|
- brandList.focusData = data.data;
|
293
|
+ brandList.focusData = _dealBrandUrl(data).data;
|
269
|
}
|
294
|
}
|
270
|
});
|
295
|
});
|
271
|
}
|
296
|
}
|
|
@@ -289,8 +314,18 @@ const categoryData = (code) => { |
|
@@ -289,8 +314,18 @@ const categoryData = (code) => { |
289
|
if (result) {
|
314
|
if (result) {
|
290
|
_.forEach(result, function(data) {
|
315
|
_.forEach(result, function(data) {
|
291
|
if (data.template_name === 'recommend_content_five') {
|
316
|
if (data.template_name === 'recommend_content_five') {
|
|
|
317
|
+ _.forEach(data.data.list, function(val) {
|
|
|
318
|
+ var param = val.url.substring(val.url.indexOf('list?') + 5);
|
|
|
319
|
+
|
|
|
320
|
+ val.url = '//list.m.yohobuy.com/?' + param;
|
|
|
321
|
+ })
|
292
|
category.list = data.data.list;
|
322
|
category.list = data.data.list;
|
293
|
} else if (data.template_name === 'focus') {
|
323
|
} else if (data.template_name === 'focus') {
|
|
|
324
|
+ _.forEach(data.data, function(val) {
|
|
|
325
|
+
|
|
|
326
|
+ val.url = '//m.yohobuy.com/guang/cate-all';
|
|
|
327
|
+ })
|
|
|
328
|
+
|
294
|
category.focusData = data;
|
329
|
category.focusData = data;
|
295
|
}
|
330
|
}
|
296
|
});
|
331
|
});
|