...
|
...
|
@@ -569,15 +569,26 @@ export function getShopCartCountFailure(error) { |
|
|
export function getShopCartCount() {
|
|
|
return (dispatch, getState) => {
|
|
|
let {app, newArrival} = getState();
|
|
|
dispatch(getShopCartCountRequest());
|
|
|
return new NewArrivalService(app.host).getShopCartCount()
|
|
|
|
|
|
let fetchInfo = (uid) => {
|
|
|
dispatch(getShopCartCountRequest());
|
|
|
return new NewArrivalService(app.host).getShopCartCount(uid,'NewArrival')
|
|
|
.then(json => {
|
|
|
let cart_goods_count = json ? json.cart_goods_count: 0;
|
|
|
dispatch(getShopCartCountSuccess(cart_goods_count));
|
|
|
})
|
|
|
.catch(error => {
|
|
|
dispatch(getShopCartCountFailure(error));
|
|
|
});
|
|
|
dispatch(getShopCartCountSuccess(cart_goods_count));
|
|
|
})
|
|
|
.catch(error => {
|
|
|
dispatch(getShopCartCountFailure(error));
|
|
|
});
|
|
|
};
|
|
|
|
|
|
ReactNative.NativeModules.YH_CommonHelper.uid()
|
|
|
.then(uid => {
|
|
|
fetchInfo(uid)
|
|
|
})
|
|
|
.catch(error => {
|
|
|
fetchInfo(0)
|
|
|
});
|
|
|
};
|
|
|
}
|
|
|
|
...
|
...
|
|