...
|
...
|
@@ -105,7 +105,7 @@ export function fetchResourceInfo() { |
|
|
};
|
|
|
}
|
|
|
|
|
|
export function getProductList(reload=false, fromDetail=false) {
|
|
|
export function getProductList(reload=false) {
|
|
|
return (dispatch, getState) => {
|
|
|
let {app, groupPurchase} = getState();
|
|
|
let {productList,activityId, groupListParams} = groupPurchase;
|
...
|
...
|
@@ -123,8 +123,9 @@ export function getProductList(reload=false, fromDetail=false) { |
|
|
|
|
|
dispatch(productListRequest());
|
|
|
|
|
|
if(fromDetail){
|
|
|
return new GroupPurchaseService(app.host).fetchGroupDetailProductList(activityId, page, limit,fromPage)
|
|
|
//处理拼团列表参数
|
|
|
let listParams = excludeParams(groupListParams);
|
|
|
return new GroupPurchaseService(app.host).fetchGroupProductList(activityId, page, limit,fromPage, listParams)
|
|
|
.then(json => {
|
|
|
json.endReached = json.page == json.page_total;
|
|
|
if (json.page > 1) {
|
...
|
...
|
@@ -137,24 +138,6 @@ export function getProductList(reload=false, fromDetail=false) { |
|
|
.catch(error => {
|
|
|
dispatch(productListFailure(error));
|
|
|
});
|
|
|
}else{
|
|
|
//处理拼团列表参数
|
|
|
let listParams = excludeParams(groupListParams);
|
|
|
|
|
|
return new GroupPurchaseService(app.host).fetchGroupProductList(activityId, page, limit,fromPage, listParams)
|
|
|
.then(json => {
|
|
|
json.endReached = json.page == json.page_total;
|
|
|
if (json.page > 1) {
|
|
|
let oldList = productList.list.toJS();
|
|
|
let list = [...oldList, ...json.collageProductVoList];
|
|
|
json.collageProductVoList = list;
|
|
|
}
|
|
|
dispatch(productListSuccess(json));
|
|
|
})
|
|
|
.catch(error => {
|
|
|
dispatch(productListFailure(error));
|
|
|
});
|
|
|
}
|
|
|
};
|
|
|
}
|
|
|
|
...
|
...
|
|