...
|
...
|
@@ -127,13 +127,11 @@ export default function redBrandReducer(state=initialState, action) { |
|
|
return state.setIn(['coupon', 'isFetching'], true)
|
|
|
.setIn(['coupon', 'error'], null);
|
|
|
}
|
|
|
|
|
|
case SHOP_COUPON_LIST_SUCCESS: {
|
|
|
return state.setIn(['coupon', 'isFetching'], false)
|
|
|
.setIn(['coupon', 'error'], null)
|
|
|
.setIn(['coupon', 'list'], Immutable.fromJS(action.payload));
|
|
|
}
|
|
|
|
|
|
case SHOP_COUPON_LIST_FAILURE: {
|
|
|
return state.setIn(['coupon', 'isFetching'], false)
|
|
|
.setIn(['coupon', 'error'], action.payload);
|
...
|
...
|
@@ -155,18 +153,15 @@ export default function redBrandReducer(state=initialState, action) { |
|
|
case ADD_FAVORITE_SUCCESS: {
|
|
|
return state.setIn(['shopIntro', 'is_addFav'], action.payload);
|
|
|
}
|
|
|
|
|
|
case ADD_FAVORITE_FAILURE: {
|
|
|
if (action.payload.code == 413) {
|
|
|
return state.setIn(['shopIntro', 'is_addFav'], true);
|
|
|
}
|
|
|
return state.setIn(['shopIntro', 'is_addFav'], false);
|
|
|
}
|
|
|
|
|
|
case CANCEL_FAVORITE_SUCCESS: {
|
|
|
return state.setIn(['shopIntro', 'is_addFav'], action.payload);
|
|
|
}
|
|
|
|
|
|
case GET_FAVORITE_COUNT_SUCCESS: {
|
|
|
return state.setIn(['shopIntro', 'favoriteCount'], action.payload);
|
|
|
}
|
...
|
...
|
@@ -235,6 +230,36 @@ export default function redBrandReducer(state=initialState, action) { |
|
|
case GET_INTRO_FAILURE: {
|
|
|
return state.setIn(['shopIntro', 'error'], action.payload);
|
|
|
}
|
|
|
case PRODUCT_SUCCESS: {
|
|
|
let {
|
|
|
shopBanner,
|
|
|
json,
|
|
|
} = action.payload;
|
|
|
|
|
|
let {
|
|
|
isFetching,
|
|
|
error,
|
|
|
app_type,
|
|
|
shop_id,
|
|
|
template_id,
|
|
|
template_type,
|
|
|
modules,
|
|
|
} = json;
|
|
|
|
|
|
let newState = state.setIn(['shopsdecorator', 'isFetching'], false)
|
|
|
.setIn(['shopsdecorator', 'error'], null)
|
|
|
.setIn(['shopsdecorator', 'app_type'], app_type)
|
|
|
.setIn(['shopsdecorator', 'shop_id'], shop_id)
|
|
|
.setIn(['shopsdecorator', 'template_id'], template_id)
|
|
|
.setIn(['shopsdecorator', 'template_type'], template_type)
|
|
|
.setIn(['shopsdecorator', 'modules'], Immutable.fromJS(modules))
|
|
|
.setIn(['shopIntro', 'shopBanner'], Immutable.fromJS(shopBanner))
|
|
|
|
|
|
return newState;
|
|
|
}
|
|
|
case PRODUCT_FAILURE: {
|
|
|
return state.setIn(['shopsdecorator', 'isFetching'], false);
|
|
|
}
|
|
|
}
|
|
|
return state;
|
|
|
} |
...
|
...
|
|