...
|
...
|
@@ -576,7 +576,6 @@ const _requestContent = (type, params) => { |
|
|
};
|
|
|
|
|
|
Object.assign(data, params);
|
|
|
|
|
|
return serviceApi.get('operations/api/v5/resource/home', data, {
|
|
|
cache: true,
|
|
|
code: 200
|
...
|
...
|
@@ -894,14 +893,9 @@ const getNewArrival = channel => { |
|
|
* @param {String} type 传入频道页类型,值可以是: boys, girls, kids, lifestyle
|
|
|
* @return {Object}
|
|
|
*/
|
|
|
const getContent = (type, req) => {
|
|
|
let params = {};
|
|
|
const getContent = (type) => {
|
|
|
let params = {new_device: 'Y'};
|
|
|
|
|
|
if (!req.user.uid) {
|
|
|
params.new_device = 'Y';
|
|
|
} else {
|
|
|
params.uid = req.user.uid;
|
|
|
}
|
|
|
return Promise.all([headerModel.requestHeaderData(type), _requestContent(type, params)]).then(res => {
|
|
|
|
|
|
let headerData = res[0].data || res[0],
|
...
|
...
|
@@ -956,14 +950,9 @@ const getContent = (type, req) => { |
|
|
|
|
|
|
|
|
// 优选品牌楼层floorData-ajax
|
|
|
const getbrandFloorDataAjax = (type, req) => {
|
|
|
let params = {};
|
|
|
const getbrandFloorDataAjax = (type) => {
|
|
|
let params = {new_device: 'Y'};
|
|
|
|
|
|
if (!req.user.uid) {
|
|
|
params.new_device = 'Y';
|
|
|
} else {
|
|
|
params.uid = req.user.uid;
|
|
|
}
|
|
|
return _requestContent(type, params).then(res => {
|
|
|
let contentData = res.data ? res.data.list : [];
|
|
|
|
...
|
...
|
@@ -1026,12 +1015,34 @@ const getIndexGuideData = () => { |
|
|
return serviceApi.get('operations/api/v6/category/getCategory', params, config.apiCache);
|
|
|
};
|
|
|
|
|
|
const hasNewUserFloor = (channelType, uid) => {
|
|
|
let params = {uid: uid};
|
|
|
|
|
|
return _requestContent(channelType, params).then(res => {
|
|
|
let isNewUser = false,
|
|
|
contentData = res.data ? res.data.list : res;
|
|
|
|
|
|
_.forEach(contentData, (data) => {
|
|
|
if (data.template_name === 'new_user_floor' || data.template_intro === '新人专享') {
|
|
|
isNewUser = true;
|
|
|
return false;
|
|
|
}
|
|
|
});
|
|
|
|
|
|
return {
|
|
|
isNewUser: isNewUser
|
|
|
};
|
|
|
});
|
|
|
};
|
|
|
|
|
|
|
|
|
module.exports = {
|
|
|
getNewArrival: getNewArrival,
|
|
|
getContent: getContent,
|
|
|
getbrandFloorDataAjax: getbrandFloorDataAjax,
|
|
|
getIndexGuideData: getIndexGuideData,
|
|
|
formatIndexGuideData: formatIndexGuideData,
|
|
|
getResourceData: getResourceData
|
|
|
getResourceData: getResourceData,
|
|
|
hasNewUserFloor: hasNewUserFloor
|
|
|
|
|
|
}; |
...
|
...
|
|