...
|
...
|
@@ -434,6 +434,25 @@ const _getSingleHotFloorData = (args, type) => { |
|
|
return _getGirlsSingleHot(args, type);
|
|
|
}
|
|
|
};
|
|
|
/**
|
|
|
* 组装最新上架楼层数据
|
|
|
*
|
|
|
* @param string data
|
|
|
* return obj
|
|
|
*/
|
|
|
const _getNewGoodsFloorData = args => {
|
|
|
const data = {};
|
|
|
|
|
|
if (!_.isEmpty(args)) {
|
|
|
data.newArrivls = {
|
|
|
name: args[0].data.text,
|
|
|
navs: []
|
|
|
};
|
|
|
|
|
|
data.newArrivls.navs = args[1].data || {};
|
|
|
}
|
|
|
return data;
|
|
|
};
|
|
|
|
|
|
/**
|
|
|
* 文本标题
|
...
|
...
|
@@ -452,6 +471,10 @@ const _getFloorTitleData = (args) => { |
|
|
} else {
|
|
|
resData.floorHeader.name = args.data.text;
|
|
|
}
|
|
|
|
|
|
if (resData.floorHeader.name.indexOf('最新上架') >= 0) {
|
|
|
resData = _getNewGoodsFloorData(args);
|
|
|
}
|
|
|
return resData;
|
|
|
};
|
|
|
|
...
|
...
|
@@ -565,25 +588,7 @@ const _processFloorDataWithQueryReusult = (rawData, originQuery, queryResult, ti |
|
|
return data;
|
|
|
};
|
|
|
|
|
|
/**
|
|
|
* 组装最新上架楼层数据
|
|
|
*
|
|
|
* @param string data
|
|
|
* return obj
|
|
|
*/
|
|
|
const _getNewGoodsFloorData = args => {
|
|
|
const data = {};
|
|
|
|
|
|
if (!_.isEmpty(args)) {
|
|
|
data.newArrivls = {
|
|
|
name: args[0].data.text,
|
|
|
navs: []
|
|
|
};
|
|
|
|
|
|
data.newArrivls.navs = args[1].data || {};
|
|
|
}
|
|
|
return data;
|
|
|
};
|
|
|
|
|
|
const _getCategoryFloorData = args => {
|
|
|
const data = {
|
...
|
...
|
@@ -715,9 +720,9 @@ const _processFloorData = (rawData, type, isJKChannel, code) => { |
|
|
if (text.indexOf('最新速报') >= 0) {
|
|
|
floorData = _getNewReportFloorData(rawData.slice(index, index + 5), type, code);
|
|
|
|
|
|
//单个图作为最新速报模块用过的,标识一下,不作为广告位了
|
|
|
// 单个图作为最新速报模块用过的,标识一下,不作为广告位了
|
|
|
_.filter(rawData.slice(index, index + 5), function(o) {
|
|
|
if(o.template_name === 'single_image') {
|
|
|
if (o.template_name === 'single_image') {
|
|
|
o.hasUser = true;
|
|
|
}
|
|
|
});
|
...
|
...
|
@@ -748,7 +753,7 @@ const _processFloorData = (rawData, type, isJKChannel, code) => { |
|
|
// 1标题12图,在日韩馆频道页,作为7个品类显示
|
|
|
floorData = floorMap.sevenCategory.call(null, data.data);
|
|
|
} else if (isJKChannel && data && data.template_name === 'single_image') {
|
|
|
if(!data.hasUser) {
|
|
|
if (!data.hasUser) {
|
|
|
// 一张图,在日韩馆频道页,做广告位
|
|
|
floorData = floorMap.ad.call(null, data.data);
|
|
|
}
|
...
|
...
|
@@ -922,9 +927,19 @@ const formatIndexGuideData = data => { |
|
|
* @param string $channel
|
|
|
* @return array
|
|
|
*/
|
|
|
const getNewArrival = channel => {
|
|
|
const getNewArrival = (channel, isJKChannel)=> {
|
|
|
let rel = [],
|
|
|
sortList = sortMap[channel],
|
|
|
params = {},
|
|
|
method = '';
|
|
|
|
|
|
if (isJKChannel) {
|
|
|
method = 'app.search.sales';
|
|
|
params = {
|
|
|
productPool: 519
|
|
|
};
|
|
|
} else {
|
|
|
method = 'web.search.newshelve';
|
|
|
params = {
|
|
|
order: 'shelve_time:desc',
|
|
|
status: 1,
|
...
|
...
|
@@ -933,6 +948,8 @@ const getNewArrival = channel => { |
|
|
stocknumber: 3,
|
|
|
dayLimit: 4
|
|
|
};
|
|
|
}
|
|
|
|
|
|
|
|
|
params.gender = channelMap[channel].gender;
|
|
|
|
...
|
...
|
@@ -940,7 +957,7 @@ const getNewArrival = channel => { |
|
|
let data = Object.assign(item, params, {limit: item.viewNum});
|
|
|
|
|
|
rel.push(api.get('', Object.assign({
|
|
|
method: 'web.search.newshelve'
|
|
|
method: method
|
|
|
}, data), {cache: true}));
|
|
|
});
|
|
|
|
...
|
...
|
@@ -978,13 +995,14 @@ const getContent = (type, req) => { |
|
|
let title = req.query.title,
|
|
|
contentCode = req.query.content_code;
|
|
|
|
|
|
let isJKChannel = title === 'japanKorean' ? true : false;
|
|
|
|
|
|
return Promise.all([headerModel.requestHeaderData(type), _requestContent(type, contentCode)]).then(res => {
|
|
|
|
|
|
let headerData = res[0].data || res[0],
|
|
|
contentData = res[1].data ? res[1].data.list : res[1];
|
|
|
|
|
|
let data = {},
|
|
|
isJKChannel = title === 'japanKorean' ? true : false;
|
|
|
let data = {};
|
|
|
|
|
|
const processResult = _processFloorData(contentData, type, isJKChannel, contentCode);
|
|
|
|
...
|
...
|
@@ -992,6 +1010,7 @@ const getContent = (type, req) => { |
|
|
data.module = 'channel';
|
|
|
data.page = 'channel';
|
|
|
data.pageType = type;
|
|
|
isJKChannel ? data.mchannel = 'japanKorean' : '';// 子频道,如日韩馆
|
|
|
data.footerTop = true;
|
|
|
data.channel = processResult.floors;
|
|
|
|
...
|
...
|
|