...
|
...
|
@@ -17,6 +17,10 @@ const { |
|
|
HOME_OVERVIEW_SUCCESS,
|
|
|
HOME_OVERVIEW_FAILURE,
|
|
|
|
|
|
HOME_BRABDRANK_REQUEST,
|
|
|
HOME_BRABDRANK_SUCCESS,
|
|
|
HOME_BRABDRANK_FAILURE,
|
|
|
|
|
|
GO_TO_SALE_STATS,
|
|
|
GO_TO_REFOUND_STATS,
|
|
|
GO_TO_STOCK_STATS,
|
...
|
...
|
@@ -40,25 +44,33 @@ export default function userReducer(state = initialState, action) { |
|
|
|
|
|
switch (action.type) {
|
|
|
|
|
|
case HOME_OVERVIEW_REQUEST: {
|
|
|
case HOME_OVERVIEW_REQUEST:
|
|
|
case HOME_BRABDRANK_REQUEST: {
|
|
|
let nextState = state.set('isFetching', true)
|
|
|
.set('error', null)
|
|
|
.set('shopId', action.payload);
|
|
|
.set('brandId', action.payload);
|
|
|
return nextState;
|
|
|
}
|
|
|
|
|
|
case HOME_OVERVIEW_SUCCESS: {
|
|
|
let nextState = state.set('isFetching', false)
|
|
|
.set('error', null)
|
|
|
.setIn(['overview', 'rank'], action.payload.rank)
|
|
|
.setIn(['overview', 'rise'], action.payload.rise)
|
|
|
.setIn(['overview', 'riseCount'], action.payload.riseCount)
|
|
|
.setIn(['overview', 'goodsCount'], action.payload.goodsCount)
|
|
|
.setIn(['overview', 'goodsAmount'], action.payload.goodsAmount);
|
|
|
.setIn(['overview', 'rank'], action.payload.rankNow)
|
|
|
.setIn(['overview', 'rise'], action.payload.rankLevel)
|
|
|
.setIn(['overview', 'riseCount'], action.payload.rankChange)
|
|
|
return nextState;
|
|
|
}
|
|
|
|
|
|
case HOME_BRABDRANK_SUCCESS: {
|
|
|
let nextState = state.set('isFetching', false)
|
|
|
.set('error', null)
|
|
|
.setIn(['overview', 'goodsCount'], action.payload.orderAmount)
|
|
|
.setIn(['overview', 'goodsAmount'], action.payload.buyNumbers);
|
|
|
return nextState;
|
|
|
}
|
|
|
|
|
|
case HOME_OVERVIEW_FAILURE:
|
|
|
case HOME_BRABDRANK_FAILURE:
|
|
|
return state.set('isFetching', false)
|
|
|
.set('error', action.payload);
|
|
|
|
...
|
...
|
|