Authored by 孙凯

update 新品到着 接口 review by chenling

... ... @@ -7,6 +7,7 @@ let InitialState = Record({
channel: 1, // 1 - boy, 2 - girl, 3 - kid, 4 - lifestyle, 5 - yoho
host: 'http://api.yoho.cn',
serviceHost: 'http://api.yoho.cn',
globalHost: 'http://api-global.yohobuy.com',
});
export default InitialState;
... ...
... ... @@ -575,9 +575,19 @@ export function getShopCartCount() {
return new NewArrivalService(app.host).getShopCartCount(uid,'NewArrival')
.then(json => {
let cart_goods_count = json ? json.cart_goods_count: 0;
new NewArrivalService(app.globalHost).getGlobalShopCartCount(uid,'NewArrival')
.then(json => {
let count = json ? json.cart_goods_count: 0;
cart_goods_count = cart_goods_count + count;
dispatch(getShopCartCountSuccess(cart_goods_count));
})
.catch(error => {
dispatch(getShopCartCountSuccess(cart_goods_count));
});
})
.catch(error => {
dispatch(getShopCartCountFailure(error));
});
};
... ...
... ... @@ -83,6 +83,22 @@ export default class HomeService {
});
}
async getGlobalShopCartCount(uid,fromPage) {
return await this.api.get({
url: '/order/api/v1/cart/getCartGoodCount',
body: {
fromPage,
uid,
}
})
.then((json) => {
return json;
})
.catch((error) => {
throw(error);
});
}
async productFilter(yh_channel=1) {
return await this.api.get({
url: '',
... ...