Authored by 陈林

拼团详情列表参数还原。review by 孙凯。

... ... @@ -61,7 +61,7 @@ class GroupPurchaseDetailContainer extends Component {
}
async componentDidMount() {
this.props.actions.getProductList(false, true);
this.props.actions.getProductList();
this.props.actions.fetchActivityGroupDetail(this.props.FP_NAME, this.props.FP_PARAM);
// this.props.actions.fetchResourceInfo();
}
... ... @@ -190,7 +190,7 @@ class GroupPurchaseDetailContainer extends Component {
}
_onEndReached() {
this.props.actions.getProductList(false, true);
this.props.actions.getProductList();
}
render() {
... ...
... ... @@ -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));
});
}
};
}
... ...
... ... @@ -171,7 +171,7 @@ export function getProductList(reload=false) {
let fromPage = Platform.OS === 'android' ? 'aFP_GroupPurchaseDetail' : 'iFP_GroupPurchaseDetail';
dispatch(productListRequest());
return new GroupPurchaseService(app.host).fetchProductList(activityId, page, limit,fromPage)
return new GroupPurchaseService(app.host).fetchGroupDetailProductList(activityId, page, limit,fromPage)
.then(json => {
json.endReached = json.page == json.page_total;
if (json.page > 1) {
... ...