...
|
...
|
@@ -344,32 +344,64 @@ export function getBrandResource(channel) { |
|
|
content_code = 'f1aa914fd23cbcda71a87de6f5416c75';
|
|
|
}
|
|
|
|
|
|
return new BrandService(app.serviceHost).getBrandResource(channel, content_code)
|
|
|
.then(json => {
|
|
|
let payload = parseResourceResources(json);
|
|
|
if (channel == 1) {
|
|
|
dispatch(getBrandResourceForBoySuccess(payload));
|
|
|
}else if (channel == 2) {
|
|
|
dispatch(getBrandResourceForGirlSuccess(payload));
|
|
|
}else if (channel == 3) {
|
|
|
dispatch(getBrandResourceForKidSuccess(payload));
|
|
|
}else if (channel == 4) {
|
|
|
dispatch(getBrandResourceForLifeStyleSuccess(payload));
|
|
|
}
|
|
|
//区分ab版本
|
|
|
let abversion = app.abversion;
|
|
|
if(abversion == "B"){
|
|
|
return new BrandService(app.host).getBrandResourceB(channel, content_code)
|
|
|
.then(json => {
|
|
|
let payload = parseResourceResources(json);
|
|
|
if (channel == 1) {
|
|
|
dispatch(getBrandResourceForBoySuccess(payload));
|
|
|
}else if (channel == 2) {
|
|
|
dispatch(getBrandResourceForGirlSuccess(payload));
|
|
|
}else if (channel == 3) {
|
|
|
dispatch(getBrandResourceForKidSuccess(payload));
|
|
|
}else if (channel == 4) {
|
|
|
dispatch(getBrandResourceForLifeStyleSuccess(payload));
|
|
|
}
|
|
|
|
|
|
dispatch(resourceDataExposure(json));
|
|
|
})
|
|
|
.catch(error => {
|
|
|
if (channel == 1) {
|
|
|
dispatch(getBrandResourceForBoyFailure(error));
|
|
|
}else if (channel == 2) {
|
|
|
dispatch(getBrandResourceForGirlFailure(error));
|
|
|
}else if (channel == 3) {
|
|
|
dispatch(getBrandResourceForKidFailure(error));
|
|
|
}else if (channel == 4) {
|
|
|
dispatch(getBrandResourceForLifeStyleFailure(error));
|
|
|
}
|
|
|
});
|
|
|
dispatch(resourceDataExposure(json));
|
|
|
})
|
|
|
.catch(error => {
|
|
|
if (channel == 1) {
|
|
|
dispatch(getBrandResourceForBoyFailure(error));
|
|
|
}else if (channel == 2) {
|
|
|
dispatch(getBrandResourceForGirlFailure(error));
|
|
|
}else if (channel == 3) {
|
|
|
dispatch(getBrandResourceForKidFailure(error));
|
|
|
}else if (channel == 4) {
|
|
|
dispatch(getBrandResourceForLifeStyleFailure(error));
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
else{
|
|
|
return new BrandService(app.serviceHost).getBrandResource(channel, content_code)
|
|
|
.then(json => {
|
|
|
let payload = parseResourceResources(json);
|
|
|
if (channel == 1) {
|
|
|
dispatch(getBrandResourceForBoySuccess(payload));
|
|
|
}else if (channel == 2) {
|
|
|
dispatch(getBrandResourceForGirlSuccess(payload));
|
|
|
}else if (channel == 3) {
|
|
|
dispatch(getBrandResourceForKidSuccess(payload));
|
|
|
}else if (channel == 4) {
|
|
|
dispatch(getBrandResourceForLifeStyleSuccess(payload));
|
|
|
}
|
|
|
|
|
|
dispatch(resourceDataExposure(json));
|
|
|
})
|
|
|
.catch(error => {
|
|
|
if (channel == 1) {
|
|
|
dispatch(getBrandResourceForBoyFailure(error));
|
|
|
}else if (channel == 2) {
|
|
|
dispatch(getBrandResourceForGirlFailure(error));
|
|
|
}else if (channel == 3) {
|
|
|
dispatch(getBrandResourceForKidFailure(error));
|
|
|
}else if (channel == 4) {
|
|
|
dispatch(getBrandResourceForLifeStyleFailure(error));
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
};
|
|
|
}
|
|
|
|
...
|
...
|
|