|
@@ -434,6 +434,25 @@ const _getSingleHotFloorData = (args, type) => { |
|
@@ -434,6 +434,25 @@ const _getSingleHotFloorData = (args, type) => { |
434
|
return _getGirlsSingleHot(args, type);
|
434
|
return _getGirlsSingleHot(args, type);
|
435
|
}
|
435
|
}
|
436
|
};
|
436
|
};
|
|
|
437
|
+/**
|
|
|
438
|
+ * 组装最新上架楼层数据
|
|
|
439
|
+ *
|
|
|
440
|
+ * @param string data
|
|
|
441
|
+ * return obj
|
|
|
442
|
+ */
|
|
|
443
|
+const _getNewGoodsFloorData = args => {
|
|
|
444
|
+ const data = {};
|
|
|
445
|
+
|
|
|
446
|
+ if (!_.isEmpty(args)) {
|
|
|
447
|
+ data.newArrivls = {
|
|
|
448
|
+ name: args[0].data.text,
|
|
|
449
|
+ navs: []
|
|
|
450
|
+ };
|
|
|
451
|
+
|
|
|
452
|
+ data.newArrivls.navs = args[1].data || {};
|
|
|
453
|
+ }
|
|
|
454
|
+ return data;
|
|
|
455
|
+};
|
437
|
|
456
|
|
438
|
/**
|
457
|
/**
|
439
|
* 文本标题
|
458
|
* 文本标题
|
|
@@ -452,6 +471,10 @@ const _getFloorTitleData = (args) => { |
|
@@ -452,6 +471,10 @@ const _getFloorTitleData = (args) => { |
452
|
} else {
|
471
|
} else {
|
453
|
resData.floorHeader.name = args.data.text;
|
472
|
resData.floorHeader.name = args.data.text;
|
454
|
}
|
473
|
}
|
|
|
474
|
+
|
|
|
475
|
+ if (resData.floorHeader.name.indexOf('最新上架') >= 0) {
|
|
|
476
|
+ resData = _getNewGoodsFloorData(args);
|
|
|
477
|
+ }
|
455
|
return resData;
|
478
|
return resData;
|
456
|
};
|
479
|
};
|
457
|
|
480
|
|
|
@@ -565,25 +588,7 @@ const _processFloorDataWithQueryReusult = (rawData, originQuery, queryResult, ti |
|
@@ -565,25 +588,7 @@ const _processFloorDataWithQueryReusult = (rawData, originQuery, queryResult, ti |
565
|
return data;
|
588
|
return data;
|
566
|
};
|
589
|
};
|
567
|
|
590
|
|
568
|
-/**
|
|
|
569
|
- * 组装最新上架楼层数据
|
|
|
570
|
- *
|
|
|
571
|
- * @param string data
|
|
|
572
|
- * return obj
|
|
|
573
|
- */
|
|
|
574
|
-const _getNewGoodsFloorData = args => {
|
|
|
575
|
- const data = {};
|
|
|
576
|
-
|
|
|
577
|
- if (!_.isEmpty(args)) {
|
|
|
578
|
- data.newArrivls = {
|
|
|
579
|
- name: args[0].data.text,
|
|
|
580
|
- navs: []
|
|
|
581
|
- };
|
|
|
582
|
|
591
|
|
583
|
- data.newArrivls.navs = args[1].data || {};
|
|
|
584
|
- }
|
|
|
585
|
- return data;
|
|
|
586
|
-};
|
|
|
587
|
|
592
|
|
588
|
const _getCategoryFloorData = args => {
|
593
|
const _getCategoryFloorData = args => {
|
589
|
const data = {
|
594
|
const data = {
|
|
@@ -715,9 +720,9 @@ const _processFloorData = (rawData, type, isJKChannel, code) => { |
|
@@ -715,9 +720,9 @@ const _processFloorData = (rawData, type, isJKChannel, code) => { |
715
|
if (text.indexOf('最新速报') >= 0) {
|
720
|
if (text.indexOf('最新速报') >= 0) {
|
716
|
floorData = _getNewReportFloorData(rawData.slice(index, index + 5), type, code);
|
721
|
floorData = _getNewReportFloorData(rawData.slice(index, index + 5), type, code);
|
717
|
|
722
|
|
718
|
- //单个图作为最新速报模块用过的,标识一下,不作为广告位了
|
723
|
+ // 单个图作为最新速报模块用过的,标识一下,不作为广告位了
|
719
|
_.filter(rawData.slice(index, index + 5), function(o) {
|
724
|
_.filter(rawData.slice(index, index + 5), function(o) {
|
720
|
- if(o.template_name === 'single_image') {
|
725
|
+ if (o.template_name === 'single_image') {
|
721
|
o.hasUser = true;
|
726
|
o.hasUser = true;
|
722
|
}
|
727
|
}
|
723
|
});
|
728
|
});
|
|
@@ -748,7 +753,7 @@ const _processFloorData = (rawData, type, isJKChannel, code) => { |
|
@@ -748,7 +753,7 @@ const _processFloorData = (rawData, type, isJKChannel, code) => { |
748
|
// 1标题12图,在日韩馆频道页,作为7个品类显示
|
753
|
// 1标题12图,在日韩馆频道页,作为7个品类显示
|
749
|
floorData = floorMap.sevenCategory.call(null, data.data);
|
754
|
floorData = floorMap.sevenCategory.call(null, data.data);
|
750
|
} else if (isJKChannel && data && data.template_name === 'single_image') {
|
755
|
} else if (isJKChannel && data && data.template_name === 'single_image') {
|
751
|
- if(!data.hasUser) {
|
756
|
+ if (!data.hasUser) {
|
752
|
// 一张图,在日韩馆频道页,做广告位
|
757
|
// 一张图,在日韩馆频道页,做广告位
|
753
|
floorData = floorMap.ad.call(null, data.data);
|
758
|
floorData = floorMap.ad.call(null, data.data);
|
754
|
}
|
759
|
}
|
|
@@ -922,9 +927,19 @@ const formatIndexGuideData = data => { |
|
@@ -922,9 +927,19 @@ const formatIndexGuideData = data => { |
922
|
* @param string $channel
|
927
|
* @param string $channel
|
923
|
* @return array
|
928
|
* @return array
|
924
|
*/
|
929
|
*/
|
925
|
-const getNewArrival = channel => {
|
930
|
+const getNewArrival = (channel, isJKChannel)=> {
|
926
|
let rel = [],
|
931
|
let rel = [],
|
927
|
sortList = sortMap[channel],
|
932
|
sortList = sortMap[channel],
|
|
|
933
|
+ params = {},
|
|
|
934
|
+ method = '';
|
|
|
935
|
+
|
|
|
936
|
+ if (isJKChannel) {
|
|
|
937
|
+ method = 'app.search.sales';
|
|
|
938
|
+ params = {
|
|
|
939
|
+ productPool: 519
|
|
|
940
|
+ };
|
|
|
941
|
+ } else {
|
|
|
942
|
+ method = 'web.search.newshelve';
|
928
|
params = {
|
943
|
params = {
|
929
|
order: 'shelve_time:desc',
|
944
|
order: 'shelve_time:desc',
|
930
|
status: 1,
|
945
|
status: 1,
|
|
@@ -933,6 +948,8 @@ const getNewArrival = channel => { |
|
@@ -933,6 +948,8 @@ const getNewArrival = channel => { |
933
|
stocknumber: 3,
|
948
|
stocknumber: 3,
|
934
|
dayLimit: 4
|
949
|
dayLimit: 4
|
935
|
};
|
950
|
};
|
|
|
951
|
+ }
|
|
|
952
|
+
|
936
|
|
953
|
|
937
|
params.gender = channelMap[channel].gender;
|
954
|
params.gender = channelMap[channel].gender;
|
938
|
|
955
|
|
|
@@ -940,7 +957,7 @@ const getNewArrival = channel => { |
|
@@ -940,7 +957,7 @@ const getNewArrival = channel => { |
940
|
let data = Object.assign(item, params, {limit: item.viewNum});
|
957
|
let data = Object.assign(item, params, {limit: item.viewNum});
|
941
|
|
958
|
|
942
|
rel.push(api.get('', Object.assign({
|
959
|
rel.push(api.get('', Object.assign({
|
943
|
- method: 'web.search.newshelve'
|
960
|
+ method: method
|
944
|
}, data), {cache: true}));
|
961
|
}, data), {cache: true}));
|
945
|
});
|
962
|
});
|
946
|
|
963
|
|
|
@@ -978,13 +995,14 @@ const getContent = (type, req) => { |
|
@@ -978,13 +995,14 @@ const getContent = (type, req) => { |
978
|
let title = req.query.title,
|
995
|
let title = req.query.title,
|
979
|
contentCode = req.query.content_code;
|
996
|
contentCode = req.query.content_code;
|
980
|
|
997
|
|
|
|
998
|
+ let isJKChannel = title === 'japanKorean' ? true : false;
|
|
|
999
|
+
|
981
|
return Promise.all([headerModel.requestHeaderData(type), _requestContent(type, contentCode)]).then(res => {
|
1000
|
return Promise.all([headerModel.requestHeaderData(type), _requestContent(type, contentCode)]).then(res => {
|
982
|
|
1001
|
|
983
|
let headerData = res[0].data || res[0],
|
1002
|
let headerData = res[0].data || res[0],
|
984
|
contentData = res[1].data ? res[1].data.list : res[1];
|
1003
|
contentData = res[1].data ? res[1].data.list : res[1];
|
985
|
|
1004
|
|
986
|
- let data = {},
|
|
|
987
|
- isJKChannel = title === 'japanKorean' ? true : false;
|
1005
|
+ let data = {};
|
988
|
|
1006
|
|
989
|
const processResult = _processFloorData(contentData, type, isJKChannel, contentCode);
|
1007
|
const processResult = _processFloorData(contentData, type, isJKChannel, contentCode);
|
990
|
|
1008
|
|
|
@@ -992,6 +1010,7 @@ const getContent = (type, req) => { |
|
@@ -992,6 +1010,7 @@ const getContent = (type, req) => { |
992
|
data.module = 'channel';
|
1010
|
data.module = 'channel';
|
993
|
data.page = 'channel';
|
1011
|
data.page = 'channel';
|
994
|
data.pageType = type;
|
1012
|
data.pageType = type;
|
|
|
1013
|
+ isJKChannel ? data.mchannel = 'japanKorean' : '';// 子频道,如日韩馆
|
995
|
data.footerTop = true;
|
1014
|
data.footerTop = true;
|
996
|
data.channel = processResult.floors;
|
1015
|
data.channel = processResult.floors;
|
997
|
|
1016
|
|