Authored by Kennaki

Part of filter. reviewed by Boss Kai.

... ... @@ -131,10 +131,33 @@ export function setProductListFilter(value) {
}
export function setFilterView(show) {
return {
type: FILTER_LIST_VIEW,
payload: show
}
return (dispatch, getState) => {
// console.log('bbbbbb');
// let {app, redBrand} = getState();
// let {filterDataReady, shopId} = redBrand;
// console.log(redBrand.toJS());
// console.log(show);
// console.log(filterDataReady);
// if (!filterDataReady && show) {
// let channel = app.channel;
// return new RedBrandService(app.host).productFilter(shopId, channel)
// .then(json => {
// console.log('ccccc');
// console.log(json);
// })
// .catch(error => {
// console.log('eeeee');
// console.log(error);
// });
// } else {
// console.log('ggggggggß');
dispatch({
type: FILTER_LIST_VIEW,
payload: show
});
// }
};
}
export function setFilterMoreView(show) {
return {
... ...
... ... @@ -8,6 +8,7 @@ let InitialState = Record({
launchProfile: false,//header 详情展开收起开关
fliter: 0,//红人首页。全部商品切换开关
filterDataReady: false,
categoryFilterList: List(),
filterCategoryDetailFilterList: List(),
similarIndex : -1,
... ...
... ... @@ -63,10 +63,30 @@ export default class RedBrandService {
});
}
async productFilter(shop_id, yh_channel=1) {
console.log('ffffffff');
return await this.api.get({
url: '',
body: {
method: 'app.search.shop.filterOld',
shop_id,
yh_channel,
}
})
.then((json) => {
console.log('aaaa');
console.log(json);
return json;
})
.catch((error) => {
throw(error);
});
}
async productList(shop_id, yh_channel=1, order='s_t_asc', page=1, limit=60, filterFactors={}, v=7) {
let bodyParams = {
method: 'app.search.li',
method: 'app.search.shop.productList',
shop_id,
yh_channel,
order,
... ...