...
|
...
|
@@ -9,23 +9,29 @@ const productProcess = require('../../../utils/product-process'); |
|
|
* @return {[array]}
|
|
|
*/
|
|
|
const getAllChannels = (params) => {
|
|
|
params = params || {};
|
|
|
let gender = params.gender - 1 || 0;
|
|
|
|
|
|
return api.get('', Object.assign({
|
|
|
return api.get('', {
|
|
|
method: 'app.blk.getAllChannels'
|
|
|
}, params)).then(result => {
|
|
|
}).then(result => {
|
|
|
let data = {channel: []};
|
|
|
|
|
|
if (result.code !== 200) {
|
|
|
return data;
|
|
|
}
|
|
|
|
|
|
if (gender === 3 && result.data.length === 3) {
|
|
|
// 1:男,2:女,3:童装,4:创意生活
|
|
|
// 如果为3,说明童装没有配置,只配置了创意生活。所以要减一
|
|
|
gender = 2;
|
|
|
}
|
|
|
|
|
|
_.forEach(result.data, (res, index) => {
|
|
|
data.channel.push({
|
|
|
id: res.channel_id,
|
|
|
mame: res.channel_name,
|
|
|
code: res.content_code,
|
|
|
focus: index === 0 ? true : false
|
|
|
focus: index === gender ? true : false
|
|
|
});
|
|
|
});
|
|
|
|
...
|
...
|
|