...
|
...
|
@@ -116,8 +116,6 @@ const getActivityDetail = (id) => { |
|
|
|
|
|
const convertActicityData = (data) => {
|
|
|
const formatData = [];
|
|
|
var showMore = false;
|
|
|
var i;
|
|
|
|
|
|
data = data || [];
|
|
|
_.forEach(data, (item) => {
|
...
|
...
|
@@ -127,48 +125,43 @@ const convertActicityData = (data) => { |
|
|
logoUrl: item.logoUrl,
|
|
|
title: item.title,
|
|
|
promotionName: item.promotionName,
|
|
|
startLeftTime: item.startLeftTime,
|
|
|
leftTime: item.startLeftTime > 0 ? item.startLeftTime : item.endLeftTime,
|
|
|
hide: false
|
|
|
});
|
|
|
});
|
|
|
|
|
|
|
|
|
if (formatData.length > 10) {
|
|
|
for (i = 10; i < formatData.length; i++) {
|
|
|
formatData[i].hide = true;
|
|
|
}
|
|
|
showMore = true;
|
|
|
}
|
|
|
|
|
|
return {data: formatData, showMore: showMore};
|
|
|
return formatData;
|
|
|
};
|
|
|
|
|
|
const getHomeActivity = (id) => {
|
|
|
const getHomeActivity = (data) => {
|
|
|
var params = {
|
|
|
method: 'app.outlets.activityGet',
|
|
|
platform: 2,
|
|
|
size: 0,
|
|
|
yh_channel: 1,
|
|
|
type: 0,
|
|
|
sort: 2,
|
|
|
client_type: 'h5'
|
|
|
};
|
|
|
|
|
|
return api.get('', sign.apiSign(params)).then(res => {
|
|
|
if (id === 0) {
|
|
|
return api.get('', sign.apiSign(_.assign(params, data))).then(res => {
|
|
|
return convertActicityData(res.data);
|
|
|
}
|
|
|
return res.data;
|
|
|
});
|
|
|
};
|
|
|
|
|
|
exports.getContent = () => {
|
|
|
let floorsData = {};
|
|
|
exports.getContent = (channel) => {
|
|
|
let floorsData = {},
|
|
|
params = {
|
|
|
type: 0,
|
|
|
id: 0
|
|
|
};
|
|
|
|
|
|
if (channel === 'boys') {
|
|
|
params.yh_channel = 1;
|
|
|
}
|
|
|
|
|
|
return Promise.all([getNavData(), getOutletResource(), getHomeActivity(0), getGoodsList()]).then(data => {
|
|
|
return Promise.all([getNavData(), getOutletResource(), getHomeActivity(params), getGoodsList()]).then(data => {
|
|
|
floorsData.nav = data[0] || [];
|
|
|
floorsData.content = data[1] || [];
|
|
|
floorsData.activity = data[2] || [];
|
|
|
floorsData.activity = {data: data[2]};
|
|
|
floorsData.goods = data[3];
|
|
|
|
|
|
return floorsData;
|
...
|
...
|
@@ -186,20 +179,16 @@ exports.getActivity = (id) => { |
|
|
});
|
|
|
};
|
|
|
|
|
|
exports.willBeEnd = () => {
|
|
|
return getHomeActivity().then(res => {
|
|
|
var data = {
|
|
|
activity: {
|
|
|
data: res
|
|
|
}
|
|
|
exports.getNearlyActivity = (channel, type) => {
|
|
|
var params = {
|
|
|
type: type
|
|
|
};
|
|
|
|
|
|
return data;
|
|
|
});
|
|
|
};
|
|
|
if (channel === 'boys') {
|
|
|
params.yh_channel = 1;
|
|
|
}
|
|
|
|
|
|
exports.willBeCome = () => {
|
|
|
return getHomeActivity().then(res => {
|
|
|
return getHomeActivity(params).then(res => {
|
|
|
var data = {
|
|
|
activity: {
|
|
|
data: res
|
...
|
...
|
|