...
|
...
|
@@ -158,19 +158,27 @@ export default function redBrandReducer(state=initialState, action) { |
|
|
case ADD_FAVORITE_SUCCESS: {
|
|
|
if (action.payload) {
|
|
|
return state.setIn(['shopIntro', 'is_addFav'], true)
|
|
|
.setIn(['receiveCouponResult', 'showMessage'], '收藏成功')
|
|
|
.setIn(['receiveCouponResult', 'isNeedShow'], true);
|
|
|
// .setIn(['shopIntro', 'favoriteCount'],parseInt(state.shopIntro.favoriteCount) +1);
|
|
|
}else {
|
|
|
return state.setIn(['shopIntro', 'is_addFav'], true);
|
|
|
return state.setIn(['shopIntro', 'is_addFav'], true)
|
|
|
}
|
|
|
}
|
|
|
case ADD_FAVORITE_FAILURE: {
|
|
|
if (action.payload.code == 413) {
|
|
|
return state.setIn(['shopIntro', 'is_addFav'], true);
|
|
|
return state.setIn(['shopIntro', 'is_addFav'], true)
|
|
|
.setIn(['receiveCouponResult', 'showMessage'], '已收藏')
|
|
|
.setIn(['receiveCouponResult', 'isNeedShow'], true);
|
|
|
}
|
|
|
return state.setIn(['shopIntro', 'is_addFav'], false);
|
|
|
return state.setIn(['shopIntro', 'is_addFav'], false)
|
|
|
.setIn(['receiveCouponResult', 'showMessage'], '收藏失败')
|
|
|
.setIn(['receiveCouponResult', 'isNeedShow'], true);
|
|
|
}
|
|
|
case CANCEL_FAVORITE_SUCCESS: {
|
|
|
return state.setIn(['shopIntro', 'is_addFav'], action.payload)
|
|
|
.setIn(['receiveCouponResult', 'showMessage'], '取消收藏成功')
|
|
|
.setIn(['receiveCouponResult', 'isNeedShow'], true);
|
|
|
// .setIn(['shopIntro', 'favoriteCount'],(parseInt(state.shopIntro.favoriteCount) -1)>0?(parseInt(state.shopIntro.favoriteCount) -1):0);
|
|
|
}
|
|
|
case GET_FAVORITE_COUNT_SUCCESS: {
|
...
|
...
|
|