|
@@ -33,7 +33,7 @@ const getOutletResource = (channel, contentcode) => { |
|
@@ -33,7 +33,7 @@ const getOutletResource = (channel, contentcode) => { |
33
|
return resourcesProcess(result.data.list);
|
33
|
return resourcesProcess(result.data.list);
|
34
|
} else {
|
34
|
} else {
|
35
|
log.error('奥莱资源位接口返回状态码 不是 200');
|
35
|
log.error('奥莱资源位接口返回状态码 不是 200');
|
36
|
- return result;
|
36
|
+ return [];
|
37
|
}
|
37
|
}
|
38
|
});
|
38
|
});
|
39
|
};
|
39
|
};
|
|
@@ -68,7 +68,7 @@ const getNavData = (categoryId) => { |
|
@@ -68,7 +68,7 @@ const getNavData = (categoryId) => { |
68
|
return data;
|
68
|
return data;
|
69
|
} else {
|
69
|
} else {
|
70
|
log.error('奥莱导航接口返回状态码 不是 200', result);
|
70
|
log.error('奥莱导航接口返回状态码 不是 200', result);
|
71
|
- return result;
|
71
|
+ return [];
|
72
|
}
|
72
|
}
|
73
|
});
|
73
|
});
|
74
|
};
|
74
|
};
|
|
@@ -115,7 +115,7 @@ const convertActicityData = (data) => { |
|
@@ -115,7 +115,7 @@ const convertActicityData = (data) => { |
115
|
const getHomeActivity = (data) => {
|
115
|
const getHomeActivity = (data) => {
|
116
|
var params = {
|
116
|
var params = {
|
117
|
method: 'app.outlets.activityGet',
|
117
|
method: 'app.outlets.activityGet',
|
118
|
- platform: 2,
|
118
|
+ platform: 2
|
119
|
};
|
119
|
};
|
120
|
|
120
|
|
121
|
return api.get('', sign.apiSign(_.assign(params, data))).then(res => {
|
121
|
return api.get('', sign.apiSign(_.assign(params, data))).then(res => {
|
|
@@ -124,8 +124,7 @@ const getHomeActivity = (data) => { |
|
@@ -124,8 +124,7 @@ const getHomeActivity = (data) => { |
124
|
};
|
124
|
};
|
125
|
|
125
|
|
126
|
exports.getContent = (categoryId, channel, code) => {
|
126
|
exports.getContent = (categoryId, channel, code) => {
|
127
|
- let floorsData = {},
|
|
|
128
|
- params = {
|
127
|
+ let params = {
|
129
|
type: 0,
|
128
|
type: 0,
|
130
|
yh_channel: channel
|
129
|
yh_channel: channel
|
131
|
};
|
130
|
};
|
|
@@ -133,39 +132,43 @@ exports.getContent = (categoryId, channel, code) => { |
|
@@ -133,39 +132,43 @@ exports.getContent = (categoryId, channel, code) => { |
133
|
const p = [getNavData(categoryId), getOutletResource(channel, code), getHomeActivity(params)];
|
132
|
const p = [getNavData(categoryId), getOutletResource(channel, code), getHomeActivity(params)];
|
134
|
|
133
|
|
135
|
return Promise.all(p).then(data => {
|
134
|
return Promise.all(p).then(data => {
|
136
|
- floorsData.nav = data[0] || [];
|
|
|
137
|
- floorsData.content = data[1] || [];
|
|
|
138
|
- floorsData.activity = {data: data[2]};
|
|
|
139
|
|
135
|
|
140
|
- return floorsData;
|
136
|
+ return {
|
|
|
137
|
+ nav: data[0] || [],
|
|
|
138
|
+ content: data[1] || [],
|
|
|
139
|
+ activity: data[2]
|
|
|
140
|
+ };
|
141
|
});
|
141
|
});
|
142
|
};
|
142
|
};
|
143
|
|
143
|
|
144
|
|
144
|
|
145
|
exports.getActivity = (id) => {
|
145
|
exports.getActivity = (id) => {
|
146
|
return getActivityDetail(id).then(res => {
|
146
|
return getActivityDetail(id).then(res => {
|
147
|
- var data = {};
|
|
|
148
|
|
147
|
|
149
|
- data.outletActivity = res;
|
|
|
150
|
- data.productPool = res[0] && res[0].productPoolId || '';
|
|
|
151
|
- data.saleType = 4;
|
|
|
152
|
- return data;
|
148
|
+ return {
|
|
|
149
|
+ outletActivity: res,
|
|
|
150
|
+ productPool: res[0] || res[0].productPoolId || '',
|
|
|
151
|
+ saleType: 4
|
|
|
152
|
+ };
|
153
|
});
|
153
|
});
|
154
|
};
|
154
|
};
|
155
|
|
155
|
|
156
|
-exports.getNearlyActivity = (channel, type, categoryId) => {
|
156
|
+/**
|
|
|
157
|
+ * 获取即将开始或即将结束的活动列表
|
|
|
158
|
+ * @param {Number} type 标明是即将开始还是即将技术
|
|
|
159
|
+ * @param {String} categoryId 父级菜单id,用于标明当前页面是奥莱页面
|
|
|
160
|
+ * @return {Object} 活动列表数据
|
|
|
161
|
+ */
|
|
|
162
|
+exports.getRecentActivity = (type, categoryId) => {
|
157
|
var params = {
|
163
|
var params = {
|
158
|
- type: type
|
164
|
+ type: 0
|
159
|
};
|
165
|
};
|
160
|
|
166
|
|
161
|
return Promise.all([getNavData(categoryId), getHomeActivity(params)]).then(res => {
|
167
|
return Promise.all([getNavData(categoryId), getHomeActivity(params)]).then(res => {
|
162
|
- var data = {
|
168
|
+
|
|
|
169
|
+ return {
|
163
|
nav: res[0] || [],
|
170
|
nav: res[0] || [],
|
164
|
- activity: {
|
|
|
165
|
- data: res[1]
|
|
|
166
|
- }
|
171
|
+ activity: res[1]
|
167
|
};
|
172
|
};
|
168
|
-
|
|
|
169
|
- return data;
|
|
|
170
|
});
|
173
|
});
|
171
|
}; |
174
|
}; |