...
|
...
|
@@ -84,7 +84,7 @@ export function setStoreFilter(filter) { |
|
|
export function setShopId(shopId) {
|
|
|
return {
|
|
|
type: SET_SHOP_ID,
|
|
|
payload: 860,
|
|
|
payload: shopId,
|
|
|
};
|
|
|
}
|
|
|
|
...
|
...
|
@@ -122,7 +122,7 @@ export function getShopInfo() { |
|
|
|
|
|
let fetchShopIntroInfo = (shopId, uid) => {
|
|
|
dispatch(shopInfoRequest());
|
|
|
return new BrandStoreService().fetchShopInfo(shopId, uid)
|
|
|
return new BrandStoreService(app.host).fetchShopInfo(shopId, uid)
|
|
|
.then(json => {
|
|
|
dispatch(shopInfoSuccess(json));
|
|
|
})
|
...
|
...
|
@@ -175,7 +175,7 @@ export function getShopResources() { |
|
|
|
|
|
let fetchShopsResourcesInfo = (shopId) => {
|
|
|
dispatch(shopResourceRequest());
|
|
|
return new BrandStoreService().fetchShopResources(shopId)
|
|
|
return new BrandStoreService(app.host).fetchShopResources(shopId)
|
|
|
.then(json => {
|
|
|
let payload = parseShopResources(json, shopId);
|
|
|
dispatch(shopResourcesSuccess(payload));
|
...
|
...
|
@@ -230,7 +230,7 @@ export function getShopCouponList() { |
|
|
|
|
|
let fetchShopCouponList = (shopId, uid) => {
|
|
|
dispatch(shopCouponListRequest());
|
|
|
return new BrandStoreService().fetchShopCouponList(shopId, uid)
|
|
|
return new BrandStoreService(app.host).fetchShopCouponList(shopId, uid)
|
|
|
.then(json => {
|
|
|
let payload = parseCouponList(json);
|
|
|
dispatch(shopCouponListSuccess(payload));
|
...
|
...
|
@@ -307,7 +307,7 @@ export function getHotProduct() { |
|
|
}
|
|
|
|
|
|
dispatch(hotProductRequest());
|
|
|
return new BrandStoreService().searchProductBySkn(productSkn)
|
|
|
return new BrandStoreService(app.host).searchProductBySkn(productSkn)
|
|
|
.then(json => {
|
|
|
_.forEach(json.product_list, (value, key) => {
|
|
|
json.product_list[key].is_soon_sold_out = 'N';
|
...
|
...
|
@@ -391,7 +391,7 @@ export function getProductList(reload=false) { |
|
|
let order = productList.order;
|
|
|
let page = productList.currentPage + 1;
|
|
|
let pageSize = productList.pageSize;
|
|
|
let channel = 1;
|
|
|
let channel = app.channel;
|
|
|
|
|
|
let bSelectedFilterFactor,allFilterFactors;
|
|
|
allFilterFactors = filterFactors.toJS();
|
...
|
...
|
@@ -404,7 +404,7 @@ export function getProductList(reload=false) { |
|
|
}
|
|
|
}
|
|
|
dispatch(productListRequest());
|
|
|
return new BrandStoreService().productList(shopId, channel, order, page, pageSize, allFilterFactors)
|
|
|
return new BrandStoreService(app.host).productList(shopId, channel, order, page, pageSize, allFilterFactors)
|
|
|
.then(json => {
|
|
|
let payload = parseProductList(json);
|
|
|
payload.endReached = payload.currentPage == payload.pageCount;
|
...
|
...
|
@@ -601,7 +601,7 @@ export function addFavorite() { |
|
|
|
|
|
ReactNative.NativeModules.YH_CommonHelper.uid()
|
|
|
.then(uid => {
|
|
|
return new BrandStoreService().addFavorite(shopId, shopId, uid)
|
|
|
return new BrandStoreService(app.host).addFavorite(shopId, shopId, uid)
|
|
|
.then(json => {
|
|
|
console.log('收藏成功');
|
|
|
dispatch(addFavoriteSuccess());
|
...
|
...
|
@@ -614,7 +614,7 @@ export function addFavorite() { |
|
|
.catch(error => {
|
|
|
ReactNative.NativeModules.YH_CommonHelper.login()
|
|
|
.then(uid => {
|
|
|
return new BrandStoreService().addFavorite(shopId, shopId, uid)
|
|
|
return new BrandStoreService(app.host).addFavorite(shopId, shopId, uid)
|
|
|
.then(json => {
|
|
|
console.log('收藏成功');
|
|
|
dispatch(addFavoriteSuccess());
|
...
|
...
|
@@ -636,7 +636,7 @@ export function cancelFavorite() { |
|
|
|
|
|
ReactNative.NativeModules.YH_CommonHelper.uid()
|
|
|
.then(uid => {
|
|
|
return new BrandStoreService().cancelFavorite(shopId, shopId, uid)
|
|
|
return new BrandStoreService(app.host).cancelFavorite(shopId, shopId, uid)
|
|
|
.then(json => {
|
|
|
console.log('取消收藏成功');
|
|
|
dispatch(cancelFavoriteSuccess());
|
...
|
...
|
@@ -658,13 +658,14 @@ export function getFavoriteState() { |
|
|
|
|
|
ReactNative.NativeModules.YH_CommonHelper.uid()
|
|
|
.then(uid => {
|
|
|
return new BrandStoreService().isFavorite(shopId, uid)
|
|
|
return new BrandStoreService(app.host).isFavorite(shopId, uid)
|
|
|
.then(json => {
|
|
|
if (json) {
|
|
|
dispatch(addFavoriteSuccess());
|
|
|
}
|
|
|
})
|
|
|
.catch(error => {
|
|
|
|
|
|
});
|
|
|
})
|
|
|
.catch(error => {
|
...
|
...
|
|