...
|
...
|
@@ -155,7 +155,12 @@ export default function redBrandReducer(state=initialState, action) { |
|
|
.setIn(['receiveCouponResult', 'isNeedShow'], false);
|
|
|
}
|
|
|
case ADD_FAVORITE_SUCCESS: {
|
|
|
return state.setIn(['shopIntro', 'is_addFav'], action.payload);
|
|
|
if (action.payload) {
|
|
|
return state.setIn(['shopIntro', 'is_addFav'], action.payload)
|
|
|
.setIn(['shopIntro', 'favoriteCount'],parseInt(state.shopIntro.favoriteCount) +1);
|
|
|
}else {
|
|
|
return state.setIn(['shopIntro', 'is_addFav'], action.payload);
|
|
|
}
|
|
|
}
|
|
|
case ADD_FAVORITE_FAILURE: {
|
|
|
if (action.payload.code == 413) {
|
...
|
...
|
@@ -164,7 +169,8 @@ export default function redBrandReducer(state=initialState, action) { |
|
|
return state.setIn(['shopIntro', 'is_addFav'], false);
|
|
|
}
|
|
|
case CANCEL_FAVORITE_SUCCESS: {
|
|
|
return state.setIn(['shopIntro', 'is_addFav'], action.payload);
|
|
|
return state.setIn(['shopIntro', 'is_addFav'], action.payload)
|
|
|
.setIn(['shopIntro', 'favoriteCount'],(parseInt(state.shopIntro.favoriteCount) -1)>0?(parseInt(state.shopIntro.favoriteCount) -1):0);
|
|
|
}
|
|
|
case GET_FAVORITE_COUNT_SUCCESS: {
|
|
|
return state.setIn(['shopIntro', 'favoriteCount'], action.payload);
|
...
|
...
|
|