|
@@ -9,6 +9,8 @@ const _ = require('lodash'); |
|
@@ -9,6 +9,8 @@ const _ = require('lodash'); |
9
|
|
9
|
|
10
|
const ServiceAPI = require(`${global.library}/api`).ServiceAPI;
|
10
|
const ServiceAPI = require(`${global.library}/api`).ServiceAPI;
|
11
|
const sign = require(`${global.library}/sign`);
|
11
|
const sign = require(`${global.library}/sign`);
|
|
|
12
|
+const helpers = require(`${global.library}/helpers`);
|
|
|
13
|
+
|
12
|
|
14
|
|
13
|
const serviceApi = new ServiceAPI();
|
15
|
const serviceApi = new ServiceAPI();
|
14
|
|
16
|
|
|
@@ -137,6 +139,30 @@ const getNewReportFloorData = args => { |
|
@@ -137,6 +139,30 @@ const getNewReportFloorData = args => { |
137
|
return floorDatas;
|
139
|
return floorDatas;
|
138
|
};
|
140
|
};
|
139
|
|
141
|
|
|
|
142
|
+// 优选品牌
|
|
|
143
|
+const getPreBrandTopData = args => {
|
|
|
144
|
+ let item = args[0].data;
|
|
|
145
|
+
|
|
|
146
|
+ const data = {
|
|
|
147
|
+ preferenceBrands: {
|
|
|
148
|
+ name: '优选品牌',
|
|
|
149
|
+ imgBrand: [],
|
|
|
150
|
+ brandUrl:helpers.urlFormat('getbrandFloorDataAjax')
|
|
|
151
|
+ }
|
|
|
152
|
+ };
|
|
|
153
|
+
|
|
|
154
|
+ _.forEach(item, (topData) => {
|
|
|
155
|
+ let o = {};
|
|
|
156
|
+
|
|
|
157
|
+ o.href = topData.url;
|
|
|
158
|
+ o.img = topData.src;
|
|
|
159
|
+
|
|
|
160
|
+ data.preferenceBrands.imgBrand.push(o);
|
|
|
161
|
+ });
|
|
|
162
|
+
|
|
|
163
|
+ return data;
|
|
|
164
|
+};
|
|
|
165
|
+
|
140
|
// 热门品类
|
166
|
// 热门品类
|
141
|
const getHotGoodsFloorData = (args) => {
|
167
|
const getHotGoodsFloorData = (args) => {
|
142
|
let item = args[0];
|
168
|
let item = args[0];
|
|
@@ -266,8 +292,8 @@ const getSingleHotFloorData = args => { |
|
@@ -266,8 +292,8 @@ const getSingleHotFloorData = args => { |
266
|
const requestContent = type => {
|
292
|
const requestContent = type => {
|
267
|
|
293
|
|
268
|
let data = sign.apiSign({
|
294
|
let data = sign.apiSign({
|
269
|
- /* eslint-disable */
|
|
|
270
|
- client_type: 'web',
|
295
|
+ /* eslint-disable */
|
|
|
296
|
+ client_type: 'web',
|
271
|
/* eslint-enable */
|
297
|
/* eslint-enable */
|
272
|
content_code: channelMap[type || 'boys'].code,
|
298
|
content_code: channelMap[type || 'boys'].code,
|
273
|
gender: channelMap[type || 'boys'].gender,
|
299
|
gender: channelMap[type || 'boys'].gender,
|
|
@@ -283,6 +309,7 @@ const floorMap = { |
|
@@ -283,6 +309,7 @@ const floorMap = { |
283
|
hot: getHotGoodsFloorData,
|
309
|
hot: getHotGoodsFloorData,
|
284
|
最新速报: getNewReportFloorData,
|
310
|
最新速报: getNewReportFloorData,
|
285
|
人气单品: getSingleHotFloorData,
|
311
|
人气单品: getSingleHotFloorData,
|
|
|
312
|
+ 优选品牌: getPreBrandTopData,
|
286
|
ad: getadbannerData
|
313
|
ad: getadbannerData
|
287
|
};
|
314
|
};
|
288
|
|
315
|
|
|
@@ -335,3 +362,31 @@ exports.getContent = type => { |
|
@@ -335,3 +362,31 @@ exports.getContent = type => { |
335
|
}
|
362
|
}
|
336
|
});
|
363
|
});
|
337
|
};
|
364
|
};
|
|
|
365
|
+
|
|
|
366
|
+
|
|
|
367
|
+// 优选品牌楼层floorData-ajax
|
|
|
368
|
+exports.getbrandFloorDataAjax = type => {
|
|
|
369
|
+ return requestContent(type).then(res => {
|
|
|
370
|
+ if (res.code === 200) {
|
|
|
371
|
+ let contentData = res.data.list;
|
|
|
372
|
+
|
|
|
373
|
+ let data = {
|
|
|
374
|
+ 'logoBrand':[],
|
|
|
375
|
+ 'moreBrand':''
|
|
|
376
|
+ };
|
|
|
377
|
+
|
|
|
378
|
+ _.forEach(contentData[6].data, (floorData) => {
|
|
|
379
|
+ let o = {};
|
|
|
380
|
+
|
|
|
381
|
+ o.href = floorData.url;
|
|
|
382
|
+ o.img = helpers.image(floorData.src, 185, 86, 2);
|
|
|
383
|
+
|
|
|
384
|
+ data.logoBrand.push(o);
|
|
|
385
|
+ });
|
|
|
386
|
+
|
|
|
387
|
+ data.moreBrand = contentData[7].data[0].url;
|
|
|
388
|
+
|
|
|
389
|
+ return data;
|
|
|
390
|
+ }
|
|
|
391
|
+ });
|
|
|
392
|
+}; |