...
|
...
|
@@ -13,6 +13,18 @@ const { |
|
|
GETBRANDLIST_FOR_BOY_SUCCESS,
|
|
|
GETBRANDLIST_FOR_BOY_FAILURE,
|
|
|
|
|
|
GETBRANDLIST_FOR_GIRL_REQUEST,
|
|
|
GETBRANDLIST_FOR_GIRL_SUCCESS,
|
|
|
GETBRANDLIST_FOR_GIRL_FAILURE,
|
|
|
|
|
|
GETBRANDLIST_FOR_KID_REQUEST,
|
|
|
GETBRANDLIST_FOR_KID_SUCCESS,
|
|
|
GETBRANDLIST_FOR_KID_FAILURE,
|
|
|
|
|
|
GETBRANDLIST_FOR_LIFESTYLE_REQUEST,
|
|
|
GETBRANDLIST_FOR_LIFESTYLE_SUCCESS,
|
|
|
GETBRANDLIST_FOR_LIFESTYLE_FAILURE,
|
|
|
|
|
|
GETBRANDRESOURCE_FOR_BOY_REQUEST,
|
|
|
GETBRANDRESOURCE_FOR_BOY_SUCCESS,
|
|
|
GETBRANDRESOURCE_FOR_BOY_FAILURE,
|
...
|
...
|
@@ -54,16 +66,100 @@ export function getBrandListForBoyFailure(error) { |
|
|
}
|
|
|
}
|
|
|
|
|
|
export function getBrandListForBoy() {
|
|
|
export function getBrandListForGirlRequest() {
|
|
|
return {
|
|
|
type: GETBRANDLIST_FOR_GIRL_REQUEST,
|
|
|
};
|
|
|
}
|
|
|
|
|
|
export function getBrandListForGirlSuccess(json) {
|
|
|
return {
|
|
|
type: GETBRANDLIST_FOR_GIRL_SUCCESS,
|
|
|
payload: json
|
|
|
}
|
|
|
}
|
|
|
|
|
|
export function getBrandListForGirlFailure(error) {
|
|
|
return {
|
|
|
type: GETBRANDLIST_FOR_GIRL_FAILURE,
|
|
|
payload: error
|
|
|
}
|
|
|
}
|
|
|
|
|
|
export function getBrandListForKidRequest() {
|
|
|
return {
|
|
|
type: GETBRANDLIST_FOR_KID_REQUEST,
|
|
|
};
|
|
|
}
|
|
|
|
|
|
export function getBrandListForKidSuccess(json) {
|
|
|
return {
|
|
|
type: GETBRANDLIST_FOR_KID_SUCCESS,
|
|
|
payload: json
|
|
|
}
|
|
|
}
|
|
|
|
|
|
export function getBrandListForKidFailure(error) {
|
|
|
return {
|
|
|
type: GETBRANDLIST_FOR_KID_FAILURE,
|
|
|
payload: error
|
|
|
}
|
|
|
}
|
|
|
|
|
|
export function getBrandListForLifeStyleRequest() {
|
|
|
return {
|
|
|
type: GETBRANDLIST_FOR_LIFESTYLE_REQUEST,
|
|
|
};
|
|
|
}
|
|
|
|
|
|
export function getBrandListForLifeStyleSuccess(json) {
|
|
|
return {
|
|
|
type: GETBRANDLIST_FOR_LIFESTYLE_SUCCESS,
|
|
|
payload: json
|
|
|
}
|
|
|
}
|
|
|
|
|
|
export function getBrandListForLifeStyleFailure(error) {
|
|
|
return {
|
|
|
type: GETBRANDLIST_FOR_LIFESTYLE_FAILURE,
|
|
|
payload: error
|
|
|
}
|
|
|
}
|
|
|
|
|
|
export function getBrandList(channel) {
|
|
|
return (dispatch, getState) => {
|
|
|
let {app, classify} = getState();
|
|
|
dispatch(getBrandListForBoyRequest());
|
|
|
return new BrandService(app.host).getBrandList()
|
|
|
if (channel == 0) {
|
|
|
dispatch(getBrandListForBoyRequest());
|
|
|
}else if (channel == 1) {
|
|
|
dispatch(getBrandListForGirlRequest());
|
|
|
}else if (channel == 2) {
|
|
|
dispatch(getBrandListForKidRequest());
|
|
|
}else if (channel == 3) {
|
|
|
dispatch(getBrandListForLifeStyleRequest());
|
|
|
}
|
|
|
return new BrandService(app.host).getBrandList(channel)
|
|
|
.then(json => {
|
|
|
dispatch(getBrandListForBoySuccess(json));
|
|
|
if (channel == 0) {
|
|
|
dispatch(getBrandListForBoySuccess(json));
|
|
|
}else if (channel == 1) {
|
|
|
dispatch(getBrandListForGirlSuccess(json));
|
|
|
}else if (channel == 2) {
|
|
|
dispatch(getBrandListForKidSuccess(json));
|
|
|
}else if (channel == 3) {
|
|
|
dispatch(getBrandListForLifeStyleSuccess(json));
|
|
|
}
|
|
|
})
|
|
|
.catch(error => {
|
|
|
dispatch(getBrandListForBoyFailure(error));
|
|
|
if (channel == 0) {
|
|
|
dispatch(getBrandListForBoyFailure(error));
|
|
|
}else if (channel == 1) {
|
|
|
dispatch(getBrandListForGirlFailure(error));
|
|
|
}else if (channel == 2) {
|
|
|
dispatch(getBrandListForKidFailure(error));
|
|
|
}else if (channel == 3) {
|
|
|
dispatch(getBrandListForLifeStyleFailure(error));
|
|
|
}
|
|
|
});
|
|
|
};
|
|
|
}
|
...
|
...
|
@@ -88,7 +184,7 @@ export function getBrandResourceForBoyFailure(error) { |
|
|
}
|
|
|
}
|
|
|
|
|
|
export function getBrandResourceForBoy() {
|
|
|
export function getBrandResource(channel) {
|
|
|
return (dispatch, getState) => {
|
|
|
let {app, classify} = getState();
|
|
|
dispatch(getBrandResourceForBoyRequest());
|
...
|
...
|
|