Authored by 姜枫

fix new product list banner

... ... @@ -83,43 +83,43 @@ const list = {
Promise.all([Resouces.newProductBanner(channel), Search.queryAllSort(),
Search.queryNewProduct(q)]).then(result => {
let banner = result[0];
let sortData = camelCase(result[1]);
let listData = result[2];
let nav = [DataHelper.getChannelNav(), {
name: '新品'
}];
retData.banner = banner;
if (listData && listData.code === 200 && listData.data) {
let data = camelCase(listData.data);
if (data.filter) {
data.filter.groupSort = DataHelper.sortConvert(sortData.data.sort);
retData.filter = DataHelper.filterHandle(data.filter, q);
retData.filter.showPrice = data.total > 10;
let banner = result[0];
let sortData = camelCase(result[1]);
let listData = result[2];
let nav = [DataHelper.getChannelNav(), {
name: '新品'
}];
retData.banner = banner;
if (listData && listData.code === 200 && listData.data) {
let data = camelCase(listData.data);
if (data.filter) {
data.filter.groupSort = DataHelper.sortConvert(sortData.data.sort);
retData.filter = DataHelper.filterHandle(data.filter, q);
retData.filter.showPrice = data.total > 10;
}
retData.navPath = {
nav: nav
};
retData.paginationData = {
page: q.page,
limit: data.limit || 45,
total: data.total,
pageTotal: data.pageTotal,
queryParams: q
};
res.display('newList', _.assign(retData, {
products: DataHelper.handleProductList(data.productList, q),
order: q.order
}));
} else {
return Promise.reject('query product error');
}
retData.navPath = {
nav: nav
};
retData.paginationData = {
page: q.page,
limit: data.limit || 45,
total: data.total,
pageTotal: data.pageTotal,
queryParams: q
};
res.display('newList', _.assign(retData, {
products: DataHelper.handleProductList(data.productList, q),
order: q.order
}));
} else {
return Promise.reject('query product error');
}
}).catch(next);
}).catch(next);
}
};
... ...